Data processing method, device and storage medium
By sorting and arranging the attributes of matrix operation tasks in optical integrated circuits according to their similarity, the problem of time-consuming calculation parameter setting in optical integrated circuits is solved and the data processing speed is improved.
Patent Information
- Application Number
- CN202511034263.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-07-25
AI Technical Summary
In optical integrated circuits, setting computing parameters takes a long time, resulting in lower data processing speed.
By obtaining the attribute similarity of matrix operation tasks, a task queue is formed according to the similarity sorting, and the matrix operation tasks with the highest similarity are arranged in adjacent positions and input into the optical integrated circuit for calculation in sequence.
The change time of the medium temperature in the optical integrated circuit is reduced, and the data processing speed is improved.
Smart Images

Figure CN120541359B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of optical computing technology, and in particular to data processing methods, devices and storage media. Background Art
[0002] Optical computing is the process of converting data into optical signals and utilizing optical principles (such as light interference, diffraction, and polarization) to perform computational tasks. Compared to traditional electronic computing, the propagation speed of light far exceeds that of electrons. Therefore, optical computing can achieve speeds far exceeding those of electronic computing.
[0003] Currently, in some technologies, when using some optical integrated circuits for data processing, it takes a long time to set calculation parameters and the data processing speed is low. Summary of the Invention
[0004] The present application provides a data processing method, a data processing device, an electronic device, a computer-readable storage medium, and a computer program product to at least solve the problem of low data processing speed in related technologies.
[0005] The present application provides a data processing method, the method comprising:
[0006] Acquiring task information, wherein the task information includes a plurality of matrix operation tasks;
[0007] Determining attribute similarities between different matrix operation tasks based on task attributes of each matrix operation task, wherein the task attributes include at least one of a matrix in the matrix operation task, a matrix dimension, an average value of matrix elements, and a task category;
[0008] sorting the plurality of matrix operation tasks according to the attribute similarity to obtain a task queue, wherein in the task queue, the matrix operation tasks with the greatest attribute similarity are arranged in adjacent positions;
[0009] The matrix operation tasks in the task queue are sequentially input into the optical integrated circuit for optical computing to obtain the running results of each matrix operation task.
[0010] The present application also provides a data processing device, comprising:
[0011] An information acquisition module is used to acquire task information, wherein the task information includes a plurality of matrix operation tasks;
[0012] a similarity determination module, configured to determine attribute similarities between different matrix operation tasks based on task attributes of each matrix operation task, wherein the task attributes include at least one of a matrix in the matrix operation task, a matrix dimension, an average value of matrix elements, and a task category;
[0013] a sorting module, configured to sort the plurality of matrix operation tasks according to the attribute similarity to obtain a task queue, wherein in the task queue, the matrix operation tasks with the greatest attribute similarity are arranged in adjacent positions;
[0014] The operation module is used to input the matrix operation tasks in the task queue into the optical integrated circuit for optical computing in sequence, and obtain the operation results of each matrix operation task.
[0015] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned data processing methods when executing the computer program.
[0016] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned data processing methods are implemented.
[0017] The present application also provides a computer program product, comprising a computer program, which implements the steps of any of the above-mentioned data processing methods when executed by a processor.
[0018] In some embodiments of the present application, matrix operation tasks with the greatest attribute similarity are arranged adjacent to each other in a task queue based on their attribute similarity. This allows the attribute similarity between two adjacent matrix operation tasks in the task queue to be high. When matrix operation tasks are sequentially input into an optical integrated circuit according to the sort order of the task queue, each change in the dielectric temperature of the optical integrated circuit can be minimized, thereby reducing waiting time and increasing data processing speed. This addresses the issue of slow data processing speed encountered in some technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0020] Figure 1 A schematic diagram of a module of a Mach-Zehnder interferometer provided for some embodiments of the present application;
[0021] Figure 2 A schematic diagram of one of the topological cascades of Mach-Zehnder interferometer units;
[0022] Figure 3Schematic diagram of another topological cascade of Mach-Zehnder interferometer units;
[0023] Figure 4 A flowchart of a data processing method provided in some embodiments of the present application;
[0024] Figure 5 A schematic diagram of task sequencing provided for some embodiments of the present application;
[0025] Figure 6 A schematic diagram of a module of a data processing device provided in some embodiments of the present application;
[0026] Figure 7 A schematic diagram of a module of an electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0028] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0029] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0030] Mach-Zehnder interferometer is an optical silicon-based device based on the principle of optical interference. Its core function is to precisely control the amplitude and phase of optical signals to complete complex mathematical operations. Figure 1 , which is a module schematic diagram of a Mach-Zehnder interferometer provided in some embodiments of the present application. Figure 1In the figure, the Mach-Zehnder interferometer includes a first phase shift arm 11, a second phase shift arm 12, an input coupler 13, and an output coupler 14. The phase shift arm is the optical path. The first phase shift arm 11 includes one or more phase modulators 15. The second phase shift arm 12 serves as a reference arm and may not include the phase modulator 15. The input coupler 13 can be used as a beam splitter for the optical signal, and the output coupler 14 can be used as a beam combiner for the optical signal. Both the input coupler 13 and the output coupler 14 can be called 2×2 couplers. Based on the above structure, the Mach-Zehnder interferometer allows the optical path difference to be adjusted to achieve interference with different phases. Specifically, when the input optical signal passes through the Mach-Zehnder interferometer, it will be split into two beams by the input coupler 13, and the two optical signals will be transmitted along the first phase shift arm 11 and the second phase shift arm 12 respectively. During the transmission process, the phase modulator 15 in the first phase shift arm 11 will change the phase of the optical signal based on the configuration. After passing through the output coupler 14, the two beams of light will be spatially recombined to form a new optical signal, which can be considered as a linear combination of the input optical signals. Based on the above principles, the Mach-Zehnder interferometer can perform matrix operations. Specifically, the second-order equivalent matrix of the two-port input and two-port output Mach-Zehnder interferometer unit can be shown as expression (2):
[0031]
[0032] in, 、 represents the input optical signal, and Can represent the input optical signal 、 phase change. 、 Indicates the output optical signal.
[0033] At present, in some optical integrated circuits used for optical computing, Figure 2 The triangular array arrangement shown or Figure 3 The rectangular array arrangement shown in the figure can realize a unitary matrix of any size by topologically cascading the Mach-Zehnder interferometer units ( Figure 2 and Figure 3 In the example, each rectangle can represent a Mach-Zehnder interferometer unit. Based on the above principle, the optical computing principle of optical integrated circuits can be implemented. For example, the multiplication of matrix A and matrix B using an optical integrated circuit can include the following steps:
[0034] 1) Perform singular value decomposition on matrix A to obtain a left unitary matrix, a right unitary matrix, and a rectangular diagonal matrix.
[0035] 2) Based on the decomposed left unitary matrix, right unitary matrix, and rectangular diagonal matrix, set the parameters of the optical integrated circuit. This is equivalent to realizing the matrix A inside the optical integrated circuit.
[0036] 3) Convert the data in matrix B into an optical signal and input the converted optical signal into the optical integrated circuit. As the optical signal propagates through the optical integrated circuit, its phase, amplitude, and other parameters change, and these changes are related to the parameters of the optical integrated circuit (that is, matrix A). In other words, the process of optical signal propagation through the optical integrated circuit can simulate the multiplication of matrix A and matrix B. The optical signal output by the optical integrated circuit can represent the result of the multiplication of matrix A and matrix B.
[0037] Based on the above description, phase adjustment is a crucial step in optical computing using optical integrated circuits, and its accuracy directly impacts the accuracy of matrix calculation results. Currently, some optical integrated circuits incorporate microheaters. When current is applied to the microheater, the heat generated by the microheater changes the refractive index of the surrounding medium, thereby adjusting the phase of the optical signal. This phase adjustment method is time-consuming and inefficient, resulting in lower data processing speeds. For example, suppose that when performing the multiplication of matrices A and B, the medium surrounding the microheater must be heated to 25 degrees Celsius to achieve a refractive index of 1.2. Furthermore, when performing the multiplication of matrices C and D, the medium must be heated to 10 degrees Celsius to achieve a refractive index of 1.0. When performing the multiplication of matrices A and B using the optical integrated circuit, the system must wait for the temperature of the medium surrounding the microheater to cool to 10 degrees Celsius before continuing to perform the multiplication of matrices C and D using the optical integrated circuit. If the temperature of the medium cools more slowly, the waiting time will be longer, thus affecting data processing speed. For example, suppose that when performing the multiplication of matrices E and F, the medium surrounding the microheater needs to be heated to 35 degrees Celsius to achieve a refractive index of 1.8. If the microheater's heating efficiency is low and the medium temperature rises slowly, a longer wait time will be required, which will affect data processing speed.
[0038] In view of this, the present application provides a data processing method that can greatly improve the efficiency of optical computing and solve the problem of low data processing speed in some technologies. The data processing method can be applied to electronic devices. The electronic devices may include but are not limited to tablet computers, desktop computers, laptop computers, servers, controllers, etc. Figure 4 , which is a flow chart of the data processing method provided in some embodiments of the present application. Figure 4 In the data processing method, the data processing method includes the following steps:
[0039] Step S401: Acquire task information, which includes multiple matrix operation tasks.
[0040] In this embodiment, the electronic device executing the method of the present application may include a human-computer interaction interface. The electronic device may receive multiple matrix operation tasks input by a user through the human-computer interaction interface.
[0041] In other embodiments, the electronic device executing the method of the present application can extract multiple matrix operation tasks based on the received data. For example, after the central processing unit receives the model training task, it can decompose the model training task and extract multiple matrix operation tasks. This application does not limit the method for obtaining task information.
[0042] Each matrix operation task can include at least one matrix and an operation type for the matrix. For example, matrix operation task A can include matrix A1 and matrix A2, and specify that the operation type between matrix A1 and matrix A2 is multiplication; matrix operation task B can include matrix B1 and constant M, and specify that the operation type between matrix B1 and constant M is multiplication; matrix operation task C can include matrix C1, matrix C2, and matrix C3, and specify that the operation type between matrix C1, matrix C2, and matrix C3 is addition.
[0043] Step S402 : determining attribute similarities between different matrix operation tasks based on task attributes of each matrix operation task, wherein the task attributes include at least one of a matrix in the matrix operation task, a matrix dimension, an average value of matrix elements, and a task category.
[0044] Specifically, the task attribute similarity may represent at least one of matrix similarity, matrix dimension similarity, matrix element average similarity, and task category similarity, which are described below respectively.
[0045] 1) Matrix similarity refers to the degree of matrix similarity between different matrix operation tasks. For example, if matrix operation task A includes matrix A1 and matrix operation task B includes matrix B1, the similarity between matrix A1 and matrix B1 can be calculated, and the result of the similarity calculation can be used as the matrix similarity between matrix operation tasks A and B.
[0046] Specifically, for any two matrices, a comprehensive evaluation can be performed on the matrix element values, element value distribution, matrix dimensions, etc. of the two matrices to obtain the matrix similarity of the two matrices. For example, suppose that both matrix A1 and matrix B1 are matrices with 3 rows and 2 columns, and in matrix A1, the element value of the 1st row is 0, the element value of the 2nd row is 2, and the element value of the 3rd row is 1, and in matrix B1, the element value of the 1st row is 0, the element value of the 2nd row and 1st column is 2, the element value of the 2nd row and 2nd column is 0, and the element value of the 3rd row is 1. Since matrix A1 and matrix B1 have the same matrix dimensions and similar element value distributions, it can be considered that matrix A1 and matrix B1 have a high similarity. For another example, suppose that matrix C1 is a matrix with 10 rows and 2 columns, and matrix D1 is a matrix with 2 rows and 2 columns, and there are no elements with values lower than 10 in matrix C1, and no elements with values higher than 10 in matrix D1. Since the matrix dimensions of matrix C1 and matrix D1 are quite different, and the element value distributions are also quite different, it can be considered that matrix A1 and matrix B1 have a low similarity.
[0047] Furthermore, when two matrix operation tasks each include multiple matrices, the similarity calculation can be performed on each matrix of one matrix operation task with each matrix in the other matrix operation task, and the similarity calculation results are averaged to obtain the matrix similarity of the two matrix operation tasks. In this way, the matrix similarity of the two matrix operation tasks can be evaluated as a whole. For example, assuming that matrix operation task A includes matrix A1 and matrix A2, and matrix operation task B includes matrix B1, the matrix similarity between matrix operation task A and matrix operation task B can be calculated as follows:
[0048] Calculate the similarity between matrix A1 and matrix B1 to obtain the similarity result Q1;
[0049] Calculate the similarity between matrix A2 and matrix B1 to obtain the similarity result Q2;
[0050] The similarity results Q1 and Q2 are averaged to obtain the average similarity result Q3.
[0051] Among them, the average similarity result Q3 can be used as the matrix similarity between matrix operation task A and matrix operation task B.
[0052] In the subsequent embodiments of this application, a better method for calculating matrix similarity is provided, which will not be described here in detail.
[0053] 2) Matrix dimension similarity refers to the degree of similarity between the matrix dimensions of different matrix operation tasks. For example, suppose matrix operation task A includes matrix A1, and matrix operation task B includes matrix B1. Matrix A1 has 4 rows and 3 columns, while matrix B1 has 30 rows and 50 columns. Since the dimensions of matrix A1 and matrix B1 differ significantly, the matrix dimension similarity between matrix operation tasks A and B is considered low. Conversely, suppose the dimensions of matrix A1 are 4 rows and 3 columns, while the dimensions of matrix B1 are 4 rows and 2 columns. Since the dimensions of matrix A1 and matrix B1 are similar, the matrix dimension similarity between matrix operation tasks A and B is considered high.
[0054] Furthermore, if two matrix operation tasks each include multiple matrices, dimensional similarity can be calculated for each matrix in one matrix operation task with each matrix in the other matrix operation task. The dimensional similarity results can then be averaged to obtain the matrix dimensional similarity for the two matrix operation tasks. The relevant principles are similar to those for calculating matrix similarity above and will not be elaborated on here.
[0055] In this embodiment, the dimensional similarity between any two matrices can be calculated based on Expression (2): , and then obtain the matrix dimension similarity between the two matrix operation tasks.
[0056] (2)
[0057] in, represents the number of rows of the first matrix, represents the number of columns of the second matrix, represents the number of rows of the first matrix, Indicates the number of columns in the second matrix.
[0058] 3) Matrix element mean similarity refers to the degree of similarity between the mean values of matrix elements in different matrix operation tasks. For example, suppose matrix operation task A includes matrix A1, and matrix operation task B includes matrix B1. The mean value of matrix elements in matrix A1 is 0.5, and the mean value of matrix elements in matrix B1 is 5. Since the mean values of matrix elements in matrix A1 and matrix B1 differ significantly, the mean similarity between matrix element means in matrix operation tasks A and B is low. Conversely, suppose the mean value of matrix elements in matrix A1 is 0.5, and the mean value of matrix elements in matrix B1 is 0.6. Since the mean value difference between matrix elements in matrix A1 and matrix B1 is relatively small, the mean similarity between matrix element means in matrix operation tasks A and B is high.
[0059] Similar to the above-mentioned matrix similarity and matrix dimension similarity, when two matrix operation tasks each include multiple matrices, the matrix element average similarity of each matrix in one of the matrix operation tasks can be calculated with each matrix in the other matrix operation task, and the calculation results can be averaged to obtain the matrix element average similarity of the two matrix operation tasks.
[0060] 4) The task category is related to the matrix in each matrix operation task. In this embodiment, the task category of each matrix operation task can be determined according to the following method.
[0061] 41) If the matrix in a matrix operation task is used as an operator for a general matrix multiplication (GEMM), the task category of the matrix operation task can be task category 1. Specifically, the general form of general matrix multiplication is C=AB, where A is a matrix with m1 rows and n1 columns, B is a matrix with m2 rows and n2 columns, and C is the product of matrices A and B.
[0062] 42) If the matrix in a matrix operation task is used as a linear operator, the task category of the matrix operation task can be the second task category. Specifically, the second task category is similar to the first task category, with the main difference being that the second task category emphasizes the transformation results of the matrix on the vector, such as stretching and rotation.
[0063] 43) If the matrix in a matrix operation task functions as a probability distribution matrix, the task category of the matrix operation task can be the third task category. Specifically, when the matrix functions as a probability distribution matrix, each row or column of the matrix represents a probability distribution, all matrix elements are non-negative, and under normal circumstances, the sum of the values of the elements in each row (or column) is 1.
[0064] 44) If the matrix in a matrix operation task is used to represent a dataset, the task category of the matrix operation task can be the fourth task category. Specifically, when a matrix is used as a dataset, it refers to a structured representation of a specific dataset in a matrix form. For example, taking the iris dataset as an example, each row of the matrix can represent the measurement data of a flower, such as sepal length, sepal width, petal length, and petal width. Each column of the matrix can represent a different feature. For example, the first column is the sepal length of all flowers, and the second column is the sepal width of all flowers.
[0065] 45) If the matrix in a matrix operation task is used to represent an image, the task category of the matrix operation task may be task category 5. Specifically, when the matrix is used to represent an image, each element in the matrix may represent the brightness value of a pixel in the image.
[0066] In this embodiment, the task information may include the task category of each matrix operation task. For a matrix operation task, if the task information does not include the task category for that matrix operation task, the matrix attributes can be obtained from the matrix operation task and input into a trained classification model to determine the task category for the matrix operation task. Matrix attributes may include, but are not limited to, matrix dimensions, the distribution of matrix element values, and the matrix's singular value vectors. This makes it convenient to quickly determine the task category of a matrix operation task even when the task information does not include the task category.
[0067] Step S403 , sorting the plurality of matrix operation tasks according to attribute similarity to obtain a task queue, wherein in the task queue, the matrix operation tasks with the greatest attribute similarity are arranged in adjacent positions.
[0068] In this embodiment, when the attribute similarity represents multiple of matrix similarity, matrix dimension similarity, matrix element average similarity, and task category similarity, multiple matrix operation tasks can be sorted in sequence according to these similarities. Figure 5 , which is a schematic diagram of task sorting provided in some embodiments of the present application. Figure 5 In the example, each quadrilateral box can represent a matrix operation task, and the width of the quadrilateral box can represent the number of matrix columns in the matrix operation task, and the height can represent the number of matrix rows in the matrix operation task. Assuming that multiple matrix operation tasks are initially obtained as shown in queue 1, the matrix operation tasks in queue 1 can be sorted according to the following steps:
[0069] 1) Sort the matrix operation tasks in queue 1 according to the matrix dimension similarity to obtain queue 2. Specifically, the matrix operation tasks with the greatest matrix dimension similarity can be arranged in adjacent positions. For example, Figure 5 As can be seen, since the matrix dimensions of matrix operation tasks 2, 11, 12, and 13 are highly similar, they are arranged in adjacent positions. Similarly, since the matrix dimensions of matrix operation tasks 1 and 3 are highly similar, they are arranged in adjacent positions. And so on.
[0070] 2) Rearrange the matrix operation tasks in adjacent positions in queue 2 according to matrix similarity to obtain queue 3. Specifically, the matrix operation tasks with the greatest matrix similarity can be arranged in adjacent positions. For example, Figure 5It can be seen that among the matrix operation tasks 2, 11, 12, and 13 in adjacent positions in queue 2, since the matrix similarity between matrix operation task 2 and matrix operation task 12 is relatively large, matrix operation task 2 and matrix operation task 12 can be arranged in adjacent positions. Similarly, among the matrix operation tasks 7, 8, 9, 10, and 14 in adjacent positions in queue 2, since the matrix similarity between matrix operation task 8 and matrix operation task 10 is the greatest, and the matrix similarity between matrix operation task 10 and matrix operation task 14 is the greatest, matrix operation task 8 and matrix operation task 10 can be arranged in adjacent positions, and matrix operation task 10 and matrix operation task 14 can be arranged in adjacent positions.
[0071] Following a similar principle, adjacent matrix operation tasks in queue 3 can be reordered based on matrix element average value similarity to obtain queue 4. Furthermore, adjacent matrix operation tasks in queue 4 can be reordered based on matrix category similarity to obtain queue 5. Reordering adjacent matrix operation tasks in queue 4 based on matrix category similarity places matrix operation tasks of the same matrix category in adjacent positions. Queue 5 can then serve as the final task queue obtained through sorting.
[0072] In other embodiments, when the attribute similarity represents multiple of matrix similarity, matrix dimension similarity, matrix element average similarity, and task category similarity, the multiple similarities can be weighted to obtain a total similarity between the matrix operation tasks, and the multiple matrix operation tasks can be sorted based on the total similarity to obtain a task queue. In the task queue, the matrix operation tasks with the largest total similarity are arranged in adjacent positions.
[0073] For example, assuming the weight of matrix similarity is 0.3, the weight of matrix dimension similarity is 0.5, the weight of matrix element average similarity is 0.1, and the weight of task category similarity is 0.1, the matrix similarity between matrix operation tasks A and B is 0.7, the matrix dimension similarity is 0.65, the matrix element average similarity is 0.9, and the task category similarity is 0.8. Then the total similarity between matrix operation tasks A and B is 0.7*0.3+0.65*0.5+0.9*0.1+0.8*0.1.
[0074] In the above embodiment, by calculating the total similarity between matrix operation tasks, the number of sorting times can be reduced and the data processing efficiency can be improved.
[0075] Step S404: input the matrix operation tasks in the task queue into the optical integrated circuit for optical computing in sequence to obtain the running results of each matrix operation task.
[0076] Specifically, each matrix operation task can be sequentially input into the optical integrated circuit for optical computing according to the order in which they appear in the task queue. Because matrix operation tasks at adjacent positions in the task queue have high similarity, the temperature variation of the medium in the optical integrated circuit can be relatively small. This reduces the waiting time during phase adjustment, thereby increasing data processing speed.
[0077] In summary, in the technical solutions of some embodiments of the present application, by arranging the matrix operation tasks with the greatest attribute similarity in adjacent positions in the task queue according to the attribute similarity between different matrix operation tasks, the attribute similarity between two adjacent matrix operation tasks in the task queue can be relatively high. When the matrix operation tasks are sequentially input into the optical integrated circuit according to the sort order of the task queue, each change in the dielectric temperature of the optical integrated circuit can be relatively small, thereby reducing waiting time and increasing data processing speed. This can solve the problem of slow data processing speed in some technologies.
[0078] Simply put, as matrix operation tasks in the task queue are sequentially input into the optical integrated circuit, the medium temperature within the optical integrated circuit can gradually change. For example, when executing the first matrix operation task, the medium temperature is 15 degrees Celsius; when executing the second matrix operation task, the medium temperature is 15.5 degrees Celsius; and when executing the third matrix operation task, the medium temperature is 15.8 degrees Celsius. This way, each time the medium temperature is adjusted, the waiting time can be greatly shortened and data processing speed can be improved.
[0079] For ease of understanding, the following describes the execution process of unsorted matrix operation tasks. Figure 5 For example, after executing matrix operation task 2, due to the significant difference between matrix operation task 2 and matrix operation task 3, a long warm-up period is required before executing matrix operation task 3 to allow the medium temperature to reach the required temperature for executing matrix operation task 3. Similarly, after executing matrix operation task 10, due to the significant difference between matrix operation task 10 and matrix operation task 11, a long cool-down period is required before executing matrix operation task 11 to allow the medium temperature to reach the required temperature for executing matrix operation task 11. This long wait time reduces data processing efficiency.
[0080] In some embodiments, each optical integrated circuit has its own supported matrix dimensions. For example, the maximum matrix dimension supported by optical integrated circuit P1 is 32 rows and 32 columns, while the maximum matrix dimension supported by optical integrated circuit P2 is 64 rows and 64 columns. Among the multiple matrix operation tasks acquired in step S401, it is possible that some matrices have larger dimensions while others have smaller dimensions. Therefore, when executing all matrix operation tasks using the same optical integrated circuit, the matrix dimensions of the matrix operation tasks may exceed the matrix dimensions supported by the optical integrated circuit. For example, the maximum matrix dimension supported by optical integrated circuit P3 is 128 rows and 128 columns, but among the acquired matrix operation tasks, a matrix with 512 rows and 512 columns exists. In this case, optical integrated circuit P3 cannot execute all matrix operation tasks.
[0081] In view of this, in some embodiments, there are multiple optical integrated circuits, and different optical integrated circuits support different matrix dimensions; the sorting of the multiple matrix operation tasks according to attribute similarity in step S403 may include:
[0082] Dividing the plurality of matrix operation tasks into at least one initial task queue according to the matrix dimensions of the matrix operation tasks and the matrix dimensions supported by the optical integrated circuit, each initial task queue corresponding to one of the optical integrated circuits, and each optical integrated circuit being used to process the matrix operation tasks in the corresponding initial task queue;
[0083] The matrix operation tasks in each initial task queue are sorted according to at least one of matrix dimension similarity, matrix similarity, matrix element average similarity, and task category similarity to obtain at least one task queue.
[0084] Specifically, the matrix dimensions of a matrix operation task can be rounded up to an integer to obtain an optical integrated circuit used to perform the matrix operation task. For example, assume that the maximum matrix dimension supported by optical integrated circuit P1 is 32 rows and 32 columns, the maximum matrix dimension supported by optical integrated circuit P2 is 64 rows and 64 columns, and the maximum matrix dimension supported by optical integrated circuit P3 is 128 rows and 128 columns. If the matrix dimension of matrix operation task A is 65 rows and 65 columns, matrix operation task A can be placed in the initial task queue corresponding to optical integrated circuit P3. This ensures that each matrix operation task can be executed normally, and avoids the problem of the matrix dimension of the matrix operation task not matching the maximum matrix supported by the optical integrated circuit.
[0085] In some embodiments, considering that the difference in matrix dimensions has the greatest impact on the medium temperature, the matrix operation tasks in each initial task queue are sorted according to at least one of matrix dimension similarity, matrix similarity, matrix element average similarity, and task category similarity, including:
[0086] sorting the matrix operation tasks in one of the initial task queues according to matrix dimension similarity to obtain a first task queue, wherein in the first task queue, the matrix operation tasks with the greatest matrix dimension similarity are arranged in adjacent positions;
[0087] Reorder the matrix operation tasks at adjacent positions in the first task queue according to at least one of matrix similarity, matrix element average value similarity, and task category similarity.
[0088] In this way, the matrix operation tasks may be sorted first according to the matrix dimensions, so that when the matrix operation tasks are executed in the order in the task queue, the medium temperature in the optical integrated circuit generally increases or decreases.
[0089] In some embodiments, considering that a high medium temperature may cause a significant crosstalk problem to the optical integrated circuit, the above-mentioned sorting of the matrix operation tasks in one of the initial task queues according to matrix dimension similarity may include:
[0090] In one of the initial task queues, the matrix operation tasks with the greatest matrix dimension similarity are arranged in adjacent positions in the order of matrix dimensions from small to large.
[0091] Accordingly, step S404 of sequentially inputting the matrix operation tasks in the task queue into the optical integrated circuit for optical computing includes:
[0092] In one of the task queues, the matrix operation tasks at both ends of the task queue are compared to determine the target end where the matrix operation task with the smaller matrix dimension is located;
[0093] Starting from the target end, each matrix operation task in the task queue is input into the corresponding optical integrated circuit in turn.
[0094] In this way, when executing matrix operation tasks, the medium temperature in the optical integrated circuit can gradually change from low temperature to high temperature, reducing the crosstalk problem in the optical integrated circuit.
[0095] In some embodiments, after prioritizing the sorting of matrix operation tasks according to matrix dimension similarity, although the medium temperature generally rises or falls, the medium temperature may also experience small fluctuations due to the influence of matrix similarity, matrix element average value similarity, and task category similarity. Among the matrix similarity, matrix element average value similarity, and task category similarity, task category similarity has the greatest impact on the medium temperature. In view of this, the above-mentioned reordering of matrix operation tasks in adjacent positions in the first task queue according to at least one of matrix similarity, matrix element average value similarity, and task category similarity may include:
[0096] Among the matrix operation tasks in adjacent positions in the first task queue, matrix operation tasks with the same task category are arranged in adjacent positions to obtain a second task queue;
[0097] The matrix operation tasks with the same task category in the second task queue are reordered according to at least one of matrix similarity and matrix element average value similarity.
[0098] In this way, fluctuations in the medium temperature can be reduced.
[0099] Furthermore, between matrix similarity and matrix element average similarity, matrix similarity has the greatest impact on the medium temperature. In view of this, the above-mentioned reordering of matrix operation tasks with the same task category in the second task queue according to at least one of matrix similarity and matrix element average similarity includes:
[0100] Among the matrix operation tasks with the same task category in the second task queue, the matrix operation tasks with the largest matrix similarity are arranged in adjacent positions to obtain a third task queue;
[0101] Among the matrix operation tasks in adjacent positions in the third task queue, the average value of the matrix elements of each matrix operation task is calculated, and the matrix operation tasks are sorted in ascending order of the average value of the matrix elements, wherein the matrix operation tasks with smaller average values of the matrix elements are input into the optical integrated circuit first, and the matrix operation tasks with larger average values of the matrix elements are input into the optical integrated circuit later.
[0102] This further reduces medium temperature fluctuations. Furthermore, among adjacent matrix operations, the matrix operations with the smallest average values are fed into the optical integrated circuit first. This ensures that the medium temperature changes from low to high temperatures, reducing crosstalk within the optical integrated circuit.
[0103] The following describes the calculation method of matrix similarity.
[0104] In some embodiments, for a first matrix operation task and a second matrix operation task having the same task category, if the matrices in the first matrix operation task and the second matrix operation task are both used as operators for general matrix multiplication, the matrix similarity between the first matrix operation task and the second matrix operation task is calculated based on the following method:
[0105] Extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task;
[0106] The Euclidean distance between the first matrix and the second matrix is calculated, and the Euclidean distance is used as the matrix similarity between the first matrix operation task and the second matrix operation task.
[0107] Specifically, the Euclidean distance E1 between the first matrix and the second matrix can be calculated according to Expression (3).
[0108]
[0109] in, is the matrix element value of the i-th row and j-th column of the first matrix, is the matrix element value in the i-th row and j-th column of the second matrix.
[0110] In some embodiments, for a first matrix operation task and a second matrix operation task having the same task category, if the matrices in the first matrix operation task and the second matrix operation task are both used as linear operators, the matrix similarity between the first matrix operation task and the second matrix operation task is calculated based on the following method:
[0111] Extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task;
[0112] Calculate the maximum singular value of the first matrix and the maximum singular value of the second matrix;
[0113] A matrix similarity between the first matrix operation task and the second matrix operation task is determined based on a maximum singular value difference between the first matrix and the second matrix.
[0114] Specifically, the first matrix can be subjected to singular value decomposition to obtain the first diagonal matrix and the maximum element value in the first diagonal matrix. , and the second matrix can be decomposed into a singular value to obtain the second diagonal matrix and the maximum element value in the second diagonal matrix , and then based on expression (4), the matrix similarity E2 between the first matrix operation task and the second matrix operation task can be determined.
[0115]
[0116] In some embodiments, for a first matrix operation task and a second matrix operation task having the same task category, if the matrices in the first matrix operation task and the second matrix operation task are both used as probability distribution matrices, the matrix similarity between the first matrix operation task and the second matrix operation task is calculated based on the following method:
[0117] Extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task;
[0118] The Kullback-Leibler divergence of the first matrix and the second matrix is calculated, and the Kullback-Leibler divergence is used as the matrix similarity between the first matrix operation task and the second matrix operation task.
[0119] Specifically, the Kullbeck-Leibler divergence E3 of the first matrix and the second matrix can be calculated based on Expression (5).
[0120]
[0121] in, is the matrix element value of the i-th row and j-th column of the first matrix, is the matrix element value in the i-th row and j-th column of the second matrix.
[0122] In some embodiments, for a first matrix operation task and a second matrix operation task having the same task category, if matrices in the first matrix operation task and the second matrix operation task are used to represent a data set, the matrix similarity between the first matrix operation task and the second matrix operation task is calculated based on the following method:
[0123] Extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task;
[0124] Using the column data of the first matrix as features, calculating the Pearson correlation coefficient matrix between the features of the first matrix, and using the column data of the second matrix as features, calculating the Pearson correlation coefficient matrix between the features of the second matrix;
[0125] The matrix similarity between the first matrix operation task and the second matrix operation task is determined based on the difference between the Pearson correlation coefficient matrices of the first matrix and the second matrix.
[0126] Specifically, taking the first matrix as an example, the Pearson correlation coefficient matrix between the features of the first matrix can be calculated based on expression (6): .
[0127]
[0128] in, is the j-th row element value of the first matrix, is the value of the kth column element of the first matrix, is the variance of the j-th row element value of the first matrix, is the variance of the elements in the kth column of the first matrix.
[0129] Furthermore, based on Expression (7), the matrix similarity E4 between the first matrix operation task and the second matrix operation task can be determined.
[0130]
[0131] in, is the Pearson correlation coefficient matrix between the features of the first matrix, is the Pearson correlation coefficient matrix between the features of the second matrix.
[0132] In some embodiments, for a first matrix operation task and a second matrix operation task having the same task category, if matrices in the first matrix operation task and the second matrix operation task are used to represent an image, the matrix similarity between the first matrix operation task and the second matrix operation task is calculated based on the following method:
[0133] Extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task;
[0134] A structural similarity index of the first matrix and the second matrix is calculated, and the structural similarity index is used as the matrix similarity between the first matrix operation task and the second matrix operation task, wherein the structural similarity index refers to the difference between the images represented by the first matrix and the second matrix.
[0135] Specifically, the matrix similarity E5 between the first matrix operation task and the second matrix operation task can be determined based on Expression (8).
[0136]
[0137] in, , , , represents the pixel average value of the first matrix, represents the pixel average value of the second matrix, represents the standard deviation of the first matrix, represents the standard deviation of the second matrix, represents the covariance of the first matrix and the second matrix.
[0138] This completes the description of this application plan.
[0139] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0140] Corresponding to the data processing method, the present application also provides a data processing device. Figure 6 , which is a module schematic diagram of a data processing device provided in some embodiments of the present application.
[0141] Information acquisition module 601, used to acquire task information, the task information includes multiple matrix operation tasks;
[0142] A similarity determination module 602 is configured to determine attribute similarities between different matrix operation tasks based on task attributes of each matrix operation task, wherein the task attributes include at least one of a matrix in the matrix operation task, a matrix dimension, an average value of matrix elements, and a task category;
[0143] A sorting module 603 is used to sort the plurality of matrix operation tasks according to attribute similarity to obtain a task queue, wherein the matrix operation tasks with the greatest attribute similarity are arranged in adjacent positions in the task queue;
[0144] The operation module 604 is used to sequentially input the matrix operation tasks in the task queue into the optical integrated circuit for optical computing to obtain the operation results of each matrix operation task.
[0145] In some embodiments, there are multiple optical integrated circuits, and different optical integrated circuits support different matrix dimensions; the sorting module 603 is used to:
[0146] Dividing the plurality of matrix operation tasks into at least one initial task queue according to the matrix dimensions of the matrix operation tasks and the matrix dimensions supported by the optical integrated circuit, each initial task queue corresponding to one of the optical integrated circuits, and each optical integrated circuit being used to process the matrix operation tasks in the corresponding initial task queue;
[0147] The matrix operation tasks in each initial task queue are sorted according to at least one of matrix dimension similarity, matrix similarity, matrix element average similarity, and task category similarity to obtain at least one task queue.
[0148] In some embodiments, the sorting module 603 is used to:
[0149] sorting the matrix operation tasks in one of the initial task queues according to matrix dimension similarity to obtain a first task queue, wherein in the first task queue, the matrix operation tasks with the greatest matrix dimension similarity are arranged in adjacent positions;
[0150] Reorder the matrix operation tasks at adjacent positions in the first task queue according to at least one of matrix similarity, matrix element average value similarity, and task category similarity.
[0151] In some embodiments, the sorting module 603 is used to:
[0152] In one of the initial task queues, the matrix operation tasks with the greatest matrix dimension similarity are arranged in adjacent positions in the order of matrix dimensions from small to large.
[0153] In some embodiments, the operation module 604 is configured to:
[0154] In one of the task queues, the matrix operation tasks at both ends of the task queue are compared to determine the target end where the matrix operation task with the smaller matrix dimension is located;
[0155] Starting from the target end, each matrix operation task in the task queue is input into the corresponding optical integrated circuit in turn.
[0156] In some embodiments, the sorting module 603 is used to:
[0157] Among the matrix operation tasks in adjacent positions in the first task queue, matrix operation tasks with the same task category are arranged in adjacent positions to obtain a second task queue;
[0158] The matrix operation tasks with the same task category in the second task queue are reordered according to at least one of matrix similarity and matrix element average value similarity.
[0159] In some embodiments, the sorting module 603 is used to:
[0160] Among the matrix operation tasks with the same task category in the second task queue, the matrix operation tasks with the largest matrix similarity are arranged in adjacent positions to obtain a third task queue;
[0161] Among the matrix operation tasks in adjacent positions in the third task queue, the average value of the matrix elements of each matrix operation task is calculated, and the matrix operation tasks are sorted in ascending order of the average value of the matrix elements, wherein the matrix operation tasks with smaller average values of the matrix elements are input into the optical integrated circuit first, and the matrix operation tasks with larger average values of the matrix elements are input into the optical integrated circuit later.
[0162] In some embodiments, for a first matrix operation task and a second matrix operation task having the same task category, if the matrices in the first matrix operation task and the second matrix operation task are both used as operators for general matrix multiplication, the similarity determination module 602 calculates the matrix similarity between the first matrix operation task and the second matrix operation task based on the following method:
[0163] Extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task;
[0164] The Euclidean distance between the first matrix and the second matrix is calculated, and the Euclidean distance is used as the matrix similarity between the first matrix operation task and the second matrix operation task.
[0165] In some embodiments, for a first matrix operation task and a second matrix operation task having the same task category, if the matrices in the first matrix operation task and the second matrix operation task are both used as linear operators, the similarity determination module 602 calculates the matrix similarity between the first matrix operation task and the second matrix operation task based on the following method:
[0166] Extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task;
[0167] Calculate the maximum singular value of the first matrix and the maximum singular value of the second matrix;
[0168] A matrix similarity between the first matrix operation task and the second matrix operation task is determined based on a maximum singular value difference between the first matrix and the second matrix.
[0169] In some embodiments, for a first matrix operation task and a second matrix operation task having the same task category, if the matrices in the first matrix operation task and the second matrix operation task are both used as probability distribution matrices, the similarity determination module 602 calculates the matrix similarity between the first matrix operation task and the second matrix operation task based on the following method:
[0170] Extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task;
[0171] The Kullback-Leibler divergence of the first matrix and the second matrix is calculated, and the Kullback-Leibler divergence is used as the matrix similarity between the first matrix operation task and the second matrix operation task.
[0172] In some embodiments, for a first matrix operation task and a second matrix operation task having the same task category, if matrices in the first matrix operation task and the second matrix operation task are used to represent a data set, the similarity determination module 602 calculates the matrix similarity between the first matrix operation task and the second matrix operation task based on the following method:
[0173] Extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task;
[0174] Using the column data of the first matrix as features, calculating the Pearson correlation coefficient matrix between the features of the first matrix, and using the column data of the second matrix as features, calculating the Pearson correlation coefficient matrix between the features of the second matrix;
[0175] The matrix similarity between the first matrix operation task and the second matrix operation task is determined based on the difference between the Pearson correlation coefficient matrices of the first matrix and the second matrix.
[0176] In some embodiments, for a first matrix operation task and a second matrix operation task having the same task category, if matrices in the first matrix operation task and the second matrix operation task are used to represent an image, the similarity determination module 602 calculates the matrix similarity between the first matrix operation task and the second matrix operation task based on the following method:
[0177] Extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task;
[0178] A structural similarity index of the first matrix and the second matrix is calculated, and the structural similarity index is used as the matrix similarity between the first matrix operation task and the second matrix operation task, wherein the structural similarity index refers to the difference between the images represented by the first matrix and the second matrix.
[0179] In some embodiments, the information acquisition module 601 is used to:
[0180] For one of the matrix operation tasks, if the task information does not include the task category of the matrix operation task, the matrix attributes are obtained from the matrix operation task, and the matrix attributes are input into the trained classification model to obtain the task category of the matrix operation task.
[0181] See also Figure 7 An embodiment of the present application further provides an electronic device, comprising a memory 10 and a processor 20, wherein the memory 10 stores a computer program, and the processor 20 is configured to run the computer program to execute the steps in any one of the above-mentioned data processing method embodiments.
[0182] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned data processing method embodiments when run.
[0183] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0184] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above data processing method embodiments are implemented.
[0185] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned data processing method embodiments are implemented.
[0186] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0187] The above is a detailed introduction to a data processing method, device, and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications may be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A data processing method, characterized in that: The method comprises: Acquiring task information, wherein the task information includes a plurality of matrix operation tasks; Determining attribute similarities between different matrix operation tasks based on task attributes of each matrix operation task, wherein the task attributes include at least one of a matrix in the matrix operation task, a matrix dimension, an average value of matrix elements, and a task category; sorting the plurality of matrix operation tasks according to the attribute similarity to obtain a task queue, wherein in the task queue, the matrix operation tasks with the greatest attribute similarity are arranged in adjacent positions; The matrix operation tasks in the task queue are sequentially input into the optical integrated circuit for optical computing to obtain the running results of each matrix operation task.
2. The method according to claim 1, characterized in that There are multiple optical integrated circuits, and different optical integrated circuits support different matrix dimensions; The sorting of the plurality of matrix operation tasks according to the attribute similarity includes: Dividing the plurality of matrix operation tasks into at least one initial task queue according to a matrix dimension of the matrix operation task and a matrix dimension supported by the optical integrated circuit, each of the initial task queues corresponding to one of the optical integrated circuits, and each of the optical integrated circuits being configured to process the matrix operation tasks in the corresponding initial task queue; The matrix operation tasks in each of the initial task queues are sorted according to at least one of matrix dimension similarity, matrix similarity, matrix element average similarity, and task category similarity to obtain at least one task queue.
3. The method according to claim 2, characterized in that The sorting of the matrix operation tasks in each of the initial task queues according to at least one of matrix dimension similarity, matrix similarity, matrix element average similarity, and task category similarity comprises: sorting the matrix operation tasks in one of the initial task queues according to matrix dimension similarity to obtain a first task queue, wherein in the first task queue, the matrix operation tasks with the greatest matrix dimension similarity are arranged in adjacent positions; Reorder the matrix operation tasks at adjacent positions in the first task queue according to at least one of matrix similarity, matrix element average value similarity, and task category similarity.
4. The method according to claim 3, characterized in that The step of sorting the matrix operation tasks in one of the initial task queues according to matrix dimension similarity includes: In one of the initial task queues, the matrix operation tasks with the greatest matrix dimension similarity are arranged in adjacent positions in the order of matrix dimensions from small to large.
5. The method according to claim 4, characterized in that The step of sequentially inputting the matrix operation tasks in the task queue into the optical integrated circuit for optical computing includes: In one of the task queues, the matrix operation tasks at both ends of the task queue are compared to determine the target end where the matrix operation task with the smaller matrix dimension is located; Starting from the target end, each matrix operation task in the task queue is input into the corresponding optical integrated circuit in sequence.
6. The method according to claim 3, characterized in that The reordering of the matrix operation tasks in adjacent positions in the first task queue according to at least one of matrix similarity, matrix element average value similarity, and task category similarity includes: Arranging matrix operation tasks with the same task category in adjacent positions among the matrix operation tasks in the first task queue to obtain a second task queue; The matrix operation tasks with the same task category in the second task queue are reordered according to at least one of matrix similarity and matrix element average value similarity.
7. The method according to claim 6, characterized in that The reordering of the matrix operation tasks of the second task queue having the same task category according to at least one of matrix similarity and matrix element average value similarity includes: Among the matrix operation tasks of the same task category in the second task queue, the matrix operation tasks with the greatest matrix similarity are arranged in adjacent positions to obtain a third task queue; Among the matrix operation tasks in adjacent positions in the third task queue, the average value of the matrix elements of each matrix operation task is calculated, and the matrix operation tasks are sorted in ascending order of the average value of the matrix elements, wherein the matrix operation tasks with smaller average values of the matrix elements are input into the optical integrated circuit first, and the matrix operation tasks with larger average values of the matrix elements are input into the optical integrated circuit later.
8. The method according to claim 7, characterized in that For a first matrix operation task and a second matrix operation task of the same task category, if the matrices in both the first matrix operation task and the second matrix operation task are used as operators for general matrix multiplication, the matrix similarity between the first matrix operation task and the second matrix operation task is calculated based on the following method: extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task; A Euclidean distance between the first matrix and the second matrix is calculated, and the Euclidean distance is used as the matrix similarity between the first matrix operation task and the second matrix operation task.
9. The method according to claim 7, characterized in that For a first matrix operation task and a second matrix operation task of the same task category, if the matrices in both the first matrix operation task and the second matrix operation task are used as linear operators, the matrix similarity between the first matrix operation task and the second matrix operation task is calculated based on the following method: extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task; Calculating the maximum singular value of the first matrix and the maximum singular value of the second matrix; Determine matrix similarity between the first matrix operation task and the second matrix operation task based on a maximum singular value difference between the first matrix and the second matrix.
10. The method according to claim 7, characterized in that For a first matrix operation task and a second matrix operation task of the same task category, if the matrices in the first matrix operation task and the second matrix operation task are both used as probability distribution matrices, the matrix similarity between the first matrix operation task and the second matrix operation task is calculated based on the following method: extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task; The Kullback-Leibler divergence of the first matrix and the second matrix is calculated, and the Kullback-Leibler divergence is used as the matrix similarity between the first matrix operation task and the second matrix operation task.
11. The method according to claim 7, characterized in that For a first matrix operation task and a second matrix operation task of the same task category, if the matrices in the first matrix operation task and the second matrix operation task are used to represent a data set, the matrix similarity between the first matrix operation task and the second matrix operation task is calculated based on the following method: extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task; Using the column data of the first matrix as features, calculating the Pearson correlation coefficient matrix between the features of the first matrix, and using the column data of the second matrix as features, calculating the Pearson correlation coefficient matrix between the features of the second matrix; Based on the difference between the Pearson correlation coefficient matrices of the first matrix and the second matrix, a matrix similarity between the first matrix operation task and the second matrix operation task is determined.
12. The method according to claim 7, characterized in that For a first matrix operation task and a second matrix operation task of the same task category, if the matrices in the first matrix operation task and the second matrix operation task are used to represent an image, the matrix similarity between the first matrix operation task and the second matrix operation task is calculated based on the following method: extracting a first matrix from the first matrix operation task, and extracting a second matrix from the second matrix operation task; Calculate a structural similarity index between the first matrix and the second matrix, and use the structural similarity index as the matrix similarity between the first matrix operation task and the second matrix operation task, wherein the structural similarity index refers to the difference between the images represented by the first matrix and the second matrix.
13. The method according to claim 1, wherein The method further comprises: For one of the matrix operation tasks, if the task information does not include the task category of the matrix operation task, the matrix attributes are obtained from the matrix operation task, and the matrix attributes are input into the trained classification model to obtain the task category of the matrix operation task.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
15. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Task processing method and task processing device of heterogeneous chip, and electronic equipment
CN111142938A
Task processing method, task processing device, task processing system, task distribution method and task distribution device
CN112650590A