Data processing method and device, equipment, storage medium and program product
By obtaining the matrix tree structure on a heterogeneous acceleration processor and determining the matrix feature parameters, the problem of low efficiency in matrix feature processing in the prior art is solved, and efficient data processing is achieved.
Patent Information
- Application Number
- CN202411824466.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-11
AI Technical Summary
The prior art has the problem of low processing efficiency when dealing with the feature problems of the matrix.
By obtaining the matrix tree structure corresponding to the to-process matrix, for any leaf node matrix in the matrix tree structure, the second characteristic parameters of the leaf node matrix are determined based on the first characteristic parameters of the multiple leaf nodes cascaded downward with the leaf node matrix, and for the root node matrix in the matrix tree structure, the characteristic parameters of the to-process matrix are determined based on the second characteristic parameters of the multiple leaf node matrix cascaded downward with the root node matrix. This method can process the pending matrix independently and in parallel on the heterogeneous acceleration processor, avoiding large amounts of data interactions between the central processor side and the heterogeneous acceleration processor side.
The efficiency of data processing is significantly improved and the processing efficiency problem caused by low data interaction efficiency in traditional methods is solved.
Smart Images

Figure CN119807578A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer equipment technology, and in particular to a data processing method, apparatus, device, storage medium and program product. Background Art
[0002] In the field of scientific research and engineering, the application of computational simulation software is becoming more and more widespread, which is of great help in improving research efficiency and reducing trial and error costs. It has important applications in numerical calculation, chemistry, materials, physics and engineering. The use of computational simulation software to deal with the characteristic problems of symmetric matrices and Hermite matrices has played an important role in quantum chemistry, material chemistry, image processing, quantum mechanics and other fields.
[0003] However, the methods for processing the characteristic problem of matrices in related documents have the problem of low processing efficiency. Summary of the invention
[0004] Based on this, it is necessary to provide a data processing method, device, equipment, storage medium and program product that can improve the efficiency of matrix data processing in response to the above technical problems.
[0005] In a first aspect, the present application provides a data processing method, which is applied to a heterogeneous acceleration processor, and the method includes:
[0006] Get the matrix tree structure corresponding to the matrix to be processed;
[0007] For any leaf node matrix in the matrix tree structure, determine the second characteristic parameter of the leaf node matrix according to the first characteristic parameters of multiple leaf nodes cascaded downward with the leaf node matrix;
[0008] For a root node matrix in a matrix tree structure, characteristic parameters of a matrix to be processed are determined according to second characteristic parameters of a plurality of leaf node matrices cascaded downward with the root node matrix.
[0009] The data processing method provided by the embodiment of the present application obtains the matrix tree structure corresponding to the matrix to be processed, and for any leaf node matrix in the matrix tree structure, determines the second characteristic parameter of the leaf node matrix according to the first characteristic parameters of multiple leaf nodes cascaded downward with the leaf node matrix, and for the root node matrix in the matrix tree structure, determines the characteristic parameters of the matrix to be processed according to the second characteristic parameters of multiple leaf node matrices cascaded downward with the root node matrix. The above method can process the matrix to be processed independently and in parallel directly on the heterogeneous acceleration processor without relying on the traditional library function and the interface of the central processing unit side, and can solve the problem of low data processing efficiency caused by the large amount of data interaction between the central processing unit side and the heterogeneous acceleration processor side in the traditional method, thereby greatly improving the data processing efficiency.
[0010] In one embodiment, determining the second characteristic parameter of the leaf node matrix according to the first characteristic parameters of a plurality of leaf node matrices cascaded downward with the leaf node matrix includes:
[0011] Generate a first feature sequence according to the feature values in each first feature parameter, and generate an intermediate vector according to the feature vector in each first feature parameter;
[0012] According to the first characteristic sequence and the intermediate vector, a second characteristic parameter of the leaf node matrix is determined.
[0013] In one embodiment, determining the second characteristic parameter of the leaf node matrix according to the first characteristic sequence and the intermediate vector includes:
[0014] Determining whether the first feature sequence can be reduced according to the first feature sequence and the intermediate vector;
[0015] If it is determined that the first feature sequence can be reduced, the first feature sequence is reduced according to the first feature sequence and the intermediate vector to obtain a second feature sequence, and a second feature parameter of the leaf node matrix is determined according to the second feature sequence;
[0016] If it is determined that the first feature sequence cannot be reduced, the second feature parameters of the leaf node matrix are determined according to the first feature sequence.
[0017] The method described in the embodiments of the present application can reduce the complexity of data processing and improve data processing efficiency by reducing the feature sequence.
[0018] In one embodiment, the first feature sequence is reduced according to the first feature sequence and the intermediate vector to obtain the second feature sequence, including:
[0019] For each vector value in the intermediate vector, determining whether the vector value satisfies a first reduction condition, and obtaining a first determination result;
[0020] For each eigenvalue in the first characteristic sequence, determining whether the eigenvalue satisfies the second reduction condition, and obtaining a second determination result; the position of the eigenvalue in the first characteristic sequence corresponds to the position of the vector value in the intermediate vector;
[0021] Generate a first position sequence corresponding to the first feature sequence according to the first determination result and the second determination result;
[0022] The first feature sequence is reduced according to the first position sequence to obtain a second feature sequence.
[0023] In one embodiment, generating a first position sequence corresponding to the first feature sequence according to the first determination result and the second determination result includes:
[0024] If the first determination result indicates that the vector value satisfies the first reduction condition, a first value is set at a first target position of the first position sequence; the target position corresponds to the position of the vector value; the first reduction condition includes that the vector value to be determined is a preset value;
[0025] If the second determination result indicates that the eigenvalue satisfies a second reduction condition, a second value is set at a second target position of the first position sequence; the second reduction condition includes that the eigenvalue to be determined is the same as the eigenvalue at the previous position.
[0026] In one embodiment, the method further comprises:
[0027] The feature value at the third target position in the first feature sequence is updated to generate a third feature sequence; the third target position corresponds to the position of the second value in the first position sequence;
[0028] Update the second value in the first position sequence according to the third feature sequence to generate a second position sequence;
[0029] The first feature sequence is reduced according to the first position sequence to obtain a second feature sequence, including:
[0030] The first feature sequence is reduced according to the second position sequence to obtain a second feature sequence.
[0031] In one embodiment, the first feature sequence is reduced according to the second position sequence to obtain the second feature sequence, including:
[0032] determining a fourth target position according to a position of a preset value in the second position sequence;
[0033] The feature value at the fourth target position in the first feature sequence is removed to generate a second feature sequence, and a third feature sequence is generated according to the removed feature value.
[0034] In the embodiment of the present application, after obtaining the second position sequence, the processor may perform reduction processing on the first feature sequence according to the second position sequence to obtain the second feature sequence.
[0035] In one embodiment, determining the second characteristic parameter of the leaf node matrix according to the second characteristic sequence includes:
[0036] Constructing a characteristic equation of the leaf node matrix according to the second characteristic sequence, and solving the characteristic equation to obtain the eigenvalue of the characteristic equation;
[0037] A second characteristic parameter is determined based on the characteristic value of the characteristic equation and the characteristic value in the third characteristic sequence.
[0038] The method described in the embodiments of the present application can record the positions of the characteristic values that can be reduced through the first position sequence and the second position sequence, and can reduce the first characteristic sequence in combination with the first shrinkage condition and the second shrinkage condition, which can save resources to the greatest extent and thus improve data processing efficiency.
[0039] In one embodiment, generating a first feature sequence according to feature values in each first feature parameter includes:
[0040] Arrange the characteristic values in each first characteristic parameter in ascending order to obtain an initial characteristic sequence corresponding to each first characteristic parameter;
[0041] Performing splicing processing on the initial feature sequences corresponding to all the first feature parameters to generate a spliced feature sequence;
[0042] The eigenvalues in the concatenated feature sequence are arranged in ascending order to obtain a first feature sequence.
[0043] In one embodiment, each feature value in the concatenated feature sequence is arranged in ascending order to obtain a first feature sequence, including:
[0044] For any feature value in the concatenated feature sequence, determine the third position of the feature value in the first feature sequence according to the first position in the initial feature sequence to which the feature value belongs and the second position of the feature value in other initial feature sequences;
[0045] According to all the feature values in the spliced feature sequence, the positions of the corresponding feature values in the spliced feature sequence are adjusted at the third positions of the first feature sequence to generate the first feature sequence.
[0046] Compared with the existing method of serial sorting one by one, the method described in the embodiment of the present application can greatly improve the efficiency of eigenvalue sorting by using independent threads in the processor to parallelly process the ascending sorting of each eigenvalue, thereby improving the data processing efficiency.
[0047] In a second aspect, the present application further provides a data processing device, the device comprising:
[0048] The acquisition module is used to obtain the matrix tree structure corresponding to the matrix to be processed.
[0049] The first determination module is used to determine, for any leaf node matrix in the matrix tree structure, a second characteristic parameter of the leaf node matrix according to first characteristic parameters of multiple leaf nodes cascaded downward with the leaf node matrix.
[0050] The second determination module is used to determine the characteristic parameters of the matrix to be processed according to the second characteristic parameters of a plurality of leaf node matrices cascaded downward with the root node matrix in the matrix tree structure.
[0051] In a third aspect, the present application further provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0052] Get the matrix tree structure corresponding to the matrix to be processed;
[0053] For any leaf node matrix in the matrix tree structure, determine the second characteristic parameter of the leaf node matrix according to the first characteristic parameters of multiple leaf nodes cascaded downward with the leaf node matrix;
[0054] For a root node matrix in a matrix tree structure, characteristic parameters of a matrix to be processed are determined according to second characteristic parameters of a plurality of leaf node matrices cascaded downward with the root node matrix.
[0055] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0056] Get the matrix tree structure corresponding to the matrix to be processed;
[0057] For any leaf node matrix in the matrix tree structure, determine the second characteristic parameter of the leaf node matrix according to the first characteristic parameters of multiple leaf nodes cascaded downward with the leaf node matrix;
[0058] For a root node matrix in a matrix tree structure, characteristic parameters of a matrix to be processed are determined according to second characteristic parameters of a plurality of leaf node matrices cascaded downward with the root node matrix.
[0059] In a fifth aspect, the present application further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0060] Get the matrix tree structure corresponding to the matrix to be processed;
[0061] For any leaf node matrix in the matrix tree structure, determine the second characteristic parameter of the leaf node matrix according to the first characteristic parameters of multiple leaf nodes cascaded downward with the leaf node matrix;
[0062] For a root node matrix in a matrix tree structure, characteristic parameters of a matrix to be processed are determined according to second characteristic parameters of a plurality of leaf node matrices cascaded downward with the root node matrix.
[0063] The above-mentioned data processing method, device, equipment, storage medium and program product, the method obtains the matrix tree structure corresponding to the matrix to be processed, and for any leaf node matrix in the matrix tree structure, determines the second characteristic parameter of the leaf node matrix according to the first characteristic parameters of multiple leaf nodes cascaded downward with the leaf node matrix, and for the root node matrix in the matrix tree structure, determines the characteristic parameters of the matrix to be processed according to the second characteristic parameters of multiple leaf node matrices cascaded downward with the root node matrix. The above-mentioned method can process the matrix to be processed independently and in parallel directly on the heterogeneous acceleration processor, without relying on the traditional library function and the interface of the central processing unit, and can solve the problem of low data processing efficiency caused by the large amount of data interaction between the central processing unit and the heterogeneous acceleration processor in the traditional method, thereby greatly improving the data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 is an internal structure diagram of a computer device in one embodiment;
[0065] Figure 2 is a flow chart of a data processing method in one embodiment;
[0066] Figure 3 is a flow chart of a data processing method in another embodiment;
[0067] Figure 4 is a flow chart of a data processing method in another embodiment;
[0068] Figure 5 is a flow chart of a data processing method in another embodiment;
[0069] Figure 6 is a flow chart of a data processing method in another embodiment;
[0070] Figure 7 is a flow chart of a data processing method in another embodiment;
[0071] Figure 8 is a flow chart of a data processing method in another embodiment;
[0072] Fig. 9 is a flow chart of a data processing method in another embodiment;
[0073] Fig.10 is a flow chart of a data processing method in another embodiment;
[0074] Fig.11 is a flow chart of a data processing method in another embodiment;
[0075] Fig.12is a flow chart of a data processing method in another embodiment;
[0076] Fig.13 is a flow chart of a data processing method in another embodiment;
[0077] Fig.14 is a flow chart of a data processing method in another embodiment;
[0078] Fig.15 A schematic diagram of the effect of a data processing method in one embodiment;
[0079] Fig.16 A schematic diagram of the effect of a data processing method in another embodiment;
[0080] Fig.17 FIG. 4 is a structural block diagram of a data processing device in one embodiment. DETAILED DESCRIPTION
[0081] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0082] In the field of scientific research and engineering, the application of computational simulation software is increasingly extensive, which is of great help to improve research efficiency and reduce trial and error costs, and has important applications in the fields of numerical calculation, chemistry, materials, physics and engineering. The use of computational simulation software to process the characteristic problems of symmetric matrices and Hermite matrices has played an important role in quantum chemistry, material chemistry, image processing, quantum mechanics, etc. However, the method for processing the characteristic problems of matrices in the relevant records has the problem of low processing efficiency. The present application provides a data processing method, which is intended to solve the above-mentioned technical problems, and the following embodiments will specifically illustrate the data processing method described in the present application.
[0083] The data processing method provided in the embodiment of the present application can be applied to Figure 1 The heterogeneous acceleration processor (hereinafter referred to as the processor) in the computer device shown in the figure can be a terminal or a server, and its internal structure diagram can be as shown in FIG. Figure 1As shown, the computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data processing method is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0084] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0085] In one embodiment, Figure 2 As shown, a data processing method is provided, which is applied to Figure 1 The heterogeneous acceleration processor (hereinafter referred to as the processor) in the example is used to illustrate the process, including the following steps:
[0086] S201, obtaining a matrix tree structure corresponding to the matrix to be processed.
[0087] The matrix to be processed is a symmetric matrix or a Hermite matrix. The matrix tree structure is a full binary tree structure, which includes a root node matrix and a multi-layer leaf node matrix. Figure 3 As shown, ①②③④ is the leaf node matrix of the bottom layer, ⑤⑥ is the leaf node matrix of the middle layer, is the root node matrix.
[0088] In an embodiment of the present application, the processor can receive data of the matrix to be processed sent by other devices, and can also respond to data of the matrix to be processed input by the user interface. After obtaining the matrix to be processed, the processor can continuously divide the matrix to be processed into two parts from the middle until the scale (number of rows and columns) of the leaf node matrix at the bottom layer meets the preset requirements, and the matrix tree structure corresponding to the matrix to be processed can be obtained. Among them, the preset requirements include that the scale (number of rows and columns) of the leaf node matrix at the bottom layer is less than the first preset threshold, and the scale difference of the leaf node matrices at the same layer is less than the second preset threshold. For example, the first preset threshold is 25, indicating that the number of rows and columns of the leaf node matrix at the bottom layer are both less than 25, and the second preset threshold is 1, indicating that the difference in the number of rows and the difference in the number of columns of the leaf node matrices at the same layer is not greater than 1.
[0089] S202, for any leaf node matrix in the matrix tree structure, determine a second characteristic parameter of the leaf node matrix according to first characteristic parameters of a plurality of leaf nodes cascaded downward with the leaf node matrix.
[0090] The characteristic parameters include characteristic values and characteristic vectors. The first characteristic parameters are characteristic parameters of multiple leaf nodes cascaded downward by the leaf node matrix, and the second characteristic parameters are characteristic parameters of the leaf node matrix.
[0091] In the embodiment of the present application, after the processor obtains the matrix tree structure corresponding to the matrix to be processed based on the above steps, the characteristic parameters of all leaf node matrices in the bottom layer can be solved using a preset algorithm, for example, using a QR algorithm to solve Figure 3 For any leaf node matrix in the matrix tree structure, for example Figure 3 In ⑤⑥, when solving the second characteristic parameters of the leaf node matrix (such as ⑤), first determine the first characteristic parameters of the multiple leaf node matrices (①②) cascaded downward by the leaf node matrix, and then determine the second characteristic parameters of the leaf node matrix (⑤) based on the first characteristic parameters of the multiple leaf node matrices (①②) cascaded downward by the leaf node matrix. Similarly, the second characteristic parameter of ⑥ is determined by the first characteristic parameters of ③④. The characteristic parameters of the above leaf node matrices ①②③④ can be solved in parallel, and the scales of each leaf node matrix are similar, so the batch processing interface of the QR algorithm for parallel solving of multiple problems of different scales can be realized. Moreover, since the scales of the leaf node matrices are similar, there is no need to worry about the problem of uneven load.
[0092] S203 , for a root node matrix in the matrix tree structure, determining characteristic parameters of the matrix to be processed according to second characteristic parameters of a plurality of leaf node matrices cascaded downward with the root node matrix.
[0093] Among them, the root node matrix is the matrix to be processed.
[0094] In the embodiment of the present application, after the processor obtains the characteristic parameters of all leaf node matrices except the root node matrix in the matrix tree structure based on the above steps, for the root node matrix, for example Figure 3 In , in solving the root node matrix When determining the characteristic parameters of the root node matrix, first determine the second characteristic parameters of the multiple leaf node matrices (⑤⑥) cascaded downward from the root node matrix, and then determine the characteristic parameters of the root node matrix based on the second characteristic parameters of the multiple leaf node matrices (⑤⑥) cascaded downward from the root node matrix, that is, the characteristic parameters of the matrix to be processed.
[0095] The data processing method provided by the embodiment of the present application obtains the matrix tree structure corresponding to the matrix to be processed, and for any leaf node matrix in the matrix tree structure, determines the second characteristic parameter of the leaf node matrix according to the first characteristic parameters of multiple leaf nodes cascaded downward with the leaf node matrix, and for the root node matrix in the matrix tree structure, determines the characteristic parameters of the matrix to be processed according to the second characteristic parameters of multiple leaf node matrices cascaded downward with the root node matrix. The above method can process the matrix to be processed independently and in parallel directly on the heterogeneous acceleration processor without relying on the traditional library function and the interface of the central processing unit side, and can solve the problem of low data processing efficiency caused by the large amount of data interaction between the central processing unit side and the heterogeneous acceleration processor side in the traditional method, thereby greatly improving the data processing efficiency.
[0096] In one embodiment, a specific implementation method for determining the second characteristic parameter of the leaf node matrix is also provided, such as Figure 4 As shown, the above step S203 of "determining the second characteristic parameter of the leaf node matrix according to the first characteristic parameters of the plurality of leaf node matrices cascaded downward with the leaf node matrix" includes:
[0097] S301, generating a first feature sequence according to the feature values in each first feature parameter, and generating an intermediate vector according to the feature vector in each first feature parameter.
[0098] The first characteristic sequence is a sequence composed of the characteristic values of multiple leaf node matrices, and the characteristic values in the first characteristic sequence are sorted from small to large. The intermediate vector is a vector composed of the characteristic vectors of multiple leaf node matrices.
[0099] In an embodiment of the present application, after obtaining the first characteristic parameters of multiple leaf node matrices cascaded downward with the leaf node matrix, the processor can generate a first characteristic sequence according to the characteristic values in each first characteristic parameter. Specifically, the characteristic values of all leaf node matrices can be sorted by size to obtain the first characteristic sequence. And, based on the characteristic vectors in each first characteristic parameter, an intermediate vector can be generated. Specifically, the vector values of the target rows or target columns in all leaf node matrices can be spliced to obtain an intermediate vector. For example, the last row in the characteristic vector of the previous leaf node matrix and the first row in the characteristic vector of the next leaf node matrix can be spliced to obtain an intermediate vector.
[0100] S302: Determine a second characteristic parameter of the leaf node matrix according to the first characteristic sequence and the intermediate vector.
[0101] In an embodiment of the present application, after the processor obtains the first feature sequence and the intermediate vector based on the above steps, it can directly optimize the scale of the leaf node matrix based on the first feature sequence and the intermediate vector, and when the scale of the leaf node matrix is the smallest, determine the second feature parameter of the leaf node matrix based on the first feature sequence.
[0102] Specifically, Figure 5 As shown, the "determining the second characteristic parameter of the leaf node matrix according to the first characteristic sequence and the intermediate vector" in the above step S302 includes:
[0103] S401: Determine whether the first feature sequence can be reduced according to the first feature sequence and the intermediate vector.
[0104] In an embodiment of the present application, after obtaining the first feature sequence and the intermediate vector, the processor can determine whether there is a vector value of a preset value in the intermediate vector, for example, determine whether there is a vector value of 0 in the intermediate vector. If there is a vector value of the preset value, then it is determined that the first feature sequence can be reduced; if there is no vector value of the preset value, then it is determined that the first feature sequence cannot be reduced.
[0105] S402: If it is determined that the first feature sequence can be reduced, the first feature sequence is reduced according to the first feature sequence and the intermediate vector to obtain a second feature sequence, and a second feature parameter of the leaf node matrix is determined according to the second feature sequence.
[0106] The second feature sequence is a feature sequence obtained by reducing the first feature sequence.
[0107] In an embodiment of the present application, when the processor determines based on the above steps that the first feature sequence can be reduced, the first feature sequence can be reduced according to the first feature sequence and the intermediate vector to obtain the second feature sequence and determine the second feature parameter of the leaf node matrix according to the second feature sequence.
[0108] S403: If it is determined that the first feature sequence cannot be reduced, determine the second feature parameter of the leaf node matrix according to the first feature sequence.
[0109] In an embodiment of the present application, when the processor determines based on the above steps that the first characteristic sequence cannot be reduced, the second characteristic parameter of the leaf node matrix can be directly determined according to the first characteristic sequence. Specifically, the characteristic equation of the leaf node matrix can be constructed according to the first characteristic sequence, and then the characteristic equation can be solved to obtain the value of the characteristic equation, and then the characteristic vector can be determined according to the value of the characteristic equation to determine the second characteristic parameter of the leaf node matrix.
[0110] The method described in the embodiments of the present application can reduce the complexity of data processing and improve data processing efficiency by reducing the feature sequence.
[0111] In one embodiment, a specific implementation method for determining the second feature sequence is also provided, such as Figure 6 As shown, the "reducing the first feature sequence according to the first feature sequence and the intermediate vector to obtain the second feature sequence" in the above step S402 includes:
[0112] S501 , for each vector value in the intermediate vector, determine whether the vector value satisfies a first reduction condition, and obtain a first determination result.
[0113] The first reduction condition includes that the vector value to be determined is a preset value, that is, there is a vector value of the preset value in the intermediate vector, for example, the preset value is 0. The first determination result includes that the vector value satisfies the first reduction condition and that the vector value does not satisfy the first reduction condition.
[0114] In an embodiment of the present application, after obtaining the intermediate vector, the processor can further determine whether there is a vector value that satisfies the first reduction condition for each vector value in the intermediate vector. If so, the first determination result indicates that the vector value satisfies the first reduction condition, that is, the first feature sequence can be reduced. If not, the first determination result indicates that the vector value does not satisfy the first reduction condition, and the first feature sequence cannot be reduced.
[0115] S502: for each eigenvalue in the first eigenvalue sequence, determine whether the eigenvalue satisfies a second reduction condition, and obtain a second determination result.
[0116] The second reduction condition includes that the eigenvalue to be determined is the same as the eigenvalue at the previous position, that is, the eigenvalue at a certain position is the same as the eigenvalue at the previous position. The position of the eigenvalue in the first feature sequence (that is, address idx) corresponds to the position of the vector value in the intermediate vector (that is, address idx), for example, Figure 7 As shown, the positional relationship between each vector value in the intermediate vector and the eigenvalue in the first eigensequence corresponds one to one.
[0117] In an embodiment of the present application, after obtaining the first feature sequence, the processor can determine, for each feature value in the first feature sequence, whether the feature value satisfies the second reduction condition. If so, the second determination result indicates that the feature value satisfies the second reduction condition, that is, the first feature sequence can be reduced. If not, the second determination result indicates that the feature value does not satisfy the second reduction condition, and the first feature sequence cannot be reduced.
[0118] S503: Generate a first position sequence corresponding to the first feature sequence according to the first determination result and the second determination result.
[0119] The first position sequence includes positions that meet the first reduction condition or the second reduction condition, and positions that do not meet the first reduction condition and the second reduction condition.
[0120] In an embodiment of the present application, after the processor obtains the first determination result and the second determination result based on the above steps, it can determine the position of the vector value that meets the first reduction condition according to the first determination result, and can determine the position of the eigenvalue that meets the second reduction condition according to the second determination result, and then generate a first position sequence corresponding to the first feature sequence according to the position of the vector value that meets the first reduction condition and the position of the eigenvalue that meets the second reduction condition.
[0121] Specifically, Figure 8 As shown, the "generating a first position sequence corresponding to the first feature sequence according to the first determination result and the second determination result" in the above step S503 includes:
[0122] S5031: If the first determination result indicates that the vector value satisfies the first reduction condition, a first value is set at the first target position of the first position sequence.
[0123] The first target position is the position of the vector value that meets the first reduction condition, and the target position corresponds to the position of the vector value. The first value may be "1", indicating that the vector value at this position in the intermediate vector meets the first reduction condition.
[0124] In an embodiment of the present application, when the processor determines that the first determination result indicates that the vector value satisfies the first reduction condition, in this case, it indicates that there is a dependency relationship between adjacent elements, which is not easy to process directly in parallel, so it is necessary to update the eigenvalues to eliminate the dependency. In this case, the first value can be set at the first target position of the first position sequence.
[0125] S5032: If the second determination result indicates that the characteristic value satisfies the second reduction condition, a second value is set at the second target position of the first position sequence.
[0126] The second target position is the position of the feature value that meets the second reduction condition. The second value may be "2", indicating that the feature value of the position in the first feature sequence meets the second reduction condition.
[0127] In the embodiment of the present application, when the processor determines that the second determination result indicates that the eigenvalue satisfies the second reduction condition, in this case, it indicates that there is a dependency relationship between adjacent elements, which is not easy to directly process in parallel, so it is necessary to update the eigenvalue to eliminate the dependency relationship. Then, the second value can be set at the second target position of the first position sequence, wherein the first position sequence can refer to Figure 7 shown.
[0128] S504: Perform reduction processing on the first feature sequence according to the first position sequence to obtain a second feature sequence.
[0129] The second feature sequence is the first feature sequence that has been reduced.
[0130] In the embodiment of the present application, after the processor obtains the first position sequence based on the above steps, the eigenvalue corresponding to the first numerical position in the first position sequence can be removed to obtain a second characteristic sequence, and the removed eigenvalues are directly used as part of the eigenvalues of the previous leaf node matrix. For example, if the intermediate vector is [0abcd0e], the first characteristic sequence is [MNNPQST], and the position of the first numerical value is [0] and [5], then the second characteristic sequence can be [NNPQT].
[0131] In one embodiment, Fig. 9 As shown, after S503 "generating a first position sequence corresponding to the first feature sequence according to the first determination result and the second determination result", the data processing method further includes:
[0132] S601, updating the feature value at the third target position in the first feature sequence to generate a third feature sequence.
[0133] The third target position is the position of the eigenvalue that meets the second reduction condition. The third feature sequence is the sequence after the first feature sequence is updated. Any eigenvalue in the third feature sequence does not meet the second contraction condition, that is, two adjacent eigenvalues are not equal. The third target position corresponds to the position of the second value in the first position sequence.
[0134] In the present application embodiment, Figure 7 As shown, after obtaining the first position sequence, the processor can update the feature value at the third target position in the first feature sequence to obtain the updated feature value, and continue to determine whether the feature value after the updated feature value meets the second reduction condition. If so, continue to update the feature value that meets the second contraction condition until all feature values in the first feature sequence do not meet the second contraction condition to generate a third feature sequence. Specifically, the feature value at the third target position can be updated by the feature value at the third target position and the feature value before the third target position, or it can be updated using a preset algorithm. The specific updating method is not limited in this embodiment. The first feature sequence is [MNNPQST], and the position of the second numerical value is [2]. Then the second feature sequence can be [MNBPQST], where the second N is updated to B.
[0135] S602: Update the second value in the first position sequence according to the third feature sequence to generate a second position sequence.
[0136] The second position sequence is the updated first position sequence.
[0137] In the embodiment of the present application, after the processor obtains the third feature sequence based on the above steps, it can update the second value in the first position sequence according to the third feature sequence to generate a second position sequence (see Figure 7 second position sequence shown).
[0138] Correspondingly, when the processor executes S504 "reducing the first feature sequence according to the first position sequence to obtain the second feature sequence", it specifically executes S603: reducing the first feature sequence according to the second position sequence to obtain the second feature sequence.
[0139] In the embodiment of the present application, after obtaining the second position sequence, the processor may perform reduction processing on the first feature sequence according to the second position sequence to obtain the second feature sequence.
[0140] Specifically, Fig.10 As shown, the "reducing the first feature sequence according to the second position sequence to obtain the second feature sequence" in the above step S603 includes:
[0141] S6021, determining a fourth target position according to the position of the preset value in the second position sequence.
[0142] In the embodiment of the present application, after obtaining the second position sequence, the processor can determine the fourth target position in the second feature sequence, that is, the position corresponding to the preset value, that is, the vector with a vector value of 0 in the intermediate vector.
[0143] S6022, remove the feature value at the fourth target position in the first feature sequence to generate a second feature sequence, and generate a third feature sequence according to the removed feature value.
[0144] In an embodiment of the present application, after the processor obtains the fourth target position based on the above steps, it can remove the feature value at the fourth target position in the first feature sequence to generate a second feature sequence, and generate a third feature sequence based on the removed feature value.
[0145] The intermediate vector is [0abcd0e], the first characteristic sequence is [MNNPQST], the position of the first numerical value is [0] and [5], and the position of the second numerical value is [2]. Then the second characteristic sequence can be [NBPQT], and the third characteristic sequence is [MS].
[0146] The method described in the embodiment of the present application can record the positions of the eigenvalues that can be reduced through the first position sequence, which is convenient for subsequent reduction processing operations, can improve the reduction processing efficiency, and further improve the data processing efficiency.
[0147] In one embodiment, based on the above steps, a specific implementation method for determining the second characteristic parameter of the leaf node matrix is also provided, such as Fig.11 As shown, the "determining the second characteristic parameter of the leaf node matrix according to the second characteristic sequence" in the above step S403 includes:
[0148] S701, constructing a characteristic equation of a leaf node matrix according to the second characteristic sequence, and solving the characteristic equation to obtain an eigenvalue of the characteristic equation.
[0149] In an embodiment of the present application, the processor obtains a second characteristic sequence based on the aforementioned steps, and can construct a characteristic equation of the leaf node matrix according to the second characteristic sequence, and solve the characteristic equation to obtain the characteristic value of the characteristic equation.
[0150] S702, determining a second characteristic parameter according to the characteristic value of the characteristic equation and the characteristic value in the third characteristic sequence.
[0151] In the embodiment of the present application, after the processor obtains the eigenvalue of the characteristic equation based on the above steps, the eigenvalue in the second characteristic parameter can be determined according to the eigenvalue of the characteristic equation and the eigenvalue in the third characteristic sequence, and then the eigenvector in the second characteristic parameter can be determined according to the eigenvalue in the second characteristic parameter and the preset formula. For example, the eigenvalue of the characteristic equation is [XYZTK], and the eigenvalue in the third characteristic sequence is MS, then the eigenvalue in the second characteristic parameter is XYZTKMS, wherein the position order of the eigenvalue of the characteristic equation and the eigenvalue in the third characteristic sequence is not limited.
[0152] The method described in the embodiment of the present application can record the positions of the characteristic values that can be reduced through the first position sequence and the second position sequence, and can reduce the first characteristic sequence in combination with the first shrinkage condition and the second shrinkage condition, which can save resources to the greatest extent and thus improve data processing efficiency.
[0153] In one embodiment, a specific implementation method for generating a first feature sequence is also provided, such as Fig.12 As shown, the "generating a first feature sequence according to the feature values in each first feature parameter" in the above step S301 includes:
[0154] S801, arranging the characteristic values in each first characteristic parameter in ascending order to obtain an initial characteristic sequence corresponding to each first characteristic parameter.
[0155] The initial feature sequence is a feature sequence in which the eigenvalues of the leaf node matrix are arranged in ascending order.
[0156] In the embodiment of the present application, after obtaining the first characteristic parameters of multiple leaf node matrices cascaded downward with the leaf node matrix, the processor can first arrange the characteristic values of each leaf node matrix cascaded downward in ascending order to obtain the initial characteristic sequence corresponding to the first characteristic parameter of each leaf node matrix cascaded downward. For details, see Fig.13 The initial feature sequence 1 and the initial feature sequence 2 in .
[0157] S802: Concatenate the initial feature sequences corresponding to all the first feature parameters to generate a concatenated feature sequence.
[0158] The concatenated feature sequence is a feature sequence obtained by concatenating all initial feature sequences.
[0159] In the embodiment of the present application, after the processor obtains the initial feature sequences corresponding to the first feature parameters based on the above steps, it can splice the initial feature sequences corresponding to all the first feature parameters to generate a spliced feature sequence.
[0160] S803, arranging the feature values in the concatenated feature sequence in ascending order to obtain a first feature sequence.
[0161] In an embodiment of the present application, after the processor obtains the spliced feature sequence based on the above steps, all feature values in the spliced feature sequence can be arranged in ascending order to obtain a first feature sequence. Specifically, the spliced feature sequence can be input into a preset sorting algorithm for ascending arrangement to obtain the first feature sequence.
[0162] Optional, such as Fig.14 As shown, the above step S803 of "arranging each feature value in the concatenated feature sequence in ascending order to obtain a first feature sequence" includes:
[0163] S8031, for any feature value in the concatenated feature sequence, determine the third position of the feature value in the first feature sequence according to the first position in the initial feature sequence to which the feature value belongs and the second position of the feature value in other initial feature sequences.
[0164] The first position is the address of the feature value in the initial feature sequence to which it belongs. The second position is the estimated address of the feature value in other initial feature sequences, for example, Fig.13 The first element "3" in the initial feature sequence is 0 because it is the first element in the initial feature sequence. It is between elements "2" and "7" in another initial feature sequence, so the second position of element "3" is 1. The third position is the sum of the first and second positions.
[0165] In the embodiment of the present application, after the processor obtains the concatenated feature sequence, for any feature value in the concatenated feature sequence, the processor first determines the first position of the feature value in the corresponding initial feature sequence, and then determines the second position of the feature value in other initial feature sequences, and then adds the first position and the second position to obtain the third position corresponding to the address of the feature value. For details, see Fig.13 For example, the first position of element "3" is 0, and the second position is 1, so the third position idx is 0+1=1, and the first position of element "9" is 3, and the second position is 3, so the third position is 6. It should be noted that each eigenvalue in the concatenated feature sequence is independent and parallel in the process of determining the third position. For any eigenvalue, a thread can be set for each eigenvalue, and the thread only needs to determine the first position and the second position of the eigenvalue itself to obtain the third position.
[0166] S8032: According to all the feature values in the spliced feature sequence, the positions of the corresponding feature values in the third position of the first feature sequence are adjusted to generate a first feature sequence.
[0167] In the embodiment of the present application, after the processor obtains the third positions of all feature values in the first feature sequence based on the above steps, the position of the corresponding feature value in the spliced feature sequence can be adjusted according to the third position to obtain the first feature sequence. Specifically,
[0168] For any thread, the third position of the feature value of the thread can be determined first, and then the feature value at the third position in the concatenated feature sequence can be adjusted to the feature value in the thread to obtain the first feature sequence. Fig.13 As shown, taking the thread where the characteristic value "13" is located as an example, the third position of the characteristic value "13" is 3+5=8, then the characteristic value at position "8" can be adjusted to "13" in the spliced characteristic sequence to generate the first characteristic sequence, and the characteristic value at position "8" in the first characteristic sequence is "13".
[0169] Compared with the existing method of serial sorting one by one, the method described in the embodiment of the present application can greatly improve the efficiency of eigenvalue sorting by using independent threads in the processor to parallelly process the ascending sorting of each eigenvalue, thereby improving the efficiency of data processing.
[0170] Based on all the above embodiments, a data processing method is also provided, which includes:
[0171] Get the matrix tree structure corresponding to the matrix to be processed.
[0172] For any leaf node matrix in the matrix tree structure, the eigenvalues in each first characteristic parameter are arranged in ascending order to obtain an initial characteristic sequence corresponding to each first characteristic parameter.
[0173] The initial feature sequences corresponding to all the first feature parameters are concatenated to generate a concatenated feature sequence.
[0174] For any feature value in the concatenated feature sequence, the third position of the feature value in the first feature sequence is determined according to the first position in the initial feature sequence to which the feature value belongs and the second position of the feature value in other initial feature sequences.
[0175] The positions of the corresponding eigenvalues in the spliced feature sequence are adjusted at the third positions of the first feature sequence according to all the eigenvalues in the spliced feature sequence to generate the first feature sequence, and the intermediate vector is generated according to the eigenvectors in each first feature parameter.
[0176] According to the first feature sequence and the intermediate vector, it is determined whether the first feature sequence can be reduced, and if it is determined that the first feature sequence can be reduced.
[0177] If it is determined that the first characteristic sequence can be reduced, then for each vector value in the intermediate vector, it is determined whether the vector value satisfies the first reduction condition to obtain a first determination result.
[0178] For each eigenvalue in the first eigenvalue sequence, it is determined whether the eigenvalue satisfies the second reduction condition to obtain a second determination result, wherein the position of the eigenvalue in the first eigenvalue sequence corresponds to the position of the vector value in the intermediate vector.
[0179] If the first determination result indicates that the vector value satisfies the first reduction condition, a first value is set at the first target position of the first position sequence, wherein the target position corresponds to the position of the vector value, and the first reduction condition includes that the vector value to be determined is a preset value.
[0180] If the second determination result indicates that the feature value satisfies the second reduction condition, a second value is set at the second target position of the first position sequence. The second reduction condition includes that the feature value to be determined is the same as the feature value at the previous position;
[0181] The feature value at the third target position in the first feature sequence is updated to generate a third feature sequence; the third target position corresponds to the position of the second value in the first position sequence.
[0182] The second value in the first position sequence is updated according to the third feature sequence to generate a second position sequence.
[0183] The third target position is determined according to the position of the preset value in the second position sequence.
[0184] The eigenvalue at the third target position in the first feature sequence is removed to generate a second feature sequence, and a third feature sequence is generated based on the removed eigenvalues. The characteristic equation of the leaf node matrix is constructed based on the second feature sequence, and the characteristic equation is solved to obtain the eigenvalue of the characteristic equation.
[0185] A second characteristic parameter is determined based on the characteristic value of the characteristic equation and the characteristic value in the third characteristic sequence.
[0186] If it is determined that the first feature sequence cannot be reduced, the second feature parameters of the leaf node matrix are determined according to the first feature sequence.
[0187] For a root node matrix in a matrix tree structure, characteristic parameters of a matrix to be processed are determined according to second characteristic parameters of a plurality of leaf node matrices cascaded downward with the root node matrix.
[0188] In the embodiment of the present application, the eigenvalue solution process of the symmetric tridiagonal matrix is optimized on the heterogeneous acceleration processor, which significantly improves the computing efficiency compared with the MAGMA library; the divide-and-conquer algorithm solution interface stedc is implemented on the device side of the heterogeneous acceleration processor, without relying on the CPU-side interface of the LAPACK library, reducing the memory copy between the CPU side and the acceleration card device side. Through the above optimization technology, the efficiency of solving the Hermite matrix eigenvalue problem on the heterogeneous acceleration processor is greatly improved.
[0189] like Fig.15 As shown in the figure, it shows the time consumption comparison of solving the Hermite matrix eigenvalue problem under different problem scales using the three mathematical libraries rocSOLVER, MAGMA, and cuSOLVER. The data of rocSOLVER and MAGMA are the test results on heterogeneous acceleration processors, and the data of cuSOLVER are the test results on V100. The horizontal axis is the matrix scale, the vertical axis on the left side of the bar graph is the percentage of the cuSOLVER library performance on V100, and the vertical axis on the right side of the line graph is the solution time (ms). It can be found that the performance of the optimized rocSOLVER is significantly better than that of the MAGMA library, which is about 3-6 times that of the MAGMA library; it is 55%-80% of the performance of cuSOLVER on V100.
[0190] like Fig.16 As shown in the figure, the optimized rocSOLVER library can achieve a performance improvement of about 10% when applied to examples of different problem sizes. The heevd eigenvalue solution time of the MAGMA library accounts for about 10% of the overall running time of the example; the heevd solution time of the optimized rocSOLVER library accounts for about 3% of the overall running time of the example.
[0191] The method described in the embodiment of the present application is implemented by a heterogeneous acceleration processor for solving the eigenvalue problem of a symmetric tridiagonal matrix. During the upward merging of subproblems represented by brother nodes, each group is executed in parallel. By recording intermediate data, the problem of solving the problem caused by the unequal scale of problems between groups is solved. In the reduction processing stage, the implementation of the parallel sorting algorithm and the design and implementation of the parallel detection and update algorithm detect in parallel whether all elements need to be shrunk, and only perform cyclic updates at the location where the shrinkage occurs.
[0192] The methods described in the above steps are all described in the above embodiments. Please refer to the above description for details and will not be repeated here.
[0193] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0194] Based on the same inventive concept, the embodiment of the present application also provides a data processing device for implementing the data processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more data processing device embodiments provided below can refer to the limitations on the data processing method above, and will not be repeated here.
[0195] In one embodiment, Fig.17 As shown, a data processing device is provided, comprising:
[0196] The acquisition module 11 is used to acquire the matrix tree structure corresponding to the matrix to be processed.
[0197] The first determination module 12 is used to determine, for any leaf node matrix in the matrix tree structure, a second characteristic parameter of the leaf node matrix according to first characteristic parameters of a plurality of leaf nodes cascaded downward with the leaf node matrix.
[0198] The second determination module 13 is used to determine the characteristic parameters of the matrix to be processed according to the second characteristic parameters of a plurality of leaf node matrices cascaded downward with the root node matrix in the matrix tree structure.
[0199] In one embodiment, the first determining module includes:
[0200] The generating unit is used to generate a first feature sequence according to the feature value in each first feature parameter, and to generate an intermediate vector according to the feature vector in each first feature parameter.
[0201] The first determining unit is used to determine the second characteristic parameter of the leaf node matrix according to the first characteristic sequence and the intermediate vector.
[0202] In one embodiment, the first determining unit includes:
[0203] The first determining subunit is used to determine whether the first feature sequence can be reduced according to the first feature sequence and the intermediate vector.
[0204] The reduction subunit is used to reduce the first feature sequence according to the first feature sequence and the intermediate vector to obtain a second feature sequence if it is determined that the first feature sequence can be reduced, and determine the second feature parameter of the leaf node matrix according to the second feature sequence.
[0205] The second determining subunit is used to determine the second characteristic parameters of the leaf node matrix according to the first characteristic sequence if it is determined that the first characteristic sequence cannot be reduced.
[0206] In one embodiment, the above-mentioned reduction subunit is specifically used to determine, for each vector value in the intermediate vector, whether the vector value satisfies the first reduction condition to obtain a first determination result; for each eigenvalue in the first feature sequence, determine whether the eigenvalue satisfies the second reduction condition to obtain a second determination result; the position of the eigenvalue in the first feature sequence corresponds to the position of the vector value in the intermediate vector; based on the first determination result and the second determination result, generate a first position sequence corresponding to the first feature sequence; and reduce the first feature sequence according to the first position sequence to obtain a second feature sequence.
[0207] In one embodiment, the above-mentioned reduction subunit is specifically used to set a first numerical value at a first target position of a first position sequence if the first determination result indicates that the vector value satisfies a first reduction condition; the target position corresponds to the position of the vector value; the first reduction condition includes that the vector value to be determined is a preset numerical value; if the second determination result indicates that the characteristic value satisfies a second reduction condition, a second numerical value is set at a second target position of the first position sequence; the second reduction condition includes that the characteristic value to be determined is the same as the characteristic value at the previous position.
[0208] In one embodiment, the above-mentioned reduction subunit is specifically used to update the feature value at the third target position in the first feature sequence to generate a third feature sequence; the third target position corresponds to the position of the second numerical value in the first position sequence; the second numerical value in the first position sequence is updated according to the third feature sequence to generate a second position sequence; the first feature sequence is reduced according to the second position sequence to obtain a second feature sequence.
[0209] In one embodiment, the above-mentioned reduction subunit is specifically used to determine the fourth target position according to the position of the preset numerical value in the second position sequence; remove the feature value at the fourth target position in the first feature sequence to generate a second feature sequence, and generate a third feature sequence according to the removed feature value.
[0210] In one embodiment, the second determining module includes:
[0211] The construction unit is used to construct a characteristic equation of the leaf node matrix according to the second characteristic sequence, and solve the characteristic equation to obtain the eigenvalue of the characteristic equation.
[0212] The second determining unit is used to determine the second characteristic parameter according to the characteristic value of the characteristic equation and the characteristic value in the third characteristic sequence.
[0213] In one embodiment, the generating unit includes:
[0214] The first arrangement subunit is used to arrange the characteristic values in each first characteristic parameter in ascending order to obtain an initial characteristic sequence corresponding to each first characteristic parameter.
[0215] The splicing subunit is used to splice the initial feature sequences corresponding to all the first feature parameters to generate a spliced feature sequence.
[0216] The second arrangement subunit is used to arrange the characteristic values in the concatenated characteristic sequence in ascending order to obtain a first characteristic sequence.
[0217] In one embodiment, the above-mentioned second arrangement unit is specifically used to determine, for any feature value in the spliced feature sequence, the third position of the feature value in the first feature sequence according to the first position in the initial feature sequence to which the feature value belongs and the second position of the feature value in other initial feature sequences; adjust the position of the corresponding feature value in the spliced feature sequence according to the third position of the first feature sequence of all the feature values in the spliced feature sequence to generate the first feature sequence.
[0218] Each module in the above data processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0219] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the data processing method described in any of the above embodiments are implemented.
[0220] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data processing method described in any of the above embodiments are implemented.
[0221] In one embodiment, a computer program product is provided, including a computer program, which implements the steps of the data processing method described in any of the above embodiments when executed by a processor.
[0222] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0223] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0224] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data processing method, characterized in that: The method is applied to a heterogeneous acceleration processor, and the method includes: Get the matrix tree structure corresponding to the matrix to be processed; For any leaf node matrix in the matrix tree structure, determine the second characteristic parameter of the leaf node matrix according to the first characteristic parameters of a plurality of leaf nodes cascaded downward with the leaf node matrix; For a root node matrix in the matrix tree structure, characteristic parameters of the matrix to be processed are determined according to second characteristic parameters of a plurality of leaf node matrices cascaded downward with the root node matrix.
2. The method according to claim 1, characterized in that The determining the second characteristic parameter of the leaf node matrix according to the first characteristic parameters of a plurality of leaf node matrices cascaded downward with the leaf node matrix comprises: Generating a first feature sequence according to the feature values in each of the first feature parameters, and generating an intermediate vector according to the feature vectors in each of the first feature parameters; A second characteristic parameter of the leaf node matrix is determined according to the first characteristic sequence and the intermediate vector.
3. The method according to claim 2, characterized in that The determining, according to the first characteristic sequence and the intermediate vector, a second characteristic parameter of the leaf node matrix includes: Determining whether the first feature sequence can be reduced according to the first feature sequence and the intermediate vector; If it is determined that the first feature sequence can be reduced, the first feature sequence is reduced according to the first feature sequence and the intermediate vector to obtain a second feature sequence, and a second feature parameter of the leaf node matrix is determined according to the second feature sequence; If it is determined that the first feature sequence cannot be reduced, the second feature parameter of the leaf node matrix is determined according to the first feature sequence.
4. The method according to claim 3, characterized in that The reducing the first feature sequence according to the first feature sequence and the intermediate vector to obtain a second feature sequence includes: For each vector value in the intermediate vector, determining whether the vector value satisfies a first reduction condition, and obtaining a first determination result; For each eigenvalue in the first feature sequence, determining whether the eigenvalue satisfies a second reduction condition, and obtaining a second determination result; the position of the eigenvalue in the first feature sequence corresponds to the position of the vector value in the intermediate vector; generating a first position sequence corresponding to the first feature sequence according to the first determination result and the second determination result; The first feature sequence is reduced according to the first position sequence to obtain a second feature sequence.
5. The method according to claim 4, characterized in that The step of generating a first position sequence corresponding to the first feature sequence according to the first determination result and the second determination result includes: If the first determination result indicates that the vector value satisfies a first reduction condition, a first value is set at a first target position of the first position sequence; the target position corresponds to the position of the vector value; the first reduction condition includes that the vector value to be determined is a preset value; If the second determination result indicates that the eigenvalue satisfies a second reduction condition, a second value is set at a second target position of the first position sequence; the second reduction condition includes that the eigenvalue to be determined is the same as the eigenvalue at the previous position.
6. The method according to claim 4, characterized in that The method further comprises: Updating the feature value at the third target position in the first feature sequence to generate a third feature sequence; the third target position corresponds to the position of the second value in the first position sequence; Update the second value in the first position sequence according to the third feature sequence to generate a second position sequence; The reducing the first feature sequence according to the first position sequence to obtain a second feature sequence includes: The first feature sequence is reduced according to the second position sequence to obtain a second feature sequence.
7. The method according to claim 6, characterized in that The reducing the first feature sequence according to the second position sequence to obtain a second feature sequence includes: determining a fourth target position according to the position of the preset value in the second position sequence; The feature value at the fourth target position in the first feature sequence is removed to generate the second feature sequence, and a third feature sequence is generated according to the removed feature value.
8. The method according to claim 7, characterized in that The determining the second characteristic parameter of the leaf node matrix according to the second characteristic sequence includes: Constructing a characteristic equation of the leaf node matrix according to the second characteristic sequence, and solving the characteristic equation to obtain an eigenvalue of the characteristic equation; The second characteristic parameter is determined according to the characteristic value of the characteristic equation and the characteristic value in the third characteristic sequence.
9. The method according to any one of claims 2 to 8, characterized in that: The step of generating a first feature sequence according to the feature values in each of the first feature parameters includes: Arranging the characteristic values in each of the first characteristic parameters in ascending order to obtain an initial characteristic sequence corresponding to each of the first characteristic parameters; Performing splicing processing on the initial feature sequences corresponding to all the first feature parameters to generate a spliced feature sequence; The feature values in the concatenated feature sequence are arranged in ascending order to obtain the first feature sequence.
10. The method according to claim 9, characterized in that The step of arranging the feature values in the concatenated feature sequence in ascending order to obtain the first feature sequence includes: For any feature value in the concatenated feature sequence, determine the third position of the feature value in the first feature sequence according to the first position in the initial feature sequence to which the feature value belongs and the second position of the feature value in other initial feature sequences; According to all the feature values in the spliced feature sequence, the positions of the corresponding feature values in the spliced feature sequence are adjusted at the third positions of the first feature sequence to generate the first feature sequence.