Data processing method and device, equipment, medium and product
By using a combination of serial loading and parallel loading for different rows of the array to be summed in the array, the problem of low efficiency of array ladder summing in the prior art is solved, and condensed matter is improved Computational efficiency of energy distribution.
Patent Information
- Application Number
- CN202411465815.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-11
AI Technical Summary
The prior art is less efficient when performing array step-wise summation, resulting in lower efficiency in determining the energy distribution of condensed matter.
By obtaining the array to be summed, the number of targets before the array is used to perform step-wise summation using serial loading and parallel accumulation for the remaining rows.
The efficiency of array step-like summing is improved, and the efficiency of determining the energy distribution of condensed matter is improved.
Smart Images

Figure CN119418831A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a data processing method, device, equipment, medium and product. Background Art
[0002] In materials science, the simulation and simulation of the interaction between different materials is a complex and critical task, involving multi-scale physical phenomena and complex computational processes. In these simulations, the step-wise summation of arrays is a common and important step, which is often used to determine the energy distribution of condensed matter. The step-wise summation takes the first number in the first row of the array as the result, the second row takes the sum of the first two numbers as the result, the third row takes the sum of the first three numbers as the result, and so on.
[0003] At present, for a row in an array that needs to be summed up in a step-wise manner, each data in the row that participates in the step-wise summation can be indexed out in a serial manner and then accumulated one by one. The efficiency of performing the step-wise summation of the array using this method is low, resulting in low efficiency in determining the energy distribution of condensed matter. Summary of the invention
[0004] The present invention provides a data processing method, device, equipment, medium and product, which can improve the efficiency of array step summation and further improve the efficiency of determining the energy distribution of condensed matter.
[0005] In a first aspect, an embodiment of the present invention provides a data processing method, including:
[0006] Acquire an array to be summed for determining energy distribution of condensed matter, wherein the array to be summed includes a plurality of intermediate result values of the energy distribution, and the dimension of the array to be summed is greater than a target number of data to be loaded in parallel by the electronic device;
[0007] For any row in the first target number of rows of the array to be summed, first data participating in the step-wise summation is indexed by serial loading and accumulated one by one to obtain a first summation result;
[0008] For any row of the array to be summed except the first target number of rows, the second data participating in the step-wise summation is read in a parallel loading manner, and the second summation result is obtained by combining parallel accumulation and serial accumulation.
[0009] In a second aspect, an embodiment of the present invention provides a data processing device, including:
[0010] An acquisition module, used for acquiring an array to be summed for determining the energy distribution of condensed matter, wherein the array to be summed includes a plurality of intermediate result values of the energy distribution, and the dimension of the array to be summed is greater than the target number of data loaded in parallel by the electronic device;
[0011] A first summing module is used to index the first data involved in the step-wise summing by serial loading for any row in the first target number of rows of the array to be summed and accumulate them one by one to obtain a first summing result;
[0012] The second summing module is used to read the second data involved in the step-wise summing by means of parallel loading for any row of the array to be summed except the first target number of rows, and obtain the second summing result by combining parallel accumulation and serial accumulation.
[0013] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] 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 the method according to the first aspect.
[0017] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method described in the first aspect when executed.
[0018] In a fifth aspect, an embodiment of the present invention provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the method as described in the first aspect is implemented.
[0019] The technical solution of the embodiment of the present invention is to index the first data involved in the step-by-step summation by serial loading for any row in the front target number of rows of the array to be summed for determining the energy distribution of condensed matter, and accumulate them one by one to obtain the first summation result; for any row of the array to be summed except the front target number of rows, read the second data involved in the step-by-step summation by parallel loading, and obtain the second summation result by combining parallel accumulation and serial accumulation. This solution is based on the target number of parallel loading data of the electronic device, and adopts different summation methods for different rows when performing step-by-step summation on the array to be summed. For rows other than the front target number of rows, parallel loading and parallel accumulation are used for summation, which can improve the efficiency of the step-by-step summation of the array and further improve the efficiency of determining the energy distribution of condensed matter.
[0020] 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
[0021] 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.
[0022] Figure 1 is a flow chart of a data processing method provided according to Embodiment 1 of the present invention;
[0023] Figure 2 is a flow chart of a data processing method provided according to Embodiment 2 of the present invention;
[0024] Figure 3 is a structural schematic diagram of a data processing device provided according to Embodiment 3 of the present invention;
[0025] Figure 4 It is a schematic diagram of the structure of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0026] 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.
[0027] It should be noted that the terms "first", "second", etc. in the present invention 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.
[0028] Embodiment 1
[0029] Figure 1 1 is a flow chart of a data processing method provided according to Embodiment 1 of the present invention. This embodiment is applicable to the case of performing stepwise summation on an array to be summed for determining the energy distribution of condensed matter. The method can be executed by a data processing device, which can be implemented in the form of software and / or hardware and integrated in an electronic device. Further, the electronic device includes but is not limited to: a computer, a laptop computer, a server, etc.
[0030] like Figure 1 As shown, the method includes:
[0031] S110, obtaining an array to be summed for determining energy distribution of condensed matter, wherein the array to be summed includes a plurality of intermediate result values of the energy distribution, and a dimension of the array to be summed is greater than a target number of data to be loaded in parallel by the electronic device.
[0032] The array to be summed may be an array to be summed in a step-wise manner. The array to be summed may include multiple values, each of which may be understood as an intermediate result value of the energy distribution of condensed matter during material calculation and simulation. By performing step-wise summation on the array to be summed, a more accurate energy distribution of condensed matter can be solved, which can then be applied to the simulation and emulation of the interaction between different materials.
[0033] The energy distribution of condensed matter can be understood as the energy distribution of atoms or molecules in a solid or liquid state, which is crucial to understanding the physical properties of materials. Stepwise summation can be understood as taking the first number in the first row of the array to be summed as the result, taking the sum of the first two numbers in the second row as the result, taking the sum of the first three numbers in the third row as the result, and so on.
[0034] In the embodiment of the present invention, the array to be summed is not limited, and can be any array used to determine the energy distribution of condensed matter and requiring step-wise summation. The array to be summed can be an array of x rows and y columns, where x and y can be the same, such as 5 rows and 5 columns, in which case the dimension of the array to be summed is 5.
[0035] In the embodiment of the present invention, the method for obtaining the array to be summed is not limited. For example, the array to be summed may be pre-stored in the memory of the electronic device, and the array to be summed may be obtained through the memory of the electronic device when step-wise summation is required; for example, the array to be summed may be downloaded through a web page; for example, the array to be summed that is triggered and input through an interface for realizing human-computer interaction may be obtained through the interface.
[0036] In an embodiment of the present invention, the electronic device can realize parallel loading of data through a built-in parallel electronic medium, and the electronic medium can load a target number of data in parallel at a time. The target number can be the number of data loaded in parallel by the electronic medium, which is not limited here. The dimension of the array to be summed is greater than the target number. For example, when the dimension of the array to be summed is 5, the target number can be 3.
[0037] S120 , for any row in the first target number of rows of the array to be summed, index the first data participating in the step-wise summation by serial loading and add them up one by one to obtain a first summation result.
[0038] For any row in the target number of rows before the array to be summed, the data in the row participating in the step-wise summation can be used as the first data corresponding to the row, and the results of accumulating the first data corresponding to the row one by one can be used as the first summation result corresponding to the row.
[0039] In one embodiment, the first data is the first second number of data in the row corresponding to the first data, and the second number is consistent with the step dimension of the row corresponding to the first data.
[0040] When performing a step-by-step summation on the array to be summed, for the first row of the array to be summed, the corresponding step dimension may be 1, and the corresponding first data may be the previous number of the first row (i.e., the first second number of data); for the second row of the array to be summed, the corresponding step dimension may be 2, and the corresponding first data may be the first two numbers of the second row (i.e., the first second number of data); for the third row of the array to be summed, the corresponding step dimension may be 3, and the corresponding first data may be the first three numbers of the third row (i.e., the first second number of data); and so on, each row in the first target number of rows has corresponding first data. Among them, the first second number of data in a row can be understood as the second number of data arranged in front of the row, such as the second number of data arranged in front from left to right.
[0041] In this step, the serial loading and accumulation of the first data are explained as follows: when the first data is one, the first data is loaded as the first summation result; when the first data is two, two first data are loaded respectively twice to obtain two first data, and the two loaded first data are accumulated to obtain the first summation result; when there are more than two first data, one first data is loaded each time, such as the first loading obtains the first data a1, the second loading obtains the first data a2, a1 and a2 are summed to obtain a1+a2, the third loading obtains the first data a3, a3 and a1+a2 are summed to obtain a1+a2+a3, and so on to obtain the first summation result.
[0042] S130 , for any row of the array to be summed except the first target number of rows, read the second data involved in the step-wise summation by means of parallel loading, and obtain a second summation result by combining parallel accumulation and serial accumulation.
[0043] For any row of the array to be summed except the first target number of rows, the data in the row participating in the step-by-step summation can be used as the second data corresponding to the row, and the results obtained by performing parallel accumulation and serial accumulation on the second data corresponding to the row can be used as the second summation result corresponding to the row.
[0044] For any row of the array to be summed except the first target number of rows, the method for determining the corresponding second data is basically the same as the method for determining the first data in S120, and is related to the step dimension corresponding to the row, and will not be repeated here. For example, if any row of the array to be summed except the first target number of rows is the fifth row of the array to be summed, the corresponding step dimension may be 5, and the corresponding second data may be the first five numbers of the fifth row.
[0045] In this step, for any row of the array to be summed except the first target number of rows, the second data is read by parallel loading. Specifically: based on the number of second data participating in the step-like summation in the row and the target number of data to be loaded in parallel by the electronic device at one time, the target number of times required for parallel loading is determined, and the determined target number of times should be able to complete the loading of the second data; within the target number of times, the electronic device loads the target number of data in parallel each time, and obtains the result of each parallel loading within the target number of times, and the result of each parallel loading can be that the target number of data are all second data, or part of the target number of data are second data and the remaining part is automatically filled with zero. Among them, the target number of times can be understood as the number of times required to read the second data by parallel loading.
[0046] When parallel loading is completed, the second summation result is obtained by combining parallel accumulation and serial accumulation. Specifically, the result of each parallel loading in the target number of times is used as a row in the array to be accumulated, and the data in the array to be accumulated is vertically accumulated in parallel, and then horizontally accumulated in serial based on the result of the vertical parallel accumulation to obtain the second summation result. The array to be accumulated can be an array for storing the result of each parallel loading in the target number of times.
[0047] The technical solution of the embodiment of the present invention is to index the first data involved in the step-by-step summation by serial loading for any row in the front target number of rows of the array to be summed for determining the energy distribution of condensed matter, and accumulate them one by one to obtain the first summation result; for any row of the array to be summed except the front target number of rows, read the second data involved in the step-by-step summation by parallel loading, and obtain the second summation result by combining parallel accumulation and serial accumulation. This solution is based on the target number of parallel loading data of the electronic device, and adopts different summation methods for different rows when performing step-by-step summation on the array to be summed. For rows other than the front target number of rows, parallel loading and parallel accumulation are used for summation, which can improve the efficiency of the step-by-step summation of the array and further improve the efficiency of determining the energy distribution of condensed matter.
[0048] Embodiment 2
[0049] Figure 2 1 is a flow chart of a data processing method provided according to the second embodiment of the present invention. This embodiment is based on the above-mentioned first embodiment, and for any row of the array to be summed except the first target number of rows, the second data involved in the step-by-step summation is read by parallel loading, and the second summation result is further refined by combining parallel accumulation and serial accumulation. Figure 2 As shown, the method includes:
[0050] S110, obtaining an array to be summed for determining energy distribution of condensed matter, wherein the array to be summed includes a plurality of intermediate result values of the energy distribution, and a dimension of the array to be summed is greater than a target number of data to be loaded in parallel by the electronic device.
[0051] S120 , for any row in the first target number of rows of the array to be summed, index the first data participating in the step-wise summation by serial loading and add them up one by one to obtain a first summation result.
[0052] S131. Take any row of the array to be summed except the first target number of rows as a row to be summed, and determine a target number of times required for parallel loading based on the row to be summed.
[0053] The row to be summed may be any row of the array to be summed except the first target number of rows. The target number of times required for parallel loading of the row to be summed may be determined based on the number of second data participating in the step-wise summation in the row to be summed, i.e., the step dimension corresponding to the row to be summed, and the target number of data to be loaded in parallel by the electronic device at one time.
[0054] In one embodiment, determining a target number of times required for parallel loading based on the rows to be summed includes:
[0055] The target number of times is determined based on rounding up the ratio of the step dimension corresponding to the row to be summed to the target number.
[0056] The ratio of the step dimension to the target number is rounded up to determine the target number, and the determined target number can ensure that the second data corresponding to the row to be summed is loaded. Exemplarily, the row to be summed is the fifth row of the array to be summed, and its corresponding step dimension is 5, the target number is 3, and the target number is 2.
[0057] S132. Read the second data participating in the step-wise summation in the row to be summed based on the target number of times and the target quantity in a parallel loading manner to obtain the result of each parallel loading within the target number of times.
[0058] In this step, based on the row to be summed, the electronic device loads the target number of data in parallel each time, and the data loaded this time will not be loaded again, and the result of each parallel loading in the target number of times is obtained by multiple loadings until the target number of times is reached. Among them, if the number of loadings is less than the target number of times, the result of each parallel loading can be that the target number of data are all the second data corresponding to the row to be summed; if the number of loadings is equal to the target number of times, the result of parallel loading can be that the target number of data includes the second data in the row to be summed that has not been loaded, and the remaining part is automatically filled with zeros.
[0059] In one embodiment, by means of parallel loading, the second data participating in the step-wise summation in the to-be-summed row is read based on the target number of times and the target quantity, and the result of each parallel loading in the target number of times is obtained, including:
[0060] Starting from the starting position of the row to be summed, the target number of data is loaded in parallel each time as the second data, and the result of the parallel loading is obtained, until the number of parallel loadings reaches the target number minus one;
[0061] Continue to load the first number of data as the second data, and automatically fill in zeros to the target number of data based on the continued loading, to obtain the result of the target number of parallel loadings; wherein the first number is the remainder corresponding to the ratio of the step dimension corresponding to the row to be summed and the target number.
[0062] The starting position of the row to be summed may be the position where data starts to be loaded in the row to be summed. For example, when data is loaded from left to right, the starting position may be the position where the leftmost data in the row to be summed is located.
[0063] Starting from the starting position of the row to be summed, data is loaded in parallel, which can be divided into the following two cases:
[0064] When the number of loadings is less than the target number, that is, when the number of loadings is from the first time to the target number minus one, the target number of data is loaded in parallel each time as the second data to obtain the result of the current parallel loading. The target number of data loaded in parallel each time can be the data from the z*(k-1)+1th column to the z*kth column in the row to be summed, z is the target number, and k is the number of parallel loadings.
[0065] For the case where the number of loadings is equal to the target number, that is, the case of parallel loading for the target number, the first number of data is continuously loaded as the second data based on the historical loading, and then zeros are automatically added to make the number of loaded data reach the target number, to obtain the result of parallel loading for the target number. The first number is the remainder corresponding to the ratio of the step dimension corresponding to the row to be summed and the target number, and the first number of data to be loaded can be the data from the z*(m-1)+1th column to the nth column in the row to be summed, z is the target number, m is the target number, and n is the step dimension corresponding to the row to be summed.
[0066] S133: Determine an array to be accumulated, wherein any row in the array to be accumulated indicates a result of a parallel load in the target number of times.
[0067] In this step, the result of each parallel loading in the target number of times may be stored in the array to be accumulated, and each row in the array to be accumulated is the result of one parallel loading in the target number of times.
[0068] S134, summing the array to be accumulated by combining parallel accumulation and serial accumulation to obtain a second summation result corresponding to the row to be summed.
[0069] In this step, the data in the array to be accumulated are accumulated in parallel in the vertical direction, and based on the result of the vertical parallel accumulation, they are accumulated in series in the horizontal direction to obtain a second summation result.
[0070] In one embodiment, the array to be accumulated is summed by combining parallel accumulation and serial accumulation to obtain a second summation result corresponding to the row to be summed, including:
[0071] Performing longitudinal summation of the data in the array to be accumulated by parallel accumulation to obtain the target number of longitudinal accumulation results;
[0072] The target number of vertical accumulation results are horizontally summed in a serial accumulation manner to obtain a second summation result corresponding to the row to be summed.
[0073] Exemplarily, if the first line in the array to be accumulated is [b1, b2, b3], the second line is [b4, b5, b6], and the third line is [b7, 0, 0], then the data in the array to be accumulated are summed in parallel vertically, and the target number of vertical accumulation results obtained in parallel are c1 = b1 + b4 + b7, c2 = b2 + b5 + 0, and c3 = b3 + b6 + 0. The vertical accumulation results are summed horizontally by serial accumulation, that is, the vertical accumulation results c1 and c2 are read respectively, c1 and c2 are summed to obtain c1 + c2, and then the vertical accumulation result c3 is read, c3 and c1 + c2 are summed to obtain c1 + c2 + c3, that is, the second summation result is obtained.
[0074] The technical solution of the embodiment of the present invention is to read the second data involved in the step-by-step summation in any row of the array to be summed except the first target number of rows by parallel loading, and automatically fill in zeros when the number of second data is less than the target number during loading, and then obtain the step-by-step summation result based on the loading result combined with parallel accumulation and serial accumulation. The advantage of this arrangement is that for rows whose corresponding step dimensions are not integer multiples of the target number, step-by-step summation can also be performed quickly, which can improve the efficiency of the step-by-step summation of the array and further improve the efficiency of determining the energy distribution of condensed matter.
[0075] Embodiment 3
[0076] Figure 3 is a schematic diagram of the structure of a data processing device provided according to the third embodiment of the present invention. This embodiment is applicable to the case where a stepwise summation is performed on an array to be summed for determining the energy distribution of condensed matter. Figure 3 As shown, the specific structure of the device includes:
[0077] An acquisition module 31 is used to acquire an array to be summed for determining the energy distribution of condensed matter, wherein the array to be summed includes a plurality of intermediate result values of the energy distribution, and the dimension of the array to be summed is greater than the target number of data loaded in parallel by the electronic device;
[0078] A first summing module 32 is used to index the first data involved in the step-wise summing by serial loading for any row in the first target number of rows of the array to be summed and accumulate them one by one to obtain a first summing result;
[0079] The second summing module 33 is used to read the second data involved in the step-wise summing by means of parallel loading for any row of the array to be summed except the first target number of rows, and obtain the second summing result by combining parallel accumulation and serial accumulation.
[0080] The data processing device provided in this embodiment obtains an array to be summed for determining the energy distribution of condensed matter through an acquisition module, wherein the array to be summed includes multiple intermediate result values of the energy distribution, and the dimension of the array to be summed is greater than the target number of data loaded in parallel by the electronic device; through a first summing module, for any row in the first target number of rows of the array to be summed, the first data participating in the step-by-step summation is indexed by serial loading and accumulated one by one to obtain a first summing result; through a second summing module, for any row of the array to be summed except the first target number of rows, the second data participating in the step-by-step summation is read by parallel loading, and the second summing result is obtained by combining parallel accumulation and serial accumulation. This scheme is based on the target number of data loaded in parallel by the electronic device, and different summing methods are used for different rows when performing step-by-step summation on the array to be summed. For rows other than the first target number of rows, parallel loading and parallel accumulation are used for summation, which can improve the efficiency of step-by-step summation of the array and further improve the efficiency of determining the energy distribution of condensed matter.
[0081] Furthermore, the second summing module 33 includes:
[0082] A target number determination module is used to take any row of the to-be-summed array except the first target number of rows as the to-be-summed row, and determine the target number of times required for parallel loading based on the to-be-summed row;
[0083] A loading module, configured to read the second data participating in the step-wise summation in the to-be-summed row based on the target number of times and the target quantity by means of parallel loading, and obtain the result of each parallel loading within the target number of times;
[0084] A module for determining an array to be accumulated, used for determining an array to be accumulated, wherein any row in the array to be accumulated indicates a result of a parallel loading in the target number of times;
[0085] The accumulation module is used to sum the array to be accumulated by combining parallel accumulation and serial accumulation to obtain a second summation result corresponding to the row to be summed.
[0086] Furthermore, the target number determination module is specifically used for:
[0087] The target number of times is determined based on rounding up the ratio of the step dimension corresponding to the row to be summed to the target number.
[0088] Furthermore, the loading module is specifically used for:
[0089] Starting from the starting position of the row to be summed, the target number of data is loaded in parallel each time as the second data, and the result of the parallel loading is obtained, until the number of parallel loadings reaches the target number minus one;
[0090] Continue to load the first number of data as the second data, and automatically fill in zeros to the target number of data based on the continued loading, to obtain the result of the target number of parallel loadings; wherein the first number is the remainder corresponding to the ratio of the step dimension corresponding to the row to be summed and the target number.
[0091] Furthermore, the accumulation module is specifically used for:
[0092] Performing longitudinal summation of the data in the array to be accumulated by parallel accumulation to obtain the target number of longitudinal accumulation results;
[0093] The target number of vertical accumulation results are horizontally summed in a serial accumulation manner to obtain a second summation result corresponding to the row to be summed.
[0094] Furthermore, the first data is the first second number of data in the row corresponding to the first data, and the second number is consistent with the step dimension of the row corresponding to the first data.
[0095] 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.
[0096] Embodiment 4
[0097] Figure 4 Schematic diagram of the structure of the electronic device implementing the embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 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.
[0098] like Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0099] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0100] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 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 11 performs the various methods and processes described above, such as a data processing method.
[0101] 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 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the data processing method in any other appropriate manner (e.g., by means of firmware).
[0102] 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.
[0103] 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.
[0104] 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.
[0105] 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).
[0106] 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.
[0107] 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.
[0108] 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.
[0109] 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: Acquire an array to be summed for determining energy distribution of condensed matter, wherein the array to be summed includes a plurality of intermediate result values of the energy distribution, and the dimension of the array to be summed is greater than a target number of data to be loaded in parallel by the electronic device; For any row in the first target number of rows of the array to be summed, first data participating in the step-wise summation is indexed by serial loading and accumulated one by one to obtain a first summation result; For any row of the array to be summed except the first target number of rows, the second data participating in the step-wise summation is read in a parallel loading manner, and the second summation result is obtained by combining parallel accumulation and serial accumulation.
2. The method according to claim 1, characterized in that For any row of the array to be summed except the first target number of rows, second data involved in the step-wise summation is read in a parallel loading manner, and a second summation result is obtained by combining parallel accumulation and serial accumulation, including: Taking any row of the array to be summed except the first target number of rows as the row to be summed, and determining the target number of times required for parallel loading based on the row to be summed; Read the second data participating in the step-wise summation in the to-be-summed row based on the target number of times and the target quantity in a parallel loading manner, and obtain the result of each parallel loading within the target number of times; Determine an array to be accumulated, wherein any row in the array to be accumulated indicates a result of a parallel load in the target number of times; The array to be accumulated is summed by combining parallel accumulation and serial accumulation to obtain a second summation result corresponding to the row to be summed.
3. The method according to claim 2, characterized in that Determine the target number of parallel loads based on the rows to be summed, including: The target number of times is determined based on rounding up the ratio of the step dimension corresponding to the row to be summed to the target number.
4. The method according to claim 2, characterized in that: The method of parallel loading is to read the second data participating in the step-wise summation in the row to be summed based on the target number of times and the target quantity, and obtain the result of each parallel loading in the target number of times, including: Starting from the starting position of the row to be summed, the target number of data is loaded in parallel each time as the second data, and the result of the parallel loading is obtained, until the number of parallel loadings reaches the target number minus one; Continue to load the first number of data as the second data, and automatically fill in zeros to the target number of data based on the continued loading, to obtain the result of the target number of parallel loadings; wherein the first number is the remainder corresponding to the ratio of the step dimension corresponding to the row to be summed and the target number.
5. The method according to claim 2, characterized in that: Summing the array to be accumulated by combining parallel accumulation and serial accumulation to obtain a second summation result corresponding to the row to be summed, including: Performing longitudinal summation of the data in the array to be accumulated by parallel accumulation to obtain the target number of longitudinal accumulation results; The target number of vertical accumulation results are horizontally summed in a serial accumulation manner to obtain a second summation result corresponding to the row to be summed.
6. The method according to claim 1, characterized in that The first data is the first second number of data in the row corresponding to the first data, and the second number is consistent with the ladder dimension of the row corresponding to the first data.
7. A data processing device, characterized in that: include: An acquisition module, used for acquiring an array to be summed for determining the energy distribution of condensed matter, wherein the array to be summed includes a plurality of intermediate result values of the energy distribution, and the dimension of the array to be summed is greater than the target number of data loaded in parallel by the electronic device; A first summing module is used to index the first data involved in the step-wise summing by serial loading for any row in the first target number of rows of the array to be summed and accumulate them one by one to obtain a first summing result; The second summing module is used to read the second data involved in the step-wise summing by means of parallel loading for any row of the array to be summed except the first target number of rows, and obtain the second summing result by combining parallel accumulation and serial accumulation.
8. An electronic device, characterized in that: include: at least one processor; as well as 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 the 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 the 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, which, when executed by a processor, implements the method according to any one of claims 1 to 6.