Edge device simulation calculation method and device and electronic equipment

By dividing the linear equation system of triangular matrices into diagonal and off-diagonal blocks and executing preset calculation operations in parallel, the solution order is optimized, solving the problem of low solution efficiency in large-scale logistics simulation and achieving high-efficiency calculation results.

CN122046751AActive Publication Date: 2026-05-15北京大学长沙计算与数字经济研究院
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
北京大学长沙计算与数字经济研究院
Filing Date
2026-04-17
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In large-scale logistics simulation scenarios, the solution efficiency of linear equation systems of triangular matrices is too low, making it difficult to adapt to the requirements of the scenario.

Method used

The first simulation data matrix is ​​divided into multiple first simulation data matrix blocks, including diagonal blocks and off-diagonal blocks, and preset calculation operations are executed in parallel on the edge device. The calculation efficiency is improved by optimizing the decomposition and solution order of the diagonal and off-diagonal blocks.

Benefits of technology

It significantly improves the efficiency of solving linear equations of triangular matrices, especially in large-scale logistics simulation scenarios, where the computational efficiency can be improved by up to 48 times, solving the problem of low solution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122046751A_ABST
    Figure CN122046751A_ABST
Patent Text Reader

Abstract

The invention discloses an edge device simulation calculation method and device and electronic equipment, and relates to the field of electric digital data processing. The method comprises the following steps: dividing a first simulation data matrix into a plurality of first simulation data matrix blocks; determining a first simulation data matrix block corresponding to each task block in the task block set; second simulation data matrix blocks corresponding to the diagonal blocks in the second simulation data matrix are determined, the diagonal blocks and the second simulation data matrix blocks corresponding to the diagonal blocks execute preset calculation operation in parallel, and first solving results corresponding to the diagonal blocks are obtained; and calling the task block to execute a preset calculation operation in parallel according to the first solving result, the off-diagonal blocks and the second simulation data matrix to obtain a second solving result corresponding to each off-diagonal block. The technical problem that large-scale logistics simulation cannot be efficiently achieved due to the fact that the solving efficiency of a triangular matrix linear equation set in the related technology is low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic digital data processing, and more specifically, to an edge device simulation calculation method, apparatus, and electronic device. Background Technology

[0002] In related technologies, the solution of linear equations for triangular matrices in scenarios such as package asset simulation, robotic arm gripping and flipping still mainly relies on the direct substitution method (including forward and backward substitution). The problem with this method is that its solution efficiency is too low in large-scale logistics simulation scenarios, making it difficult to adapt to the requirements of the scenario.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This application provides an edge device simulation calculation method, apparatus, and electronic device to at least solve the technical problem that large-scale logistics simulation cannot be efficiently realized due to the low efficiency of solving linear equations of triangular matrices in related technologies.

[0005] According to one aspect of the embodiments of this application, an edge device simulation calculation method is provided, comprising: dividing a first simulation data matrix into a plurality of first simulation data matrix blocks, wherein the first simulation data matrix includes a lower triangular matrix or an upper triangular matrix, and the plurality of first simulation data matrix blocks include diagonal blocks and off-diagonal blocks, wherein the diagonal blocks are first simulation data matrix blocks passing through the diagonal of the first simulation data matrix, and the off-diagonal blocks are first simulation data matrix blocks other than the diagonal blocks; determining a set of task blocks in the edge device for performing a task of calculating a system of linear equations of a triangular matrix, and determining the first simulation data matrix block corresponding to each task block in the task block set, wherein each task block corresponds to at least one diagonal block; determining the first simulation data matrix block in a second simulation data matrix that corresponds to the diagonal block. The task block is called to perform a preset calculation operation in parallel on the diagonal blocks and the corresponding second simulation data matrix blocks, obtaining the first solution result for each diagonal block. The first solution result includes the elements in the third simulation data matrix corresponding to the diagonal blocks. The second simulation data matrix is ​​the right-hand side of the equation system obtained by matrix multiplication between the first and third simulation data matrices. After the first solution result for each diagonal block is determined, the task block is called to perform a preset calculation operation in parallel on the off-diagonal blocks and the second simulation data matrix based on the first solution result, obtaining the second solution result for each off-diagonal block. The second solution result includes the elements in the third simulation data matrix corresponding to the off-diagonal blocks.

[0006] Optionally, the task block is invoked to perform a preset calculation operation based on the second simulation data matrix and the diagonal block to obtain the first solution result corresponding to each diagonal block, including: for each diagonal block corresponding to the task block, dividing the diagonal block into multiple first sub-blocks and determining the thread in the task block corresponding to each first sub-block; determining the second sub-block corresponding to each first sub-block in the second simulation data matrix, wherein the threads corresponding to the first sub-block and the second sub-block are the same; invoking each thread in the task block to perform a preset calculation operation on the first sub-block and the second sub-block to obtain the first solution result.

[0007] Optionally, determining the thread in the task block corresponding to each first sub-block includes: dividing the multiple first sub-blocks in the diagonal block into multiple groups, wherein each group includes a row of first sub-blocks; determining the allocation order of the task blocks, and cyclically determining the group corresponding to each thread according to the allocation order, until all groups are allocated to the corresponding threads.

[0008] Optionally, determining the second simulation data matrix block corresponding to the diagonal block in the second simulation data matrix, and invoking the task block to perform preset calculation operations in parallel on the diagonal block and each of the corresponding second simulation data matrix blocks, includes: determining the second simulation data matrix block to be calculated with the diagonal block in the second simulation data matrix, wherein each diagonal block is calculated with a column of second simulation data matrix blocks in the second simulation data matrix; and invoking multiple threads in the task block to perform preset calculation operations in parallel on the diagonal block and the corresponding second simulation data matrix blocks.

[0009] Optionally, calling each thread in the task block to perform preset calculation operations on the first sub-block and the second sub-block to obtain the first solution result includes: determining the target sub-block located on the diagonal of the diagonal block among the multiple first sub-blocks; adding a barrier to each thread, wherein the barrier is used to instruct the thread to calculate the sub-blocks other than the target sub-block among the multiple first sub-blocks after all target sub-blocks have been calculated.

[0010] Optionally, edge devices include statically scheduled edge computing devices.

[0011] Optionally, after obtaining the first solution result corresponding to each diagonal block, the method further includes: storing the first solution result in local memory.

[0012] According to another aspect of the embodiments of this application, an edge device simulation computing apparatus is also provided, comprising: a first processing module, configured to divide a first simulation data matrix into a plurality of first simulation data matrix blocks, wherein the first simulation data matrix includes a lower triangular matrix or an upper triangular matrix, and the plurality of first simulation data matrix blocks include diagonal blocks and off-diagonal blocks, wherein the diagonal blocks are first simulation data matrix blocks passing through the diagonal of the first simulation data matrix, and the off-diagonal blocks are first simulation data matrix blocks other than the diagonal blocks; and a second processing module, configured to determine a set of task blocks in the edge device for performing a task of calculating a system of linear equations of a triangular matrix, and to determine the first simulation data matrix block corresponding to each task block in the set of task blocks, wherein each task block corresponds to a... One diagonal block is missing; the third processing module is used to call the task block to perform preset calculation operations based on the second simulation data matrix and the diagonal blocks, and obtain the first solution result corresponding to each diagonal block. The first solution result includes the elements in the third simulation data matrix corresponding to the diagonal blocks. The second simulation data matrix is ​​the right-hand side term of the equation system obtained by matrix multiplication between the first simulation data matrix and the third simulation data matrix; the fourth processing module is used to call the task block to perform preset calculation operations in parallel based on the first solution result, the off-diagonal blocks and the second simulation data matrix, after the first solution result corresponding to each diagonal block is determined, and obtain the second solution result corresponding to each off-diagonal block. The second solution result includes the elements in the third simulation data matrix corresponding to the off-diagonal blocks.

[0013] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, wherein a program is stored in the non-volatile storage medium, wherein the program controls the device where the non-volatile storage medium is located to execute an edge device simulation calculation method when it runs.

[0014] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the program executes an edge device simulation calculation method during runtime.

[0015] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that implements an edge device simulation calculation method when executed by a processor.

[0016] In this embodiment, a first simulation data matrix is ​​divided into multiple first simulation data matrix blocks. The first simulation data matrix includes a lower triangular matrix or an upper triangular matrix. The multiple first simulation data matrix blocks include diagonal blocks and off-diagonal blocks. A diagonal block is a first simulation data matrix block passing through the diagonal of the first simulation data matrix, and an off-diagonal block is a first simulation data matrix block other than the diagonal blocks. A set of task blocks for performing linear equations of the triangular matrix is ​​determined in the edge device, and the first simulation data matrix block corresponding to each task block in the task block set is determined. Each task block corresponds to at least one diagonal block. The second simulation data matrix block corresponding to the diagonal block in the second simulation data matrix is ​​determined, and the task block is invoked to perform a preset calculation operation in parallel on the diagonal block and each second simulation data matrix block corresponding to the diagonal block, obtaining a first solution result corresponding to each diagonal block. The first solution result includes elements in the third simulation data matrix corresponding to the diagonal block. The second simulation data matrix is ​​the first simulation data matrix... The equations are obtained by performing matrix multiplication between the first simulation data matrix and the second simulation data matrix. After the first solution result for each diagonal block is determined, the task block is called to perform preset calculation operations in parallel with the off-diagonal blocks and the second simulation data matrix based on the first solution result, to obtain the second solution result for each off-diagonal block. The second solution result includes the elements in the third simulation data matrix corresponding to the off-diagonal blocks. By decomposing the lower triangular matrix linear equations into diagonal and off-diagonal blocks according to the characteristics of the lower triangular matrix linear equations, the equations are assigned to the corresponding task blocks. Then, the solution order is determined according to the type of the first simulation data matrix block being processed, which is to calculate the first solution result for the diagonal block first and then calculate the second solution result for the off-diagonal block. This achieves the purpose of allocating the calculation tasks of each task block in the case of uneven calculation tasks, thereby improving the technical effect of solving the triangular matrix linear equations and solving the technical problem that the low solution efficiency of the triangular matrix linear equations in related technologies makes it impossible to efficiently realize large-scale logistics simulation. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 This is a schematic diagram of the structure of an edge computing device according to an embodiment of this application;

[0019] Figure 2 This is a flowchart illustrating an edge device simulation calculation method according to an embodiment of this application;

[0020] Figure 3(a) is a schematic diagram of a method for dividing a first simulation data matrix block according to an embodiment of this application;

[0021] Figure 3(b) is a schematic diagram of a third simulation data matrix provided according to an embodiment of this application;

[0022] Figure 3(c) is a schematic diagram of a method for dividing a second simulation data matrix block according to an embodiment of this application;

[0023] Figure 4(a) is a schematic diagram of the matrix sub-blocks corresponding to each thread in a first simulation data matrix according to an embodiment of this application;

[0024] Figure 4(b) is a schematic diagram of the matrix sub-blocks corresponding to each thread in a second simulation data matrix according to an embodiment of this application;

[0025] Figure 5 This is a schematic diagram of the structure of an edge device simulation computing device provided according to an embodiment of this application. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] Linear equations involving triangular matrices are widely used in scientific computing, engineering simulation, data analysis, and other fields. When the coefficient matrix is ​​triangular (either upper or lower triangular), solving these equations offers high computational efficiency. Traditional methods, such as direct substitution (forward or backward substitution), while simple and effective, still have room for improvement in large-scale problems. For common edge computing GPU platforms, a common approach to solving triangular linear equations is elimination, transforming the augmented matrix into echelon form through linear transformation, and then solving using back substitution. If the coefficient matrix is ​​lower triangular, the solution process involves multiple multiplications, multiple subtractions, and one division, requiring n(n+1) / 2n(n+1) / 2n(n+1) / 2 floating-point operations. For upper triangular matrices, the solution process is similar, but the specific details may differ slightly.

[0029] Due to the unique nature of algorithms for solving linear equations of a triangular matrix, the calculation of each row depends on the results of the preceding rows. This means that all unknowns cannot be calculated simultaneously; calculations must be performed row by row sequentially. Each step depends on the results of subsequent rows. This dependency limits the degree of parallelization. Furthermore, since the calculation requires accessing data row by row, and the elements of each row are typically stored contiguously in memory, frequent access to different memory locations due to the dependency on previous results leads to a non-contiguous memory access pattern. Considering these factors, traditional GPU platforms can utilize inter-kernel broadcast mechanisms to mitigate some memory access latency issues. This method also performs well in terms of execution efficiency for edge computing devices such as GPUs with dynamically scheduled task blocks. However, for some edge computing devices with statically scheduled task blocks, the lack of optimization for uneven computational tasks in related technologies results in lower computational efficiency in these devices.

[0030] Furthermore, in the field of embodied intelligent logistics, the solution of linear equations for triangular matrices in scenarios such as parcel asset simulation, robotic arm gripping and flipping is still mainly based on the direct substitution method (including forward substitution and backward substitution). Although this method is simple in principle and easy to implement, and can meet the simulation data solution needs of a single parcel and a simple robotic arm action in small-scale scenarios, its solution efficiency is difficult to adapt to the needs of large-scale logistics simulation scenarios (such as batch simulation of multi-size parcels and multi-robotic arm collaborative gripping and flipping simulation).

[0031] To address the aforementioned issues, this application provides relevant solutions, which are detailed below.

[0032] According to an embodiment of this application, a method embodiment of an edge device simulation calculation method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0033] The method embodiments provided in this application can be executed in an edge device or a similar computing device. Figure 1 A hardware structure block diagram of an edge device for implementing an edge device simulation calculation method is shown. For example... Figure 1 As shown, the edge device 10 may include one or more (shown as 102a, 102b, ..., 102n in the figure) processors 102 (processors 102 may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, the edge device 10 may also include components that are more advanced than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0034] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuitry are generally referred to herein as "data processing circuitry". This data processing circuitry may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the edge device 10. As involved in the embodiments of this application, this data processing circuitry serves as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0035] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the edge device simulation calculation method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned edge device simulation calculation method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the edge device 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0036] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the edge device 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0037] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the edge device 10.

[0038] Under the aforementioned operating environment, this application provides an edge device simulation calculation method, such as... Figure 2 As shown, the method includes the following steps:

[0039] Step S202: Divide the first simulation data matrix into multiple first simulation data matrix blocks. The first simulation data matrix includes a lower triangular matrix or an upper triangular matrix. The multiple first simulation data matrix blocks include diagonal blocks and off-diagonal blocks. The diagonal blocks are the first simulation data matrix blocks that pass through the diagonal of the first simulation data matrix. The off-diagonal blocks are the first simulation data matrix blocks other than the diagonal blocks.

[0040] In some embodiments of this application, the aforementioned edge device includes a statically scheduled edge computing device. Each task block within the statically scheduled edge computing device is also statically scheduled. Here, a task block refers to a set of resources and tasks allocated in an edge computing environment to perform a specific computing task. This may include computing, storage, and network resources, as well as applications or services running on the edge device. Additionally, the edge device may be equipped with a GPU. Furthermore, when partitioning the first simulation data matrix, the same number of computing tasks can be allocated to different computing unit groups based on the number of computing unit groups in the edge device, thereby achieving parallel computing and improving computing efficiency.

[0041] In some embodiments of this application, the first simulation data matrix is ​​a triangular matrix established based on the actual simulation scenario and related simulation data, such as a simulation matrix established based on multi-specification package data, or a simulation matrix based on data from multiple robotic arms simulating a robotic arm in a collaborative gripping and flipping scenario.

[0042] As an optional implementation, the task block described above also includes a thread group for solving the first simulation data matrix block.

[0043] Step S204: Determine the set of task blocks in the edge device that perform the task of calculating the linear equation system of the triangular matrix, and determine the first simulation data matrix block corresponding to each task block in the task block set, wherein each task block corresponds to at least one diagonal block;

[0044] In some embodiments of this application, the specific method of dividing the first simulation data matrix A and the second simulation data matrix B is shown in Figures 3(a) and 3(c). Each block in Figures 3(a), 3(b), and 3(c) represents a task block. One block is responsible for multiple blocks in one column of B in Figure 3(c), calculated sequentially from top to bottom in batches. Each batch completes one row of matrix B. The size of each block is 128. 128. For scales of 1024 and above, on the target hardware, 8 blocks can be opened at a time to ensure no waste of computing resources. Furthermore, as shown in Figures 3(a) and 3(c), during computation, each block in matrix A is computed in parallel with a block in a row of matrix B. After the computation of each row of blocks in matrix A is completed, the computation of the next row continues.

[0045] Step S206: Determine the second simulation data matrix block corresponding to the diagonal block in the second simulation data matrix, and call the task block to perform preset calculation operations in parallel on the diagonal block and each second simulation data matrix block corresponding to the diagonal block to obtain the first solution result corresponding to each diagonal block. The first solution result includes the element corresponding to the diagonal block in the third simulation data matrix. The second simulation data matrix is ​​the right-hand side of the equation system obtained by matrix multiplication between the first simulation data matrix and the third simulation data matrix.

[0046] In the technical solution provided in step S206, the step of calling the task block to perform a preset calculation operation based on the second simulation data matrix and the diagonal block to obtain the first solution result corresponding to each diagonal block includes: for each diagonal block corresponding to the task block, dividing the diagonal block into multiple first sub-blocks and determining the thread in the task block corresponding to each first sub-block; determining the second sub-block corresponding to each first sub-block in the second simulation data matrix, wherein the threads corresponding to the first sub-block and the second sub-block are the same; calling each thread in the task block to perform a preset calculation operation on the first sub-block and the second sub-block to obtain the first solution result.

[0047] As an optional implementation, the step of determining the thread in the task block corresponding to each first sub-block includes: dividing the multiple first sub-blocks in the diagonal block into multiple groups, wherein each group includes a row of first sub-blocks; determining the allocation order of the task blocks, and cyclically determining the group corresponding to each thread according to the allocation order, until all groups are allocated to the corresponding threads.

[0048] In some embodiments of this application, determining the second simulation data matrix block corresponding to the diagonal block in the second simulation data matrix and invoking the task block to perform preset calculation operations on the diagonal block and each of the corresponding second simulation data matrix blocks in parallel includes: determining the second simulation data matrix block to be calculated with the diagonal block in the second simulation data matrix, wherein each diagonal block is calculated with a column of second simulation data matrix blocks in the second simulation data matrix; and invoking multiple threads in the task block to perform preset calculation operations on the diagonal block and the corresponding second simulation data matrix blocks in parallel.

[0049] As an optional implementation, the step of calling each thread in the task block to perform preset calculation operations on the first sub-block and the second sub-block to obtain the first solution result includes: determining the target sub-block located on the diagonal of the diagonal block among the multiple first sub-blocks; adding a barrier to each thread, wherein the barrier is used to instruct the thread to calculate the sub-blocks other than the target sub-block among the multiple first sub-blocks after all target sub-blocks have been calculated.

[0050] In some embodiments of this application, the calculated first solution result can be stored in local memory.

[0051] As an optional implementation, in solving the linear equations of a triangular matrix, the calculation process for off-diagonal blocks is basically the same as that in related technologies, except that the data access index needs to be modified. For diagonal blocks, this application provides a decomposition method as shown in Figures 4(a) and 4(b), which further divides the diagonal blocks into multiple sub-blocks and assigns them to corresponding threads.

[0052] Specifically, Figure 4(a) shows the first simulation data matrix A, and Figure 4(b) shows the second simulation data matrix B. Each block in Figures 4(a) and 4(b) is an n×n block, where n is a positive integer, for example, 4. The internal number of each block is the thread ID. Assuming the thread block size inside a block is (4,4), it executes sequentially in the K-dimensional direction (column direction) of matrix A, and in parallel along the Y-axis (thread_y) in the M-dimensional direction (row direction). In matrix B, it executes in parallel along the X-dimensional direction (column direction) of the N-dimensional direction (column direction), and sequentially in the M-dimensional direction (row direction). However, when processing each 4... Threads in other Y directions need to wait at the diagonal of 4. Therefore, in 4... After the four diagonal blocks are processed, a barrier is added to wait for all diagonal blocks in the corresponding X direction (thread_x)B to be processed. Simultaneously, elements of the calculated X matrix (i.e., the third simulation data matrix) are stored in local memory for use by threads related to non-diagonal blocks. Optionally, the size of the local memory for X can be set to 4. The size is 128 floats. Each thread register can occupy at least 25 registers to store the B matrix data (16) and the calculated X (1+4). For 128 A 128-block structure means each thread is responsible for calculating the reduction data corresponding to 64 B matrices. X(1+4) indicates that 1+4 registers are used to store the calculated X. The reason for using 1+4 registers to store X is because for a block size of 4... The first simulation data matrix block of 4 requires 16 elements of matrix B for calculation, and the calculation result has 4 X values. Therefore, 4 registers are set up to store each calculation result, and an additional register is set up as a spare to facilitate changing the register where each calculation result is located.

[0053] Step S208: After the first solution result corresponding to each diagonal block is determined, the task block is called to perform a preset calculation operation in parallel with the off-diagonal blocks and the second simulation data matrix based on the first solution result, so as to obtain the second solution result corresponding to each off-diagonal block. The second solution result includes the elements in the third simulation data matrix corresponding to the off-diagonal blocks.

[0054] In some embodiments of this application, to further demonstrate the technical advantages of the method provided in this application compared to methods in related technologies, comparative experiments were conducted on the method provided in this application and methods in related technologies. Experimental results show that the method provided in this application can achieve a speedup of up to 48 times on a 5120-scale matrix, and nearly 10 times on a 512-scale matrix. Furthermore, the method provided in this application can fully utilize the various computing unit groups in the device and can allocate computing tasks according to the hardware parameters of the device, thereby significantly improving computing efficiency and further enhancing the speed of data simulation and synthesis.

[0055] The first simulation data matrix is ​​divided into multiple first simulation data matrix blocks, where the first simulation data matrix includes a lower triangular matrix or an upper triangular matrix. These multiple first simulation data matrix blocks include diagonal blocks and off-diagonal blocks. Diagonal blocks are those passing through the diagonal of the first simulation data matrix, and off-diagonal blocks are those other than the diagonal blocks. A set of task blocks for performing the linear equation system calculation task of the triangular matrix is ​​determined in the edge device, and the first simulation data matrix blocks corresponding to each task block in the task block set are determined. Each task block corresponds to at least one diagonal block. The second simulation data matrix blocks corresponding to the diagonal blocks in the second simulation data matrix are determined, and the task blocks are invoked to perform preset calculation operations in parallel on the diagonal blocks and the corresponding second simulation data matrix blocks, obtaining the first solution result corresponding to each diagonal block. The first solution result includes the elements corresponding to the diagonal blocks in the third simulation data matrix. The second simulation data matrix is ​​the sum of the elements of the first simulation data matrix and the second simulation data matrix. The equations on the right side of the system are obtained by matrix multiplication between the third simulation data matrices. After the first solution result corresponding to each diagonal block is determined, the task block is called to perform preset calculation operations in parallel with the off-diagonal blocks and the second simulation data matrix based on the first solution result, to obtain the second solution result corresponding to each off-diagonal block. The second solution result includes the elements in the third simulation data matrix corresponding to the off-diagonal blocks. By decomposing the lower triangular matrix linear equation system into diagonal and off-diagonal blocks according to the characteristics of the lower triangular matrix linear equation system, the equations are assigned to the corresponding task blocks. Then, the solution order is determined according to the type of the first simulation data matrix block being processed, which is to calculate the first solution result corresponding to the diagonal block first and then calculate the second solution result corresponding to the off-diagonal block. This achieves the purpose of allocating the calculation tasks of each task block in the case of uneven calculation tasks, thereby improving the technical effect of solving the triangular matrix linear equation system. This solves the technical problem that the low solution efficiency of the triangular matrix linear equation system in related technologies makes it impossible to efficiently realize large-scale logistics simulation.

[0056] In summary, this application provides an optimized method for solving the linear equations of a triangular matrix on edge computing devices with statically scheduled task blocks. This optimized method efficiently handles task imbalances and redesigns a unique task partitioning method and intra-block task parallelism strategy based on hardware characteristics. It fully utilizes the hardware resources of edge computing devices, decoupling data dependency propagation, improving the parallelism of the method, and overcoming the efficiency bottleneck of existing parallel methods on edge computing devices with statically scheduled task blocks.

[0057] Using the method provided in this application embodiment, a comparative experiment was conducted with the clBlast library when solving a system of linear equations for a triangular matrix on an edge device with eight computing unit groups, each corresponding to one task block. The results show that the speedup can reach up to 48 times for a 5120-scale matrix and nearly 10 times for a 512-scale matrix. Since the edge device has eight computing unit groups, the performance improvement brought by the task allocation scheme can be fully utilized when the scale exceeds 1024, depending on the hardware parameters. Therefore, a speedup of 48 times can be achieved on a 5120-scale matrix. In other words, the method provided in this application embodiment can significantly improve the computational efficiency when solving a system of linear equations for a triangular matrix compared to existing technologies.

[0058] This application provides an edge device simulation computing device. Figure 5 This is a schematic diagram of the device. From Figure 5As can be seen from the diagram, the device includes: a first processing module 50, used to divide a first simulation data matrix into multiple first simulation data matrix blocks, wherein the first simulation data matrix includes a lower triangular matrix or an upper triangular matrix, and the multiple first simulation data matrix blocks include diagonal blocks and off-diagonal blocks, wherein the diagonal blocks are the first simulation data matrix blocks passing through the diagonal of the first simulation data matrix, and the off-diagonal blocks are the first simulation data matrix blocks other than the diagonal blocks; a second processing module 52, used to determine a set of task blocks in the edge device that perform the task of calculating the linear equation system of the triangular matrix, and to determine the first simulation data matrix block corresponding to each task block in the task block set, wherein each task block corresponds to at least one diagonal block; and a third... The processing module 54 is used to call the task block to perform preset calculation operations based on the second simulation data matrix and the diagonal blocks, and obtain the first solution result corresponding to each diagonal block. The first solution result includes the elements in the third simulation data matrix corresponding to the diagonal blocks. The second simulation data matrix is ​​the right-hand side term of the equation system obtained by matrix multiplication between the first simulation data matrix and the third simulation data matrix. The fourth processing module 56 is used to call the task block to perform preset calculation operations in parallel based on the first solution result, the off-diagonal blocks and the second simulation data matrix, after the first solution result corresponding to each diagonal block is determined, and obtain the second solution result corresponding to each off-diagonal block. The second solution result includes the elements in the third simulation data matrix corresponding to the off-diagonal blocks.

[0059] In some embodiments of this application, the edge device includes a statically scheduled edge computing device.

[0060] In some embodiments of this application, the step of the third processing module 54 calling the task block to perform preset calculation operations based on the second simulation data matrix and the diagonal block to obtain the first solution result corresponding to each diagonal block includes: for each diagonal block corresponding to the task block, dividing the diagonal block into multiple first sub-blocks, and determining the thread in the task block corresponding to each first sub-block; determining the second sub-block corresponding to each first sub-block in the second simulation data matrix, wherein the threads corresponding to the first sub-block and the second sub-block are the same; calling each thread in the task block to perform preset calculation operations on the first sub-block and the second sub-block to obtain the first solution result.

[0061] In some embodiments of this application, the step of the third processing module 54 in determining the thread in the task block corresponding to each first sub-block includes: dividing the multiple first sub-blocks in the diagonal block into multiple groups, wherein each group includes a row of first sub-blocks; determining the allocation order of the task blocks, and cyclically determining the group corresponding to each thread according to the allocation order, until all groups are allocated to the corresponding thread.

[0062] In some embodiments of this application, before the task block performs a preset calculation operation based on the second simulation data matrix and the diagonal block, the third processing module 54 determines the second simulation data matrix block corresponding to the diagonal block in the second simulation data matrix, and calls the task block to perform the preset calculation operation on the diagonal block and each of the corresponding second simulation data matrix blocks in parallel. The steps include: determining the second simulation data matrix block in the second simulation data matrix to be calculated with the diagonal block, wherein each diagonal block is calculated with a column of second simulation data matrix blocks in the second simulation data matrix; and calling multiple threads in the task block to perform the preset calculation operation on the diagonal block and the corresponding second simulation data matrix block in parallel.

[0063] In some embodiments of this application, the third processing module 54 calls each thread in the task block to perform preset calculation operations on the first sub-block and the second sub-block to obtain the first solution result. The steps include: determining the target sub-block located on the diagonal of the diagonal block among the multiple first sub-blocks; adding a barrier to each thread, wherein the barrier is used to instruct the thread to calculate the sub-blocks other than the target sub-block among the multiple first sub-blocks after all target sub-blocks have been calculated.

[0064] In some embodiments of this application, after obtaining the first solution result corresponding to each diagonal block, the third processing module 54 is further configured to: store the first solution result into local memory.

[0065] It should be noted that each module in the aforementioned edge device simulation computing device can be a program module (e.g., a set of program instructions to implement a specific function) or a hardware module. For the latter, it can take the following forms, but is not limited to them: each of the above modules is represented by a processor, or the functions of each of the above modules are implemented by a processor.

[0066] According to an embodiment of this application, a non-volatile storage medium is also provided, which stores a program. During program execution, the device where the non-volatile storage medium is located executes the following edge device simulation calculation method: A first simulation data matrix is ​​divided into multiple first simulation data matrix blocks, wherein the first simulation data matrix includes a lower triangular matrix or an upper triangular matrix, and the multiple first simulation data matrix blocks include diagonal blocks and off-diagonal blocks. Diagonal blocks are first simulation data matrix blocks passing through the diagonal of the first simulation data matrix, and off-diagonal blocks are first simulation data matrix blocks other than the diagonal blocks. A set of task blocks for performing the linear equation system calculation task of the triangular matrix is ​​determined in the edge device, and the first simulation data matrix block corresponding to each task block in the task block set is determined, wherein each task block corresponds to... At least one diagonal block; determine the second simulation data matrix block corresponding to the diagonal block in the second simulation data matrix, and call the task block to perform preset calculation operations in parallel on the diagonal block and each of the corresponding second simulation data matrix blocks to obtain the first solution result corresponding to each diagonal block, wherein the first solution result includes the element corresponding to the diagonal block in the third simulation data matrix, and the second simulation data matrix is ​​the right-hand side term of the equation system obtained by matrix multiplication between the first simulation data matrix and the third simulation data matrix; after the first solution result corresponding to each diagonal block is determined, call the task block to perform preset calculation operations in parallel on the off-diagonal blocks and the second simulation data matrix according to the first solution result to obtain the second solution result corresponding to each off-diagonal block, wherein the second solution result includes the element corresponding to the off-diagonal block in the third simulation data matrix.

[0067] According to an embodiment of this application, an electronic device is also provided, including: a memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the following edge device simulation calculation method: dividing a first simulation data matrix into multiple first simulation data matrix blocks, wherein the first simulation data matrix includes a lower triangular matrix or an upper triangular matrix, the multiple first simulation data matrix blocks include diagonal blocks and off-diagonal blocks, the diagonal blocks are the first simulation data matrix blocks passing through the diagonal of the first simulation data matrix, and the off-diagonal blocks are the first simulation data matrix blocks other than the diagonal blocks; determining a set of task blocks in the edge device for performing the task of calculating a system of linear equations of a triangular matrix, and determining the first simulation data matrix block corresponding to each task block in the set of task blocks, wherein each task block corresponds to at least A diagonal block; determine the second simulation data matrix block corresponding to the diagonal block in the second simulation data matrix, and call the task block to perform preset calculation operations in parallel on the diagonal block and each of the corresponding second simulation data matrix blocks to obtain the first solution result corresponding to each diagonal block. The first solution result includes the element corresponding to the diagonal block in the third simulation data matrix. The second simulation data matrix is ​​the right-hand side term of the equation system obtained by matrix multiplication between the first simulation data matrix and the third simulation data matrix. After the first solution result corresponding to each diagonal block is determined, call the task block to perform preset calculation operations in parallel on the off-diagonal blocks and the second simulation data matrix based on the first solution result to obtain the second solution result corresponding to each off-diagonal block. The second solution result includes the element corresponding to the off-diagonal block in the third simulation data matrix.

[0068] According to an embodiment of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the following edge device simulation calculation method: dividing a first simulation data matrix into multiple first simulation data matrix blocks, wherein the first simulation data matrix includes a lower triangular matrix or an upper triangular matrix, and the multiple first simulation data matrix blocks include diagonal blocks and off-diagonal blocks, wherein the diagonal blocks are the first simulation data matrix blocks passing through the diagonal of the first simulation data matrix, and the off-diagonal blocks are the first simulation data matrix blocks other than the diagonal blocks; determining a set of task blocks in the edge device for performing the calculation of a system of linear equations of a triangular matrix, and determining the first simulation data matrix block corresponding to each task block in the task block set, wherein each task block corresponds to at least one diagonal block; The system first determines the second simulation data matrix block corresponding to the diagonal block in the second simulation data matrix, and then calls the task block to perform preset calculation operations in parallel on the diagonal block and each of the corresponding second simulation data matrix blocks, obtaining the first solution result for each diagonal block. The first solution result includes the elements corresponding to the diagonal block in the third simulation data matrix. The second simulation data matrix is ​​the right-hand side of the equation system obtained by matrix multiplication between the first and third simulation data matrices. After the first solution result for each diagonal block is determined, the task block is called to perform preset calculation operations in parallel on the off-diagonal blocks and the second simulation data matrix based on the first solution result, obtaining the second solution result for each off-diagonal block. The second solution result includes the elements corresponding to the off-diagonal block in the third simulation data matrix.

[0069] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0070] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0071] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0072] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0073] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0074] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for simulating edge devices, characterized in that, include: The first simulation data matrix is ​​divided into multiple first simulation data matrix blocks, wherein the first simulation data matrix includes a lower triangular matrix or an upper triangular matrix, and the multiple first simulation data matrix blocks include diagonal blocks and off-diagonal blocks. The diagonal blocks are the first simulation data matrix blocks that pass through the diagonal of the first simulation data matrix, and the off-diagonal blocks are the first simulation data matrix blocks other than the diagonal blocks among the multiple first simulation data matrix blocks. A set of task blocks for performing the calculation of a system of linear equations of a triangular matrix is ​​determined in the edge device, and a first simulation data matrix block corresponding to each task block in the set of task blocks is determined, wherein each task block corresponds to at least one diagonal block; The second simulation data matrix block corresponding to the diagonal block in the second simulation data matrix is ​​determined, and the task block is called to perform a preset calculation operation in parallel on the diagonal block and each of the second simulation data matrix blocks corresponding to the diagonal block, so as to obtain the first solution result corresponding to each diagonal block. The first solution result includes the element corresponding to the diagonal block in the third simulation data matrix, and the second simulation data matrix is ​​the right-hand side of the equation system obtained by matrix multiplication between the first simulation data matrix and the third simulation data matrix. After the first solution result corresponding to each of the diagonal blocks is determined, the task block is invoked to perform the preset calculation operation in parallel with the off-diagonal blocks and the second simulation data matrix based on the first solution result, to obtain the second solution result corresponding to each off-diagonal block. The second solution result includes the element in the third simulation data matrix corresponding to the off-diagonal block.

2. The edge device simulation calculation method according to claim 1, characterized in that, The task block is invoked to perform a preset calculation operation based on the second simulation data matrix and the diagonal block, obtaining the first solution result corresponding to each diagonal block, including: For each task block corresponding to the diagonal block, the diagonal block is divided into multiple first sub-blocks, and the threads in the task block corresponding to each first sub-block are determined; In the second simulation data matrix, a second sub-block is determined corresponding to each of the first sub-blocks, wherein the threads corresponding to the first sub-blocks and the second sub-blocks are the same; Each thread in the task block is invoked to perform the preset calculation operation on the first sub-block and the second sub-block to obtain the first solution result.

3. The edge device simulation calculation method according to claim 2, characterized in that, Determining the threads in the task blocks corresponding to each of the first sub-blocks includes: The first sub-blocks in the diagonal block are divided into multiple groups, wherein each group includes a row of the first sub-blocks; The allocation order of the task blocks is determined, and the groups corresponding to each thread are determined cyclically according to the allocation order until all groups are allocated to the corresponding threads.

4. The edge device simulation calculation method according to claim 2, characterized in that, The process of determining the second simulation data matrix block corresponding to the diagonal block in the second simulation data matrix, and invoking the task block to perform preset calculation operations in parallel on the diagonal block and each of the second simulation data matrix blocks corresponding to the diagonal block, includes: Determine the second simulation data matrix block in the second simulation data matrix that is calculated with the diagonal block, wherein each diagonal block is calculated with a column of the second simulation data matrix blocks in the second simulation data matrix; Multiple threads within the task block are invoked to perform preset calculation operations in parallel on the diagonal block and the corresponding second simulation data matrix block.

5. The edge device simulation calculation method according to claim 2, characterized in that, The process of invoking each thread within the task block to perform the preset calculation operations on the first sub-block and the second sub-block to obtain the first solution result includes: Identify the target sub-block located on the diagonal of the diagonal block among the plurality of first sub-blocks; A barrier is added to each of the threads, wherein the barrier is used to instruct the thread to compute the sub-blocks other than the target sub-block in the plurality of first sub-blocks only after all the target sub-blocks have been computed.

6. The edge device simulation calculation method according to claim 1, characterized in that, The edge devices include statically scheduled edge computing devices.

7. The edge device simulation calculation method according to claim 1, characterized in that, After obtaining the first solution result corresponding to each diagonal block, the method further includes: The first solution result is stored in local memory.

8. An edge device simulation computing device, characterized in that, include: A first processing module is used to divide a first simulation data matrix into multiple first simulation data matrix blocks, wherein the first simulation data matrix includes a lower triangular matrix or an upper triangular matrix, and the multiple first simulation data matrix blocks include diagonal blocks and off-diagonal blocks. The diagonal blocks are first simulation data matrix blocks that pass through the diagonal of the first simulation data matrix, and the off-diagonal blocks are first simulation data matrix blocks other than the diagonal blocks among the multiple first simulation data matrix blocks. The second processing module is used to determine the set of task blocks in the edge device that perform the task of calculating the linear equation system of the triangular matrix, and to determine the first simulation data matrix block corresponding to each task block in the set of task blocks, wherein each task block corresponds to at least one of the diagonal blocks; The third processing module is used to determine the second simulation data matrix block corresponding to the diagonal block in the second simulation data matrix, and call the task block to perform preset calculation operations in parallel on the diagonal block and each of the second simulation data matrix blocks corresponding to the diagonal block to obtain the first solution result corresponding to each diagonal block. The first solution result includes the element corresponding to the diagonal block in the third simulation data matrix. The second simulation data matrix is ​​the right-hand side of the equation system obtained by matrix multiplication between the first simulation data matrix and the third simulation data matrix. The fourth processing module is used to, after the first solution result corresponding to each of the diagonal blocks is determined, call the task block to perform the preset calculation operation in parallel with the off-diagonal blocks and the second simulation data matrix based on the first solution result, to obtain the second solution result corresponding to each off-diagonal block, wherein the second solution result includes the element in the third simulation data matrix corresponding to the off-diagonal block.

9. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a program, wherein when the program is executed, it controls the device where the non-volatile storage medium is located to execute the edge device simulation calculation method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, include: A memory and a processor, the processor being configured to run a program stored in the memory, wherein the program, when running, executes the edge device simulation computing method according to any one of claims 1 to 7.

11. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the edge device simulation calculation method according to any one of claims 1 to 7.