Data processing device and method, electronic equipment and storage medium
By using the high-bit components of floating point numbers for data compression and grouping in the data processing device, the problem of hardware acceleration of Top-K operations in the existing technology is solved, efficient and low-resource Top-K operations are realized, and the performance of artificial intelligence chips is improved. Execution efficiency.
Patent Information
- Application Number
- CN202411081805.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-10-15
AI Technical Summary
In big data and deep learning application scenarios, it is difficult for existing algorithms to effectively implement hardware acceleration of Top-K operations, resulting in high hardware resource overhead and low efficiency.
By using the high-bit components of floating point numbers for data compression and grouping in the data processing device to determine the data sequence to be processed, efficient Top-K operations are achieved and hardware resource overhead is reduced.
It realizes efficient and low resource overhead Top-K operations on artificial intelligence chips, improving execution efficiency and performance.
Smart Images

Figure CN118779253A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the technical fields of chips, deep learning, big data, and big models. More specifically, the present disclosure provides a data processing device, method, electronic device, and storage medium. Background Art
[0002] With the development of artificial intelligence technology, the application of artificial intelligence chips is increasing. Summary of the invention
[0003] The present disclosure provides a data processing method, apparatus, device and storage medium.
[0004] According to one aspect of the present disclosure, a data processing device is provided, which includes: a storage unit storing a plurality of data to be processed; a processing module configured to: obtain the plurality of data to be processed from the storage unit; determine at least one sequence of data to be processed based on the plurality of data to be processed, wherein the sequence of data to be processed includes a plurality of data to be processed arranged in a target order; and determine a target sequence based on the at least one sequence of data to be processed.
[0005] According to another aspect of the present disclosure, an electronic device is provided. The device includes the apparatus provided by the present disclosure.
[0006] According to another aspect of the present disclosure, a data processing method is provided, the method comprising: acquiring a plurality of data to be processed from a storage unit; determining at least one sequence of data to be processed based on the plurality of data to be processed, wherein the sequence of data to be processed comprises a plurality of data to be processed arranged in a target order; and determining a target sequence based on the at least one sequence of data to be processed.
[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method provided according to the present disclosure.
[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method provided according to the present disclosure.
[0009] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method provided according to the present disclosure is implemented.
[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0012] Figure 1 is a schematic block diagram of a data processing device according to an embodiment of the present disclosure;
[0013] Figure 2 is a schematic diagram of a processing unit according to an embodiment of the present disclosure;
[0014] Figure 3 is a schematic diagram of a processing module according to an embodiment of the present disclosure;
[0015] Figure 4A is a schematic diagram of a start processing cycle according to one embodiment of the present disclosure;
[0016] Figure 4B is a schematic diagram of a current processing cycle according to one embodiment of the present disclosure;
[0017] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present disclosure;
[0018] Figure 6 is a schematic flow chart of a data processing method according to an embodiment of the present disclosure; and
[0019] Figure 7 is a block diagram of an electronic device to which a data processing method can be applied according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0021] The rapid development of deep learning technology and graphics processing technology has posed a challenge to hardware computing power. In order to better meet the computing power requirements of various application scenarios, Domain Specific Architecture (DSA) chips for specific application scenarios have emerged. Domain-specific architecture chips include general-purpose graphics processing units (GPGPU), tensor processing units (TPU), and neural network processing units (NPU), which can perform hardware parallel acceleration on specific tasks to accelerate application services. Domain-specific architecture chips can be used as the above-mentioned artificial intelligence chips.
[0022] In application scenarios such as big data, deep learning, or large models, determining the K largest or smallest data (Top-K) from N data is a very important and common operation. The Top-K operation can be implemented based on various algorithms. Various algorithms can include global sorting, local sorting, merge sorting, bucket sorting, and insertion sorting. The following will take the example of obtaining the largest K data from N data to explain.
[0023] For example, after globally sorting N data, the K largest data can be determined. However, global sorting requires many traversals, which consumes a lot of bandwidth resources. For example, N data can also be sorted locally. Traverse all data each time. Get the first n largest numbers in each round of traversal, and complete the Top-K operation after traversing K / n times. When n=1, local sorting is equivalent to bubble sorting. The efficiency of local sorting is related to the value of n. Considering the index and n≥500, at most two rounds of traversal are required to obtain the final result.
[0024] For another example, N data can be merged and sorted. Multiple subsequences can be sorted first, and then these subsequences can be gradually merged, and the results of the Top-K operation can be obtained during the merging process. However, the reading mode of the merge operation includes: batch sending of read addresses, batch acquisition of data, and batch processing, which is a high-latency batch data reading mode. During the merge sorting process, if the data being processed is stored in a static random access memory (SRAM), it will result in the inability to read new data according to the comparison result. Therefore, the subsequences must be stored in the coprocessor when merging, and cannot exist in the static random access memory, which leads to a large cache space requirement, and the number of data to be cached is also greater than K. For example, N data can be eliminated and sorted. A container can be used to save the first K numbers. Then, all the remaining data are compared with the minimum data in the container. If a certain remaining data is larger than the minimum data in the container, the minimum data in the container is deleted and the remaining data is added to the container. However, the number of data to be cached is also greater than K, and the cache space requirement is also large.
[0025] For example, N data can be quickly sorted. Based on randomly selected benchmark data, the N data are divided into one or more first data greater than the benchmark data and one or more second data less than the benchmark data. Then the number of first data and the number of second data are used to select the data to be sorted from multiple first data or multiple second data. Then the multiple selected data to be sorted are sorted. The benchmark data is randomly selected, and all data may be first data, resulting in a large demand for storage resources. In addition, the data distribution is irregular, which may cause synchronization problems between cores. The number of first data and the number of second data are not fixed and the difference may be large, resulting in subsequent inability to be uniformly processed. For another example, the N data can also be divided into multiple batches, first determine the K largest data in each batch, and then determine the K largest data from the K largest data in multiple batches. The problem of insufficient cache space can be solved, but the sorting efficiency is low.
[0026] The above algorithms mainly use software algorithms to implement Top-K operations. When using hardware to implement the above algorithms, it is difficult to achieve hardware acceleration. With the advent of the era of large models, the number of model parameters has increased significantly, and how to quickly implement Top-K operations in parallel on hardware has become increasingly important. It is difficult to get good performance by adapting the original algorithm to the hardware.
[0027] Therefore, as the importance of Top-K operations continues to increase, in order to achieve high-performance Top-K operations with less hardware resource overhead, the present disclosure provides a data processing device, which will be described below.
[0028] Figure 1 is a schematic block diagram of a data processing device according to an embodiment of the present disclosure.
[0029] like Figure 1 As shown, the method 100 may include a storage unit 110 and a processing module 120 .
[0030] The storage unit 110 may store a plurality of data to be processed.
[0031] In the embodiment of the present disclosure, the plurality of data to be processed may come from N initial data. The number of data to be processed may be less than or equal to N. N is an integer greater than 1. The number of data to be processed may be greater than K.
[0032] The processing module 120 may be configured to: obtain a plurality of data to be processed from the storage unit. For example, the plurality of data to be processed may be read from the storage unit 110 .
[0033] The processing module 120 may also be configured to determine at least one sequence of data to be processed based on the plurality of data to be processed.
[0034] In the embodiment of the present disclosure, the sequence of data to be processed may include a plurality of data to be processed arranged in a target order. For example, the target order may be from large to small or from small to large. The sequence of data to be processed may include, for example, 4 data to be processed.
[0035] The processing module 120 may also be configured to: determine a target sequence according to at least one data sequence to be processed.
[0036] In the embodiment of the present disclosure, a target sequence may be determined in various ways according to at least one ordered sequence of data to be processed.
[0037] In the embodiment of the present disclosure, the target sequence may include K data to be processed.
[0038] Through the embodiments of the present disclosure, Top-K operation is implemented from the perspective of hardware, which helps to achieve hardware acceleration. The processing module can efficiently determine the sequence of data to be processed, which helps to improve the execution efficiency of Top-K operation, and can achieve high-performance Top-K operation with less hardware resource overhead.
[0039] It can be understood that the data processing device of the present disclosure is described above, and a plurality of data to be processed of the present disclosure will be described below.
[0040] In some embodiments, the plurality of data to be processed are determined according to high-order components of the plurality of initial data.
[0041] In the disclosed embodiment, the data to be processed may be a floating point number. Without considering the sign bit, the exponent and the tail code of the floating point number may be compared in size according to the integer arrangement. Thus, if the first few bits close to the sign bit are larger, the floating point number is larger. The sign bit of the floating point number may be 0 or 1. If the sign bit is 0, the floating point number is a positive number. If the sign bit is 1, the floating point number is a negative number. The high-order component of the floating point number may include multiple bits starting from the sign bit. For example, taking a 32-bit floating point number (FP32) as an example, the floating point number may include the 31st to the 0th bit. The 31st bit may be a sign bit. The 31st to the 28th bits [31:28] of the floating point number may be used as the first high-order component. The 27th to the 24th bits [27:24] of the floating point number may be used as the second high-order component. For a 32-bit floating-point number, the first high-order component may be "0111", "0110", "0101", "0100", "0011", "0010", "0001", "0000", "1000", "1001", "1010", "1011", "1100", "1101", "1110" or "1111". It will be appreciated that if 16 floating-point numbers include the 16 first high-order components in sequence, the 16 floating-point numbers decrease in sequence. For example, a floating-point number including the first high-order component "0111" is greater than a floating-point number including the first high-order component "0110". A floating-point number including the first high-order component "0000" is greater than a floating-point number including the first high-order component "1111".
[0042] In some embodiments, a plurality of data to be processed is determined according to the respective high-order components of a plurality of initial data by the following operation: at least one initial data set is determined according to the respective first high-order components of the plurality of initial data. Any initial data in the initial data set includes the first high-order component corresponding to the initial data set. For example, a plurality of floating-point numbers including the same first high-order component can be used as an initial data set. One or more floating-point numbers including the first high-order component "0111" can be used as an initial data set. One or more floating-point numbers including the first high-order component "0110" can be used as an initial data set. Thus, at most 16 initial data sets can be used. It can be understood that a plurality of initial data can also include the same first high-order component. In this case, the initial data set can be 1.
[0043] In the embodiment of the present disclosure, the initial data set includes a first initial number of initial data. For example, the number of to-be-processed data in each initial data set may be determined as the first initial number.
[0044] In some embodiments, at least one to-be-processed data set is determined from at least one initial data set according to the target data number and at least one first initial number of at least one initial data set. The number of to-be-processed data in at least one to-be-processed data set is greater than or equal to the target data number. The number of to-be-processed data is less than or equal to the number of initial data. For example, the number of initial data may be N. N may be, for example, 50,000. The target data number may be K. Taking K=1000 as an example, the number of to-be-processed data in at least one to-be-processed data set may be 1200. Some methods for determining the to-be-processed data set are described below.
[0045] In an embodiment of the present disclosure, determining at least one to-be-processed data set from at least one initial data set may include: determining at least one to-be-processed data set and at least one unprocessed data set from multiple initial data sets. The first high-order component corresponding to any to-be-processed data set is greater than the first high-order component corresponding to any unprocessed data set. For example, taking the case where a plurality of initial data sets correspond to the first high-order components "0111", "0110", "0101", "0100", "0011", "0010", "0001", "0000", "1000", "1001", "1010", "1011" and the target sequence is K maximum data, if the sum of the first initial numbers of the six initial data sets corresponding to the first high-order components "0111", "0110", "0101", "0100", "0011" and "0010" is 800 and the first initial number of the initial data set corresponding to the first high-order component "0001" is 400, it can be determined that the seven initial data sets corresponding to the first high-order components "0111", "0110", "0101", "0100", "0011", "0010" and "0001" are seven data sets to be processed. The number of data to be processed can be 1200. The five initial data sets corresponding to the first high-order components "0000", "1000", "1001", "1010", and "1011" can be five unprocessed data sets. Thus, the first high-order component corresponding to any to-be-processed data set is greater than the first high-order component of any unprocessed data set.
[0046] It can be understood that the above description uses the example of determining K maximum data to illustrate the present disclosure, but the present disclosure is not limited thereto, and the following description will use the example of determining K minimum data to illustrate the present disclosure.
[0047] In the embodiment of the present disclosure, the first high-order component corresponding to any to-be-processed data set may be smaller than the first high-order component of any unprocessed data set. Taking multiple initial data sets corresponding to the first high-order components "0111", "0110", "0101", "0100", "0011", "0010", "0001", "0000", "1000", "1001", "1010", "1011" respectively and the target sequence is k minimum data as an example, if the sum of the first initial numbers of the two initial data sets corresponding to the first high-order components "1011" and "1010" is 700 and the first initial number of the initial data set corresponding to the first high-order component "1001" is 500, it can be determined that the three initial data sets corresponding to the first high-order components "1011", "1010", and "1001" are three to-be-processed data sets respectively. The number of to-be-processed data may be 1200. The 9 initial data sets corresponding to the first high-order components "0111", "0110", "0101", "0100", "0011", "0010", "0001", "0000", and "1000" can be 9 unprocessed data sets. Therefore, the first high-order component corresponding to any to-be-processed data set is smaller than the first high-order component of any unprocessed data set. Through the embodiments of the present disclosure, multiple to-be-processed data are determined from N initial data based on the high-order components of floating-point numbers, which is equivalent to compressing the N initial data, reducing the difficulty of implementing the Top-K operation and saving hardware overhead.
[0048] It can be understood that the difference between the sum of the first initial numbers of the multiple initial data sets with larger (or smaller) data and the target data number is small. If the difference between the sum of the first initial numbers of the multiple initial data sets with larger data and the target data number is large, the initial data sets can be grouped, which will be explained below.
[0049] In some embodiments, the plurality of data to be processed is also determined according to the high-order components of the plurality of initial data by the following operation: in response to determining that the first initial number of the initial data set is greater than or equal to the preset number threshold, performing at least one round of iterative grouping on the plurality of initial data in the initial data set to obtain a plurality of initial data subsets. The second initial number of any of the initial data subsets is less than the preset number threshold.
[0050] For example, the preset number threshold may be 1000. Different from the target data number of 1000 in the above text, in this embodiment, the target data number may be 2000. Taking the determination of 2000 maximum data as an example, the sum of the first initial numbers of the above 7 initial data sets corresponding to the first high-order components "0111", "0110", "0101", "0100", "0011", "0010" and "0001" is 1200. If the first initial number of the initial data set corresponding to the first high-order component "0000" is 9000, it is necessary to determine 2000 data from 10200 data, the data compression effect is poor, and the hardware resource overhead can be further optimized. The iterative grouping method will be further explained below.
[0051] In an embodiment of the present disclosure, performing at least one round of iterative grouping includes: performing the iterative grouping of the current round according to the second current high-order component of each of the multiple initial data, and determining multiple current initial data groups. The current initial data group includes the current initial number of initial data. The second high-order component of the starting round in at least one round of iterative grouping is determined according to the first high-order component. For example, taking the iterative grouping of the current round as the iterative grouping of the starting round as an example, as described above, the first high-order component can be the 31st to 28th bits [31:28]. Thus, the second high-order component of the starting round can be the 27th to 24th bits [27:24]. It can be understood that the second high-order component may not include a sign bit, and the second current high-order component may be "1111", "1110", "1101", "1100", "1011", "1010", "1001", "1000", "0111", "0110", "0101", "0100", "0011", "0010", "0001" or "0000". If 16 floating-point numbers include the 16 second current high-order components in sequence and the first high-order components of the 16 floating-point numbers are the same, the 16 floating-point numbers are reduced in sequence. For example, the floating-point number including the second current high-order component "1111" is greater than the floating-point number including the second current high-order component "1110". A plurality of floating-point numbers including the same second high-order component of the current round can be used as the current initial data group. At most 16 current initial data groups can be determined.
[0052] In an embodiment of the present disclosure, performing at least one round of iterative grouping further includes: in response to determining that the current initial number is less than or equal to a preset number threshold, obtaining multiple initial data subsets based on multiple current initial data groups. For example, in response to determining that the current initial number of any current initial data group of the starting round is less than the preset number threshold, multiple initial data subsets can be obtained based on multiple current initial data groups of the starting round. Through the embodiment of the present disclosure, a data set with a large number of data can be compressed again to further reduce hardware resource overhead.
[0053] It can be understood that the above description of the present disclosure is based on the example that the current initial number is less than the preset number threshold, and the following description will be based on the example that the current initial number is greater than or equal to the preset number threshold.
[0054] In an embodiment of the present disclosure, performing iterative grouping of at least one round further includes: in response to determining that the current initial number is greater than a preset number threshold, determining the second highest component of the subsequent round of each of the multiple initial data according to the second highest component of the current round of each of the multiple initial data, so as to perform iterative grouping of the subsequent round of the current round. For example, if one or more current initial numbers are greater than the preset number threshold, in the case where the second highest component of the current round is the 27th to 24th bit [27:24], the second highest component of the subsequent round may be the 23rd to 19th bit [23:19]. Next, iterative grouping of the subsequent round may be performed until the current initial number of any current initial data group of a round is less than or equal to the preset number threshold, thereby obtaining multiple initial data subsets.
[0055] In the embodiment of the present disclosure, determining at least one to-be-processed data set from at least one initial data set may further include: determining at least one to-be-processed data set from at least one initial data set and at least one initial data subset.
[0056] It can be understood that the above describes the method of determining multiple data to be processed, and the processing module of the present disclosure will be described below.
[0057] In some embodiments, the processing module may include at least one processing unit. The processing unit may include a first comparator, a second comparator, a third comparator, a fourth comparator, and a fifth comparator. Figure 2 Provide explanation.
[0058] Figure 2 is a schematic diagram of a processing unit according to an embodiment of the present disclosure.
[0059] like Figure 2 As shown, the processing unit P220 may include a first comparator cmp221 , a second comparator cmp222 , a third comparator cmp223 , a fourth comparator cmp224 , and a fifth comparator cmp225 .
[0060] In the embodiment of the present disclosure, the plurality of data to be processed may include two first data to be processed and two second data to be processed. For example, the plurality of data to be processed processed by the processing unit P220 may include the first data to be processed d211, the first data to be processed d212, the second data to be processed d221 and the second data to be processed d222.
[0061] In the embodiment of the present disclosure, the first comparator can be configured to determine the first initial maximum data and the first initial minimum data from the two first data to be processed. For example, from the first data to be processed d211 and the first data to be processed d212, the first comparator cmp221 can determine the first initial maximum data max21 and the first initial minimum data min21.
[0062] In the embodiment of the present disclosure, the second comparator can be configured to determine the second initial maximum data and the second initial minimum data from the two second data to be processed. For example, from the second data to be processed d221 and the second data to be processed d222, the second comparator cmp222 can determine the second initial maximum data max22 and the second initial minimum data min22.
[0063] In the embodiment of the present disclosure, the third comparator can be configured to determine the target maximum data and the first data to be compared from the first initial maximum data and the second initial maximum data. For example, from the first initial maximum data max21 and the second initial maximum data max22, the third comparator cmp223 can determine the target maximum data max200 and the first data to be compared mid21.
[0064] In the embodiment of the present disclosure, the fourth comparator can be configured to determine the target minimum data and the second data to be compared from the first initial minimum data and the second initial minimum data. For example, from the first initial minimum data min21 and the second initial minimum data min22, the fourth comparator cmp224 can determine the target minimum data min200 and the second data to be compared mid22.
[0065] In the embodiment of the present disclosure, the fifth comparator can be configured to determine the target minimum data and the second data to be compared from the first data to be compared and the second data to be compared. For example, from the first data to be compared mid21 and the second data to be compared mid22, the fifth comparator cmp225 can determine the intermediate larger data mo200 and the intermediate smaller data le200.
[0066] In the embodiment of the present disclosure, the data sequence to be processed may include: target maximum data, middle larger data, middle smaller data and target minimum data in sequence. For example, the target order may be from large to small, and the data sequence to be processed may include: target maximum data max200, middle larger data mo200, middle smaller data le200 and target minimum data min200 in sequence.
[0067] In the embodiment of the present disclosure, the data sequence to be processed may also include: target minimum data, intermediate smaller data, intermediate larger data and target maximum data in sequence. For example, the target order may be from small to large, and the data sequence to be processed may include: target minimum data min200, intermediate smaller data le200, intermediate larger data mo200 and target maximum data max200 in sequence.
[0068] Through the embodiments of the present disclosure, a processing unit including multiple comparators can efficiently determine the data sequence to be processed, which helps to improve the efficiency of the artificial intelligence chip in performing Top-K operations.
[0069] It can be understood that the above describes the processing unit of the processing module of the present disclosure, and the following will describe the processing module including multiple processing units.
[0070] In some embodiments, the processing module may include multiple processing units. Thus, the multiple processing units can respectively determine multiple data sequences to be processed in parallel to further improve the efficiency of the artificial intelligence chip in performing the Top-k operation.
[0071] In some embodiments, the processing module may be further configured to perform the following operations to determine a target sequence according to at least one data sequence to be processed: determining at least one processed sequence according to multiple data sequences to be processed. Determining a target sequence according to at least one processed sequence.
[0072] In the embodiment of the present disclosure, the plurality of processing units may include a first processing unit, a second processing unit, and a third processing unit. Figure 3 A plurality of processing units are described.
[0073] Figure 3 is a schematic diagram of a processing module according to an embodiment of the present disclosure.
[0074] like Figure 3 As shown, the processing module 320 may include a first processing unit P321, a second processing unit P322, and a third processing unit P323. It can be understood that the above description of the processing unit P220 is also applicable to the first processing unit P321, the second processing unit P322, and the third processing unit P323, and the present disclosure will not repeat them here.
[0075] In the embodiment of the present disclosure, the plurality of data sequences to be processed include a first data sequence to be processed and a second data sequence to be processed. For example, the first data sequence to be processed may include target maximum data max310, intermediate larger data mo310, intermediate smaller data le310, and target minimum data min310. The second data sequence to be processed may include target maximum data max320, intermediate larger data mo320, intermediate smaller data le320, and target minimum data min320.
[0076] In the embodiment of the present disclosure, the first processing unit can be configured to: determine the first target maximum data, the second target maximum data, the third data to be compared, and the fourth data to be compared according to the target maximum data and the intermediate larger data of the first data sequence to be processed and the target maximum data and the intermediate larger data of the second data sequence to be processed. For example, according to the target maximum data max310 and the intermediate larger data mo310 of the first data sequence to be processed and the target maximum data max320 and the intermediate larger data mo320 of the second data sequence to be processed, the first processing unit P321 can determine the first target maximum data maxt301, the second target maximum data maxt302, the third data to be compared mid303, and the fourth data to be compared mid304.
[0077] In the embodiment of the present disclosure, the second processing unit can be configured to: determine the first target minimum data, the second target minimum data, the fifth data to be compared, and the sixth data to be compared according to the target minimum data and the intermediate smaller data of the first data sequence to be processed and the target minimum data and the intermediate smaller data of the second data sequence to be processed. For example, according to the target minimum data min310 and the intermediate smaller data le310 of the first data sequence to be processed and the target minimum data min320 and the intermediate smaller data le320 of the second data sequence to be processed, the second comparison unit P322 can determine the first target minimum data mint301, the second target minimum data mint302, the fifth data to be compared mid305, and the sixth data to be compared mid306.
[0078] In the embodiment of the present disclosure, the third processing unit can be configured to: determine the first intermediate larger data, the second intermediate larger data, the first intermediate smaller data, and the second intermediate smaller data according to the third data to be compared, the fourth data to be compared, the fifth data to be compared, and the sixth data to be compared. For example, according to the third data to be compared mid303, the fourth data to be compared mid304, the fifth data to be compared mid305, and the sixth data to be compared mid306, the third processing unit P323 can determine the first intermediate larger data mo-mid301, the second intermediate larger data mo-mid302, the first intermediate smaller data le-mid301, and the second intermediate smaller data le-mid302.
[0079] In the embodiment of the present disclosure, the processed sequence includes: the first target maximum data, the second target maximum data, the first intermediate larger data, the second intermediate larger data, the first intermediate smaller data, the second intermediate smaller data, the first target minimum data, and the second target minimum data. For example, the processed sequence may also include a plurality of data arranged in target order. The target order may be from large to small, and the processed sequence may include: the first target maximum data maxt301, the second target maximum data maxt302, the first intermediate larger data mo-mid301, the second intermediate larger data mo-mid302, the first intermediate smaller data le-mid301, the second intermediate smaller data le-mid302, the first target minimum data mint301, and the second target minimum data mint302.
[0080] In the embodiment of the present disclosure, the processed sequence includes: the second target minimum data, the first target minimum data, the second intermediate smaller data, the first intermediate smaller data, the second intermediate larger data, the first intermediate larger data, the second target maximum data and the first target maximum data. For example, the target order can be from small to large, and the processed sequence can also include: the second target minimum data mint302, the first target minimum data mint301, the second intermediate smaller data le-mid302, the first intermediate smaller data le-mid301, the second intermediate larger data mo-mid302, the first intermediate larger data mo-mid301, the second target maximum data maxt302 and the first target maximum data maxt301.
[0081] Through the embodiments of the present disclosure, multiple processing units can be used to convert multiple sequences of data to be processed into processed sequences, and multiple ordered data to be processed can be further determined, which helps to improve the efficiency of the artificial intelligence chip in performing Top-K operations. Next, a target sequence can be determined based on at least one processed sequence, which will be explained below.
[0082] In some embodiments, the processing module is further configured to perform the following operations to determine a target sequence according to at least one processed sequence: determine at least one sequence to be output according to multiple processed sequences. Determine a target sequence according to at least one sequence to be output.
[0083] In the embodiment of the present disclosure, the plurality of processed sequences may be M. The processed sequence may include a first processed subsequence and a second processed subsequence. For example, the first processed subsequence may be a preceding subsequence, and the second processed subsequence may be a succeeding subsequence.
[0084] In the embodiment of the present disclosure, the processing module is further configured to perform the following operations to determine at least one sequence to be output based on multiple processed sequences: perform multiple first processes based on the first processed subsequence of the mth processed sequence and the 2(m-1) first intermediate subsequences of the m-1th level first intermediate sequence to obtain 2m-1 second intermediate subsequences of the m-1th level second intermediate sequence. m is an integer greater than 1 and less than or equal to M. For example, for simplicity, the processed sequence includes decimal numbers as an example for explanation, and the first processed sequence can be "16, 15, 14, 13, 12, 11, 10, 9", which can be used as the first level intermediate sequence. The first level intermediate sequence can include 2 first intermediate subsequences, namely the first first intermediate subsequence "16, 15, 14, 13" and the second first intermediate subsequence "12, 11, 10, 9". Taking m=2 as an example, the second processed sequence can be "18, 7, 6, 5, 4, 3, 2, 1". The second processed sequence may include a first processed sequence of "18, 7, 6, 5" and a second processed subsequence of "4, 3, 2, 1".
[0085] In the disclosed embodiment, the i-th first processing of the multiple first processings includes: according to the i-th first subsequence to be compared and the 2(m-1)-(i-1)th first intermediate subsequence, obtaining the 2m-1-(i-1)th second intermediate subsequence and the i+1th first subsequence to be compared. i can be an integer greater than or equal to 1 and less than or equal to 2(m-1). For example, when i=1, the 1st first subsequence to be compared can be the first processed subsequence "18,7,6,5". According to the first processed subsequence "18,7,6,5" and the 2nd first intermediate subsequence "12,11,10,9", the processing module can determine the 2nd first subsequence to be compared "18,12,11,10" and the 3rd second intermediate subsequence "9,7,6,5". Next, when i=2, based on the second first subsequence to be compared "18,12,11,10" and the first first intermediate subsequence "16,15,14,13", the processing module can determine the second second intermediate subsequence "13,12,11,10" and the third first subsequence to be compared "18,16,15,14". When i=2(m-1), the processing module completes 2(m-1) first processings, and the i+1th first subsequence to be compared can be used as the first second intermediate subsequence. Thus, the first-level second intermediate sequence "18,16,15,14,13,12,11,10,9,7,6,5" can be obtained.
[0086] In the embodiment of the present disclosure, the processing module is further configured to perform the following operations to determine at least one sequence to be output based on multiple processed sequences: perform multiple second processings based on 2m-1 second intermediate subsequences of the m-1th level second intermediate sequence and the second processed subsequence of the mth processed sequence to obtain 2m first intermediate subsequences of the mth level first intermediate sequence.
[0087] In the disclosed embodiment, the jth second processing of multiple second processings includes: according to the jth second subsequence to be compared and the 2m-1-(j-1)th second intermediate subsequence, obtaining the 2m-(j-1)th first intermediate subsequence and the j+1th second subsequence to be compared. j can be an integer greater than or equal to 1 and less than or equal to 2m-1. For example, when j=1, the first second subsequence to be compared can be the second processed subsequence "4,3,2,1". According to the second processed subsequence "4,3,2,1" and the third second intermediate subsequence "9,7,6,5", the processing module can determine the second second subsequence to be compared "9,7,6,5" and the fourth second intermediate subsequence "4,3,2,1". Next, in the case of j=2, based on the 2nd second subsequence to be compared "9,7,6,5" and the 2nd second intermediate subsequence "13,12,11,10", the processing module can determine the 3rd first intermediate subsequence "9,7,6,5" and the 3rd second subsequence to be compared "13,12,11,10". Next, in the case of j=3, based on the 3rd second subsequence to be compared "13,12,11,10" and the 1st second intermediate subsequence "18,16,15,14", the processing module can determine the 2nd first intermediate subsequence "13,12,11,10" and the 4th second subsequence to be compared "18,16,15,14". In the case of j=2m-1, the processing module completes 2m-1 times of the second processing, and the j+1th second subsequence to be compared can be used as the 1st first intermediate subsequence. Thus, the second-level first intermediate sequence "18, 16, 15, 14, 13, 12, 11, 10, 9, 7, 6, 5, 4, 3, 2, 1" can be obtained. It can be understood that the processing module processes the mth processed sequence to the Mth processed sequence in the same or similar manner. The Mth-level first intermediate sequence can be used as a sequence to be output.
[0088] It can be understood that the above describes the method of determining the sequence to be output, and the following describes some methods of determining the target sequence according to the sequence to be output.
[0089] In some embodiments, there may be multiple sequences to be output. The processing module is further configured to perform the following operations to determine a target sequence according to at least one sequence to be output: performing multiple processing cycles of processing according to multiple sequences to be output to determine the target sequence. Figure 4A and Figure 4B Provide explanation.
[0090] Figure 4A is a schematic diagram of a start processing cycle according to one embodiment of the present disclosure.
[0091] In the embodiment of the present disclosure, a plurality of sequences to be output may include a first sequence to be output Oseq41 and a second sequence to be output Oseq42. The first sequence to be output Oseq41 may include a plurality of first data to be output. The plurality of first data to be output may include first data to be output od411, first data to be output od412, first data to be output od413, first data to be output od414, first data to be output od415, ... first data to be output od4110. The plurality of second data to be output may include second data to be output od421, second data to be output od422, second data to be output od423, second data to be output od424, second data to be output od425, second data to be output od426, second data to be output od427, ... second data to be output od4210. The plurality of first data to be output of the first sequence to be output Oseq41 decreases in sequence. The plurality of second data to be output of the second sequence to be output Oseq42 decreases in sequence.
[0092] In the disclosed embodiment, the processing module is further configured to perform the following operations to process the starting processing cycle in multiple processing cycles: determine the first sequence to be compared and the second sequence to be compared of the starting processing cycle according to the processing number threshold of the first data to be output in the starting processing cycle and the processing number threshold of the second data to be output in the starting processing cycle, respectively. The processing number threshold may correspond to the processing unit. For example, the above-mentioned processing unit P220 may determine the sequence of data to be processed u according to 4 data to be processed at a time. Thus, the processing number threshold may be 4. Figure 4A As shown, the starting processing cycle is the first processing cycle. In the starting initial cycle, the first to-be-output data od411 to the first to-be-output data od414 can be used as the first to-be-compared sequence, and the second to-be-output data od421 to the second to-be-output data od424 can be used as the second to-be-compared sequence.
[0093] In the disclosed embodiment, the processing module is further configured to perform the following operations to process the starting processing cycle in a plurality of processing cycles: determine the output sequence of the starting processing cycle and the reference sequence of the subsequent processing cycle of the starting processing cycle according to the first sequence to be compared and the second sequence to be compared of the starting processing cycle. For example, according to the first sequence to be compared and the second sequence to be compared, the processing module can determine the output sequence out401 of the starting processing cycle and the reference sequence ref401 of the subsequent processing cycle. The output sequence out401 may, for example, include 1 first data to be output and 3 second data to be output. The reference sequence ref401 may, for example, include 3 first data to be output and 1 second data to be output. The subsequent processing cycle of the starting processing cycle is the second processing cycle.
[0094] In the embodiment of the present disclosure, the processing module is further configured to perform the following operations to start the processing of a processing cycle in the plurality of processing cycles: according to the processing number threshold, advance the first pointer corresponding to the first sequence to be output and the second pointer corresponding to the second sequence to be output. Figure 4A As shown, in the initial processing cycle, the first pointer pointer 41 can point to the first data to be output od411. The second pointer pointer 42 can point to the second data to be output od421. After the processing of the initial processing cycle is completed, the first pointer pointer 41 can be pushed so that the first pointer pointer 41 points to the first data to be output od415. The second pointer pointer 42 can also be pushed so that the second pointer pointer 42 points to the second data to be output od425.
[0095] Next, the subsequent processing cycle of the initial processing cycle can be used as the current processing cycle, and the corresponding processing of the current processing cycle is performed. Figure 4B Provide explanation.
[0096] Figure 4B is a schematic diagram of a current processing cycle according to an embodiment of the present disclosure.
[0097] In an embodiment of the present disclosure, the processing module is also configured to perform the following operations to execute processing of the current processing cycle in multiple processing cycles: determine the sequence to be compared of the current processing cycle based on the first number of first data to be compared to be output in the current processing cycle and the second number of second data to be compared to be output in the current processing cycle.
[0098] In the disclosed embodiment, the first number to be compared is determined according to the first reference number of the first output data in the reference sequence of the current processing cycle and the processing number threshold. The second number to be compared is determined according to the second reference number of the second output data in the reference sequence of the current processing cycle and the processing number threshold. For example, the reference sequence ref401 of the second processing cycle may include 3 first data to be output and 1 second data to be output. As described above, the processing number threshold may be 4. Thus, in the second processing cycle, the first number to be compared may be 1, and the second number to be compared may be 3.
[0099] In the embodiment of the present disclosure, the first number of first data to be compared and output is obtained from the position indicated by the first pointer in the current processing cycle, and the second number of second data to be compared and output is obtained from the position indicated by the second pointer in the current processing cycle. Figure 4BAs shown, the first pointer pointer41 points to the first data to be output od415. The first number to be compared is 1, and the first data to be output od415 can be obtained. The second pointer pointer42 points to the second data to be output od425. The second number to be compared is 3, and the second data to be output od425, the second data to be output od426, and the second data to be output od427 can be obtained. Therefore, the sequence to be compared cseq402 of the current processing cycle may include the first data to be output od415, the second data to be output od425, the second data to be output od426, and the second data to be output od427. It can be understood that according to the first number of first data to be output and the second number of second data to be output, a processing unit can be used to determine the sequence to be compared of the current processing cycle.
[0100] In the embodiment of the present disclosure, the processing module is further configured to perform the following operations to execute the processing of the current processing cycle among the multiple processing cycles: according to the reference sequence of the current processing cycle and the sequence to be compared of the current processing cycle, determine the output sequence of the current processing cycle and the reference sequence of the subsequent processing cycle of the current processing cycle. Figure 4B As shown, according to the sequence to be compared cseq402 of the current processing cycle and the reference sequence ref401, the processing module can determine the output sequence out402 of the current processing cycle and the reference sequence ref402 in the subsequent processing cycle.
[0101] In the embodiment of the present disclosure, the processing module is further configured to perform the following operations to execute the processing of the current processing cycle in the plurality of processing cycles: according to the first number to be compared and the second number to be compared, respectively advance the first pointer and the second pointer. Figure 4B As shown, after completing the processing of the second processing cycle, the first pointer pointer 41 can be pushed so that the first pointer pointer 41 points to the first data to be output od 416. The second pointer pointer 42 can also be pushed so that the second pointer pointer 42 points to the second data to be output od 428. Next, the processing of multiple processing cycles can be performed to obtain the output sequences of multiple processing cycles.
[0102] In the disclosed embodiment, the number of processing cycles can be determined according to the target data number and the processing number threshold. In the last processing cycle, the reference sequence obtained in the last processing cycle can also be used as an output sequence. According to the output sequences of multiple processing cycles, the target sequence can be determined. The target sequence can include k data.
[0103] It can be understood that in the current processing cycle, any data in the output sequence is greater than the data in the reference sequence in the post-processing cycle.
[0104] It can be understood that the above description uses the determination of k maximum data as an example to illustrate the present disclosure. However, the present disclosure is not limited thereto, and k minimum data can also be determined. It can also be understood that the processed sequence can also be directly used as the sequence to be output.
[0105] It can be understood that when comparing two data, the value of the sign bit of the data is considered, that is, the positive and negative of the data are considered. In order to further reduce the hardware resource overhead, the first high-order component can be converted, which will be explained below.
[0106] In the embodiment of the present disclosure, the plurality of data to be processed is determined according to the high-order components of the plurality of initial data by the following operation: in response to determining that the first high-order component corresponding to the set of data to be processed includes a first symbol value, the first symbol value is converted into a second symbol value. For example, the first symbol value may be 0, and the first symbol value 0 may be converted into the second symbol value 1.
[0107] In the embodiment of the present disclosure, the plurality of data to be processed is still determined according to the respective high-order components of the plurality of initial data by the following operation: in response to determining that the first high-order component corresponding to the set of data to be processed includes the second sign value, the plurality of bits of the first high-order component are inverted. For example, in the case where the first high-order component includes the second sign bit, if the first high-order component is "1000", the converted first high-order component may be "0111". Through the embodiment of the present disclosure, the first high-order component is converted, so that the processing unit does not need to consider the positive or negative of the data when comparing the data size, which helps to further save hardware resource overhead.
[0108] It can be understood that the above describes the device of the present disclosure, and the following describes an electronic device including the device.
[0109] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present disclosure.
[0110] like Figure 5 As shown, the device 5000 may include an apparatus 500. The apparatus 500 may be the apparatus 100 described above.
[0111] It can be understood that the above describes the device and an apparatus of the present disclosure, and the following describes the method of the present disclosure.
[0112] Figure 6 is a schematic flow chart of a data processing method according to an embodiment of the present disclosure.
[0113] In operation S610, a plurality of to-be-processed data is acquired from a storage unit.
[0114] In operation S620, at least one sequence of data to be processed is determined according to the plurality of data to be processed.
[0115] In the embodiment of the present disclosure, the sequence of data to be processed includes a plurality of data to be processed arranged in a target order.
[0116] In operation S630, a target sequence is determined according to at least one data sequence to be processed.
[0117] It can be understood that the method 600 can be executed by the above-mentioned processing module 120.
[0118] In some embodiments, the plurality of data to be processed includes two first data to be processed and two second data to be processed. According to the plurality of data to be processed, determining at least one sequence of data to be processed includes: determining a first initial maximum data and a first initial minimum data from the two first data to be processed. Determining a second initial maximum data and a second initial minimum data from the two second data to be processed. Determining a target maximum data and a first data to be compared from the first initial maximum data and the second initial maximum data. Determining a target minimum data and a second data to be compared from the first initial minimum data and the second initial minimum data. Determining an intermediate larger data and an intermediate smaller data from the first data to be compared and the second data to be compared.
[0119] In some embodiments, the data sequence to be processed includes, in sequence: target maximum data, intermediate larger data, intermediate smaller data, and target minimum data.
[0120] In some embodiments, the data sequence to be processed includes, in sequence: target minimum data, intermediate smaller data, intermediate larger data, and target maximum data.
[0121] In some embodiments, a plurality of data to be processed is determined based on the respective high-order components of a plurality of initial data, and the number of data to be processed is less than or equal to the number of initial data. A plurality of data to be processed is determined based on the respective high-order components of a plurality of initial data by the following operations: at least one initial data set is determined based on the respective first high-order components of the plurality of initial data. The initial data set includes a first initial number of initial data, and any initial data in the initial data set includes a first high-order component corresponding to the initial data set. At least one data set to be processed is determined from at least one initial data set based on the number of target data and at least one first initial number of at least one initial data set. The number of data to be processed in at least one data set to be processed is greater than or equal to the number of target data.
[0122] In some embodiments, there are multiple initial data sets. Determining at least one to-be-processed data set from at least one initial data set includes: determining at least one to-be-processed data set and at least one unprocessed data set from multiple initial data sets. The first high-order component corresponding to any to-be-processed data set is greater than the first high-order component corresponding to any unprocessed data set. Alternatively, the first high-order component corresponding to any to-be-processed data set is less than the first high-order component corresponding to any unprocessed data set.
[0123] In some embodiments, the plurality of data to be processed is also determined according to the high-order components of the plurality of initial data by the following operation: in response to determining that the first initial number of the initial data set is greater than or equal to the preset number threshold, performing at least one round of iterative grouping on the plurality of initial data in the initial data set to obtain a plurality of initial data subsets. The second initial number of any of the initial data subsets is less than the preset number threshold.
[0124] In some embodiments, performing at least one round of iterative grouping includes: performing iterative grouping of the current round according to the second high-order component of the current round of each of the multiple initial data, and determining multiple current initial data groups. The current initial data group includes the current initial number of initial data. In response to determining that the current initial number is greater than a preset number threshold, the second high-order component of the subsequent round of each of the multiple initial data is determined according to the second current high-order component of the current round of each of the multiple initial data, so as to perform iterative grouping of the subsequent round of the current round. The second high-order component of the starting round in at least one round of iterative grouping is determined according to the first high-order component. In response to determining that the current initial number is less than or equal to the preset number threshold, multiple subsets of initial data are obtained according to the multiple current initial data groups.
[0125] In some embodiments, determining the target sequence according to at least one data sequence to be processed includes: determining at least one processed sequence according to a plurality of data sequences to be processed, and determining the target sequence according to the at least one processed sequence.
[0126] In some embodiments, the plurality of data sequences to be processed include a first data sequence to be processed and a second data sequence to be processed. According to the plurality of data sequences to be processed, determining at least one processed sequence includes: determining the first target maximum data, the second target maximum data, the third data to be compared, and the fourth data to be compared according to the target maximum data and the intermediate larger data of the first data sequence to be processed and the target maximum data and the intermediate larger data of the second data sequence to be processed. Determine the first target minimum data, the second target minimum data, the fifth data to be compared, and the sixth data to be compared according to the target minimum data and the intermediate smaller data of the first data sequence to be processed and the target minimum data and the intermediate smaller data of the second data sequence to be processed. Determine the first intermediate larger data, the second intermediate larger data, the first intermediate smaller data, and the second intermediate smaller data according to the third data to be compared, the fourth data to be compared, the fifth data to be compared, and the sixth data to be compared.
[0127] In some embodiments, the processed sequence includes, in sequence: first target maximum data, second target maximum data, first intermediate larger data, second intermediate larger data, first intermediate smaller data, second intermediate smaller data, first target minimum data and second target minimum data.
[0128] In some embodiments, the processed sequence includes, in sequence: second target minimum data, first target minimum data, second intermediate smaller data, first intermediate smaller data, second intermediate larger data, first intermediate larger data, second target maximum data and first target maximum data.
[0129] In some embodiments, determining the target sequence according to at least one processed sequence includes: determining at least one sequence to be output according to a plurality of processed sequences. Determining the target sequence according to at least one sequence to be output.
[0130] In some embodiments, the number of processed sequences is M, and the processed sequences include a first processed subsequence and a second processed subsequence, and M is an integer greater than 1. According to the multiple processed sequences, determining at least one sequence to be output includes: performing a first process multiple times according to the first processed subsequence of the m-th processed sequence and the 2(m-1) first intermediate subsequences of the m-1th level first intermediate sequence, to obtain 2m-1 second intermediate subsequences of the m-1th level second intermediate sequence. m is an integer greater than 1 and less than or equal to M. Performing a second process multiple times according to the 2m-1 second intermediate subsequences of the m-1th level second intermediate sequence and the second processed subsequence of the m-th processed sequence, to obtain 2m first intermediate subsequences of the m-1th level first intermediate sequence.
[0131] In some embodiments, there are multiple sequences to be outputted. Determining the target sequence according to at least one sequence to be outputted includes: performing multiple processing cycles according to the multiple sequences to be outputted to determine the target sequence.
[0132] In some embodiments, the plurality of sequences to be output include a first sequence to be output and a second sequence to be output, the first sequence to be output includes a plurality of first data to be output, and the second sequence to be output includes a plurality of second data to be output. Executing the processing of the current processing cycle in the plurality of processing cycles includes: determining the sequence to be compared of the current processing cycle according to a first number of first data to be compared of the current processing cycle and a second number of second data to be compared of the current processing cycle. The first number of first data to be compared is obtained from the position indicated by the first pointer in the current processing cycle, and the second number of second data to be compared is obtained from the position indicated by the second pointer in the current processing cycle. According to the reference sequence of the current processing cycle and the sequence to be compared of the current processing cycle, determine the output sequence of the current processing cycle and the reference sequence of the subsequent processing cycle of the current processing cycle.
[0133] In some embodiments, the first number to be compared is determined based on a first baseline number of first output data in a baseline sequence of a current processing cycle and a processing number threshold, and the second number to be compared is determined based on a second baseline number of second output data in a baseline sequence of the current processing cycle and a processing number threshold, and the processing number threshold corresponds to a processing unit.
[0134] In some embodiments, the target sequence includes multiple output sequences. Executing the processing of the initial processing cycle in the multiple processing cycles includes: determining the first sequence to be compared and the second sequence to be compared of the initial processing cycle according to the processing number threshold number of first data to be output of the initial processing cycle and the processing number threshold number of second data to be output of the initial processing cycle, respectively. Determine the output sequence of the initial processing cycle and the reference sequence of the subsequent processing cycle of the initial processing cycle according to the first sequence to be compared and the second sequence to be compared of the initial processing cycle.
[0135] It can be understood that the method of the present disclosure is described above, and another electronic device of the present disclosure will be described below.
[0136] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0137] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0138] Figure 7A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0139] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 to a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0140] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0141] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as data processing methods. For example, in some embodiments, the data processing method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the data processing method in any other appropriate manner (eg, by means of firmware).
[0142] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), system on chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0143] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0144] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories (EPROM) or flash memories, optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0145] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) display or a liquid crystal display (LCD)) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0146] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a Local Area Network (LAN), a Wide Area Network (WAN), and the Internet.
[0147] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0148] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0149] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A data processing device, comprising: A storage unit storing a plurality of data to be processed; Processing module, configured as: Acquire a plurality of the to-be-processed data from the storage unit; Determine at least one sequence of data to be processed according to the plurality of data to be processed, wherein the sequence of data to be processed includes the plurality of data to be processed arranged in a target order; A target sequence is determined according to at least one of the data sequences to be processed.
2. The device according to claim 1, wherein: The processing module includes at least one processing unit, and the plurality of data to be processed include two first data to be processed and two second data to be processed. The processing unit includes a first comparator, a second comparator, a third comparator, a fourth comparator and a fifth comparator, The first comparator is configured to: determine first initial maximum data and first initial minimum data from the two first data to be processed; The second comparator is configured to: determine a second initial maximum data and a second initial minimum data from two of the second data to be processed; The third comparator is configured to: determine target maximum data and first data to be compared from the first initial maximum data and the second initial maximum data; The fourth comparator is configured to: determine target minimum data and second data to be compared from the first initial minimum data and the second initial minimum data; The fifth comparator is configured to determine intermediate larger data and intermediate smaller data from the first data to be compared and the second data to be compared.
3. The device according to claim 2, wherein: The data sequence to be processed includes, in sequence: the target maximum data, the intermediate larger data, the intermediate smaller data and the target minimum data; or The data sequence to be processed includes, in sequence: the target minimum data, the intermediate smaller data, the intermediate larger data and the target maximum data.
4. The device according to claim 1, wherein: The plurality of data to be processed are determined according to the high-order components of the plurality of initial data, and the number of the data to be processed is less than or equal to the number of the initial data. The plurality of data to be processed are determined according to the high-order components of the plurality of initial data by the following operations: Determine at least one initial data set according to first high-order components of each of the plurality of initial data, wherein the initial data set includes a first initial number of initial data, and any initial data in the initial data set includes the first high-order component corresponding to the initial data set; Based on the target data number and at least one of the first initial numbers of at least one of the initial data sets, at least one set of data to be processed is determined from at least one of the initial data sets, wherein the number of the data to be processed in at least one of the set of data to be processed is greater than or equal to the target data number.
5. The device according to claim 4, wherein: The initial data set is multiple, Determining at least one to-be-processed data set from at least one of the initial data sets comprises: At least one of the to-be-processed data sets and at least one of the unprocessed data sets are determined from the multiple initial data sets, wherein the first high-order component corresponding to any of the to-be-processed data sets is greater than the first high-order component corresponding to any of the unprocessed data sets, or the first high-order component corresponding to any of the to-be-processed data sets is less than the first high-order component corresponding to any of the unprocessed data sets.
6. The device according to claim 4, wherein: The plurality of data to be processed are also determined according to the high-order components of the plurality of initial data by the following operations: In response to determining that the first initial number of the initial data set is greater than or equal to a preset number threshold, performing at least one round of iterative grouping on a plurality of the initial data in the initial data set to obtain a plurality of initial data subsets, The second initial number of any of the initial data subsets is smaller than the preset number threshold, Wherein, executing at least one round of iterative grouping includes: According to the second high-order components of the current round of the respective multiple initial data, perform iterative grouping of the current round to determine multiple current initial data groups, wherein the current initial data groups include the current initial number of initial data; In response to determining that the current initial number is greater than the preset number threshold, determining the second high-order components of the subsequent rounds of the plurality of initial data respectively according to the second current high-order components of the current round of the plurality of initial data respectively, so as to perform iterative grouping of the subsequent rounds of the current round, wherein the second high-order component of the starting round in at least one round iterative grouping is determined according to the first high-order component; In response to determining that the current initial number is less than or equal to the preset number threshold, a plurality of the initial data subsets are obtained according to a plurality of the current initial data groups.
7. The device according to claim 1, wherein: The processing module includes a plurality of processing units. The processing module is further configured to perform the following operations to determine a target sequence according to at least one of the to-be-processed data sequences: Determine at least one processed sequence according to the plurality of data sequences to be processed; The target sequence is determined based on at least one of the processed sequences.
8. The device according to claim 7, wherein: The plurality of processing units include a first processing unit, a second processing unit and a third processing unit, the plurality of data sequences to be processed include a first data sequence to be processed and a second data sequence to be processed, The first processing unit is configured to: determine first target maximum data, second target maximum data, third data to be compared, and fourth data to be compared according to the target maximum data and intermediate larger data of the first data sequence to be processed and the target maximum data and intermediate larger data of the second data sequence to be processed; The second processing unit is configured to: determine the first target minimum data, the second target minimum data, the fifth data to be compared, and the sixth data to be compared according to the target minimum data and the intermediate smaller data of the first data sequence to be processed and the target minimum data and the intermediate smaller data of the second data sequence to be processed; The third processing unit is configured to determine first intermediate larger data, second intermediate larger data, first intermediate smaller data and second intermediate smaller data according to the third data to be compared, the fourth data to be compared, the fifth data to be compared and the sixth data to be compared.
9. The device according to claim 7, wherein: The processed sequence includes, in sequence: the first target maximum data, the second target maximum data, the first intermediate larger data, the second intermediate larger data, the first intermediate smaller data, the second intermediate smaller data, the first target minimum data and the second target minimum data; or The processed sequence includes, in sequence: the second target minimum data, the first target minimum data, the second intermediate smaller data, the first intermediate smaller data, the second intermediate larger data, the first intermediate larger data, the second target maximum data and the first target maximum data.
10. The device according to claim 7, wherein: The processing module is further configured to perform the following operations to determine the target sequence according to at least one of the processed sequences: Determine at least one sequence to be output according to the plurality of processed sequences; The target sequence is determined according to at least one of the sequences to be output.
11. The device according to claim 10, wherein: The number of the processed sequences is M, and the processed sequences include a first processed subsequence and a second processed subsequence, and M is an integer greater than 1. The processing module is further configured to perform the following operations to determine at least one sequence to be output according to the plurality of processed sequences: According to the first processed subsequence of the m-th processed sequence and the 2(m-1) first intermediate subsequences of the m-1th level first intermediate sequence, the first processing is performed multiple times to obtain 2m-1 second intermediate subsequences of the m-1th level second intermediate sequence, where m is an integer greater than 1 and less than or equal to M; According to the 2m-1 second intermediate subsequences of the m-1th level second intermediate sequence and the second processed subsequence of the mth processed sequence, multiple second processes are performed to obtain 2m first intermediate subsequences of the mth level first intermediate sequence.
12. The device according to claim 10, wherein: There are multiple sequences to be output. The processing module is further configured to perform the following operations to determine the target sequence according to at least one of the sequences to be output: According to the plurality of sequences to be output, a plurality of processing cycles are executed to determine the target sequence.
13. The device according to claim 12, wherein: The plurality of sequences to be output include a first sequence to be output and a second sequence to be output, the first sequence to be output includes a plurality of first data to be output, the second sequence to be output includes a plurality of second data to be output, The processing module is further configured to perform the following operations to execute the processing of the current processing cycle in the plurality of processing cycles: Determine a sequence to be compared in the current processing cycle according to a first number of the first data to be output to be compared in the current processing cycle and a second number of the second data to be output to be compared in the current processing cycle, wherein the first number of the first data to be output to be compared is obtained from a position indicated by the first pointer in the current processing cycle, and the second number of the second data to be output to be compared is obtained from a position indicated by the second pointer in the current processing cycle; According to the reference sequence of the current processing cycle and the sequence to be compared of the current processing cycle, an output sequence of the current processing cycle and a reference sequence of a subsequent processing cycle of the current processing cycle are determined.
14. The device according to claim 13, wherein: The first number to be compared is determined based on a first benchmark number of the first output data in a benchmark sequence of the current processing cycle and a processing number threshold, and the second number to be compared is determined based on a second benchmark number of the second output data in a benchmark sequence of the current processing cycle and the processing number threshold, and the processing number threshold corresponds to the processing unit.
15. The device according to claim 13, wherein: The target sequence includes a plurality of the output sequences, The processing module is further configured to perform the following operations to initiate processing of a processing cycle in the plurality of processing cycles: Determine a first sequence to be compared and a second sequence to be compared of the starting processing cycle respectively according to a processing number threshold of the first data to be output in the starting processing cycle and a processing number threshold of the second data to be output in the starting processing cycle; An output sequence of the initial processing cycle and a reference sequence of a subsequent processing cycle of the initial processing cycle are determined according to the first sequence to be compared and the second sequence to be compared of the initial processing cycle.
16. A data processing method, comprising: Acquire multiple data to be processed from a storage unit; Determine at least one sequence of data to be processed according to the plurality of data to be processed, wherein the sequence of data to be processed includes the plurality of data to be processed arranged in a target order; A target sequence is determined according to at least one of the data sequences to be processed.
17. The method according to claim 1, wherein: The plurality of data to be processed include two first data to be processed and two second data to be processed, Determining at least one sequence of data to be processed according to the plurality of data to be processed comprises: Determine first initial maximum data and first initial minimum data from the two first data to be processed; Determine a second initial maximum data and a second initial minimum data from the two second data to be processed; Determining target maximum data and first data to be compared from the first initial maximum data and the second initial maximum data; Determining target minimum data and second data to be compared from the first initial minimum data and the second initial minimum data; From the first data to be compared and the second data to be compared, intermediate larger data and intermediate smaller data are determined.
18. The method according to claim 17, wherein: The data sequence to be processed includes, in sequence: the target maximum data, the intermediate larger data, the intermediate smaller data and the target minimum data; or The data sequence to be processed includes, in sequence: the target smaller data, the intermediate smaller data, the intermediate larger data and the target maximum data.
19. The method according to claim 16, wherein: The plurality of data to be processed are determined according to the high-order components of the plurality of initial data, and the number of the data to be processed is less than or equal to the number of the initial data. The plurality of data to be processed are determined according to the high-order components of the plurality of initial data by the following operations: Determine at least one initial data set according to first high-order components of each of the plurality of initial data, wherein the initial data set includes a first initial number of initial data, and any initial data in the initial data set includes the first high-order component corresponding to the initial data set; Based on the target data number and at least one of the first initial numbers of at least one of the initial data sets, at least one set of data to be processed is determined from at least one of the initial data sets, wherein the number of the data to be processed in at least one of the set of data to be processed is greater than or equal to the target data number.
20. The method according to claim 19, wherein: The initial data set is multiple, Determining at least one to-be-processed data set from at least one of the initial data sets comprises: At least one of the to-be-processed data sets and at least one of the unprocessed data sets are determined from the multiple initial data sets, wherein the first high-order component corresponding to any of the to-be-processed data sets is greater than the first high-order component corresponding to any of the unprocessed data sets, or the first high-order component corresponding to any of the to-be-processed data sets is less than the first high-order component corresponding to any of the unprocessed data sets.
21. The method according to claim 19, wherein: The plurality of data to be processed are also determined according to the high-order components of the plurality of initial data by the following operations: In response to determining that the first initial number of the initial data set is greater than or equal to a preset number threshold, performing at least one round of iterative grouping on a plurality of the initial data in the initial data set to obtain a plurality of initial data subsets, The second initial number of any of the initial data subsets is smaller than the preset number threshold, Wherein, executing at least one round of iterative grouping includes: According to the second high-order components of the current round of the respective multiple initial data, perform iterative grouping of the current round to determine multiple current initial data groups, wherein the current initial data groups include the current initial number of initial data; In response to determining that the current initial number is greater than the preset number threshold, determining the second high-order components of the subsequent rounds of the plurality of initial data respectively according to the second current high-order components of the current round of the plurality of initial data respectively, so as to perform iterative grouping of the subsequent rounds of the current round, wherein the second high-order component of the starting round in at least one round iterative grouping is determined according to the first high-order component; In response to determining that the current initial number is less than or equal to the preset number threshold, a plurality of the initial data subsets are obtained according to a plurality of the current initial data groups.
22. The method according to claim 16, wherein: Determining the target sequence according to at least one of the to-be-processed data sequences includes: Determine at least one processed sequence according to the plurality of data sequences to be processed; The target sequence is determined based on at least one of the processed sequences.
23. The method according to claim 22, wherein: The plurality of data sequences to be processed include a first data sequence to be processed and a second data sequence to be processed, The determining at least one processed sequence according to the plurality of data sequences to be processed comprises: Determine the first target maximum data, the second target maximum data, the third data to be compared, and the fourth data to be compared according to the target maximum data and the intermediate larger data of the first data sequence to be processed and the target maximum data and the intermediate larger data of the second data sequence to be processed; Determine the first target minimum data, the second target minimum data, the fifth data to be compared, and the sixth data to be compared according to the target minimum data and the intermediate smaller data of the first data sequence to be processed and the target minimum data and the intermediate smaller data of the second data sequence to be processed; According to the third data to be compared, the fourth data to be compared, the fifth data to be compared and the sixth data to be compared, the first intermediate larger data, the second intermediate larger data, the first intermediate smaller data and the second intermediate smaller data are determined.
24. The method according to claim 22, wherein: The processed sequence includes, in sequence: the first target maximum data, the second target maximum data, the first intermediate larger data, the second intermediate larger data, the first intermediate smaller data, the second intermediate smaller data, the first target minimum data and the second target minimum data; or The processed sequence includes, in sequence: the second target minimum data, the first target minimum data, the second intermediate smaller data, the first intermediate smaller data, the second intermediate larger data, the first intermediate larger data, the second target maximum data and the first target maximum data.
25. The method according to claim 22, wherein: Determining the target sequence according to at least one of the processed sequences comprises: Determine at least one sequence to be output according to the plurality of processed sequences; The target sequence is determined according to at least one of the sequences to be output.
26. The method according to claim 25, wherein: The number of the processed sequences is M, and the processed sequences include a first processed subsequence and a second processed subsequence, and M is an integer greater than 1. The determining at least one sequence to be output according to the plurality of processed sequences comprises: According to the first processed subsequence of the m-th processed sequence and the 2(m-1) first intermediate subsequences of the m-1th level first intermediate sequence, the first processing is performed multiple times to obtain 2m-1 second intermediate subsequences of the m-1th level second intermediate sequence, where m is an integer greater than 1 and less than or equal to M; According to the 2m-1 second intermediate subsequences of the m-1th level second intermediate sequence and the second processed subsequence of the mth processed sequence, multiple second processes are performed to obtain 2m first intermediate subsequences of the mth level first intermediate sequence.
27. The method according to claim 25, wherein: There are multiple sequences to be output. The determining the target sequence according to at least one of the sequences to be output comprises: According to the plurality of sequences to be output, a plurality of processing cycles are executed to determine the target sequence.
28. The method according to claim 27, wherein: The plurality of sequences to be output include a first sequence to be output and a second sequence to be output, the first sequence to be output includes a plurality of first data to be output, the second sequence to be output includes a plurality of second data to be output, The executing of the processing of the current processing cycle in the plurality of processing cycles comprises: Determine a sequence to be compared in the current processing cycle according to a first number of the first data to be output to be compared in the current processing cycle and a second number of the second data to be output to be compared in the current processing cycle, wherein the first number of the first data to be output to be compared is obtained from a position indicated by the first pointer in the current processing cycle, and the second number of the second data to be output to be compared is obtained from a position indicated by the second pointer in the current processing cycle; According to the reference sequence of the current processing cycle and the sequence to be compared of the current processing cycle, an output sequence of the current processing cycle and a reference sequence of a subsequent processing cycle of the current processing cycle are determined.
29. The method according to claim 28, wherein: The first number to be compared is determined based on a first benchmark number of the first output data in a benchmark sequence of the current processing cycle and a processing number threshold, and the second number to be compared is determined based on a second benchmark number of the second output data in a benchmark sequence of the current processing cycle and the processing number threshold, and the processing number threshold corresponds to the processing unit.
30. The method of claim 28, wherein: The target sequence includes a plurality of the output sequences, The processing of executing the starting processing cycle among the plurality of processing cycles comprises: Determine a first sequence to be compared and a second sequence to be compared of the starting processing cycle respectively according to a processing number threshold of the first data to be output in the starting processing cycle and a processing number threshold of the second data to be output in the starting processing cycle; An output sequence of the initial processing cycle and a reference sequence of a subsequent processing cycle of the initial processing cycle are determined according to the first sequence to be compared and the second sequence to be compared of the initial processing cycle.
31. An electronic device comprising the apparatus according to any one of claims 1 to 15.
32. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 15.
33. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 15.
34. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 15.
