IP Library › Granted Patent US 12,443,457
Granted Patent B2
US 12,443,457 · App. 17/713,628 · Granted Oct 14, 2025

Efficient random sampling from dynamically changing sample pool

Inventor: Can Goksen (Seattle, WA)
Assignee: Microsoft Technology Licensing, LLC
G06F9/5044G06F9/5033G06F9/5088G06F2209/5011G06F2209/508
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,443,457
App. No.
17/713,628
Granted
Oct 14, 2025
Kind
B2
Abstract

A method for cost-efficient repeated random sampling from a dynamically-changing sampling pool includes defining an array of elements to be selectively masked and unmasked throughout repeated random sampling operations from a first sampling pool. The first sampling pool includes unmasked elements of the array and excludes masked elements of the array. The method further includes identifying an exclusion element within the first sampling pool that is to be excluded from a sampling operation and removing the exclusion element from the first sampling pool. Removing the exclusion element is achieved by moving the exclusion element to a new position by swapping an array index of the exclusion element with an array index that was, during an immediately prior sampling operation, included within and bounding the first sampling pool and by masking the array index corresponding to a new position of the exclusion element. Following the swapping and masking operations, the first sampling pool is randomly sampled.

Claims (68)

1. A processor-implemented method for cost-efficiently performing repeated random sampling operations from a first sampling pool, the method comprising:

defining a first array of elements to be selectively masked and unmasked throughout the repeated random sampling operations from the first sampling pool, the first sampling pool including unmasked elements of the first array and excluding masked elements of the first array;

defining a dummy array for tracking locations of elements that are moved between different positions within the first array, the dummy array storing identifiers for the elements in the first array in association with pointers to current locations of the elements within the first array of elements;

identifying an element within the first sampling pool that is to be excluded from a sampling operation;

removing the element from the first sampling pool by:

moving the element to a new position by swapping a first array index of the element with a second array index that was, during an immediately prior sampling operation, included within and bounding the first sampling pool; and

masking the second array index corresponding to the new position of the element;

updating a pointer associated with the element the dummy array to point to the second array index instead of the first array index; and

implementing the sampling operation by randomly sampling from the first sampling pool;

subsequent to the sampling operation, selectively adding the element back into the first sampling pool by:

swapping the second array index of the element with a third array index that was, during an immediately prior sampling operation, external to and bounding the first sampling pool;

updating the pointer associated with the element in the dummy array to point to the third array index instead of the second array index; and

unmasking the third array index.

2. The processor-implemented method of claim 1 , wherein masking the second array index corresponding to the new position of the element further comprises decrementing a size of the first sampling pool.

3. The processor-implemented method of claim 1 , wherein moving the element to the new position further comprises:

swapping the first array index of the element with an array index of a highest-indexed unmasked element in the first array; and wherein masking the second array index corresponding to the new position further comprises:

masking the array index of the highest-indexed unmasked element.

4. The processor-implemented method of claim 1 , wherein unmasking the third array index further comprises incrementing a size of the first sampling pool.

5. The processor-implemented method of claim 4 , wherein adding the element back into the first sampling pool further comprises:

unmasking an array index of a lowest-indexed masked element in the first array and swapping the second array index of the element with the unmasked array index.

6. The processor-implemented method of claim 1 , wherein the first array is a source array that includes data sources available to provide data for migration in a data allocation system, and wherein randomly sampling from the first sampling pool further comprises:

randomly sampling a data source from the source array;

identifying a collection of data chunks at the sampled data source available for migration; and

sampling a data chunk from the collection of data chunks according to a predefined probability distribution.

7. The processor-implemented method of claim 6 , further comprising:

randomly sampling a data destination from a destination array that includes data destinations available to receive migrated data in the data allocation system; and

migrating data from the sampled data source to the sampled data destination.

8. The processor-implemented method of claim 1 , wherein identifying the element further comprises determining that the element violates a defined constraint.

9. The processor-implemented method of claim 1 , wherein selectively adding the element back into the first sampling pool is performed in response to determining that the element is no longer in violation of a defined constraint.

10. A system for cost-efficiently performing repeated random sampling from a first sampling pool, the system comprising:

a first array defining elements eligible to be selectively masked and unmasked throughout repeated random sampling from the first sampling pool, the first sampling pool including unmasked elements of the first array and excluding masked elements of the first array;

a dummy array that identifies current locations of masked and unmasked elements in the first array, the dummy array storing an identifier for each element in the first array in association with a pointer that identifies a current location of the element within the first array;

a random sampling management tool stored in memory and executable to:

identify an element within the first sampling pool that is to be excluded from a sampling operation;

remove the element from the first sampling pool by:

moving the element to a new position by swapping a first array index of the element with a second array index that was, during an immediately prior sampling operation, included within and bounding the first sampling pool; and

masking the second array index corresponding to the new position of the element;

updating a pointer associated with the element in the dummy array to point to the second array index instead of the first array index; and

implementing the sampling operation by randomly sampling from the first sampling pool;

subsequent to the sampling operation, selectively add the element back into the first sampling pool by:

swapping the second array index of the element with a third array index that was, during an immediately prior sampling operation, external to and bounding the first sampling pool;

updating the pointer associated with the element the dummy array to point to the third array index instead of the second array index; and

unmasking the third array index.

11. The system of claim 10 , wherein masking the second array index corresponding to the new position further comprises decrementing a size of the first sampling pool.

12. The system of claim 10 , wherein the random sampling management tool removes the element from the first sampling pool by performing operations including:

swapping the first array index of the element with an array index of a highest-indexed unmasked element in the first array and wherein masking the array index corresponding to the new position further comprises masking the element at the array index of the highest-indexed unmasked element.

13. The system of claim 10 , wherein unmasking the third array index further comprises incrementing a size of the first sampling pool.

14. The system of claim 10 , wherein adding the element back into the first sampling pool further includes:

unmasking an array index of a lowest-indexed masked element in the first array and swapping the second array index of the element with the unmasked array index.

15. The system of claim 10 , wherein in the random sampling management tool identifies the element by determining that the element violates a defined constraint.

16. The system of claim 10 , wherein the random sampling management tool selectively adds the element back into the first sampling pool in response to determining that the element is no longer in violation of a defined constraint.

17. The system of claim 10 , wherein the first array is a source array that includes data sources available to provide data for migration in a data allocation system, and wherein implementing the sampling operation further comprises:

randomly sampling a data source from the source array;

randomly sampling a data destination from a destination array that includes data destinations available to receive migrated data in the data allocation system; and

migrating data from the sampled data source to the sampled data destination.

18. One or more computer-readable storage media encoding computer-executable instructions for executing a computer process, the computer process comprising:

defining a first array of elements to be selectively masked and unmasked throughout repeated random sampling operations from a first sampling pool, the first sampling pool including unmasked elements of the first array and excluding masked elements of the first array;

defining a dummy array for tracking locations of elements that are moved between different positions within the first array, the dummy array storing identifiers for the elements in the first array in association with pointers to current locations of the elements within the first array of elements;

identifying an element within the first sampling pool that is to be excluded from a sampling operation;

removing the element from the first sampling pool by:

moving the element to a new position by swapping first array index of the element with a second array index that was, during an immediately prior sampling operation, included within and bounding the first sampling pool;

masking the second array index corresponding to the new position of the element;

updating a pointer associated with the element the dummy array to point to the second array index instead of the first array index; and

implementing the sampling operation by randomly sampling from the first sampling pool; and

subsequent to the sampling operation, selectively adding the element back into the first sampling pool by operations that include:

swapping the second array index of the element with a third array index that was, during an immediately prior sampling operation, external to and bounding the first sampling pool;

updating the pointer associated with the element the dummy array to point to the third array index instead of the second array index; and

unmasking the third array index.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 5, 2022
From: GOKSEN, CAN
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 059505/0216 →
Continuity (2)
Provisional Application 63294542 · Dec 29, 2021
Related Publication 20230205593A1 · Jun 29, 2023
References Cited (31)
US 6732085B1 · Mozes · 2004 [cited by applicant]
US 7092399B1 · Cheriton · 2006 [cited by examiner]
US 9104483B2 · Natarajan · 2015 [cited by examiner]
US 9250874B1 · Verwaest · 2016 [cited by examiner]
US 9300523B2 · Alon et al. · 2016 [cited by applicant]
US 9405686B2 · Waldspurger et al. · 2016 [cited by applicant]
US 10083100B1 · Agetsuma · 2018 [cited by examiner]
US 10902014B1 · Adogla · 2021 [cited by examiner]
US 11106713B2 · Miller et al. · 2021 [cited by applicant]
US 11182691B1 · Zhang · 2021 [cited by applicant]
US 20170230171A1 · Gadepally et al. · 2017 [cited by applicant]
US 20170230306A1 · Cropper · 2017 [cited by examiner]
US 20170235587A1 · Vully · 2017 [cited by examiner]
US 20190065247A1 · Ros-Giralt · 2019 [cited by examiner]
US 20200387490A1 · Schulze · 2020 [cited by examiner]
US 20210105322A1 · Sakashita · 2021 [cited by examiner]
EP 3916652A1 · 2021 [cited by applicant]
PAPSO: A Power-Aware VM Placement Technique Based on Particle Swarm Optimization Abdelhameed Ibrahim, Mostafa Noshy, Hesham Arafat Ali (Year: 2020). [cited by examiner]
Server-Storage Virtualization: Integration and Load Balancing in Data Centers Aameek Singh, Madhukar Korupolu, Dushmanta Mohapatra (Year: 2008). [cited by examiner]
Doing the Two-Step for Efficient Reversible Deletes David R. MacIver www.drmaciver.com/2018/06/doing-the-two-step-for-efficient-reversible-deletes/ (Year: 2018). [cited by examiner]
A hybrid MIP-based large neighborhood search heuristic for solving the machine reassignment problem W. Jaskowski, M. Szubert, P. Gawron (Year: 2016). [cited by examiner]
Data Structures Part 1: Bulk Data Niklas Gray ruby0x1.github.io/machinery_blog_archive/post/data-structures-part-1-bulk-data/index.html (Year: 2019). [cited by examiner]
Ryerson University, School of Computer Science CPS109 Fall 2015 course website Course Management Form, main page, Arrays and Array Lists class notes (Year: 2015). [cited by examiner]
Virtual Machine Migration in Cloud Infrastructures: Problem Formalization and Policies Proposal Alessandro Vittorio Papadopoulos, Martina Maggio (Year: 2015). [cited by examiner]
“International Search Report and Written Opinion Issued in PCT Application No. PCT/US22/044045”, Mailed Date: Dec. 5, 2022, 11 Pages. [cited by applicant]
Tao, et al., “Random Sampling for Continuous Streams with Arbitrary Updates”, In Journal of IEEE Transactions on Knowledge and Data Engineering, vol. 19, Issue 1, Jan. 1, 2007, pp. 96-110. [cited by applicant]
“Dancing Links”, Retrieved From: https://web.archive.org/web/20220131124734/http://en.wikipedia.org/wiki/Dancing_Links, Jan. 31, 2022, 4 Pages. [cited by applicant]
“Greedy randomized adaptive search procedure”, Retrieved From: https://web.archive.org/web/20210506161803/http://en.wikipedia.org/wiki/Greedy_randomized_adaptive_search_procedure, May 6, 2021, 2 Pages. [cited by applicant]
“Knuth's Algorithm X”, Retrieved From: https://web.archive.org/web/20080622040253/http://en.wikipedia.org:80/wiki/Knuth's_Algorithm_X, Jun. 22, 2008, 6 Pages. [cited by applicant]
Asadi et al., “Analytical Evaluation of Resource Allocation Algorithms and Process Migration Methods in Virtualized Systems,” Sustainable Computing: Informatics and Systems, vol. 25, Mar. 2020, 16 pages. [cited by applicant]
Communication under Rule 71(3) Received for European Application No. 22786660.5, mailed on Jun. 17, 2025, 7 pages. [cited by applicant]