A low-power consumption sorting control method based on a single-stage sorting network

By optimizing the Bitonic sorting network through a single-level sorting network and utilizing high-bit comparison and cumulative equality flags, the problem of invalid comparisons under large data volumes is solved, achieving low-power and efficient sorting.

CN122431634APending Publication Date: 2026-07-21SHANGHAI GUANGYU XINCHEN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI GUANGYU XINCHEN TECHNOLOGY CO LTD
Filing Date
2026-06-24
Publication Date
2026-07-21

Smart Images

  • Figure CN122431634A_ABST
    Figure CN122431634A_ABST
Patent Text Reader

Abstract

The application provides a low-power consumption sorting control method based on a single-stage sorting network, which provides a configuration basis for sorting processing of a single-stage sorting network unit by pre-configuring a sorting configuration set; obtains current batch data to be sorted by controlling the single-stage sorting network unit; controls the single-stage sorting network unit to sequentially perform sorting processing corresponding to each sorting stage configuration based on preset high bits of data elements and the sorting configuration set; and generates an accumulated equal flag in the sorting processing; obtains a final accumulated equal flag and a current intermediate sorting result by a preset target sorting stage configuration; processes the current intermediate sorting result by a target data processing path determined based on the final accumulated equal flag to obtain current batch candidate data; and obtains historical update candidate data based on the current batch candidate data. The application avoids a large number of invalid low-bit comparisons and data flip operations, and significantly reduces dynamic power consumption in the sorting process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of low-power sorting control, and in particular to a low-power sorting control method based on a single-level sorting network. Background Technology

[0002] Bitonic sorting is a classic algorithm in parallel sorting networks. Due to its regular structure, deterministic data flow, and ease of hardware pipelining implementation, it is widely used in high-throughput data processing, Top-K selection, AI acceleration, and signal processing.

[0003] Existing Bitonic sorting networks typically consist of multiple sorting stages connected in series. Each sorting stage contains a set of parallel compare-exchange units with the same element comparison distance, which usually corresponds to a pipeline stage in hardware. The compare-exchange unit is the basic operation unit of the Bitonic sorting network, integrating a comparator and a selector. It can compare two input data elements and decide whether to swap the positions of the two data elements based on the comparison result and a preset sorting direction (ascending ASC or descending DESC). Multiple consecutive sorting stages form a sorting block, which is used to perform bitonic merge or bitonic sorting operations on a continuous data segment, realizing the transformation from local order to larger-scale order.

[0004] The comparison order and connection method of existing Bitonic sorting networks are statically determined during design and are independent of the input data. Although they can fully leverage the advantages of parallel processing, they still have significant shortcomings in power consumption optimization in practical applications, especially for sorting scenarios such as Top-K / Top-N selection. This is mainly reflected in the following two aspects:

[0005] On the one hand, when the numerical magnitudes of the two data elements to be compared are significantly different (e.g., several orders of magnitude apart) and the results of the high-order comparison are sufficient to determine the size, existing sorting networks will still perform a complete comparison of the entire bit width of the data, resulting in a large number of invalid low-order comparisons and data flipping operations, generating unnecessary dynamic power consumption.

[0006] On the other hand, the amount of data to be sorted is usually quite large, and as the data bit width increases, the power consumption of logic gates such as comparators will increase significantly. Existing technologies have not proposed effective optimization solutions for this problem, making it difficult to meet the application requirements of low-power scenarios. Summary of the Invention

[0007] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a low-power sorting control method based on a single-level sorting network, which solves the technical problem of high dynamic power consumption in the existing Bitonic sorting network, where a large number of invalid low-bit comparisons and data flipping operations are generated in scenarios with large data volume and large differences in numerical magnitude.

[0008] To achieve the above and other related objectives, this application provides a low-power sorting control method based on a single-level sorting network. The method is characterized by a sorting controller applied to a sorting control system, wherein the sorting controller is electrically connected to a single-level sorting network unit. The method includes: pre-configuring a sorting configuration set, the sorting configuration set including multiple sorting block configurations; each sorting block configuration including one or more sorting level configurations; controlling the single-level sorting network unit to acquire the current batch of data to be sorted; and, based on the preset high bits of each data element in the current batch of data to be sorted and the pre-configured sorting configuration set, controlling the single-level sorting network unit to sequentially execute the sorting processing corresponding to each sorting level configuration. During the sorting process, the single-level sorting network unit generates a cumulative equality flag. After the single-level sorting network unit reaches the preset target sorting level configuration, the generated cumulative equality flag is used as the final cumulative equality flag, and the corresponding current intermediate sorting result is obtained. Based on the final cumulative equality flag, a target data processing path is determined from at least two preset data processing paths, and based on the target data processing path and the current intermediate sorting result, the corresponding current batch candidate data is obtained. Based on the current batch candidate data, the historical candidate data is updated to obtain the corresponding historical updated candidate data, and the historical updated candidate data is used as the historical candidate data to be updated in the next batch.

[0009] In some embodiments of the first aspect of this application, the process of generating a cumulative equality flag during the sorting process performed by the single-level sorting network unit includes: generating a corresponding equality flag for each pair of data elements participating in the comparison during the sorting process performed by the single-level sorting network unit corresponding to the current sorting level configuration; the equality flag is used to characterize whether the corresponding data elements of the data element pair are equal under the preset high bit; performing a preset logical operation on all equality flags generated in the sorting process corresponding to the current sorting level configuration to obtain an intra-level equality flag; performing the preset logical operation on the intra-level equality flag and the historical cumulative equality flag to obtain the cumulative equality flag of the current sorting level configuration; and using the cumulative equality flag of the current sorting level configuration as the historical cumulative equality flag of the next sorting level configuration.

[0010] In some embodiments of the first aspect of this application, the preset at least two data processing paths include a first data processing path and a second data processing path; determining the target data processing path among the preset at least two data processing paths based on the final cumulative equality flag includes: when the final cumulative equality flag indicates that there are equal data elements, determining the first data processing path as the target data processing path; when the final cumulative equality flag indicates that there are no equal data elements, determining the second data processing path as the target data processing path.

[0011] In some embodiments of the first aspect of this application, the method of obtaining corresponding current batch candidate data based on the target data processing path and the current intermediate sorting result includes: when the target data processing path is a first data processing path, controlling the single-level sorting network unit to stop executing sorting level configurations that have not yet been executed in the sorting configuration set; based on the current intermediate sorting result, determining a target local data processing path among at least two preset local data processing paths, and obtaining corresponding current batch candidate data based on the target local data processing path and the current intermediate sorting result; when the target data processing path is a second data processing path, controlling the single-level sorting network unit to continue executing sorting level configurations that have not yet been executed in the sorting configuration set on the current intermediate sorting result to obtain the current batch sorting result; and selecting data that meets the preset sorting direction and preset data volume from the current batch sorting result as the current batch candidate data.

[0012] In some embodiments of the first aspect of this application, the preset at least two local data processing paths include a first local data processing path and a second local data processing path; determining the target local data processing path among the preset at least two local data processing paths based on the current intermediate sorting result includes: in the current intermediate sorting result, determining whether data elements at at least two consecutive preset data positions are equal; if they are equal, determining the first local data processing path as the target local data processing path; if they are not equal, determining the second local data processing path as the target local data processing path.

[0013] In some embodiments of the first aspect of this application, the method of obtaining corresponding current batch candidate data based on the target local data processing path and the current intermediate sorting result includes: when the first local data processing path is the target local data processing path, performing local odd-even sorting processing on the current intermediate sorting result, and selecting data that satisfies a preset sorting direction and a preset data amount from the result after odd-even sorting processing as the current batch candidate data; when the second local data processing path is the target local data processing path, selecting data that satisfies a preset sorting direction and a preset data amount from the current intermediate sorting result as the current batch candidate data.

[0014] In some embodiments of the first aspect of this application, when the first local data processing path is the target local data processing path, the process of performing local parity sorting on the current intermediate sorting result includes: locating a continuous equal data interval in the current intermediate sorting result based on data elements at at least two consecutive preset data positions; and controlling the single-level sorting network unit to perform local parity sorting on the data elements in the continuous equal data interval based on the preset low bits corresponding to the data elements in the located continuous equal data interval.

[0015] In some embodiments of the first aspect of this application, the method of locating a continuous equal data interval in the current intermediate sorting result based on data elements at at least two consecutive preset data positions includes: in the current intermediate sorting result, taking at least two consecutive preset data positions as centers, expanding outwards to both sides, and locating all data elements that are equal to the data elements at the preset data positions under the preset high bit position; all data elements that are equal to the data elements at the preset data positions under the preset high bit position constitute the continuous equal data interval.

[0016] In some embodiments of the first aspect of this application, the sorting control system further includes an intermediate result storage unit electrically connected to the single-level sorting network unit; the process of updating historical candidate data based on the current batch candidate data to obtain corresponding historical updated candidate data, and using the historical updated candidate data as the historical candidate data to be updated in the next batch includes: controlling the single-level sorting network unit to sort the current batch candidate data in reverse order; concatenating the reverse-ordered current batch candidate data with the historical candidate data in the intermediate result storage unit to obtain concatenated data; controlling the single-level sorting network unit to perform merge sorting processing on the concatenated data based on a preset target sorting block configuration to obtain a merge sorting processing result; obtaining the historical updated candidate data based on the merge sorting processing result, and updating the historical updated candidate data to the intermediate result storage unit as the historical candidate data to be updated in the next batch.

[0017] In some embodiments of the first aspect of this application, the sorting control system further includes a state register unit electrically connected to the sorting controller; the state register unit is set to a second state before updating historical candidate data based on the current batch candidate data; and the state register unit is set to a first state after obtaining the historical updated candidate data.

[0018] As described above, the low-power sorting control method based on a single-level sorting network of this application has the following beneficial effects: This invention provides a configuration basis for the single-level sorting network unit to perform sorting processing by pre-configuring a sorting configuration set; it controls the single-level sorting network unit to obtain the current batch of data to be sorted; based on the preset high bits of each data element in the current batch of data to be sorted and the pre-configured sorting configuration set, it controls the single-level sorting network unit to sequentially execute the sorting processing corresponding to each sorting level configuration; and generates a cumulative equality flag during the sorting process; through a preset target sorting level configuration, it obtains the final cumulative equality flag and the corresponding current intermediate sorting result; it processes the current intermediate sorting result based on the target data processing path determined by the final cumulative equality flag to obtain the corresponding current batch candidate data; and it updates the historical candidate data using the current batch candidate data to obtain the corresponding updated historical candidate data. This invention executes multiple sorting level configurations sequentially through a single-level sorting network unit, compares data elements using preset high bits, and dynamically skips invalid sorting level configurations based on the cumulative equality flag, avoiding a large number of invalid low-bit comparisons and data flipping operations, significantly reducing dynamic power consumption during the sorting process. Attached Figure Description

[0019] Figure 1a The diagram shown is a flowchart of a low-power sorting control method based on a single-level sorting network according to an embodiment of the present invention.

[0020] Figure 1b The diagram shown illustrates the sorting execution logic of the bitone sorting algorithm in one embodiment of the present invention.

[0021] Figure 2 The diagram shows a flowchart illustrating the process of generating a cumulative equality flag during the sorting process performed by a single-level sorting network unit in an embodiment of the present invention.

[0022] Figure 3 This is a schematic diagram illustrating the process of performing local odd-even sorting on the current intermediate sorting result in one embodiment of the present invention.

[0023] Figure 4 This is a schematic diagram illustrating the process of locating a range of consecutive equal data in the current intermediate sorting results, as shown in one embodiment of the present invention.

[0024] Figure 5 This is a schematic diagram illustrating the process of updating historical candidate data based on the current batch of candidate data and obtaining the corresponding updated historical candidate data in one embodiment of the present invention.

[0025] Figure 6 The diagram shown is a structural schematic of a sorting control system in a specific example of the present invention.

[0026] Figure 7 The diagram shown is a flowchart illustrating a low-power sorting control method based on a single-level sorting network, as described in a specific example of the present invention. Detailed Implementation

[0027] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0028] It should be noted that in the following description, reference is made to the accompanying drawings, which illustrate several embodiments of this application. It should be understood that other embodiments may also be used, and changes in mechanical composition, structure, electrical system, and operation may be made without departing from the spirit and scope of this application. The following detailed description should not be considered limiting, and the scope of the embodiments of this application is defined only by the claims of the published patent. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. Spatially related terms, such as “upper,” “lower,” “left,” “right,” “below,” “below,” “lower part,” “above,” “upper part,” etc., may be used herein to illustrate the relationship between one element or feature shown in the figures and another element or feature.

[0029] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," "fixing," and "holding" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0030] Furthermore, as used herein, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context indicates otherwise. The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data used can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising,” “including,” indicate the presence of the stated features, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence, or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. It should be further understood that the terms “or” and “and / or” as used herein are interpreted as inclusive, or mean any one or any combination thereof. Thus, “A, B, or C” or “A, B, and / or C” means “any one of: A; B; C; A and B; A and C; B and C; A, B, and C.” An exception to this definition will only occur if the combination of elements, functions, or operations is inherently mutually exclusive in some way.

[0031] Before providing a further detailed description of the present invention, the nouns and terms used in the embodiments of the present invention are explained, and the nouns and terms used in the embodiments of the present invention are subject to the following interpretations:

[0032] <1> Data Element: A data element is the basic unit of operation in sorting processes; that is, a single data object that participates in sorting comparisons and exchanges. Each data element is represented in a computer system by a certain length of binary bits and has a specific data type and data width.

[0033] <2> Element Comparison Distance: Element comparison distance refers to the difference in index of two data elements being compared within a sorting stage of a sorting network. For example, an element comparison distance of 4 indicates that the i-th element in the sequence is being compared with the (i+4)-th element.

[0034] <3> Bitonic Sort Algorithm: A parallel sorting algorithm that recursively constructs a bitonic sequence from the sequence into ascending-descending (or descending-ascending) sequences, and then merges the bitonic sequences into a monotonically ordered sequence through multiple bitonic merge operations, thus completing the sorting of the entire sequence.

[0035] <4> The Odd-Even Sort Algorithm is a parallel sorting algorithm that iteratively compares and swaps data elements at odd indices with their adjacent even indices, then compares and swaps data elements at even indices with their adjacent odd indices. After multiple iterations, the entire sequence is sorted. This algorithm does not require the number of data elements to be sorted to be a positive integer power of 2, making it suitable for sorting data of any size.

[0036] The low-power sorting control method based on a single-level sorting network provided by this invention is applicable to various scenarios requiring low power consumption, high throughput, and hardware-accelerated sorting, such as Top-K selection in AI accelerators, peak filtering in signal processing, result sorting in database queries, relevance sorting in search engines, real-time data sorting in embedded systems, and message priority sorting in high-throughput network processors. Specifically, the invention provides a configuration basis for the single-level sorting network unit to perform sorting processing by pre-configuring a sorting configuration set; it controls the single-level sorting network unit to obtain the current batch of data to be sorted; based on the preset high bits of each data element in the current batch of data to be sorted and the pre-configured sorting configuration set, it controls the single-level sorting network unit to sequentially execute the sorting processing corresponding to each sorting level configuration; and it generates a cumulative equality flag during the sorting process; it obtains the final cumulative equality flag and the corresponding current intermediate sorting result by pre-setting the target sorting level configuration; it processes the current intermediate sorting result based on the target data processing path determined by the final cumulative equality flag to obtain the corresponding current batch of candidate data; and it updates the historical candidate data using the current batch of candidate data to obtain the corresponding updated historical candidate data.

[0037] The technical solutions in the embodiments of the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the invention.

[0038] like Figure 1a The diagram illustrates a flowchart of a low-power sorting control method based on a single-level sorting network according to an embodiment of the present invention. The low-power sorting control method based on a single-level sorting network in this embodiment includes the following steps:

[0039] Step S11: Pre-configure a sorting configuration set, which includes multiple sorting block configurations; each sorting block configuration includes one or more sorting level configurations.

[0040] It should be noted that the sorting control method of this application is applied to the sorting controller of a sorting control system. The sorting control system includes at least a sorting controller and a single-stage sorting network unit electrically connected to the sorting controller.

[0041] The sorting controller is pre-configured with a sorting configuration set. This set comprises all configuration information required to complete a single sorting process, controlling the single-level sorting network unit to execute the sorting process according to a preset order and parameters. The sorting configuration set is divided into multiple sorting block configurations according to the sorting execution logic of a preset sorting algorithm (e.g., bitonetic sorting). These multiple sorting block configurations are arranged according to a preset sorting block execution order. Each sorting block configuration contains one or more sorting level configurations, and multiple sorting level configurations within the same sorting block configuration are arranged sequentially according to a preset sorting level execution order. Both the sorting block configuration and the sorting level configuration are logical configurations based on the preset sorting algorithm and are not independent physical hardware. The sorting level configuration is the smallest granularity of sorting control configuration, including at least sorting control parameters such as element comparison distance and sorting direction.

[0042] In this embodiment, the single-level sorting network unit is a sorting operation unit with only a single-level hardware architecture in physical hardware, which integrates multiple comparators and selectors. The comparators are used to compare the numerical values ​​of two data elements, and the selectors are used to determine whether to swap the positions of the two data elements based on the comparison result and a preset sorting direction (e.g., ascending or descending). Together, they realize the comparison-swapping operation of data elements.

[0043] After pre-configuring the sorting configuration set, the sorting controller sequentially calls each sorting block configuration in the sorting configuration set according to the preset sorting block execution order, and sequentially calls each sorting level configuration within the corresponding sorting block configuration according to the preset sorting level execution order. The single-level sorting network unit receives the sorting control parameters corresponding to the current sorting level configuration from the sorting controller, and then performs corresponding data comparison, position swapping, and other sorting operations based on these parameters. By sequentially traversing and executing all sorting level configurations, the sorting operations corresponding to multiple sorting level configurations in the sorting configuration set can be completed using only one physical hardware unit—the single-level sorting network unit.

[0044] To facilitate understanding by those skilled in the art, the following example uses the bitonic sorting algorithm to illustrate the configuration logic of the sorting configuration set corresponding to the sorting process of N data elements to be sorted. It should be specifically noted that this example is merely one feasible implementation and does not constitute a limitation on the present invention. First, as... Figure 1bAs shown, the sorting execution logic of the bitonic sorting algorithm is as follows: When sorting N data elements to be sorted, multiple sorting blocks need to be executed sequentially. Each sorting block corresponds to one complete bitonic merge operation, and the lengths of the sorting blocks are 2, 4, 8, ..., N, respectively. Within each sorting block, multiple sorting stages need to be executed sequentially, and each sorting stage has a fixed element comparison distance. The element comparison distance corresponding to the sorting stage starts from half the length of the current sorting block and decreases by half at each stage until it reaches 1. Furthermore, under the sorting execution logic of the bitonic sorting algorithm, the sorting processing for N=8 data elements to be sorted includes three sorting block configurations in the sorting configuration set: the first sorting block configuration with a length of 2, the second sorting block configuration with a length of 4, and the third sorting block configuration with a length of 8. The first sorting block configuration contains one sorting stage configuration, where the element comparison distance is 1, and the sorting direction is ascending. The second sorting block configuration contains two sorting levels, executed in the order of the first and second sorting levels. The first sorting level configuration has an element comparison distance of 2 and sorts in ascending order; the second sorting level configuration has an element comparison distance of 1 and sorts in ascending order. The third sorting block configuration contains three sorting levels, executed in the order of the first, second, and third sorting levels. The first sorting level configuration has an element comparison distance of 4 and sorts in ascending order; the second sorting level configuration has an element comparison distance of 2 and sorts in ascending order; the third sorting level configuration has an element comparison distance of 1 and sorts in ascending order. According to the above sorting configuration set, the sorting controller sequentially calls the first sorting level configuration of the first sorting block, the first sorting level configuration of the second sorting block, the second sorting level configuration of the second sorting block, the first sorting level configuration of the third sorting block, the second sorting level configuration of the third sorting block, and the third sorting level configuration of the third sorting block, and sends them to the single-level sorting network unit. The single-level sorting network unit performs bitone sorting processing in sequence according to the above sorting level configuration.

[0045] Step S12: Control the single-level sorting network unit to obtain the current batch of data to be sorted.

[0046] It should be noted that the current batch of data to be sorted refers to a batch of data taken from the original data to be sorted and sent to the single-level sorting network unit for sorting. Since the number of data elements that a single-level sorting network unit can process at one time is a positive integer power of 2, denoted as N, when the number of data elements in the original data to be sorted (denoted as B) is greater than N, the original data to be sorted needs to be processed in batches. Each batch contains N data elements, which are sequentially sent to the single-level sorting network unit for sorting. When B is not an integer multiple of N, the last batch has fewer than N data elements. In this case, the maximum or minimum value under the current data type is used to fill the remaining batch to make up N data elements. For example, if the single-level sorting network unit sorts the N data elements in ascending order and needs to filter the first N / 2 data elements, the last batch is filled with the maximum value to avoid affecting the filtering result; if the single-level sorting network unit sorts the N data elements in descending order and needs to filter the first N / 2 data elements, the last batch is filled with the minimum value to avoid affecting the filtering result.

[0047] Step S13: Based on the preset high bits of each data element in the current batch of data to be sorted and the pre-configured sorting configuration set, control the single-level sorting network unit to sequentially execute the sorting process corresponding to each sorting level configuration; generate a cumulative equality flag during the sorting process executed by the single-level sorting network unit.

[0048] In one embodiment of this application, as Figure 2 As shown, the process of generating a cumulative equality flag during the sorting process performed by the single-level sorting network unit includes:

[0049] Step S131: In the sorting process corresponding to the current sorting level configuration executed by the single-level sorting network unit, a corresponding equality flag is generated for each data element pair participating in the comparison; the equality flag is used to characterize whether the data elements corresponding to the data element pair are equal under the preset high bit.

[0050] Specifically, in the sorting process corresponding to the current sorting level configuration executed by the single-level sorting network unit, each data element is compared only at the preset high bit position, and a corresponding equality flag is generated after the comparison. It should be noted that the bit position refers to the number of binary bits occupied by a data element in a computer system. For example, the data width of a single-precision floating-point number (float32) is 32 bits, the data width of a double-precision floating-point number (float64) is 64 bits, and the data width of an integer (int16) is 16 bits. The preset high bit position is the effective bit range extracted from all bits of the data element according to a preset bit selection direction and a preset number of bits. For example, the highest two bits of all bits of the data element are selected as the preset high bit position.

[0051] To improve the efficiency of comparison operations, this application does not require comparing all bits of the data element, but only compares a preset high-order bit. For example, for a 32-bit single-precision floating-point number, a 16-bit comparator, or any comparator less than 32 bits, can be used for comparison. Since the comparison operation is performed only on the preset high-order bit, the number of logic gates and level transitions in the comparator is reduced, significantly lowering power consumption.

[0052] The equality flag is used to characterize whether the data elements are equal to the corresponding data elements under the preset high bit. For example, equality flag 0 is configured to indicate that the two data elements being compared are not equal under the preset high bit, and equality flag 1 is configured to indicate that the two data elements being compared are equal under the preset high bit.

[0053] Step S132: Perform a preset logical operation on all equality flags generated in the sorting process corresponding to the current sorting level configuration to obtain the intra-level equality flags.

[0054] Specifically, in the sorting process corresponding to the current sorting level configuration executed by the single-level sorting network unit, a preset logical operation is performed on all equality flags generated in the sorting process to obtain intra-level equality flags. In this embodiment, the preset logical operation is a logical OR operation, used to determine whether there are pairs of data elements with equal data elements in the sorting process corresponding to the current sorting level configuration executed by the single-level sorting network unit.

[0055] Step S133: Perform the preset logical operation on the intra-level equality flag and the historical cumulative equality flag to obtain the cumulative equality flag configured in the current sorting level; use the cumulative equality flag configured in the current sorting level as the historical cumulative equality flag configured in the next sorting level.

[0056] It should be noted that the historical cumulative equality flag is used to record whether any data elements that are equal at the preset high bit position have appeared in all sorting level configurations that have been executed so far. Before the single-level sorting network unit starts executing the first sorting level configuration in the first sorting block configuration, the historical cumulative equality flag is initialized to 0.

[0057] For the current sorting level configuration, its corresponding historical cumulative equality flag is the cumulative equality flag of the previous sorting level configuration. A logical OR operation is performed between the cumulative equality flag of the previous sorting level configuration (i.e., the historical cumulative equality flag) and the intra-level equality flag corresponding to the current sorting level configuration to obtain the updated result, which is then used as the cumulative equality flag of the current sorting level configuration. In other words, the calculation formula for the cumulative equality flag of the current sorting level configuration is:

[0058] ;(Formula 1)

[0059] Wherein, B_final is the cumulative equality flag configured in the current sorting level; B_final_old is the cumulative equality flag configured in the previous sorting level; and B_i is the intra-level equality flag configured in the current sorting level.

[0060] After obtaining the cumulative equality flag of the current sorting level configuration, the cumulative equality flag of the current sorting level configuration is used as the historical cumulative equality flag of the next sorting level configuration.

[0061] Step S14: After the single-level sorting network unit executes to the preset target sorting level configuration, the generated cumulative equality flag is used as the final cumulative equality flag, and the corresponding current intermediate sorting result is obtained.

[0062] Specifically, a preset target sorting level configuration is set in advance. When a single-level sorting network unit executes the preset target sorting level configuration, its corresponding cumulative equality flag is determined as the final cumulative equality flag; at the same time, the sorting data obtained at this time is used as the current intermediate sorting result. In a specific embodiment of this application, the preset target sorting level configuration is the first sorting level configuration of the last sorting block configuration.

[0063] Step S15: Based on the final cumulative equality flag, determine the target data processing path from at least two preset data processing paths, and obtain the corresponding current batch candidate data based on the target data processing path and the current intermediate sorting result.

[0064] In one embodiment of this application, the preset at least two data processing paths include a first data processing path and a second data processing path. Determining the target data processing path among the preset at least two data processing paths based on the final cumulative equality flag includes: determining the first data processing path as the target data processing path when the final cumulative equality flag indicates the existence of equal data elements; and determining the second data processing path as the target data processing path when the final cumulative equality flag indicates the absence of equal data elements. For example, the final cumulative equality flag can be configured to have a value of 1 indicating the existence of equal data elements, and a value of 0 indicating the absence of equal data elements.

[0065] In one embodiment of this application, the method for obtaining the corresponding current batch candidate data based on the target data processing path and the current intermediate sorting result includes:

[0066] When the target data processing path is the first data processing path, the single-level sorting network unit is controlled to stop executing the sorting level configurations that have not yet been executed in the sorting configuration set; based on the current intermediate sorting result, the target local data processing path is determined from at least two preset local data processing paths, and the corresponding current batch candidate data is obtained based on the target local data processing path and the current intermediate sorting result.

[0067] When the target data processing path is the second data processing path, the single-level sorting network unit is controlled to continue executing the sorting level configurations that have not yet been executed in the sorting configuration set on the current intermediate sorting result to obtain the current batch sorting result. Data that satisfy a preset sorting direction (such as ascending or descending) and a preset data quantity (such as the first N / 2, where N is the number of data elements in the current batch sorting result) are selected from the current batch sorting result as the current batch candidate data. It should be noted that during the process of the single-level sorting network unit continuing to execute the sorting level configurations that have not yet been executed in the sorting configuration set, a cumulative equality flag is no longer generated.

[0068] In one embodiment of this application, the preset at least two local data processing paths include a first local data processing path and a second local data processing path; the method for determining the target local data processing path among the preset at least two local data processing paths based on the current intermediate sorting result includes:

[0069] In the current intermediate sorting result, it is determined whether the data elements at at least two consecutive preset data positions are equal; if they are equal, the first local data processing path is determined as the target local data processing path; if they are not equal, the second local data processing path is determined as the target local data processing path. In a specific embodiment of this application, the at least two consecutive preset data positions are the last data element position of the first half of the data and the first data element position of the second half of the data in the current intermediate sorting result; wherein, the number of data elements in the first half of the data and the number of data elements in the second half of the data are equal.

[0070] In one embodiment of this application, the method for obtaining the corresponding current batch candidate data based on the target local data processing path and the current intermediate sorting result includes:

[0071] When the first local data processing path is the target local data processing path, the current intermediate sorting result is subjected to local odd-even sorting processing, and data that satisfies the preset sorting direction (such as ascending or descending order) and preset data volume (such as the first N / 2, where N is the number of data elements in the current intermediate sorting result after odd-even sorting processing) are selected from the results after odd-even sorting processing as the candidate data for the current batch.

[0072] When the second local data processing path is the target local data processing path, data that satisfies the preset sorting direction (such as ascending or descending order) and preset data volume (such as the first N / 2, where N is the number of data elements in the current intermediate sorting result) are selected from the current intermediate sorting result as the current batch candidate data.

[0073] In one embodiment of this application, as Figure 3 As shown, when the first local data processing path is the target local data processing path, the process of performing local parity sorting on the current intermediate sorting result includes:

[0074] Step S31: Based on data elements at at least two consecutive preset data positions, locate consecutive equal data intervals in the current intermediate sorting result.

[0075] In some alternative implementations, such as Figure 4 As shown, the method for locating a continuous interval of equal data in the current intermediate sorting result based on data elements at at least two consecutive preset data positions includes:

[0076] Step S41: In the current intermediate sorting result, take at least two consecutive preset data positions as the center and expand to both sides to locate all data elements that are equal to the data elements at the preset data positions under the preset high bit position.

[0077] Step S42: All data elements that are equal to the data element at the preset data position under the preset high bit position constitute the continuous equal data interval.

[0078] Specifically, during the expansion to the left centered on at least two consecutive preset data positions, each data element is checked sequentially to the left for its value at the preset high bit position to see if it equals the value of the corresponding data element at the preset data position, until the first data element not equal to the value of the corresponding data element at the preset data position is encountered. During the leftward expansion, all data elements equal to the value of the corresponding data element at the preset data position belong to a continuous equal data interval. Similarly, during the expansion to the right centered on at least two consecutive preset data positions, each data element is checked sequentially to the right for its value at the preset high bit position to see if it equals the value of the corresponding data element at the preset data position, until the first data element not equal to the value of the corresponding data element at the preset data position is encountered. During the rightward expansion, all data elements equal to the value of the corresponding data element at the preset data position found during both the leftward and rightward expansions together constitute a continuous equal data interval.

[0079] To facilitate understanding by those skilled in the art, the location of consecutive equal data intervals is illustrated below. It should be specifically noted that this example is merely one feasible implementation and does not constitute a limitation of the present invention. Assume that the current batch of data to be sorted contains 8 data elements. After sorting at a preset high bit level (e.g., the high 16 bits), the values ​​of each data element in the current intermediate sorting result are: 10.00, 15.00, 10.00, 15.03, 15.01, 15.02, 20.00, and 25.00. This current intermediate sorting result can be divided into two equal segments: a first half with 4 data elements and a second half with 4 data elements. At least two consecutive preset data positions are the last data element position in the first half (the position of the 4th data element) and the first data element position in the second half (the position of the 5th data element). First, since the fourth and fifth data elements both have a value of 15 under the preset high bit position, and these two data element values ​​are equal, the first local data processing path is determined as the target local data processing path. Second, after determining the target local data processing path, the system expands outwards from the positions of the fourth and fifth data elements. During the leftward expansion, the expansion stops because the third data element is not equal to 15 under the preset high bit position. During the rightward expansion, the sixth data element is included in the interval because it is equal to 15 under the preset high bit position, and the expansion continues to the right. The rightward expansion stops because the seventh data element is not equal to 15 under the preset high bit position. Finally, the fourth, fifth, and sixth data elements together constitute a continuous interval of equal data.

[0080] Step S32: Based on the preset low bit corresponding to the data elements in the located continuous equal data interval, control the single-level sorting network unit to perform local parity sorting processing on the data elements in the continuous equal data interval.

[0081] It should be noted that after locating a continuous interval of equal data, since all data elements within this interval are equal at the preset high bit position, their relative order cannot be determined solely by comparing the values ​​of the data elements at the preset high bit position. Therefore, it is necessary to use the preset low bit position (e.g., the lower 8 bits) of the data elements for further sorting. The preset low bit position refers to the effective bit interval obtained by subtracting the preset high bit position from all the bits corresponding to the data elements within the continuous interval of equal data, according to the preset bit selection direction and preset bit quantity. For example, if the total number of bits corresponding to a data element is 8 bits, and the preset high bit position is the highest 2 bits, then from the remaining 6 bits, either the highest 2 bits are selected as the preset low bit position, or all 6 remaining bits are selected as the preset low bit position.

[0082] Specifically, after locating a continuous interval of equal data, the control unit of the single-level sorting network performs local parity sorting on the data elements within the interval using a parity sorting algorithm based on a preset low bit. The parity sorting algorithm does not require the number of data elements to be sorted to be a positive integer power of 2, and is applicable to sorting data with any number of data elements. The parity sorting algorithm arranges the data elements in a preset sorting direction (ascending or descending) by alternately comparing and exchanging odd and even index positions in the data to be sorted.

[0083] Step S16: Update the historical candidate data based on the current batch candidate data to obtain the corresponding historical updated candidate data, and use the historical updated candidate data as the historical candidate data to be updated in the next batch.

[0084] It should be noted that for the current batch of candidate data, the corresponding historical candidate data is the historical updated candidate data after the previous batch. After obtaining the current batch of candidate data, the historical updated candidate data after the previous batch (i.e., the historical candidate data) is updated based on the current batch of candidate data to obtain the updated result, which is the historical updated candidate data. This updated result is then used as the historical candidate data to be updated in the next batch.

[0085] In one embodiment of this application, the sorting control system further includes an intermediate result storage unit electrically connected to the single-level sorting network unit. This intermediate result storage unit is used to cache historical candidate data during the iteration process and uses the historical updated candidate data obtained after the last batch completes sorting as the final sorting result. The number of data elements that the intermediate result storage unit can store is a multiple of the number of data elements that the single-level sorting network unit can process at one time.

[0086] In some optional implementations, the number of data elements that the single-level sorting network unit can process at one time is twice the number of data elements that the intermediate result temporary storage unit can store. It should be noted that the intermediate result temporary storage unit needs to be initialized before sorting the original data to be sorted. Specifically, the intermediate result temporary storage unit is fixed to store N / 2 data elements (N is the number of data elements that the single-level sorting network unit can process at one time, and N is a positive integer power of 2). During initialization, each data element is set to the maximum or minimum value corresponding to the data type of the data element in the original data to be sorted. Specifically, if the sorting goal is to filter the first N / 2 minimum values ​​in the original data to be sorted, the intermediate result temporary storage unit is initialized to the maximum value; if the sorting goal is to filter the first N / 2 maximum values ​​in the original data to be sorted, the intermediate result temporary storage unit is initialized to the minimum value. For example, if the original data to be sorted is a 32-bit integer with B data elements, and the sorting goal is to select the first N / 2 (B is greater than N) minimum values ​​in the original data to be sorted, then the intermediate result temporary storage unit is initialized with N / 2 integer maximum values, and each integer maximum value is 2147483647.

[0087] In one embodiment of this application, as Figure 5 As shown, the process of updating historical candidate data based on the current batch of candidate data, obtaining corresponding historical updated candidate data, and using the historical updated candidate data as the historical candidate data to be updated in the next batch includes:

[0088] Step S161: Control the single-level sorting network unit to sort the candidate data of the current batch in reverse order.

[0089] Specifically, in order to concatenate with historical candidate data and construct a bitonic sequence, the current batch of candidate data needs to be reversed. This reversed order means completely reversing the order of the data elements: the first element becomes the last, the second element becomes the second to last, and so on. For example, assuming the current batch of candidate data is 2, 4, 6, 8 (in ascending order), after reversing, it becomes 8, 6, 4, 2.

[0090] Step S162: Concatenate the current batch of candidate data arranged in reverse order with the historical candidate data in the intermediate result temporary storage unit to obtain concatenated data.

[0091] Specifically, after reversing the order of the candidate data in the current batch, the historical updated candidate data (i.e., historical candidate data) from the previous batch, stored in the intermediate result temporary storage unit, is read. The new candidate data of the current batch after reversing the order is then concatenated with the historical candidate data in the intermediate result temporary storage unit according to a preset order, forming a set of concatenated data with bitonicity, which serves as the input data for subsequent merging and sorting. For example, suppose the historical candidate data stored in the intermediate result temporary storage unit is 1, 3, 5, 7, arranged in ascending order; the candidate data of the current batch is 2, 4, 6, 8, arranged in ascending order; and the candidate data of the current batch after reversing the order is 8, 6, 4, 2, arranged in descending order. The concatenated data obtained by concatenating the historical candidate data stored in the intermediate result temporary storage unit and the current batch candidate data after reversing the order, with the historical candidate data first and the current batch candidate data after reversing the order, is 1, 3, 5, 7, 8, 6, 4, 2. The first half of the concatenated data is in ascending order and the second half is in descending order, which has a bitonicity and is suitable as input data for subsequent merging and sorting processing.

[0092] Step S163: Based on the preset target sorting block configuration, control the single-level sorting network unit to perform merging and sorting processing on the spliced ​​data to obtain the merging and sorting processing result.

[0093] Specifically, after obtaining the concatenated data, the sorting controller sequentially controls the single-level sorting network unit to perform the comparison-swap operations corresponding to each sorting level configuration according to the sorting level configuration in the preset target sorting block configuration. Since the concatenated data already has bitone properties, after the single-level sorting network unit performs merge sorting processing on the concatenated data based on the preset target sorting block configuration, the merge sorting result obtained is a completely ordered sequence (all ascending or all descending). In this embodiment, the preset target sorting block configuration is the last sorting block configuration in the sorting configuration set. For example, the concatenated data is 1, 3, 5, 7, 8, 6, 4, 2, which has bitone properties; after the single-level sorting network unit performs merge sorting processing on the concatenated data based on the last sorting block configuration, the merge sorting result obtained is 1, 2, 3, 4, 5, 6, 7, 8, which is completely ascending.

[0094] Step S164: Based on the merge sorting result, obtain the historical update candidate data, and update the historical update candidate data to the intermediate result temporary storage unit as the historical candidate data to be updated in the next batch.

[0095] Specifically, after obtaining the merge sorting result, data that satisfies a preset sorting direction (such as ascending or descending) and a preset data quantity (such as the first N / 2 elements, where N is the number of data elements in the merge sorting result) are selected from the merge sorting result as the historical update candidate data. This historical update candidate data is then updated to the intermediate result temporary storage unit as the next batch of historical candidate data to be updated. For example, if the merge sorting result is: 1, 2, 3, 4, 5, 6, 7, 8 (ascending order, number of data elements N=8), and the first N / 2=4 data elements are 1, 2, 3, 4, then the first N / 2 data elements are selected as historical update candidate data and written into the intermediate result temporary storage unit as the next batch of historical candidate data.

[0096] In one embodiment of this application, the sorting control system further includes a state register unit electrically connected to the sorting controller. This state register unit is mainly used to mark the operational stage of the sorting process for the current batch of data to be sorted, including a first state and a second state. The first state represents the sorting stage, and the second state represents the update stage. Before updating historical candidate data based on the current batch of candidate data, the state register unit is set to the second state; after obtaining the historical updated candidate data, the state register unit is set to the first state. For example, the first state of the state register unit is configured as 1, and the second state as 0. Before updating historical candidate data based on the current batch of candidate data, the state register unit is configured as 0; after obtaining the historical updated candidate data, the state register unit is configured as 1.

[0097] In one embodiment of this application, the sorting control system further includes a read / write controller electrically connected to the single-level sorting network unit. The read / write controller is used to read memory data and transmit the current batch of data to be sorted to the single-level sorting network unit.

[0098] To better understand the implementation scheme of the low-power sorting control method based on a single-level sorting network, the following section combines... Figure 6 and Figure 7 The specific implementation examples are described below:

[0099] In this embodiment, the number of data elements that a single-level sorting network unit can process at one time is N=8; the number of data elements that the intermediate result temporary storage unit can store is 4 (i.e., N / 2); the original data to be sorted consists of 20 32-bit single-precision floating-point data, and the sorting goal is to select the first 4 minimum values ​​in the original data to be sorted; the original data to be sorted is divided into 3 current batches of data to be sorted, namely the first current batch of data to be sorted consisting of the 1st to 8th data elements; the second current batch of data to be sorted consisting of the 9th to 16th data elements; and the third current batch of data to be sorted consisting of the last 4 data elements plus 4 maximum values ​​(e.g., 2147483647); the intermediate result temporary storage unit is initialized to 4 maximum values ​​(e.g., 2147483647); and the state register unit is initialized to 1.

[0100] 1. Pre-configure sorting configuration set

[0101] The sorting configuration set is configured sequentially according to the bitonic sorting algorithm as follows: The first sorting block configuration (sorting block length 2) contains one sorting level configuration, where the element comparison distance is 1; the second sorting block configuration (sorting block length 4) contains two sorting level configurations, where the element comparison distances are 2 and 1 respectively; the third sorting block configuration (sorting block length 8) contains three sorting level configurations, where the element comparison distances are 4, 2, and 1 respectively. The sorting direction in all sorting level configurations is ascending.

[0102] Based on the aforementioned sorting configuration set, the sorting controller sequentially calls the corresponding sorting level configurations. The single-level sorting network unit performs bitone sorting processing sequentially based on the preset high bits (such as the first 16 bits) of each data element in the current batch of data to be sorted and the corresponding sorting level configuration. Simultaneously, a cumulative equality flag is generated during the sorting process performed by the single-level sorting network unit.

[0103] 2. Lock the target sorting level configuration results

[0104] In this embodiment, the first sorting level configuration of the third sorting block is set as the preset target sorting level configuration; after the single-level sorting network unit executes to the target sorting level configuration, it uses the generated cumulative equality flag as the final cumulative equality flag, and outputs the corresponding current intermediate sorting result.

[0105] 3. Scenario-based branching processing

[0106] Processing rules: A final cumulative equality flag of 0 indicates that there are no data elements that are equal at the preset high bit position during the sorting process; a flag of 1 indicates that there are data elements that are equal at the preset high bit position during the sorting process.

[0107] Example 1: No equal data elements (final cumulative equality flag = 0)

[0108] The current intermediate sorting results are 10.00, 11.00, 16.00, 15.00, 12.00, 19.00, 20.00, and 25.00. Subsequent data processing will proceed according to the second data processing path. Specifically, the sorting controller controls the single-level sorting network unit to continue executing the sorting level configurations not yet executed in the sorting configuration set for the current intermediate sorting results, obtaining the current batch sorting results as 10.00, 11.00, 12.00, 15.00, 16.00, 19.00, 20.00, and 25.00, and based on these results, obtaining the current batch candidate data as 10.00, 11.00, 12.00, and 15.00.

[0109] Example 2: There are equal data elements, but the data elements at the preset data positions are not equal (final cumulative equality flag = 1).

[0110] The current intermediate sorting result is 10.00, 10.00, 10.00, 15.01, 12.02, 19.00, 20.00, 25.00. Subsequent data processing follows the second data processing path, whereby the sorting controller controls the single-level sorting network unit to stop executing sorting-level configurations that have not yet been executed in the sorting configuration set. Since the fourth data element in the current intermediate sorting result has a value of 15 in the preset high bit position and the fifth data element has a value of 12 in the preset high bit position, the two data element values ​​are not equal. Therefore, the current intermediate sorting result is processed according to the second local data processing path, resulting in the current batch candidate data being 10.00, 10.00, 10.00, 15.01.

[0111] Example 3: There are equal data elements. The data elements at the preset data positions are equal (final cumulative equality flag = 1).

[0112] The current intermediate sorting result is 10.00, 10.00, 10.00, 15.22, 15.01, 15.00, 20.00, 25.00. Subsequent data processing will be performed on this current intermediate sorting result according to the second data processing path. That is, the sorting controller controls the single-level sorting network unit to stop executing sorting level configurations that have not yet been executed in the sorting configuration set. Since the 4th data element and the 5th data element in the current intermediate sorting result are both 15 in the preset high bit position, and their values ​​are equal, the current intermediate sorting result will be processed according to the first local data processing path. That is, the 4th data element (15.22), the 5th data element (15.01), and the 6th data element (15.00) will be determined to constitute a continuous equal data interval. Based on the preset low bits corresponding to the data elements within the consecutive equal data interval, the single-level sorting network unit is controlled to perform local parity sorting on the data elements within the consecutive equal data interval, and the current batch candidate data is obtained as 10.00, 10.00, 10.00, and 15.00 according to the local parity sorting result.

[0113] 4. Merge and sort processing

[0114] After obtaining the candidate data for the current batch, the sorting controller sets the status register to 0 and enters the data update phase: First, the candidate data for the current batch is sorted in reverse order; second, the historical candidate data stored in the intermediate result temporary storage unit is read and concatenated according to the rule of historical data first and data after reverse order, forming concatenated data with bitonetic characteristics; next, the last sorting block configuration in the sorting configuration set is called, and the single-level sorting network unit performs merge sorting processing on the concatenated data to obtain the merge sorting result; finally, the first 4 data points are extracted from the merge sorting result as historical update candidate data and updated and stored in the intermediate result temporary storage unit; after the update is completed, the sorting controller sets the status register to 1 again, waiting for the next batch of data to be processed. After all three current batches of data to be sorted are sorted, the final sorted data is obtained.

[0115] In summary, this invention provides a low-power sorting control method based on a single-level sorting network. It pre-configures a sorting configuration set to provide a configuration basis for the single-level sorting network unit to perform sorting processing. The method controls the single-level sorting network unit to acquire the current batch of data to be sorted. Based on the preset high bits of each data element in the current batch of data to be sorted and the pre-configured sorting configuration set, the method controls the single-level sorting network unit to sequentially execute the sorting processing corresponding to each sorting level configuration. During the sorting process, a cumulative equality flag is generated. Through a preset target sorting level configuration, the final cumulative equality flag and the corresponding current intermediate sorting result are obtained. The current intermediate sorting result is processed based on the target data processing path determined by the final cumulative equality flag to obtain the corresponding current batch of candidate data. The current batch of candidate data is used to update historical candidate data, thereby obtaining the corresponding historical updated candidate data. This invention sequentially executes multiple sorting level configurations through a single-level sorting network unit, uses preset high bits for data element comparison, and dynamically skips invalid sorting level configurations based on the cumulative equality flag, avoiding a large number of invalid low-bit comparisons and data flipping operations, significantly reducing dynamic power consumption during the sorting process.

[0116] Therefore, this application effectively overcomes the various shortcomings of the prior art and has high industrial application value.

[0117] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. A low-power sorting control method based on a single-level sorting network, characterized in that, A sorting controller applied to a sorting control system, the sorting controller being electrically connected to a single-stage sorting network unit; the method includes: A sorting configuration set is pre-configured, which includes multiple sorting block configurations; each sorting block configuration includes one or more sorting level configurations. The single-level sorting network unit is controlled to acquire the current batch of data to be sorted; Based on the preset high bits of each data element in the current batch of data to be sorted and the pre-configured sorting configuration set, the single-level sorting network unit is controlled to sequentially execute the sorting process corresponding to each sorting level configuration; during the sorting process executed by the single-level sorting network unit, a cumulative equality flag is generated; After the single-level sorting network unit executes to the preset target sorting level configuration, the generated cumulative equality flag is used as the final cumulative equality flag, and the corresponding current intermediate sorting result is obtained; Based on the final cumulative equality flag, a target data processing path is determined from at least two preset data processing paths, and based on the target data processing path and the current intermediate sorting result, the corresponding current batch candidate data is obtained. Based on the current batch of candidate data, the historical candidate data is updated to obtain the corresponding historical updated candidate data, and the historical updated candidate data is used as the historical candidate data to be updated in the next batch.

2. The low-power sorting control method based on a single-level sorting network according to claim 1, characterized in that, The process of generating a cumulative equality flag during the sorting process performed by the single-level sorting network unit includes: In the single-level sorting network unit, when performing the sorting process corresponding to the current sorting level configuration, a corresponding equality flag is generated for each pair of data elements participating in the comparison; the equality flag is used to characterize whether the data elements corresponding to the data element pair are equal under the preset high bit. Perform a preset logical operation on all equality flags generated in the sorting process corresponding to the current sorting level configuration to obtain the intra-level equality flags; Perform the preset logical operation on the intra-level equality flag and the historical cumulative equality flag to obtain the cumulative equality flag configured for the current sorting level; use the cumulative equality flag configured for the current sorting level as the historical cumulative equality flag configured for the next sorting level.

3. The low-power sorting control method based on a single-level sorting network according to claim 1 or 2, characterized in that, The preset at least two data processing paths include a first data processing path and a second data processing path; Based on the final cumulative equality flag, determining the target data processing path from at least two preset data processing paths includes: When the final cumulative equality flag indicates that there are equal data elements, the first data processing path is determined to be the target data processing path. When the final cumulative equality flag indicates that there are no equal data elements, the second data processing path is determined as the target data processing path.

4. The low-power sorting control method based on a single-level sorting network according to claim 3, characterized in that, Based on the target data processing path and the current intermediate sorting result, the methods for obtaining the corresponding current batch candidate data include: When the target data processing path is the first data processing path, the single-level sorting network unit is controlled to stop executing the sorting level configurations that have not yet been executed in the sorting configuration set; based on the current intermediate sorting result, the target local data processing path is determined from at least two preset local data processing paths, and based on the target local data processing path and the current intermediate sorting result, the corresponding current batch candidate data is obtained; When the target data processing path is the second data processing path, the single-level sorting network unit is controlled to continue to execute the sorting level configuration that has not yet been executed in the sorting configuration set on the current intermediate sorting result to obtain the current batch sorting result; data that meets the preset sorting direction and preset data volume are selected from the current batch sorting result as the current batch candidate data.

5. The low-power sorting control method based on a single-level sorting network according to claim 4, characterized in that, The preset at least two local data processing paths include a first local data processing path and a second local data processing path; based on the current intermediate sorting result, determining the target local data processing path among the preset at least two local data processing paths includes: In the current intermediate sorting result, it is determined whether the data elements at at least two consecutive preset data positions are equal; If they are equal, the first local data processing path is determined to be the target local data processing path. If they are not equal, the second local data processing path is determined as the target local data processing path.

6. The low-power sorting control method based on a single-level sorting network according to claim 5, characterized in that, The methods for obtaining the corresponding current batch candidate data based on the target local data processing path and the current intermediate sorting result include: When the first local data processing path is the target local data processing path, the current intermediate sorting result is subjected to local odd-even sorting processing, and data that meets the preset sorting direction and preset data volume is selected from the results after odd-even sorting processing as the current batch candidate data. When the second local data processing path is the target local data processing path, data that meets the preset sorting direction and preset data volume are selected from the current intermediate sorting results as the current batch candidate data.

7. The low-power sorting control method based on a single-level sorting network according to claim 6, characterized in that, When the first local data processing path is the target local data processing path, the process of performing local odd-even sorting on the current intermediate sorting result includes: Based on data elements at at least two consecutive preset data positions, locate consecutive equal data intervals in the current intermediate sorting result; Based on the preset low bits corresponding to the data elements within the identified consecutive equal data intervals, the single-level sorting network unit is controlled to perform local parity sorting on the data elements within the consecutive equal data intervals.

8. The low-power sorting control method based on a single-level sorting network according to claim 7, characterized in that, The methods for locating consecutive equal data intervals in the current intermediate sorting result based on data elements at at least two consecutive preset data positions include: In the current intermediate sorting result, taking at least two consecutive preset data positions as the center, expand to both sides to locate all data elements that are equal to the data elements at the preset data positions under the preset high bit position; All data elements that are equal to the data element at the preset high bit position constitute the continuous equal data interval.

9. The low-power sorting control method based on a single-level sorting network according to claim 1, characterized in that, The sorting control system further includes an intermediate result temporary storage unit electrically connected to the single-level sorting network unit; the process of updating historical candidate data based on the current batch candidate data to obtain corresponding historical updated candidate data, and using the historical updated candidate data as the historical candidate data to be updated in the next batch includes: The single-level sorting network unit is controlled to sort the candidate data of the current batch in reverse order. The current batch of candidate data, sorted in reverse order, is concatenated with the historical candidate data in the intermediate result temporary storage unit to obtain concatenated data; Based on the preset target sorting block configuration, the single-level sorting network unit is controlled to perform merging and sorting processing on the spliced ​​data to obtain the merging and sorting processing result. Based on the merge sorting results, the historical update candidate data is obtained, and the historical update candidate data is updated to the intermediate result temporary storage unit as the historical candidate data to be updated in the next batch.

10. The low-power sorting control method based on a single-level sorting network according to claim 1, characterized in that, The sorting control system further includes a state register unit electrically connected to the sorting controller; Before updating the historical candidate data based on the current batch of candidate data, the state register unit is set to the second state; after obtaining the historical updated candidate data, the state register unit is set to the first state.