US 12,271,709 B2
Device and method for selecting top values from a set of raw values
Zhijie Liu, Shanghai (CN); Jinfeng Ji, Shanghai (CN); and Jie Dai, Shanghai (CN)
Assigned to MONTAGE ELECTRONICS (SHANGHAI) CO, Shanghai (CN)
Filed by MONTAGE ELECTRONICS (SHANGHAI) CO., LTD., Shanghai (CN)
Filed on Dec. 27, 2022, as Appl. No. 18/146,992.
Claims priority of application No. 202111665241.4 (CN), filed on Dec. 31, 2021.
Prior Publication US 2023/0214178 A1, Jul. 6, 2023
Int. Cl. G06F 16/901 (2019.01); G06F 7/16 (2006.01); G06F 16/23 (2019.01)
CPC G06F 7/16 (2013.01) [G06F 16/2365 (2019.01); G06F 16/901 (2019.01)] 21 Claims
OG exemplary drawing
 
1. A device for selecting k top values from a set of raw values, the device comprising:
an output queue storage module having a predetermined size of storage space for receiving and storing sorted output sequences in batches, wherein each of the output sequences includes at most N values, where k and N are positive integers;
a loop queue storage module having a predetermined size of storage space for storing an intermediate sequence, wherein the intermediate sequence includes at most N values;
a top value storage module for storing k top values, wherein the top value storage module includes a plurality of storage areas, and each storage area is used for storing at most N top values; and
a control module coupled to the output queue storage module, the loop queue storage module and the top value storage module, wherein the control module is configured to perform the follow steps:
merging the output sequences with at most N top values stored in a storage area to be processed of the top value storage module,
sorting the merged values to generate a merged sequence including at most 2N values,
providing a first subsequence of the merged sequence to the storage area to be processed of the top value storage module to update the values stored in the storage area, wherein the first subsequence includes at most N values in the merged sequence which is closer to a top most value of the merged sequence,
providing a second subsequence of the merged sequence to the loop queue storage module to generate or update the intermediate sequence, wherein the second subsequence includes at most N values in the merged sequence which is farther away from the top most value of the merged sequence,
repeatedly performing the following steps until all values stored in the storage areas to be processed of the top value storage module are updated:
selecting the intermediate sequence stored in the loop queue storage module;
selecting the at most N top values stored in another storage area to be processed of the top value storage module;
merging the selected intermediate sequence with the selected at most N top values,
sorting the merged values to generate another merged sequence,
providing another first subsequence of the another merged sequence to the another storage area to be processed of the top value storage module to update the values stored in the another storage area, wherein the another first subsequence includes at most N values in the another merged sequence which is closer to a top most value of the another merged sequence,
if not all values stored in the storage areas to be processed of the top value storage module are updated, providing another second subsequence of the another merged sequence to the loop queue storage module to update the intermediate sequence, wherein the another second subsequence includes at most N values in the another merged sequence which is farther from the top most value of the another merged sequence.