A data processing method, apparatus, device, medium, and product
By setting incremental coefficients and using multiple iterations in the hardware processing device, the problems of inconsistent calculation results and low efficiency in parallel processing of hardware processing devices are solved, and high-speed, efficient parallel processing and correctness of data processing are achieved.
Patent Information
- Application Number
- CN202411945658.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-12-27
AI Technical Summary
When hardware processing devices process multiple data streams in parallel, they suffer from inconsistent results and low efficiency. In particular, they output incorrect results when some data has not completed the iterative calculation, leading to inaccurate results.
By determining the incremental coefficients of the multi-processing array, multiple rounds of parallel processing are performed based on the changes in the iterative results to separate qualified and unqualified data, recalculate the unqualified data, and continue until all data are qualified.
It achieves high-speed and efficient parallel processing of data, improves the utilization rate of processing equipment, and ensures the correctness and consistency of calculation results.
Smart Images

Figure CN119883619B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer technology, and in particular to a data processing method, device, equipment, medium and product. BACKGROUND
[0002] The hardware processing device has an N-way processing array, and can realize parallel processing operation of N-way data.
[0003] When the hardware processing device performs data processing, N-way processing arrays can be used to perform parallel processing on N pieces of to-be-processed data in a single iteration. The single iteration operation logic of each to-be-processed data is consistent, but the number of iteration rounds required by each to-be-processed data to complete the operation is not fixed. This can cause the following problems in the case of simultaneous operation of N-way to-be-processed data: at a certain round, some to-be-processed data has obtained a final qualified operation result, and some to-be-processed data has not obtained a qualified operation result, indicating that the operation of the to-be-processed data is not completed and still needs to continue iteration. If the operation result is output at this round, the operation result of the to-be-processed data that has not completed iteration is unqualified error data; if the iteration of the next round is continued, the to-be-processed data that has obtained a qualified operation result can be wrong in the next round of operation, so that the originally qualified operation result becomes an unqualified result. This operation method cannot guarantee the consistency of the operation process and the correctness of the operation result output. If this technical problem is to be solved, a single to-be-processed data can be iteratively operated by a single processing array, the operation of the to-be-processed data is completed, and the qualified operation result corresponding to the to-be-processed data is obtained before the operation of the next to-be-processed data is performed. However, the utilization rate of the hardware processing device is only 1 / N in this operation method, and the operation efficiency is poor. SUMMARY
[0004] The present application provides a data processing method, device, equipment, medium and product, which realizes multi-round parallel processing of to-be-processed data, improves the utilization rate of the processing device, realizes high-speed processing and efficient processing of data, and guarantees the correctness of data processing.
[0005] In a first aspect, the present application provides a data processing method, comprising:
[0006] determining an increment coefficient of each processing array in the multi-way processing array, the increment coefficient being a coefficient that changes based on an iteration result;
[0007] The initial data in the to-be-processed data table is obtained, and a number of initial data corresponding to the number of paths of the processing array are taken as current to-be-processed data, which are sequentially placed in each processing array. The constraint calculation of each current to-be-processed data is performed in parallel through the multi-path processing array to obtain corresponding current incremental data. The current update data is obtained according to the current to-be-processed data and the current incremental data, and the to-be-processed data table is updated according to the current update data. The current to-be-processed data, the current incremental data and the current update data are correspondingly determined as historical to-be-processed data, historical incremental data and historical update data;
[0008] Based on the data qualification condition, the historical update data is divided into qualified data and unqualified data. The make-up initial data of the qualified data is taken from the to-be-processed data table as current to-be-processed data, which is placed in the processing array corresponding to the qualified data. The historical update data of the unqualified data is taken and placed in the processing array corresponding to the unqualified data.
[0009] The constraint calculation of each current to-be-processed data is performed in parallel through the multi-path processing array to obtain corresponding current incremental data. The current update data is obtained according to the current to-be-processed data, the current incremental data and the incremental coefficient, and the to-be-processed data table is updated according to the current update data. Iterative loop until the initial data in the to-be-processed data table is calculated and completed.
[0010] In a second aspect, the embodiments of the present disclosure provide a data processing device, comprising:
[0011] An incremental coefficient determination module is configured to determine an incremental coefficient of each processing array in the multi-path processing array. The incremental coefficient is a coefficient that changes based on an iteration result.
[0012] A first round of iteration module is configured to obtain initial data in a to-be-processed data table, take a number of initial data corresponding to the number of paths of the processing array as current to-be-processed data, sequentially place the current to-be-processed data in each processing array, perform constraint calculation of each current to-be-processed data in parallel through the multi-path processing array to obtain corresponding current incremental data, obtain current update data according to the current to-be-processed data and the current incremental data, and update the to-be-processed data table according to the current update data. The current to-be-processed data, the current incremental data and the current update data are correspondingly determined as historical to-be-processed data, historical incremental data and historical update data.
[0013] An iteration result determining module is configured to divide the historical update data into qualified data and unqualified data based on a data qualification condition, take the replacement initial data of the qualified data from the to-be-processed data table as current to-be-processed data, and place the current to-be-processed data in a processing array corresponding to the qualified data, and take the historical update data as the unqualified data and place the unqualified data in a processing array corresponding to the unqualified data;
[0014] A continuous iteration module is configured to return to the constraint effect calculation of each current to-be-processed data through the multi-path processing array in parallel, obtain corresponding current incremental data, obtain current update data based on the current to-be-processed data, the current incremental data and the incremental coefficient, and update the to-be-processed data table based on the current update data, and the iteration is looped until the initial data in the to-be-processed data table is calculated completely.
[0015] In a third aspect, an electronic device is provided, and the electronic device comprises:
[0016] at least one processor; and
[0017] a memory connected to the at least one processor in communication; wherein
[0018] 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 to enable the at least one processor to execute the data processing method provided in the first aspect.
[0019] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data processing method provided in the first aspect when the processor executes the computer instructions.
[0020] In a fifth aspect, a computer program product is provided, and the computer program product comprises a computer program, and the computer program implements the data processing method provided in the first aspect when the computer program is executed by a processor.
[0021] A data processing method, device, equipment, medium and product provided by an embodiment of the present application include: determining an increment coefficient of each processing array in a multi-path processing array, the increment coefficient being a coefficient that changes based on an iteration result; obtaining initial data in a to-be-processed data table, and placing a number of initial data corresponding to the number of paths of the processing array as current to-be-processed data into each processing array in sequence, performing constraint calculation of each current to-be-processed data in parallel through the multi-path processing array to obtain corresponding current increment data, obtaining current update data according to the current to-be-processed data and the current increment data, and updating the to-be-processed data table according to the current update data, and determining the current to-be-processed data, the current increment data and the current update data as historical to-be-processed data, historical increment data and historical update data respectively; based on a data eligibility condition, dividing the historical update data into eligible data and unqualified data, taking the replacement initial data of the eligible data from the to-be-processed data table as the current to-be-processed data and placing the current to-be-processed data into the processing array corresponding to the eligible data, and taking the historical update data of the unqualified data and placing the historical update data into the processing array corresponding to the unqualified data; returning to perform constraint calculation of each current to-be-processed data in parallel through the multi-path processing array to obtain corresponding current increment data, obtaining current update data according to the current to-be-processed data, the current increment data and the increment coefficient, and updating the to-be-processed data table according to the current update data, and iteratively circulating until the initial data in the to-be-processed data table has been calculated completely. The above technical solution realizes multi-round parallel processing of to-be-processed data based on a multi-path processing array, improves the utilization rate of a processing device, and realizes high-speed processing and efficient processing of data; and the setting of the increment coefficient avoids the problem of accompanying running errors of eligible data, and guarantees the consistency and correctness of data processing.
[0022] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0024] Figure 1 is a flowchart of a data processing method provided by an embodiment of the present application;
[0025] Figure 2is a structural schematic diagram of a data processing device provided by embodiment two of the present application.
[0026] Figure 3 is a structural schematic diagram of an electronic device provided by embodiment three of the present application. DETAILED DESCRIPTION
[0027] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should fall within the scope of protection of the present application.
[0028] It should be noted that the terms "first", "second", and "target" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Embodiment one
[0030] Figure 1 is a flowchart of a data processing method provided by embodiment one of the present application. The present embodiment can be applicable to the case of parallel implementation of data processing based on a multi-path processing array. The method can be executed by a data processing device, which can be realized in the form of hardware and / or software.
[0031] As shown in Figure 1 , the method comprises:
[0032] S101, determining an increment coefficient of each processing array in the multi-path processing array, the increment coefficient being a coefficient that changes based on an iteration result.
[0033] In the embodiment, the processing array can be understood as a processing branch in the hardware processing device, each processing array represents a processing thread, and the multiple processing arrays operate in parallel in a single round of iteration, that is, multiple processing threads run in parallel in the same node. For the hardware processing device to which the processing array belongs, the processing bit width is L*N=Mbit, Mbit is the total processing bandwidth, N represents the number of processing array channels included in the hardware processing device, N can take different values, for example, 8, 16, 64, 128 or 256, etc., and the embodiment does not limit this, L represents the bit width of the data to be processed on each processing array, which is Lbit. The increment coefficient can be understood as a coefficient of the increment data obtained by the processing array calculation, which can also be regarded as a weight, the increment coefficient includes 0 and 1, and each processing array has its corresponding increment coefficient. The iteration result can be understood as a result of judging whether the updated data obtained after the calculation constraint on the to-be-processed data is qualified before the next round of iteration starts after the end of a round of iteration. A single processing array can correspond to multiple to-be-processed data, if all the to-be-processed data of a certain processing array are qualified, it is confirmed that the processing of the processing array is completed, at this time, the increment coefficient is set to 0, if any to-be-processed data in a certain processing array is not qualified, the increment coefficient is set to 1.
[0034] Specifically, the processed flag bit and the to-be-processed flag bit are set, before the operation logic starts, the processed flag bit is first set to 0, 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 to-be-processed flag bit. If the to-be-processed flag of a certain processing array is equal to the processed flag, it indicates that the processing array has completed the processing of all data corresponding to the period, and it is determined that the increment coefficient of the processing array is 0, otherwise, it is determined that the increment coefficient is 1.
[0035] It can be understood that in the first round of iteration, the increment coefficient is not used, and from the second round of iteration, the final processing result (that is, the formation of the updated data) is obtained based on the increment coefficient.
[0036] It can be understood that the start of a single round of iteration is the acquisition of to-be-processed data, and the end of a single round of iteration is to obtain increment data based on the to-be-processed data, and to obtain updated data based on the to-be-processed data and the increment data. Between the end of a round of iteration and the start of the next round of iteration, it also includes the judgment of whether the updated data obtained in the ended round of iteration is qualified or not, which determines the position of the to-be-processed data in the next round, that is, who is the to-be-processed data in the next round.
[0037] S102, obtain initial data in a to-be-processed data table, take the initial data corresponding to the number of processing arrays as current to-be-processed data, sequentially place the current to-be-processed data in each processing array, perform constraint calculation on each current to-be-processed data in parallel through the multiple processing arrays, obtain corresponding current incremental data, obtain current updated data according to the current to-be-processed data and the current incremental data, update the to-be-processed data table according to the current updated data, and determine the current to-be-processed data, the current incremental data and the current updated data as historical to-be-processed data, historical incremental data and historical updated data.
[0038] In the embodiment, the to-be-processed data table can be understood as a table composed of multiple to-be-processed data. Before iteration starts, the data in the to-be-processed data table are all initial data. After one round of iteration ends and before the last round of iteration ends, the data in the to-be-processed data table include initial data and updated data. After the last round of iteration ends, the data in the to-be-processed data table are all updated data. The initial data can be understood as original data. The updated data can be understood as more optimized data obtained by calculating constraint after the initial data or the updated data of the previous round. The current to-be-processed data can be understood as data placed in the processing array in the current iteration. In the first iteration, the current to-be-processed data are initial data. In subsequent iterations, the current to-be-processed data can be initial data or updated data. The current incremental data can be understood as change information obtained by calculating constraint on the current to-be-processed data in the current iteration. It can be understood that, in the scenario of calculating constraint based on molecular dynamics to determine particle force, the current incremental data is negative. The current updated data can be understood as data obtained by optimizing the current to-be-processed data with the current incremental data. It can be understood that the initial data, the to-be-processed data and the updated data all represent the position and speed of an atom. After one round of iteration ends, the current to-be-processed data are determined as historical to-be-processed data, the current incremental data are determined as historical incremental data, and the current updated data are determined as historical updated data.
[0039] Specifically, a to-be-processed data table in the memory is accessed, and in the first iteration, initial data corresponding to the number of lanes of the processing array is sequentially obtained from the to-be-processed data table and placed in the corresponding processing array as the current to-be-processed data. The constraint calculation of each current to-be-processed data is performed in parallel through the multi-lane processing array to obtain the current incremental data corresponding to each processing array. The sum of the current to-be-processed data and the current incremental data corresponding to each processing array is determined as the current updated data, and the to-be-processed data table is updated according to the current updated data, that is, the initial data placed in the processing array is replaced by the corresponding current updated data. After completing this iteration, the data in this iteration will be the historical data under the next iteration, that is, the current to-be-processed data is determined as the historical to-be-processed data, the current incremental data is determined as the historical incremental data, and the current updated data is determined as the historical updated data.
[0040] For example, there are 16 processing arrays currently existing, and initial data located at positions 1-16 is obtained (copied) from the current to-be-processed data table in the memory. The initial data at position 1 in the table is placed in the first processing array as the current to-be-processed data of the first processing array, and the other 15 initial data are placed in the corresponding processing array in the same way. After all 16 initial data are placed in the corresponding processing array as the current to-be-processed data, the 16 processing arrays are synchronized to perform constraint calculation on the current to-be-processed data to obtain the current incremental data for each current to-be-processed data. The sum of the current to-be-processed data and the current incremental data is taken to obtain the current updated data, which is placed in the corresponding position in the to-be-processed data table to replace the original initial data, thereby completing the update of the to-be-processed data table. For example, the initial data a at position 1 is calculated as the current to-be-processed data of the first processing array to obtain the corresponding current incremental data b, and further obtain the corresponding current updated data c (c = a + b), and then c is placed in the first position in the to-be-processed data table to replace the original initial data a.
[0041] It can be understood that each initial data in the to-be-processed data table has a corresponding processing array, and it can also be understood that each processing array has a corresponding initial data set. The identifier of the initial data in the set can be represented 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] For example, the data table to be processed includes 50 initial data, and there are 16 processing arrays in total. The first 16 initial data correspond to the first to sixteenth processing arrays in turn. Taking the second processing array as an example, the first initial data corresponding to the second processing array in the data table to be processed is the second initial data (2+0*16), and the second initial data corresponding to the second processing array in the data table to be processed is the eighteenth initial data (2+1*16). In this way, the second processing array corresponds to the second, eighteenth, thirty-fourth and fiftieth initial data in the data table to be processed.
[0043] It can be understood that the number of initial data in the data table to be processed is only described as an example and does not represent the actual number of initial data. The number of initial data is not limited in the embodiment.
[0044] In S103, the historical update data is divided into qualified data and unqualified data based on a data qualification condition. The initial data for supplementing the qualified data is taken from the data table to be processed as current data to be processed, and is placed in the processing array corresponding to the qualified data. The historical update data as unqualified data is placed in the processing array corresponding to the unqualified data.
[0045] In the embodiment, the data qualification condition can be understood as a condition for judging whether the update data calculated in the last iteration is qualified before the next iteration starts. The qualified data can be understood as the historical update data satisfying the data qualification condition, and the unqualified data can be understood as the historical update data not satisfying the data qualification condition. The initial data for supplementing can be understood as the initial data with the smallest identifier in the data to be processed corresponding to the processing array in which the qualified data is calculated, except for the initial data corresponding to the qualified data. Taking the above example, if the qualified data corresponds to the second initial data, that is, the qualified data is the data calculated by one or more iterations of the second initial data, the eighteenth initial data is determined as the initial data for supplementing in the current iteration as the current data to be processed.
[0046] Specifically, the historical update data is stored in the register in addition to being stored in the memory for updating the storage, and the historical update data obtained in the last iteration is obtained from the register to determine whether the historical update data meets the data qualification condition. For qualified data, the backfill data of the qualified data in the to-be-processed data table is determined (for example, according to the example described above, if the processing array has 16 channels, the data of the second channel is qualified, and the to-be-processed data table also corresponds to the second position, and the backfill data is the eighteenth position), and the backfill data of the qualified data is taken as the current to-be-processed data of the current iteration and is placed (copied) in the corresponding processing array (for example, according to the example described above, the eighteenth initial data is placed in the second processing array as the current to-be-processed data). For unqualified data, the identifier of the unqualified data in the to-be-processed data table is determined, the historical update data placed in the position corresponding to the identifier is taken, and the historical update data is placed (copied) as the current to-be-processed data of the current iteration (that is, if the historical update data calculated in the last iteration is unqualified data, the historical update data itself is taken as the current to-be-processed data of the current iteration). For example, because the historical update data of the iteration is placed back in the corresponding position of the to-be-processed data table after each iteration, the third processing array places the historical update data in the third position of the to-be-processed data table after the historical update data is calculated in the last iteration, and replaces the initial data originally in the third position. Before the next iteration starts, it is determined whether the historical update data is qualified data. If the historical update data is unqualified data, the historical update data is taken (copied) from the third position of the to-be-processed data table as the current to-be-processed data of the third processing array. It can be understood that, according to the example described above, the second processing array processes the initial data with the identifier 18 in the current iteration, and the third processing array continues to process the update data with the identifier 3.
[0047] S104, return to re-pass the constraint effect calculation of each current to-be-processed data through the multi-channel processing array in parallel to obtain corresponding current incremental data, obtain current update data according to the current to-be-processed data, the current incremental data and the incremental coefficient, and update the to-be-processed data table according to the current update data. Iteration is performed until the initial data in the to-be-processed data table is calculated completely.
[0048] In the current iteration, the current to-be-processed data of the current iteration is determined, the constraint effect calculation of each current to-be-processed data is performed through the multi-channel processing array in parallel to obtain corresponding current incremental data, and the difference from the first iteration is that the incremental coefficient is required to participate in the calculation of the current update data in the process of the second iteration to the last iteration, so as to avoid the problem that the qualified data of the current channel becomes unqualified data in the iteration process of accompanying other processing arrays that are not completely calculated.
[0049] After obtaining the current incremental data, obtaining the current update data according to the current to-be-processed data, the current incremental data and the incremental coefficient, and updating the to-be-processed data table according to the current update data, the current to-be-processed data, the current incremental data and the current update data are continuously determined as the historical to-be-processed data, the historical incremental data and the historical update data, and then step S103 is continuously executed, and then the calculation of the constraint effect of each current to-be-processed data by the multi-path processing array is re-performed in parallel, and the corresponding current incremental data is obtained again… until the current update data corresponding to the last current to-be-processed data of the last processing array is qualified data, it is determined that the iteration is completed, or it can also be understood that all the initial data in the to-be-processed data table have been calculated and completed, each update data of the to-be-processed data table is qualified data, it is determined that the iteration is completed, and the calculation process is ended.
[0050] Molecular dynamics (MD) is a method of simulating the motion of individual particles in a large particle collective system (such as a solid, gas or liquid). In the context of molecular dynamics, the embodiments of the present application provide a method of calculating the constraint effect of particles by parallel iteration of a multi-path processing array in a processor to obtain the final particle motion result.
[0051] The data processing method of the embodiment comprises the following steps: determining an increment coefficient of each processing array in a multi-path processing array, wherein the increment coefficient is a coefficient that changes based on an iteration result; obtaining initial data in a to-be-processed data table, taking a number of initial data corresponding to the number of paths of the processing array as current to-be-processed data, and sequentially placing the current to-be-processed data into each processing array; performing constraint calculation on each current to-be-processed data in parallel through the multi-path processing array to obtain corresponding current increment data; obtaining current update data based on the current to-be-processed data and the current increment data, and updating the to-be-processed data table based on the current update data; determining the current to-be-processed data, the current increment data and the current update data as historical to-be-processed data, historical increment data and historical update data respectively; dividing the historical update data into qualified data and unqualified data based on a data qualification condition, taking the initial data of the qualified data as the current to-be-processed data from the to-be-processed data table, and placing the current to-be-processed data into the processing array corresponding to the qualified data; taking the historical update data as the unqualified data, and placing the unqualified data into the processing array corresponding to the unqualified data; returning to perform constraint calculation on each current to-be-processed data in parallel through the multi-path processing array to obtain corresponding current increment data, obtaining current update data based on the current to-be-processed data, the current increment data and the increment coefficient, and updating the to-be-processed data table based on the current update data, and iteratively circulating until the initial data in the to-be-processed data table is calculated completely. The above technical solution realizes multi-round parallel processing of to-be-processed data based on a multi-path processing array, improves the utilization rate of a processing device, and realizes high-speed processing and efficient processing of data. The setting of the increment coefficient avoids the problem of accompanying running errors of qualified data, and guarantees the consistency and correctness of data processing.
[0052] As a first optional embodiment of the present embodiment, the increment coefficient of each processing array in the multi-path processing array is determined, comprising:
[0053] In S1011, the to-be-processed data table stored in the memory is accessed, the identification and the number of each initial data in the to-be-processed data table are determined, the correspondence between each initial data and each processing array is determined based on the identification, the number of the initial data and the number of paths of the processing array, and the to-be-processed identification of each processing array is determined.
[0054] In the present embodiment, the identification of the initial data can be understood as the position of the initial data, for example, the arrangement bit number of the initial data in the to-be-processed data table. The number of the initial data is consistent with the value represented by the identification of the last initial data in the to-be-processed data table. The to-be-processed identification can be understood as the number of initial data corresponding to each processing array that needs to be processed.
[0055] Specifically, a to-be-processed data table stored in the memory is accessed to determine the identification and quantity of each initial data in the to-be-processed data table, the quantity of the initial data is divided by the number of processing arrays, if the result is an integer, the integer is determined as the to-be-processed identification of each processing array (for example, 64 initial data, 64 / 16, the to-be-processed identification of each processing array is 4), if the result contains an integer and a remainder, the to-be-processed identification of the remainder processing array is determined as the integer+1 in sequence, and the to-be-processed identification of the other processing arrays is determined as the integer (for example, 50 initial data, 50 / 16, the integer obtained by calculation is 3, and the remainder is 2, the to-be-processed identification of the first 2 processing arrays is 4, and the to-be-processed identification of the last 14 processing arrays is 3). Each initial data is matched with a corresponding processing array in sequence according to the identification, for example, the first 16 initial data are matched with the first 16 processing arrays, the 17th-32nd initial data are matched with the first 16 processing arrays, and the 33rd-48th initial data are matched with the first 16 processing arrays…
[0056] For example, the to-be-processed data table includes 50 initial data, and there are 16 processing arrays, the initial data corresponding to the first processing array is the first, 17th, 33rd and 49th, and thus the to-be-processed identification of the first processing array is determined as 4; the initial data corresponding to the second processing array is the second, 18th, 34th and 50th, and thus the to-be-processed identification of the second processing array is determined as 4; the initial data corresponding to the third processing array is the third, 20th and 36th, and thus the to-be-processed identification of the third processing array is determined as 3; the to-be-processed identification of the subsequent processing array is also 3, and the determination method is the same as above, which will not be described here.
[0057] S1012, the processed identification of each processing array is determined, and the processed identification corresponding to the first round of iteration is set to zero.
[0058] When the processed identification is set, the processed identification is set to 0, and the processed identification is also 0 in the first round of iteration, in the subsequent iteration process, if the iteration result is that the historical update data is qualified data, the processed identification+1, until the processed identification is equal to the to-be-processed identification.
[0059] S1013, if the to-be-processed identification and the processed identification are equal, the increment coefficient is determined as zero, otherwise, the increment coefficient is determined as one.
[0060] In the embodiment, if the to-be-processed identifier and the processed identifier are equal, it indicates that the lane processing array has completed the calculation of all initial data (to-be-processed data) corresponding to the lane processing array, but if there is at least one column in other lane processing arrays that has not completed the calculation of all initial data, the lane processing array may perform the next round of iteration together with other lane processing arrays. At this time, in order to avoid the last qualified data being calculated from becoming unqualified data through calculation in the subsequent iteration calculation process, the increment coefficient of the lane processing array is set to 0. The increment data calculated in each round of iteration calculation is multiplied by the increment coefficient 0, and then added to the to-be-processed data, so that the updated data obtained is still the to-be-processed data itself, and no change is generated, thereby avoiding the risk that the to-be-processed data becomes unqualified data from qualified data. If the to-be-processed identifier and the processed identifier are not equal, it indicates that the lane processing array has not completed the calculation of all initial data (to-be-processed data) corresponding to the lane processing array. At this time, the lane processing array still needs to apply the increment data to obtain the latest updated data, and therefore the increment coefficient of the lane processing array is set to 1. The increment data calculated in each round of iteration calculation is multiplied by the increment coefficient 1, and then added to the to-be-processed data, so that the updated data obtained is constrained.
[0061] As a second optional embodiment of the embodiment, the current updated data is obtained according to the current to-be-processed data and the current increment data, and includes:
[0062] S1021, obtaining a sum value of the current to-be-processed data and the current increment data to obtain the current updated data.
[0063] In the embodiment, the sum value of the current to-be-processed data a and the current increment data b is obtained to obtain the current updated data c (c=a+b).
[0064] S1022, storing the current updated data in the associated register.
[0065] In order to quickly judge whether the updated data is qualified or not, after each round of iteration calculation is completed, the current updated data obtained by calculation is stored in the associated register.
[0066] As a third optional embodiment of the embodiment, the historical updated data is divided into qualified data and unqualified data based on a data qualification condition, and includes:
[0067] S1031, obtaining the time stamp distance from the last stored historical updated data from the register.
[0068] In the embodiment, the historical updated data is stored once in each round of iteration calculation. Before the current round of iteration starts, the time stamp distance from the last stored historical updated data is obtained from the register, that is, the updated data determined by the last round of iteration calculation.
[0069] S1032, determine the atomic force based on the atomic position and the atomic velocity pointed by the historical update data.
[0070] In this embodiment, the atomic force can be understood as the particle interaction force of the atom pointed by the initial data corresponding to the historical update data.
[0071] Specifically, the molecular dynamics has its specific force calculation formula, and the atomic position and the atomic velocity pointed by the historical update data are taken as the input of the calculation formula to obtain the atomic force of the atom output by the formula.
[0072] S1033, compare the atomic force with the preset force, if the atomic force is less 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 atomic force.
[0074] Specifically, since each update data is calculated based on the constraint force, the update data of the initial data is a smaller and smaller value in the process of multiple iterations, and the set force is the maximum expected value of the atomic force. Therefore, the atomic force corresponding to the historical update data obtained in each iteration is compared with the preset force, if the atomic force is less than the preset force, it is indicated that the atomic force determined based on the historical update data reaches the expected value, and the historical update data is determined as qualified data; if the atomic force is greater than the preset force, it is indicated that the atomic force determined based on the historical update data still does not reach the expected value, and iteration constraint needs to be continued, and the historical update data is determined as unqualified data.
[0075] As a fourth optional embodiment of this embodiment, after the historical update data is divided into qualified data and unqualified data, it further includes:
[0076] S1034, increase the value of the processed identifier of the processing array corresponding to the qualified data by one.
[0077] In this embodiment, after the historical update data is divided into qualified data and unqualified data, the value of the processed identifier of the processing array corresponding to the qualified data is increased by one, so as to represent that the processing array has completed the calculation of a certain initial data corresponding thereto.
[0078] As a fifth optional embodiment of this embodiment, the current update data is obtained according to the current to-be-processed data, the current incremental data and the incremental coefficient, and includes:
[0079] S1041, take the product of the current incremental data and the current incremental coefficient to obtain the target incremental data.
[0080] In the embodiment, the current increment coefficient can be understood as an increment coefficient corresponding to each processing array in the current iteration process. The target increment data can be understood as increment data corresponding to the constraint requirement,
[0081] Specifically, for each processing array, if the processed identifier and the to-be-processed identifier of the processing array are equal, it is determined that the processing array does not have a constraint requirement, the current increment coefficient of the processing array is 0, and the target increment data obtained by multiplying the current increment coefficient and the current increment data is also 0; if the processed identifier and the to-be-processed identifier of the processing array are not equal, it is determined that the processing array still has a constraint requirement, the current increment coefficient of the processing array is 1, and the target increment data obtained by multiplying the current increment coefficient and the current increment data is the current increment data itself.
[0082] S1042, obtaining a sum of the target increment data and the current to-be-processed data to obtain current update data.
[0083] In the embodiment, the sum of the target increment data and the current to-be-processed data is obtained to obtain the current update data. If the target increment data is the current increment data itself, the current update data after the current constraint is calculated; if the target increment data is 0, the current update data is still the current to-be-processed data itself, which avoids the problem that the current to-be-processed data as qualified data appears an error in the accompanying running process and becomes unqualified data, and guarantees the consistency and correctness of data processing.
[0084] Embodiment two
[0085] Figure 2 is a structural schematic diagram of a data processing device provided by the embodiment two of the application. As shown in the figure, the device comprises: Figure 2
[0086] An increment coefficient determination module 21 is configured to determine an increment coefficient of each processing array in a plurality of processing arrays, wherein the increment coefficient is a coefficient that changes based on an iteration result.
[0087] A first round iteration module 22 is configured to obtain initial data in a to-be-processed data table, to place a number of initial data corresponding to a number of processing arrays as current to-be-processed data in the processing arrays in sequence, to perform constraint calculation on each current to-be-processed data in parallel through the plurality of processing arrays to obtain corresponding current increment data, to obtain current update data based on the current to-be-processed data and the current increment data, and to update the to-be-processed data table based on the current update data, to determine the current to-be-processed data, the current increment data and the current update data as historical to-be-processed data, historical increment data and historical update data correspondingly.
[0088] An iteration result determining module 23 is configured to divide the historical update data into qualified data and unqualified data based on a data qualification condition, take the replacement initial data of the qualified data from the to-be-processed data table as current to-be-processed data, and place the current to-be-processed data in a processing array corresponding to the qualified data, take the historical update data as the unqualified data, and place the unqualified data in a processing array corresponding to the unqualified data;
[0089] A continuous iteration module 24 is configured to return to the constraint effect calculation of each current to-be-processed data through the multiple processing arrays in parallel, obtain corresponding current incremental data, obtain current update data based on the current to-be-processed data, the current incremental data and the incremental coefficient, and update the to-be-processed data table based on the current update data, and the iteration is looped until the initial data in the to-be-processed data table is calculated completely.
[0090] The data processing device adopted in the technical solution can realize multiple rounds of parallel processing of to-be-processed data, improve the utilization rate of processing equipment, realize high-speed and efficient processing of data, and guarantee the correctness of data processing.
[0091] Optionally, the incremental coefficient determining module 21 is specifically configured to:
[0092] access the to-be-processed data table stored in the memory, determine the identity and quantity of each initial data in the to-be-processed data table, determine the correspondence between each initial data and each processing array based on the identity, quantity and number of processing arrays of the initial data, and determine the to-be-processed identity of each processing array;
[0093] determine the processed identity of each processing array, and set the corresponding processed identity to zero in the first round of iteration;
[0094] if the to-be-processed identity is equal to the processed identity, it is determined that the incremental coefficient is zero, otherwise, it is determined that the incremental coefficient is one.
[0095] Optionally, the first round of iteration module 22 is specifically configured to:
[0096] obtain the sum of the current to-be-processed data and the current incremental data to obtain current update data;
[0097] store the current update data in the associated register.
[0098] Optionally, the iteration result determining module 23 is specifically configured to:
[0099] take the time stamp from the register closest to the historical update data;
[0100] determine the atomic force based on the atomic position and atomic speed pointed to by the historical update data.
[0101] The atomic force is compared with a preset force, if the atomic force is less than the preset force, the historical update data is determined as qualified data, otherwise, the historical update data is determined as unqualified data.
[0102] Optionally, the iteration result determining module 23 is further configured to:
[0103] After the historical update data is divided into qualified data and unqualified data, the value of the processed identifier of the processing array corresponding to the qualified data is increased by one.
[0104] Optionally, the iteration continuing module 24 is specifically configured to:
[0105] The product of the current incremental data and the current incremental coefficient is taken to obtain target incremental data;
[0106] The sum of the target incremental data and the current to-be-processed data is taken to obtain current update data.
[0107] The data processing apparatus provided by the embodiments of the present application can execute the data processing method provided by any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.
[0108] Embodiment three
[0109] Figure 3 is a structural schematic diagram of an electronic device provided by Embodiment three of the present application. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, 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 implementations described and / or claimed in this document.
[0110] As Figure 3As shown, the electronic device 30 includes at least one processor 31, and a memory, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., connected in communication with the at least one processor 31, where 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 is executable by the 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 loaded into the random access memory (RAM) 33 from the storage unit 38. 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 plurality 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, a speaker, etc., a storage unit 38, such as a magnetic 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 can be various general and / or special-purpose processing components having 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 special-purpose 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 various methods and processes described above, such as a data processing method.
[0113] In some embodiments, the data processing method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 38. In some embodiments, part or all of the computer program can be loaded and / or installed onto 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 can be performed. Alternatively, in other embodiments, the processor 31 can be configured to perform the data processing method by any other appropriate means, such as by means of firmware.
[0114] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0115] Computer programs used to implement the processes of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program, when executed, can cause instructions defined in the flow charts and / or block diagrams to be implemented. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package and partially on a remote machine or entirely on a remote machine or server.
[0116] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0117] To provide for interaction with a user, the systems and techniques described here can 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 a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, 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, speech, or tactile input.
[0118] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can 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] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can 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 large management difficulty and weak business scalability in traditional physical host and VPS service.
[0120] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be executed in parallel, executed in sequence, or executed in a different order, as long as the desired results of the present disclosure are achieved, and the present disclosure is not limited herein.
[0121] The specific embodiments described above are not intended to be limiting, and persons skilled in the art will appreciate that various modifications, combinations, sub-combinations and alternatives can be made to the specific embodiments without departing from the spirit and principles of the disclosure. Accordingly, the disclosure is not limited to the specific embodiments described above, but only by the scope of the appended claims.
Claims
1. A data processing method, characterized by, The method comprises the steps of: determining an increment coefficient of each processing array in the multi-path processing array, the increment coefficient being a coefficient that changes based on iteration results; obtaining initial data in a data table to be processed, and placing initial data corresponding to the number of paths of the processing array as current data to be processed into each processing array in sequence, performing constraint calculation on each current data to be processed in parallel through the multi-path processing array to obtain corresponding current increment data, obtaining current update data based on the current data to be processed and the current increment data, and updating the data table to be processed based on the current update data, and determining the current data to be processed, the current increment data and the current update data as historical data to be processed, historical increment data and historical update data respectively; based on a data eligibility condition, dividing the historical update data into eligible data and unqualified data, taking the initial data of the eligible data from the data table to be processed as the current data to be processed, and placing the data into the processing array corresponding to the eligible data, and taking the historical update data as the unqualified data and placing the data into the processing array corresponding to the unqualified data; returning to performing constraint calculation on each current data to be processed in parallel through the multi-path processing array to obtain corresponding current increment data, obtaining current update data based on the current data to be processed, the current increment data and the increment coefficient, and updating the data table to be processed based on the current update data, and iteratively circulating until the initial data in the data table to be processed is calculated and completed.
2. The method of claim 1, wherein, The method comprises the steps of: accessing the data table to be processed stored in the memory, determining the identification and quantity of each initial data in the data table to be processed, determining the correspondence between each initial data and each processing array based on the identification, quantity and number of paths of the processing array, and determining the processed identification of each processing array; determining the processed identification of each processing array, and setting the corresponding processed identification to zero in the first iteration; if the processed identification is equal to the processed identification, the increment coefficient is determined to be zero, otherwise the increment coefficient is determined to be one.
3. The method of claim 1, wherein, The method comprises the steps of: taking the sum of the current data to be processed and the current increment data to obtain the current update data; storing the current update data in the associated register.
4. The method of claim 1, wherein, The method comprises the steps of: taking the time stamp of the historical update data closest to the last storage from the register; determining the atomic force based on the atomic position and atomic speed pointed to by the historical update data; comparing the atomic force with the preset force, if the atomic force is less than the preset force, the historical update data is determined to be eligible data, otherwise the historical update data is determined to be unqualified data.
5. The method of claim 1, wherein, After dividing the historical update data into eligible data and unqualified data, the method further comprises the steps of: Increment the value of the processed identifier of the processing array corresponding to the qualified data by one.
6. The method of claim 1, wherein, The step of obtaining the current updated data based on the current data to be processed, the current incremental data, and the incremental coefficient includes: The target incremental data is obtained by multiplying the current incremental data and the current incremental coefficient. 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 apparatus, characterized by, include: An incremental coefficient determination module is used to determine the incremental coefficient of each processing array in a multi-processing array, wherein the incremental coefficient is a coefficient that changes based on the iteration results; The first iteration module is used to obtain the initial data in the data table to be processed, take the initial data corresponding to the number of paths of the processing array as the current data to be processed, put them into each processing array in sequence, calculate the constraint effect of each current data to be processed in parallel through multiple processing arrays, obtain the corresponding current incremental data, obtain the current updated data based on the current data to be processed and the current incremental data, update the data table to be processed based on 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. The iteration result determination module is used to divide the historical updated data into qualified data and unqualified data based on the data qualification conditions, take the supplementary initial data of the qualified data from the data table to be processed as the current data to be processed, and put it into the processing array corresponding to the qualified data; and take the historical updated data as the unqualified data and put it into the processing array corresponding to the unqualified data. The continuous iteration module is used to return and recalculate the constraint effect of each of the current data to be processed in parallel through the multi-processing array to obtain the corresponding current incremental data. Based on the current data to be processed, the current incremental data, and the incremental coefficient, the current updated data is obtained, and the data to be processed table is updated based on the current updated data. The iteration loop continues until the initial data in the data to be processed table has been traversed and calculated.
8. An electronic device, comprising: include: At least one processor, said processor comprising a multiprocessor array; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a data processing method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute a data processing method according to any one of claims 1-6.
10. A computer program product, characterised in that, The computer program product includes a computer program that, when executed by a processor, implements a data processing method according to any one of claims 1-6.
Citation Information
Patent Citations
Incremental data extraction processing method and device, computer equipment and medium
CN111309733A
Database synchronization method and terminal
CN118733673A