Data processing method and device, equipment, medium and product
By determining the increment coefficient in the hardware processing device and performing multiple rounds of parallel processing, the problems of inconsistent calculation processes and incorrect results in parallel processing are solved, and processing efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411945658.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-27
AI Technical Summary
When hardware processing devices process multiple to-process data in parallel, it is difficult for them to ensure the consistency of the calculation process and the correctness of the calculation results, especially when the number of iteration rounds required for different to-process data to complete the calculation is not fixed.
By determining the increment coefficient of each processed array in the multiple processing array, and in multiple rounds of parallel processing, the data is divided according to the data eligibility conditions, and the constraint calculation is performed again until the initial data in the pending data table has been traversed and calculated.
It improves the utilization rate of processing equipment, realizes high-speed and efficient data processing, and ensures the correctness and consistency of data processing.
Smart Images

Figure CN119883619A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data processing method, device, equipment, medium and product. Background Art
[0002] The hardware processing device has an N-way processing array, which can realize parallel processing operations of N-way data.
[0003] When processing data, the hardware processing device can process N data to be processed in parallel in a single round of iteration through an N-way processing array. The single-round iterative operation logic of each data to be processed is consistent, but the number of iterations required for each data to be processed to complete the operation is not fixed. This will result in that when N data to be processed are operated simultaneously, by a certain round, some data to be processed have obtained the final qualified operation results, while some data to be processed have not obtained qualified operation results, indicating that the operation has not been completed and it still needs to be iterated. If the operation results are output in this round, the operation results of the data to be processed that have not been iterated are unqualified and erroneous data; if the next round of iterations is continued, the data to be processed that has obtained qualified operation results may make mistakes in the next round of accompanying operation, causing the originally qualified operation results to become unqualified results. This operation method cannot guarantee the consistency of the operation process and the correctness of the output of the operation results. To solve this technical problem, a single-channel processing array can be used to iteratively calculate a single piece of data to be processed, complete the calculation of the data to be processed, obtain the corresponding qualified calculation result, and then perform the calculation of the next piece of data to be processed. However, this calculation method has a utilization rate of only 1 / N for the hardware processing equipment, and the calculation efficiency is poor. Summary of the invention
[0004] The present invention provides a data processing method, device, equipment, medium and product to realize multi-round parallel processing of data to be processed, improve the utilization rate of processing equipment, realize high-speed and efficient processing of data, and ensure the correctness of data processing.
[0005] In a first aspect, an embodiment of the present disclosure provides a data processing method, including:
[0006] Determine an incremental coefficient of each processing array in the multi-way processing array, wherein the incremental coefficient is a coefficient that changes based on an iteration result;
[0007] Acquire initial data in the table of data to be processed, take initial data corresponding to the number of ways of the processing array as current data to be processed, place them into each processing array in order, perform constraint calculations of each current data to be processed in parallel through the multi-way processing array, obtain corresponding current incremental data, obtain current updated data according to the current data to be processed and the current incremental data, update the table of data to be processed according to the current updated data, and determine the current data to be processed, the current incremental data and the current updated data as historical data to be processed, historical incremental data and historical updated data respectively;
[0008] Based on the data qualification condition, the historical update data is divided into qualified data and unqualified data, the supplementary initial data of the qualified data is taken from the table of data to be processed as the current data to be processed, and is placed in the processing array corresponding to the qualified data, and the historical update data as the unqualified data is taken and placed in the processing array corresponding to the unqualified data;
[0009] Return and recalculate the constraint effects of each of the current data to be processed in parallel through the multi-way processing array to obtain the corresponding current incremental data, obtain the current update data based on the current data to be processed, the current incremental data and the incremental coefficient, and update the table of data to be processed based on the current update data, and iterate the loop until the initial data in the table of data to be processed has been traversed and calculated.
[0010] In a second aspect, an embodiment of the present disclosure provides a data processing device, including:
[0011] An incremental coefficient determination module, used to determine an incremental coefficient of each processing array in a multi-way processing array, wherein the incremental coefficient is a coefficient that changes based on an iteration result;
[0012] The first-round iteration module is used to obtain the initial data in the table of data to be processed, and to use the initial data corresponding to the number of ways of the processing array as the current data to be processed, and to sequentially place them into each of the processing arrays, and to perform constraint calculations of each of the current data to be processed in parallel through the multi-way processing arrays to obtain the corresponding current incremental data, and to obtain the current updated data according to the current data to be processed and the current incremental data, and to update the table of data to be processed according to the current updated data, and to determine the current data to be processed, the current incremental data and the current updated data as the historical data to be processed, the historical incremental data and the historical updated data respectively;
[0013] an iterative result determination module, for dividing the historical update data into qualified data and unqualified data based on data qualification conditions, taking the supplementary initial data of the qualified data from the table of data to be processed as the current data to be processed, and placing it into a processing array corresponding to the qualified data, and taking the historical update data as the unqualified data, and placing it into a processing array corresponding to the unqualified data;
[0014] The continuing iteration module is used to return to recalculate the constraint effects of each of the current data to be processed in parallel through the multi-way processing array to obtain the corresponding current incremental data, obtain the current updated data based on the current data to be processed, the current incremental data and the incremental coefficient, and update the table of data to be processed based on the current updated data, and iterate until the initial data in the table of data to be processed has been traversed and calculated.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0016] at least one processor; and
[0017] a memory communicatively connected to at least one processor; wherein,
[0018] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute a data processing method provided by the above-mentioned first aspect embodiment.
[0019] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a processor to implement a data processing method provided by the embodiment of the first aspect above when executed.
[0020] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements a data processing method provided by the embodiment of the first aspect above.
[0021] A data processing method, device, equipment, medium and product according to an embodiment of the present invention include: determining an incremental coefficient of each processing array in a multi-way processing array, wherein the incremental coefficient is a coefficient that changes based on an iteration result; obtaining initial data in a table of data to be processed, taking initial data corresponding to the number of paths of the processing array as current data to be processed, and sequentially placing the initial data into each of the processing arrays, performing constraint calculations of each of the current data to be processed in parallel through the multi-way processing array to obtain corresponding current incremental data, obtaining current updated data according to the current data to be processed and the current incremental data, and updating the table of data to be processed according to the current updated data, and determining the current data to be processed, the current incremental data and the current updated data as historical data to be processed, historical incremental data and historical incremental data respectively; The amount of data and historical update data; based on the data qualification conditions, the historical update data is divided into qualified data and unqualified data, the initial data of the qualified data is taken from the table of data to be processed as the current data to be processed, and placed in the processing array corresponding to the qualified data, and the historical update data as the unqualified data is taken and placed in the processing array corresponding to the unqualified data; return to recalculate the constraint effect of each of the current data to be processed in parallel through the multi-way processing array to obtain the corresponding current incremental data, obtain the current update data according to the current data to be processed, the current incremental data and the incremental coefficient, and update the table of data to be processed according to the current update data, iterate until the initial data in the table of data to be processed has been traversed and calculated. The above technical solution realizes multiple rounds of parallel processing of the data to be processed based on the multi-way processing array, improves the utilization rate of the processing equipment, and realizes high-speed and efficient processing of data; based on the setting of the incremental coefficient, it avoids the running-along error problem of the qualified data and ensures the consistency and correctness of data processing.
[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 is a flow chart of a data processing method provided by Embodiment 1 of the present invention;
[0025] Figure 2is a structural schematic diagram of a data processing device provided in Embodiment 2 of the present invention;
[0026] Figure 3 It is a structural schematic diagram of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second" and "target" in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Embodiment 1
[0030] Figure 1 It is a flow chart of a data processing method provided in the first embodiment of the present invention. This embodiment is applicable to the situation where data processing is implemented in parallel based on a multi-way processing array. The method can be executed by a data processing device, and the data processing device can be implemented in the form of hardware and / or software.
[0031] like Figure 1 As shown, the method includes:
[0032] S101, determining an incremental coefficient of each processing array in a multi-way processing array, where the incremental coefficient is a coefficient that changes based on an iteration result.
[0033] In this embodiment, the processing array can be understood as a processing branch in a hardware processing device. Each processing array represents a processing thread. Multiple processing arrays operate in parallel in a single round of iteration, that is, multiple processing threads run in parallel on the same node. For the hardware processing device to which the processing array belongs, its processing bit width is L*N=Mbit, where Mbit is the total processing bandwidth. N represents the number of processing arrays included in the hardware processing device. N can take different values, such as 8, 16, 64, 128 or 256, etc. This embodiment does not set a limitation on this. L represents the bit width of the data to be processed on each processing array, which is Lbit. The incremental coefficient can be understood as the coefficient of the incremental data calculated by the processing array, and can also be considered as a weight. The incremental coefficient includes 0 and 1, and each processing array has its corresponding incremental coefficient. The iteration result can be understood as the result of judging whether the updated data obtained after the calculation constraints of the data to be processed are qualified after one round of iteration ends and before the next round of iteration begins. A single processing array may correspond to multiple data to be processed. If all the data to be processed in a processing array are qualified, it is confirmed that the processing is completed. At this time, its increment coefficient is set to 0. If any data to be processed in a processing array is unqualified, its increment coefficient is set to 1.
[0034] Specifically, the processed flag and the pending flag are set. Before the operation logic starts, the processed flag is first set to 0, and then the total number of data to be processed is determined. Based on the total number of data to be processed and the total number of processing arrays, the number of data to be processed by each processing array is determined, and the number is determined as the value of the pending flag. If the pending flag and the processed flag of a certain processing array are equal, it indicates that the processing array has completed the processing of all the data corresponding to the period, and the incremental coefficient of the path is determined to be 0, otherwise, the incremental coefficient is determined to be 1.
[0035] It can be understood that in the first round of iteration, the incremental coefficient is not applied, and starting from the second round of iteration, the final processing result (that is, the formation of updated data) is obtained based on the incremental coefficient.
[0036] It can be understood that the beginning of a single round of iteration is the acquisition of data to be processed, and the end of a single round of iteration is the acquisition of incremental data based on the data to be processed, and the acquisition of updated data based on the data to be processed and the incremental data. Between the end of one round of iteration and the beginning of the next round of iteration, it also includes the qualification judgment of the updated data obtained from the completed round of iteration, which determines the acquisition location of the next round of data to be processed, that is, who the next round of data to be processed is.
[0037] S102, obtaining the initial data in the table of data to be processed, taking the initial data corresponding to the number of processing arrays as the current data to be processed, placing them into each processing array in order, performing constraint calculations on each current data to be processed in parallel through the multi-way processing arrays, obtaining the corresponding current incremental data, obtaining the current updated data based on the current data to be processed and the current incremental data, and updating the table of data to be processed based on the current updated data, and determining the current data to be processed, the current incremental data and the current updated data as the historical data to be processed, the historical incremental data and the historical updated data correspondingly.
[0038] In this embodiment, the table of data to be processed can be understood as a table consisting of multiple data to be processed. Before the iteration begins, the data in the table of data to be processed are all initial data. After a round of iteration ends, before the last round of iteration ends, the data in the table of data to be processed include initial data and updated data. After the last round of iteration ends, the data in the table of data to be processed are all updated data. Among them, the initial data can be understood as the initial original data, and the updated data can be understood as the more optimized data obtained after the constraint effect is calculated based on the initial data or the updated data of the previous round. The current data to be processed can be understood as the data placed in the processing array in this round of iteration. In the first round of iteration, the current data to be processed first is the initial data. In subsequent iterations, the current data to be processed can be the initial data or the updated data. The current incremental data can be understood as the change information obtained after the constraint effect calculation is performed on the current data to be processed in this round of iteration. It can be understood that in the scenario of performing constraint effect calculation based on molecular dynamics to determine the particle force, the current incremental data is a negative value. The current updated data can be understood as the data obtained after the current data to be processed is optimized by the current incremental data. It is understandable that the initial data, the data to be processed and the updated data all represent the position and velocity of a certain atom. After a round of iteration, the current data to be processed is determined as the historical data to be processed, the current incremental data is determined as the historical incremental data, and the current updated data is determined as the historical updated data.
[0039] Specifically, the table of data to be processed in the memory is accessed. In the first round of iteration, the initial data corresponding to the number of processing arrays are obtained in sequence from the table of data to be processed, and these initial data are used as the current data to be processed and placed in the corresponding processing arrays in sequence. The constraint effect calculation of each current data to be processed is performed in parallel through the multi-channel processing array to obtain the current incremental data corresponding to each processing array, and the sum of the current data to be processed and the current incremental data corresponding to each processing array is determined as the current updated data. The table of data to be processed is updated according to the current updated data, that is, the initial data placed in the processing array is replaced with the corresponding current updated data. After completing this round of iteration, the data in this round of iteration will be used as the historical data under the main body of the next round of iteration, thereby determining the current data to be processed as the historical data to be processed, the current incremental data as the historical incremental data, and the current updated data as the historical updated data.
[0040] Exemplarily, there are 16 processing arrays in total at present. The initial data at the 1st to 16th positions are obtained (copied) from the current data table to be processed in the memory, and the initial data at the 1st position in the table is placed in the 1st processing array as the current data to be processed of the 1st processing array, and the other 15 initial data are the same. After all the 16 initial data are placed in the corresponding processing array as the current data to be processed, the 16 processing arrays act synchronously, and the constraint calculation for the current data to be processed is performed to obtain the current incremental data for each current data to be processed, and the sum of the current data to be processed and the current incremental data is taken to obtain the current updated data, and the current updated data is placed in the corresponding position in the data table to be processed, replacing its initial initial data, and completing the update of the data table to be processed. For example, the 1st initial data a is used as the current data to be processed of the 1st processing array to calculate the corresponding current increment b, and further obtain the corresponding current updated data c (c=a+b), and then c is placed in the 1st position in the data table to be processed to replace the original initial data a.
[0041] It can be understood that each initial data in the data table to be processed has its corresponding processing array, and it can also be understood that each processing array has its corresponding initial data set. The identifier of the initial data in the set can be expressed as p+qN, where p represents the identifier of the first initial data corresponding to the processing array, q is a natural number, q∈[0,∞), and N represents the total number of processing arrays.
[0042] Exemplarily, the table of data to be processed includes 50 initial data, and there are 16 processing arrays in total. The first 16 initial data correspond to the 1st to 16th processing arrays in turn. Taking the 2nd processing array as an example, the first initial data corresponding to it in the table of data to be processed is the 2nd initial data (2+0*16), and the second initial data corresponding to it in the table of data to be processed is the 18th initial data (2+1*16). In this way, it is determined in turn that the 2nd processing array corresponds to the 2nd, 18th, 34th, and 50th initial data in the list to be processed.
[0043] It is understandable that the number of initial data in the to-be-processed data table is only described as an example and does not represent the actual number of initial data. This embodiment does not set a limit on the number of initial data.
[0044] S103. Based on the data qualification conditions, the historical updated data is divided into qualified data and unqualified data. The initial data of qualified data is taken from the table of data to be processed as the current data to be processed and placed in the processing array corresponding to the qualified data. The historical updated data as unqualified data is taken and placed in the processing array corresponding to the unqualified data.
[0045] In this embodiment, the data qualification condition can be understood as a condition for judging whether the updated data calculated in the previous round of iterations is qualified before the next round of iterations begins. Qualified data can be understood as historical updated data that meets the data qualification condition, and unqualified data can be understood as historical updated data that does not meet the data qualification condition. The supplementary initial data can be understood as the initial data with the smallest identifier in the data to be processed that corresponds to the processing array that calculates the qualified data, except for the initial data corresponding to the qualified data. Continuing with the above example, if the qualified data corresponds to the initial data of the second position, that is, the qualified data is the data calculated after one or more rounds of iterations of the initial data of the second position, then the 18th initial data is determined to be supplemented in this round of iteration as the initial data of the current data to be processed.
[0046] Specifically, in addition to being updated and stored in the memory, the historical update data will also be stored in the register, and the historical update data obtained in the previous round of iterations will be obtained from the register to determine whether these historical update data meet the data qualification conditions. For qualified data, determine the supplementary data of qualified data in the table of pending data (according to the description in the above example, for example, it can be that the processing array has 16 channels, the data of the second channel is qualified, and it also corresponds to the second position in the table of pending data, then the supplementary data is the 18th position), and the supplementary data of qualified data is used as the current pending data of this round, and is placed (copied to) the corresponding processing array (according to the description in the above example, for example, the 18th initial data can be placed as the current pending data in the second channel processing array). For unqualified data, determine the identifier of the unqualified data in the table of pending data, take the historical update data placed in the position corresponding to the identifier, and place (copy to) the current pending data of this round of iteration (that is, if the historical update data calculated in the previous round of iterations is unqualified data, then the historical update data itself is used as the current pending data of this round of iteration). For example, since after each round of iteration, the historical update data of the iteration will be put back to the corresponding position in the table of data to be processed, after the 3rd processing array obtains the historical update data in the previous round of iteration, it puts the historical update data in the 3rd position of the table of data to be processed, replacing the original initial data in the 3rd position. Before the next round of iteration, it is determined whether the historical update data is qualified data. If it is unqualified data, the historical update data is retrieved (copied) from the 3rd position of the table of data to be processed as the current data to be processed of the 3rd processing array. It can be understood that, following the above example description, in this round of iteration, the 2nd processing array corresponds to the initial data with the processing mark 18, and the 3rd processing array continues to process the update data with the processing mark 3.
[0047] S104, return and recalculate the constraint effects of each current data to be processed in parallel through the multi-way processing array to obtain the corresponding current incremental data, obtain the current update data based on the current data to be processed, the current incremental data and the incremental coefficient, and update the table of data to be processed based on the current update data, iterate the loop until the initial data in the table of data to be processed has been traversed and calculated.
[0048] In this embodiment, in the current round of iteration, after the current data to be processed in this round of iteration is determined, the constraint effect calculation of each current data to be processed is also performed in parallel through the multi-way processing array to obtain the corresponding current incremental data. Different from the first round of iteration, in the process from the second round of iteration to the last round of iteration, the calculation of the current update data requires the participation of the incremental coefficient to avoid the problem of changing the qualified data of this path into unqualified data after a certain processing array completes the calculation of all the corresponding data to be processed while accompanying other processing arrays that have not been fully calculated to perform iterations.
[0049] After obtaining the current incremental data, obtaining the current updated data according to the current data to be processed, the current incremental data and the incremental coefficient, and updating the table of data to be processed according to the current updated data, continue to determine the current data to be processed, the current incremental data and the current updated data as the historical data to be processed, the historical incremental data and the historical updated data, and then continue to execute step S103, and then return to recalculate the constraint effect of each current data to be processed in parallel through the multi-way processing array, and obtain the corresponding current incremental data again...until the current updated data corresponding to the last current data to be processed of the last processing array is qualified data, and it is determined that all iterations are completed. Alternatively, it can also be understood that all initial data in the table of data to be processed have been traversed and calculated, and each updated data filling the table of data to be processed is qualified data, and it is determined that all iterations are completed, and the calculation process ends.
[0050] Molecular dynamics (MD) is a method for simulating the motion of a single particle in a large number of particle collection systems (such as solids, gases, and liquids). In the context of molecular dynamics, an embodiment of the present invention provides a method for calculating the particle constraint effect by parallel iteration of a multi-way processing array in a processor to obtain the final particle motion result.
[0051] A data processing method according to an embodiment of the present invention comprises: determining an incremental coefficient of each processing array in a multi-way processing array, wherein the incremental coefficient is a coefficient that changes based on an iteration result; obtaining initial data in a table of data to be processed, taking initial data corresponding to the number of processing arrays as current data to be processed, and sequentially placing the initial data into each processing array, performing constraint calculations of each current data to be processed in parallel through the multi-way processing array to obtain corresponding current incremental data, obtaining current updated data according to the current data to be processed and the current incremental data, and updating the table of data to be processed according to the current updated data, and determining the current data to be processed, the current incremental data and the current updated data as historical data to be processed and historical incremental data respectively; and historical update data; based on the data qualification conditions, the historical update data is divided into qualified data and unqualified data, the initial data of the qualified data is taken from the table of data to be processed as the current data to be processed, and placed in the processing array corresponding to the qualified data, and the historical update data as the unqualified data is taken and placed in the processing array corresponding to the unqualified data; return to recalculate the constraint effect of each current data to be processed in parallel through the multi-way processing array to obtain the corresponding current incremental data, and obtain the current updated data according to the current data to be processed, the current incremental data and the incremental coefficient, and update the table of data to be processed according to the current updated data, and iterate until the initial data in the table of data to be processed has been traversed and calculated. The above technical solution realizes multiple rounds of parallel processing of data to be processed based on the multi-way processing array, improves the utilization rate of processing equipment, and realizes high-speed and efficient processing of data. The setting based on the incremental coefficient avoids the error problem of accompanying running of qualified data and ensures the consistency and correctness of data processing.
[0052] As a first optional embodiment of this embodiment, determining the increment coefficient of each processing array in the multi-way processing array includes:
[0053] S1011, access the data table to be processed stored in the memory, determine the identification and quantity of each initial data in the data table to be processed, determine the corresponding relationship between each initial data and each processing array based on the identification and quantity of the initial data and the number of processing arrays, and determine the identification to be processed of each processing array.
[0054] In this embodiment, the identifier of the initial data can be understood as the location of the initial data, such as the number of digits of the initial data in the table of data to be processed. The number of initial data is consistent with the value represented by the identifier of the last initial data in the table of data to be processed. The identifier to be processed can be understood as the number of initial data to be processed corresponding to each processing array.
[0055] Specifically, the table of data to be processed stored in the memory is accessed to determine the identifier and number of each initial data in the table of data to be processed, and the number of initial data is divided by the number of processing arrays. If the result is an integer, the integer is determined as the identifier to be processed of each processing array (for example, 64 initial data, 64 / 16, the identifier to be processed of each processing array is 4). If the result contains an integer and a remainder, the identifier to be processed of the remainder processing array is determined to be integer+1 in order, and the identifier to be processed of other processing arrays is determined to be the integer (for example, 50 initial data, 50 / 16, the integer calculated is 3, the remainder is 2, and the identifier to be processed of the first 2 processing arrays is determined to be 4, and the identifier to be processed of the last 14 processing arrays is determined to be 3). Each initial data is matched to the corresponding processing array in the order of the identifier, for example, the 1st to 16th initial data corresponds to the 1st to 16th processing array, the 17th to 32nd initial data corresponds to the 1st to 16th processing array, the 33rd to 48th initial data corresponds to the 1st to 16th processing array...
[0056] Exemplarily, the table of data to be processed includes 50 initial data, and there are 16 processing arrays in total. The initial data corresponding to the 1st processing array are the 1st, 17th, 33rd and 49th bits, thereby determining that the to-be-processed identifier of the 1st processing array is 4; the initial data corresponding to the 2nd processing array are the 2nd, 18th, 34th and 50th bits, thereby determining that the to-be-processed identifier of the 2nd processing array is 4; the initial data corresponding to the 3rd processing array are the 3rd, 20th and 36th bits, thereby determining that the to-be-processed identifier of the 3rd processing array is 3; the to-be-processed identifier of the subsequent processing array also corresponds to 3, and the determination method is the same as above, which will not be repeated here.
[0057] S1012: Determine the processed flag of each processing array, and set the processed flag corresponding to the first round of iteration to zero.
[0058] When setting the processed flag, set the processed flag to 0. The processed flag in the first iteration is also 0. In subsequent iterations, if the iteration result is that the historical update data is qualified data, the processed flag is increased by 1 until the processed flag is equal to the pending flag.
[0059] S1013. If the identifier to be processed is equal to the identifier that has been processed, the incremental coefficient is determined to be zero; otherwise, the incremental coefficient is determined to be one.
[0060] In this embodiment, if the pending flag and the processed flag are equal, it indicates that the processing array has completed the calculation of all the corresponding initial data (data to be processed), but if there is at least one column of other processing arrays that has not yet completed the calculation of all the initial data, the processing array may accompany other processing arrays to perform the next round of iterations. At this time, in order to avoid the last qualified data calculated to become unqualified data through calculation in the subsequent iterative calculation process, the incremental coefficient of the processing array is set to 0, and the incremental data calculated in each round of iteration * incremental coefficient 0 is added to the data to be processed. The updated data obtained is still the data to be processed itself and will not change, thus avoiding the risk of the data to be processed changing from qualified data to unqualified data. If the pending flag and the processed flag are not equal, it indicates that the processing array has not completed the calculation of all the corresponding initial data (data to be processed). At this time, the processing array still needs the application of incremental data to obtain the latest updated data. Therefore, the incremental coefficient of the processing array is set to 1, and the incremental data calculated in each round of iteration * incremental coefficient 1 is added to the data to be processed to obtain the updated data after constraints.
[0061] As a second optional embodiment of this embodiment, current update data is obtained according to current data to be processed and current incremental data, including:
[0062] S1021. Take the sum of the current data to be processed and the current incremental data to obtain the current updated data.
[0063] In this embodiment, the sum of the current data to be processed a and the current incremental data b is taken to obtain the current updated data c (c=a+b).
[0064] S1022. Store the current update data into the associated register.
[0065] In order to quickly determine whether the updated data is qualified, after completing each round of iterative calculation, the calculated current updated data is stored in the associated register.
[0066] As a third optional embodiment of this embodiment, based on the data qualification condition, the historical update data is divided into qualified data and unqualified data, including:
[0067] S1031. Get the historical update data with the most recent timestamp stored from the register.
[0068] In this embodiment, each round of iterative calculation stores historical update data. Before the current round of iteration begins, the historical update data with the most recent timestamp stored is retrieved from the register, that is, the update data determined by the previous round of iterative calculation.
[0069] S1032. Determine the atomic force based on the atomic position and atomic velocity pointed to by the historical update data.
[0070] In this embodiment, the atomic force can be understood as the particle interaction force of the atom pointed to by the initial data corresponding to the historical update data.
[0071] Specifically, molecular dynamics has its own specific force calculation formula, and the atomic position and atomic velocity pointed to by the historical update data are used as inputs of the calculation formula to obtain the atomic force on the atom output by the formula.
[0072] S1033. Compare the atomic force with the preset force. If the atomic force is smaller than the preset force, determine that the historical update data is qualified data; otherwise, determine that the historical update data is unqualified data.
[0073] In this embodiment, the set force can be understood as the maximum expected value of the set atomic force.
[0074] Specifically, since each updated data is calculated based on the constraint, the updated data of the initial data is a smaller and smaller value during multiple rounds of iterations, and the set force is the maximum expected value of the atomic force. Therefore, the atomic force corresponding to the historical updated data obtained in each round of iteration is compared with the preset force. If the atomic force is less than the preset force, it indicates that the atomic force determined based on the historical updated data has reached the expected value, and the historical updated data is determined as qualified data; if the atomic force is greater than the preset force, it indicates that the atomic force determined based on the historical updated data has not yet reached the expected value, and it is necessary to continue iterating the constraint, and the historical updated data is determined as unqualified data.
[0075] As a fourth optional embodiment of this embodiment, after dividing the historical update data into qualified data and unqualified data, it further includes:
[0076] S1034, adding one to the value of the processed flag of the processing array corresponding to the qualified data.
[0077] In this embodiment, after the historical update data is divided into qualified data and unqualified data, the value of the processed flag of the processing array corresponding to the qualified data is increased by one to indicate that the processing array has completed the calculation of the corresponding initial data.
[0078] As a fifth optional embodiment of this embodiment, current update data is obtained according to current data to be processed, current incremental data and incremental coefficient, including:
[0079] S1041. Take the product of the current incremental data and the current incremental coefficient to obtain the target incremental data.
[0080] In this embodiment, the current incremental coefficient can be understood as the incremental coefficient corresponding to each processing array in this round of iteration. The target incremental data can be understood as the incremental data corresponding to the constraint requirements.
[0081] Specifically, for each processing array, if the processed identifier and the identifier to be processed of the processing array are equal, it is determined that there is no constraint requirement for the road, and its current incremental coefficient is 0, and the target incremental data obtained by multiplying the current incremental data and the current incremental coefficient is also 0; if the processed identifier and the identifier to be processed of the road are not equal, it is determined that there is still a constraint requirement for the road, and its current incremental coefficient is 1, and the target incremental data obtained by multiplying the current incremental data and the current incremental coefficient is the current incremental data itself.
[0082] S1042. Take the sum of the target incremental data and the current data to be processed to obtain the current updated data.
[0083] In this embodiment, the sum of the target incremental data and the current data to be processed is taken to obtain the current updated data. If the target incremental data is the current incremental data itself, the current updated data after the current round of constraints is calculated; if the target incremental data is 0, the current updated data is still the current data to be processed itself, which avoids the problem that the current data to be processed, which is qualified data, becomes unqualified data due to errors during the accompanying process, and ensures the consistency and correctness of data processing.
[0084] Embodiment 2
[0085] Figure 2 Schematic diagram of the structure of a data processing device provided by Embodiment 2 of the present invention. Figure 2 As shown, the device comprises:
[0086] An incremental coefficient determination module 21, used to determine an incremental coefficient of each processing array in a multi-way processing array, wherein the incremental coefficient is a coefficient that changes based on an iteration result;
[0087] The first-round iteration module 22 is used to obtain the initial data in the table of data to be processed, and to place the initial data corresponding to the number of paths of the processing array as the current data to be processed, and sequentially place them into each processing array, and to perform constraint calculations of each current data to be processed in parallel through the multi-path processing array to obtain the corresponding current incremental data, and to obtain the current updated data according to the current data to be processed and the current incremental data, and to update the table of data to be processed according to the current updated data, and to determine the current data to be processed, the current incremental data and the current updated data as the historical data to be processed, the historical incremental data and the historical updated data respectively;
[0088] The iteration result determination module 23 is used to divide the historical update data into qualified data and unqualified data based on the data qualification condition, take the supplementary initial data of the qualified data from the table of data to be processed as the current data to be processed, and place it into the processing array corresponding to the qualified data, and take the historical update data as the unqualified data, and place it into the processing array corresponding to the unqualified data;
[0089] The continuing iteration module 24 is used to return to recalculate the constraint effects of each of the current data to be processed in parallel through the multi-way processing array to obtain the corresponding current incremental data, obtain the current updated data based on the current data to be processed, the current incremental data and the incremental coefficient, and update the table of data to be processed based on the current updated data, and iterate until the initial data in the table of data to be processed has been traversed and calculated.
[0090] The data processing device adopted in the technical solution realizes multiple rounds of parallel processing of the data to be processed, improves the utilization rate of the processing equipment, realizes high-speed and efficient processing of data, and ensures the correctness of data processing.
[0091] Optionally, the increment coefficient determination module 21 is specifically used for:
[0092] Accessing a table of data to be processed stored in a memory, determining the identifier and quantity of each initial data in the table of data to be processed, determining the corresponding relationship between each initial data and each processing array based on the identifier and quantity of the initial data and the number of processing arrays, and determining the identifier to be processed of each processing array;
[0093] Determine the processed flag of each processing array, and set the processed flag corresponding to the first round of iteration to zero;
[0094] If the to-be-processed identifier is equal to the processed identifier, the incremental coefficient is determined to be zero; otherwise, the incremental coefficient is determined to be one.
[0095] Optionally, the first round iteration module 22 is specifically used for:
[0096] Taking the sum of the current data to be processed and the current incremental data to obtain the current updated data;
[0097] The current update data is stored in the associated register.
[0098] Optionally, the iteration result determination module 23 is specifically configured to:
[0099] Get the historical update data with the most recent timestamp from the register;
[0100] Determining atomic forces based on atomic positions and atomic velocities pointed to by the historical update data;
[0101] The atomic force is compared with a preset force. If the atomic force is smaller than the preset force, the historical update data is determined to be qualified data; otherwise, the historical update data is determined to be unqualified data.
[0102] Optionally, the iteration result determination module 23 is further used for:
[0103] After the historical update data is divided into qualified data and unqualified data, the value of the processed flag of the processing array corresponding to the qualified data is increased by one.
[0104] Optionally, the iterative module 24 is further configured to:
[0105] Taking the product of the current incremental data and the current incremental coefficient to obtain target incremental data;
[0106] The sum of the target incremental data and the current data to be processed is taken to obtain the current updated data.
[0107] The data processing device provided in the embodiment of the present invention can execute the data processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0108] Embodiment 3
[0109] Figure 3 : is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) 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 invention described and / or required herein.
[0110] like Figure 3As shown, the electronic device 30 includes at least one processor 31, and a memory connected to the at least one processor 31, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., wherein the processor 31 includes a multi-way processing array, such as 8-way, 16-way or 63-way, etc. The memory stores a computer program that can be executed by at least one processor, and the processor 31 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 32 or the computer program loaded from the storage unit 38 to the random access memory (RAM) 33. In the RAM 33, various programs and data required for the operation of the electronic device 30 can also be stored. The processor 31, the ROM 32 and the RAM 33 are connected to each other through a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.
[0111] A number of components in the electronic device 30 are connected to the I / O interface 35, including: an input unit 36, such as a keyboard, a mouse, etc.; an output unit 37, such as various types of displays, speakers, etc.; a storage unit 38, such as a disk, an optical disk, etc.; and a communication unit 39, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 39 allows the electronic device 30 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0112] The processor 31 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 31 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 31 performs the various methods and processes described above, such as data processing methods.
[0113] In some embodiments, the data processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 30 via the ROM 32 and / or the communication unit 39. When the computer program is loaded into the RAM 33 and executed by the processor 31, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the processor 31 may be configured to perform the data processing method in any other appropriate manner (e.g., by means of firmware).
[0114] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can 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 can be a special purpose 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.
[0115] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program 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.
[0116] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0117] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0118] 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), a blockchain network, and the Internet.
[0119] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0120] 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 described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0121] The above specific implementations do not constitute a limitation on the protection scope of the present invention. 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 invention should be included in the protection scope of the present invention.
Claims
1. A data processing method, characterized in that: include: Determine an incremental coefficient of each processing array in the multi-way processing array, wherein the incremental coefficient is a coefficient that changes based on an iteration result; Acquire initial data in the table of data to be processed, take initial data corresponding to the number of ways of the processing array as current data to be processed, place them into each processing array in order, perform constraint calculations of each current data to be processed in parallel through the multi-way processing array, obtain corresponding current incremental data, obtain current updated data according to the current data to be processed and the current incremental data, update the table of data to be processed according to the current updated data, and determine the current data to be processed, the current incremental data and the current updated data as historical data to be processed, historical incremental data and historical updated data respectively; Based on the data qualification condition, the historical update data is divided into qualified data and unqualified data, the supplementary initial data of the qualified data is taken from the table of data to be processed as the current data to be processed, and is placed in the processing array corresponding to the qualified data, and the historical update data as the unqualified data is taken and placed in the processing array corresponding to the unqualified data; Return and recalculate the constraint effects of each of the current data to be processed in parallel through the multi-way processing array to obtain the corresponding current incremental data, obtain the current update data based on the current data to be processed, the current incremental data and the incremental coefficient, and update the table of data to be processed based on the current update data, and iterate the loop until the initial data in the table of data to be processed has been traversed and calculated.
2. The method according to claim 1, characterized in that The step of determining the increment coefficient of each processing array in the multi-way processing array comprises: Accessing a table of data to be processed stored in a memory, determining the identifier and quantity of each initial data in the table of data to be processed, determining the corresponding relationship between each initial data and each processing array based on the identifier and quantity of the initial data and the number of processing arrays, and determining the identifier to be processed of each processing array; Determine the processed flag of each processing array, and set the processed flag corresponding to the first round of iteration to zero; If the to-be-processed identifier is equal to the processed identifier, the incremental coefficient is determined to be zero; otherwise, the incremental coefficient is determined to be one.
3. The method according to claim 1, characterized in that The step of obtaining current update data according to the current data to be processed and the current incremental data includes: Taking the sum of the current data to be processed and the current incremental data to obtain the current updated data; The current update data is stored in the associated register.
4. The method according to claim 1, characterized in that: The dividing the historical update data into qualified data and unqualified data based on the data qualification condition includes: Get the historical update data with the most recent timestamp from the register; Determining atomic forces based on atomic positions and atomic velocities pointed to by the historical update data; The atomic force is compared with a preset force. If the atomic force is smaller than the preset force, the historical update data is determined to be qualified data; otherwise, the historical update data is determined to be unqualified data.
5. The method according to claim 1, characterized in that After dividing the historical update data into qualified data and unqualified data, the method further includes: The value of the processed flag of the processing array corresponding to the qualified data is increased by one.
6. The method according to claim 1, characterized in that The step of obtaining the current update data according to the current data to be processed, the current incremental data and the incremental coefficient includes: Taking the product of the current incremental data and the current incremental coefficient to obtain target incremental data; The sum of the target incremental data and the current data to be processed is taken to obtain the current updated data.
7. A data processing device, characterized in that: include: An incremental coefficient determination module, used to determine an incremental coefficient of each processing array in a multi-way processing array, wherein the incremental coefficient is a coefficient that changes based on an iteration result; The first-round iteration module is used to obtain the initial data in the table of data to be processed, and to use the initial data corresponding to the number of ways of the processing array as the current data to be processed, and to sequentially place them into each of the processing arrays, and to perform constraint calculations of each of the current data to be processed in parallel through the multi-way processing arrays to obtain the corresponding current incremental data, and to obtain the current updated data according to the current data to be processed and the current incremental data, and to update the table of data to be processed according to the current updated data, and to determine the current data to be processed, the current incremental data and the current updated data as the historical data to be processed, the historical incremental data and the historical updated data respectively; an iterative result determination module, for dividing the historical update data into qualified data and unqualified data based on data qualification conditions, taking the supplementary initial data of the qualified data from the table of data to be processed as the current data to be processed, and placing it into a processing array corresponding to the qualified data, and taking the historical update data as the unqualified data, and placing it into a processing array corresponding to the unqualified data; The continuing iteration module is used to return to recalculate the constraint effects of each of the current data to be processed in parallel through the multi-way processing array to obtain the corresponding current incremental data, obtain the current updated data based on the current data to be processed, the current incremental data and the incremental coefficient, and update the table of data to be processed based on the current updated data, and iterate until the initial data in the table of data to be processed has been traversed and calculated.
8. An electronic device, characterized in that: include: at least one processor, the processor comprising a multi-way processing array; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform a data processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a data processing method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements a data processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Incremental data extraction processing method and device, computer equipment and medium
CN111309733A
Database synchronization method and terminal
CN118733673A
Device parameter adjusting method and device, electronic device and storage medium
CN118760096A
Incremental Parallel Processing of Data
US20150277965A1
Grape framework-based graph algorithm parallel acceleration method and apparatus
WO2022165687A1