CN111507178B - Data processing optimization method and device, storage medium and computer equipment - Google Patents
Data processing optimization method and device, storage medium and computer equipment Download PDFInfo
- Publication number
- CN111507178B CN111507178B CN202010138933.2A CN202010138933A CN111507178B CN 111507178 B CN111507178 B CN 111507178B CN 202010138933 A CN202010138933 A CN 202010138933A CN 111507178 B CN111507178 B CN 111507178B
- Authority
- CN
- China
- Prior art keywords
- face data
- matrix
- data matrix
- preset
- optimization
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000012545 processing Methods 0.000 title claims abstract description 106
- 238000005457 optimization Methods 0.000 title claims abstract description 105
- 238000000034 method Methods 0.000 title claims abstract description 49
- 239000011159 matrix material Substances 0.000 claims abstract description 323
- 238000004891 communication Methods 0.000 claims description 16
- 230000000903 blocking effect Effects 0.000 claims description 13
- 238000000638 solvent extraction Methods 0.000 claims description 7
- 238000004364 calculation method Methods 0.000 description 10
- 230000008901 benefit Effects 0.000 description 8
- 230000008569 process Effects 0.000 description 8
- 238000006243 chemical reaction Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 238000007667 floating Methods 0.000 description 3
- 229910052754 neon Inorganic materials 0.000 description 3
- GKAOGPIIYCISHV-UHFFFAOYSA-N neon atom Chemical compound [Ne] GKAOGPIIYCISHV-UHFFFAOYSA-N 0.000 description 3
- 230000011218 segmentation Effects 0.000 description 3
- 230000010354 integration Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000012300 Sequence Analysis Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000005429 filling process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000004886 process control Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/94—Hardware or software architectures specially adapted for image or video understanding
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Mining & Analysis (AREA)
- Multimedia (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Artificial Intelligence (AREA)
- Software Systems (AREA)
- Evolutionary Computation (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Human Computer Interaction (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a data processing optimization method and device, a storage medium and computer equipment, relates to the technical field of data processing, and mainly aims to solve the problems that simple multiplication between existing matrixes consumes a lot of time when code operation is carried out, and when the order of the matrixes is larger, the calculated amount of a computer is increased, a lot of CPU (Central processing Unit) resources are occupied, and the data processing efficiency is reduced. Comprising the following steps: judging whether the number of lines of a face data matrix constructed according to the face data exceeds a preset optimization threshold; if all the line numbers of the face data matrix do not exceed the preset optimization threshold, calling a preset expansion instruction to integrate the face data matrix; and if any line number of the face data matrix exceeds the preset optimization threshold, performing reduced-order processing on the face data matrix to obtain an optimization matrix of the face data matrix.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing optimization method and apparatus, a storage medium, and a computer device.
Background
With the rapid development of big data processing, more and more data need to be processed by a computer as operation equipment, and more complex forms of processing data are also provided. In the fields of process control, image processing, scientific calculation, signal processing, cryptography, computer time sequence analysis and the like, a matrix has become a basic data unit for big data processing.
At present, in the existing face recognition process, face data is needed to be used as basic data of a recognition model to be operated after the face data is acquired, in the process, when the face data is needed to be multiplied in a matrix form to be subjected to code conversion operation processing according to multiplication between common matrixes, but because the face data for recognizing the face is formed by pixel data, the order of the formed matrix data is larger, in the preprocessing process before recognition, the simple multiplication between the matrixes consumes a large amount of time when the code operation is utilized, and when the matrix order is larger, the calculation amount of a computer is increased, a large amount of CPU resources are occupied, and the data processing efficiency is reduced.
Disclosure of Invention
In view of this, the present invention provides a method and apparatus for optimizing data processing, a storage medium, and a computer device, and aims to solve the problems that simple multiplication between existing matrices consumes a lot of time when performing code operation, and when the order of the matrix is large, the calculation amount of the computer is increased, a lot of CPU resources are occupied, and the efficiency of data processing is reduced.
According to one aspect of the present invention, there is provided a data processing optimization method, comprising:
When the face recognition is to be carried out according to the obtained face data, the face data are intercepted, and whether the number of lines of a face data matrix constructed according to the face data exceeds a preset optimization threshold is judged;
If all the line numbers of the face data matrix do not exceed the preset optimization threshold, calling a preset expansion instruction to integrate the face data matrix;
And if any line number of the face data matrix exceeds the preset optimization threshold, performing reduced-order processing on the face data matrix to obtain an optimization matrix of the face data matrix.
Further, after the step-down processing is performed on the face data matrix to obtain the optimized matrix of the face data matrix, the method further includes:
and determining the optimized matrix as a face data matrix, and re-executing the step of judging whether the number of lines of the face data matrix constructed according to the face data exceeds a preset optimized threshold.
Further, the step-down processing the face data matrix to obtain an optimized matrix of the face data matrix includes:
and partitioning the face data matrix, and taking the face data matrix containing the partitioned matrix as an optimization matrix.
Further, before the face data matrix is segmented and the face data matrix including the segmented matrix is used as the optimization matrix, the method further includes:
and filling data of the rows and columns belonging to the odd number in the face data matrix.
Further, the partitioning the face data matrix, and taking the face data matrix including the partitioning matrix as an optimization matrix includes:
And partitioning the face data matrix according to the first order as a unit, and taking all the determined partitioned matrixes as an optimization matrix of the face data matrix.
Further, after the face data matrix is segmented and the face data matrix including the segmented matrix is used as an optimization matrix, the method further includes:
Judging whether the number of rows and the number of columns of the block matrix are smaller than a preset block threshold value or not;
if the number of the blocks is smaller than the preset block threshold, the face data matrix is blocked according to the second order, and all the determined block matrixes are used as an optimization matrix of the face data matrix.
Further, the invoking the preset expansion instruction to integrate the face data matrix includes:
and carrying out recursive operation processing on all the block matrixes contained in the face data matrix by using a preset expansion instruction to obtain a matrix operation result of the face data matrix, wherein the summation expression is an algorithm for carrying out product summation on a plurality of block matrixes.
According to another aspect of the present invention, there is provided an optimizing apparatus for data processing, comprising:
the judging module is used for intercepting the face data when the face recognition is to be carried out according to the obtained face data, and judging whether the number of lines of a face data matrix constructed according to the face data exceeds a preset optimization threshold;
the first processing module is used for calling a preset expansion instruction to integrate the face data matrix if all the line numbers of the face data matrix do not exceed the preset optimization threshold;
And the second processing module is used for performing reduced-order processing on the face data matrix if any line number of the face data matrix exceeds the preset optimization threshold value to obtain an optimization matrix of the face data matrix.
Further, the apparatus further comprises:
And the determining module is used for determining the optimization matrix as a face data matrix and re-executing the step of judging whether the number of lines of the face data matrix constructed according to the face data exceeds a preset optimization threshold.
Further, the second processing module is specifically configured to segment the face data matrix, and take the face data matrix including the segment matrix as an optimization matrix.
Further, the apparatus further comprises:
and the filling module is used for filling data of the rows and columns belonging to the odd number in the face data matrix.
Further, the second processing module is specifically configured to block the face data matrix according to the first order, and take the determined all block matrices as an optimization matrix of the face data matrix.
Further, the first device further includes:
The judging module is used for judging whether the number of rows and the number of columns of the block matrix are smaller than a preset block threshold value or not;
And the blocking module is used for blocking the face data matrix according to the second order as a unit if the block number is smaller than the preset blocking threshold value, and taking all the determined blocking matrixes as an optimization matrix of the face data matrix.
Further, the first processing module is specifically configured to perform recursive operation processing on all the block matrices included in the face data matrix by using a preset expansion instruction, so as to obtain a matrix operation result of the face data matrix, where the summation expression is an algorithm for performing product summation on multiple block matrices.
According to still another aspect of the present invention, there is provided a storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the optimization method of data processing as described above.
According to still another aspect of the present invention, there is provided a computer apparatus including: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
The memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the data processing optimizing method.
By means of the technical scheme, the technical scheme provided by the embodiment of the invention has at least the following advantages:
Compared with the prior art that code conversion operation is carried out according to multiplication between commonly used matrixes, the method, the device and the computer equipment for optimizing the data processing, the device and the computer equipment are used for obtaining the optimized matrix by carrying out reduced order processing on the human face data matrix when judging that the number of lines of the human face data matrix exceeds the preset optimized threshold, carrying out sum expression operation on the human face data matrix by utilizing the preset expansion instruction when judging that the number of lines of the human face data matrix does not exceed the preset optimized threshold, so that the time consumption of code iteration operation in the simple matrix multiplication is reduced, CPU resources are occupied, the data processing quantity is reduced, and the data processing efficiency is improved.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 shows a flowchart of an optimization method for data processing according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for optimizing data processing according to an embodiment of the present invention;
FIG. 3 is a block diagram showing an optimizing apparatus for data processing according to an embodiment of the present invention;
FIG. 4 is a block diagram showing another data processing optimizing apparatus according to an embodiment of the present invention;
Fig. 5 shows a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the invention provides a data processing optimization method, as shown in fig. 1, which comprises the following steps:
101. When the face recognition is to be carried out according to the obtained face data, the face data are intercepted, and whether the number of lines of a face data matrix constructed according to the face data exceeds a preset optimization threshold is judged.
The face data matrix comprises 2 matrixes which need matrix multiplication calculation, and the number of rows and the number of columns of the matrix can be obtained by searching the number of statistical rows and the number of columns in each matrix. In the embodiment of the present invention, for setting the preset optimization threshold, in order to achieve balance of matrix optimization calculation when the matrix is calculated, the preset optimization threshold is set to 32, for example, whether the number of rows of the face data matrix exceeds 32 rows is determined, and the embodiment of the present invention is not limited specifically.
102A, if all the line numbers of the face data matrix do not exceed the preset optimization threshold, calling a preset expansion instruction to integrate the face data matrix.
In the embodiment of the invention, the face data matrix can be 2 matrixes for multiplication operation, so that when all functions of the 2 matrixes are judged not to exceed the preset optimization threshold, the multiplication operation between the matrixes can be illustrated in the form of a sum expression, and the operation processing is performed by using a preset expansion instruction. The preset expansion instruction is an expansion instruction based on arm neon, specifically, a matrix multiplication instruction based on arm neon, which is not particularly limited in the embodiment of the present invention.
102B, if any line number of the face data matrix exceeds the preset optimization threshold, performing reduced order processing on the face data matrix to obtain an optimization matrix of the face data matrix.
For the embodiment of the invention, in order to reduce the operation amount when multiplying the face data matrix with the line number larger than the preset optimization threshold, the operation efficiency is improved, and the optimized matrix is obtained after the step-down processing of the face data matrix when any one matrix line number in the face data matrix exceeds the preset optimization threshold, for example, 32 lines.
After the optimized matrix is obtained, in order to further calculate the matrix and determine whether the optimized matrix is still needed, the optimized matrix is returned to step 101 to be re-determined as the face data matrix until the number of rows in the face data matrix does not exceed the preset optimized threshold, and a preset expansion instruction is invoked to integrate the face data matrix.
Compared with the prior art that code conversion operation is carried out according to multiplication between commonly used matrixes, the method provided by the invention has the advantages that when the number of the lines of the face data matrix exceeds the preset optimization threshold, the step-down processing is carried out on the face data matrix to obtain the optimized matrix, and when the number of the lines of the face data matrix does not exceed the preset optimization threshold, the sum expression operation is carried out on the face data matrix by utilizing the preset expansion instruction, so that the time consumption of code iteration operation in the simple matrix multiplication time is reduced, CPU resources are occupied, the data processing quantity is reduced, and the data processing efficiency is improved.
An embodiment of the present invention provides another optimization method for data processing, as shown in fig. 2, where the method includes:
201. When the face recognition is to be carried out according to the obtained face data, the face data are intercepted, and whether the number of lines of a face data matrix constructed according to the face data exceeds a preset optimization threshold is judged.
The method of this step is the same as the method of step 101 shown in fig. 1, and will not be described here again.
If the face data matrix to be determined is an optimized matrix, determining that the number of blocks in each row in the optimized matrix is a column number, and whether the number of blocks in each column is a row number exceeds a preset optimization threshold.
202A, if all the line numbers of the face data matrix do not exceed the preset optimization threshold, calling a preset expansion instruction to integrate the face data matrix.
The method of this step is the same as that of step 102a shown in fig. 1, and will not be described here again.
Further, if it is determined that the number of lines of the face data matrix exceeds the preset optimization threshold, performing reduced-order processing on the face data matrix, and performing operation to obtain an optimized matrix of the face data matrix, and when the optimized matrix is used as the face data matrix and it is determined that the number of lines does not exceed the preset optimization threshold, the step of calling a preset expansion instruction to perform integrated processing on the face data matrix may specifically be: and carrying out recursive operation processing on all the block matrixes contained in the face data matrix by using a preset expansion instruction to obtain a matrix operation result of the face data matrix, wherein the summation expression is an algorithm for carrying out product summation on a plurality of block matrixes.
As the number of lines of the face data matrix does not exceed the preset optimization threshold, the order of the face data matrix is suitable for calculation of the calculation instruction in the computer, the time consumption is not increased in the calculation process, and the occupied CPU resource is small. Therefore, when all the number of lines in the face data matrix does not exceed the preset optimization threshold, namely, the number of lines of the 2 matrices to be subjected to matrix multiplication calculation does not exceed the preset optimization threshold, performing recursive operation processing of sum expression on all the partitioned matrices contained in the face data matrix by using a preset expansion instruction to obtain a matrix operation result.
Since step 202a is a step parallel to step 202b, and after step 202b, the 2 optimization matrices newly used as face data matrices each include a plurality of block matrices, it is necessary to perform multiplication processing individually on the plurality of block matrices in one face data matrix after optimization when performing recursive processing of the sum expression by using a preset expansion instruction. In the embodiment of the invention, the face data matrix with the number of lines not exceeding the preset optimization threshold may be a matrix subjected to multiple reduced order processing, so that the face data matrix comprises a plurality of block matrixes, namely the block matrixes further comprise sub-block matrixes, and therefore when the recursive operation processing of the sum expression is performed by using the preset expansion instruction, the sub-block matrixes in the block matrixes are preferably subjected to multiplication operation, then the block matrixes are subjected to multiplication operation, and each block matrix is sequentially subjected to the operation processing in a recursive manner, so that the operation result of the face data matrix is finally obtained.
For example, the face data matrix isA 11、a12、a21、a22、b11、b12、b21、b22 is a block matrix and a formula a i1b1j+ai2b2j=cij of an expression, calculating the product of each block in the matrix c by using a preset expansion instruction, if a sub-block matrix exists in the block matrix, firstly calculating the sub-block matrix, and then recursively calculating all the block matrices one by one to finally obtain the product of the face data matrix.
For the embodiment of the present invention, the preset expansion instruction may be a multiplication instruction based on arm neon, specifically, as follows: the method comprises the specific steps of inputting a float, copying and pasting 4 times to form a float32 x 4_t, and returning, wherein 4 floating point type float data are taken from a data source address src to form a floating point type 32 x 4 matrix, namely float32 x 4_t. One float32 x 4_t is written to the data source address dst, which corresponds to writing 4 floating point data at a time. And adding elements corresponding to dst in src respectively, and multiplying to obtain a result. The method comprises the steps of multiplying V1 elements in src by s1, adding the result with elements in the corresponding position of V2 in dst, writing the result to V0, calculating a 4*4 block each time, reducing the number of times of multiplication and addition, but reducing the number of times of value of b matrix to 1/4 of the original number, multiplying each corresponding element of V1 and V2 to obtain V3, adding each corresponding element of V3, writing the V3 to V0, aligning according to a 4-byte boundary when a compiler sets a variable address, and comparing the data, wherein the cache can grasp surrounding data while grasping the data, so that multiplication calculation of a plurality of matrices is realized.
202B, if any line number of the face data matrix exceeds the preset optimization threshold, partitioning the face data matrix, and taking the face data matrix containing the partitioned matrix as an optimization matrix.
In the embodiment of the invention, the number of lines of the face data matrix exceeds the preset optimization threshold, which indicates that the order of the face data matrix is too large, and a large amount of resources of a CPU (Central processing Unit) are consumed when the multiplication operation is carried out by using the existing method, so that the time consumption is too long, and therefore, the block matrix in the face data matrix is preferably determined so as to realize the order reduction processing.
For the embodiment of the invention, in order to avoid that the determined blocking matrix lacks corresponding rows or columns and cannot be completely blocked, the steps of blocking the face data matrix and taking the face data matrix containing the blocking matrix as an optimization matrix further comprise: and filling data of the rows and columns belonging to the odd number in the face data matrix.
The parity is firstly judged for the number of rows and columns in the face data matrix, and then the rows and columns belonging to the odd number are filled. The specific process comprises the following steps: judging whether columns of the first matrix and rows of the second matrix in the face data matrix are even numbers, and if so, judging whether columns of the second matrix are even numbers. The filling process may specifically directly amplify the rows or columns belonging to the odd number to the even number or columns according to a preset value, in this embodiment of the present invention, one row or one column is amplified, where the filling value may be a preset arbitrary non-zero natural number, and the embodiment of the present invention is not specifically limited.
For further illustration and limitation, step 202b is specifically: and partitioning the face data matrix according to the first order as a unit, and taking all the determined partitioned matrixes as an optimization matrix of the face data matrix.
When the face data matrix is segmented, in order to improve the segmentation efficiency and the operation speed in the operation process, the segmentation can be performed according to a first order, wherein the first order can be the order determined by dividing the number of rows and the number of columns by 2, for example, the face data matrix is a matrix of 100 rows by 100 columns, the number of rows and the number of columns are divided by 2 to be 50, and the obtained optimized matrix is a matrix of 50 rows by 50 columns by taking 2 as the segmentation order.
For the embodiment of the present invention, in order to avoid the block to two 1×1 matrix multiplications, the method may further include, after step 202 b: judging whether the number of rows and the number of columns of the block matrix are smaller than a preset block threshold value or not; if the number of the blocks is smaller than the preset block threshold, the face data matrix is blocked according to the second order, and all the determined block matrixes are used as an optimization matrix of the face data matrix.
The preset block threshold may be 0< i < k, k=1, 2, 7, which determines the number of rows and columns corresponding to the 2 i×2i th order of the block. When the number of rows and the number of columns of the block matrix are smaller than a preset block threshold, the face data matrix is blocked according to a second receiving unit, the second number can be the number of rows and the number of columns divided by the number of columns determined by 2 i, and after the face data matrix is blocked according to the number of columns, all the determined block matrices are used as an optimization matrix of the face data matrix.
For the embodiment of the present invention, in order to complete multiplication processing of the obtained optimization matrix, the steps after step 202b determine the optimization matrix as a face data matrix, and re-execute the step of determining whether the number of rows of the face data matrix constructed according to the face data exceeds a preset optimization threshold.
Compared with the prior art that code conversion operation is carried out according to multiplication between commonly used matrixes, the method provided by the invention has the advantages that when the number of the lines of the face data matrix exceeds the preset optimization threshold, the step-down processing is carried out on the face data matrix to obtain the optimized matrix, and when the number of the lines of the face data matrix does not exceed the preset optimization threshold, the sum expression operation is carried out on the face data matrix by utilizing the preset expansion instruction, so that the time consumption of code iteration operation in the simple matrix multiplication time is reduced, CPU resources are occupied, the data processing quantity is reduced, and the data processing efficiency is improved.
Further, as an implementation of the method shown in fig. 1, an embodiment of the present invention provides an optimizing apparatus for data processing, as shown in fig. 3, where the apparatus includes: a judging module 31, a first processing module 32 and a second processing module 33.
The judging module 31 is configured to intercept face data when face recognition is to be performed according to the obtained face data, and judge whether the number of lines of a face data matrix constructed according to the face data exceeds a preset optimization threshold;
The first processing module 32 is configured to invoke a preset expansion instruction to perform an integration process on the face data matrix if all the rows of the face data matrix do not exceed the preset optimization threshold;
And the second processing module 33 is configured to perform reduced-order processing on the face data matrix if any number of rows of the face data matrix exceeds the preset optimization threshold, so as to obtain an optimization matrix of the face data matrix.
Compared with the prior art that code conversion operation is carried out according to multiplication between commonly used matrixes, the method provided by the invention has the advantages that when the number of the lines of the face data matrix exceeds the preset optimization threshold, the step-down processing is carried out on the face data matrix to obtain the optimized matrix, and when the number of the lines of the face data matrix does not exceed the preset optimization threshold, the sum expression operation is carried out on the face data matrix by utilizing the preset expansion instruction, so that the time consumption of code iteration operation in the simple matrix multiplication time is reduced, CPU resources are occupied, the data processing quantity is reduced, and the data processing efficiency is improved.
Further, as an implementation of the method shown in fig. 2, another data processing optimizing apparatus is provided in an embodiment of the present invention, as shown in fig. 4, where the apparatus includes: the device comprises a judging module 41, a first processing module 42, a second processing module 43, a determining module 44, a filling module 45, a judging module 46 and a blocking module 47.
The judging module 41 is configured to intercept face data when face recognition is to be performed according to the obtained face data, and judge whether the number of lines of a face data matrix constructed according to the face data exceeds a preset optimization threshold;
The first processing module 42 is configured to invoke a preset expansion instruction to perform an integration process on the face data matrix if all the rows of the face data matrix do not exceed the preset optimization threshold;
And the second processing module 43 is configured to perform reduced-order processing on the face data matrix if any number of rows of the face data matrix exceeds the preset optimization threshold, so as to obtain an optimization matrix of the face data matrix.
Further, the apparatus further comprises:
The determining module 44 is configured to determine the optimization matrix as a face data matrix, and re-execute the step of determining whether the number of rows of the face data matrix constructed according to the face data exceeds a preset optimization threshold.
Further, the second processing module 43 is specifically configured to block the face data matrix, and take the face data matrix including the block matrix as an optimization matrix.
Further, the apparatus further comprises:
And the filling module 45 is configured to fill data in the rows and columns belonging to the odd number in the face data matrix.
Further, the second processing module 43 is specifically configured to block the face data matrix according to the first order, and take the determined all block matrices as an optimization matrix of the face data matrix.
Further, the first device further includes:
the judging module 46 is configured to judge whether the number of rows and the number of columns of the block matrix are smaller than a preset block threshold;
And the blocking module 47 is configured to block the face data matrix according to a second order if the block size is smaller than the preset block size threshold, and take the determined all block matrices as an optimization matrix of the face data matrix.
Further, the first processing module 42 is specifically configured to perform recursive operation processing on all the block matrices included in the face data matrix by using a preset expansion instruction, so as to obtain a matrix operation result of the face data matrix, where the summation expression is an algorithm for performing product summation on a plurality of block matrices.
Compared with the prior art that code conversion operation is carried out according to multiplication between commonly used matrixes, the method provided by the invention has the advantages that when the number of the lines of the face data matrix exceeds the preset optimization threshold, the step-down processing is carried out on the face data matrix to obtain the optimized matrix, and when the number of the lines of the face data matrix does not exceed the preset optimization threshold, the sum expression operation is carried out on the face data matrix by utilizing the preset expansion instruction, so that the time consumption of code iteration operation in the simple matrix multiplication time is reduced, CPU resources are occupied, the data processing quantity is reduced, and the data processing efficiency is improved.
According to one embodiment of the present invention, there is provided a storage medium storing at least one executable instruction for performing the method of optimizing data processing in any of the method embodiments described above.
Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention, and the specific embodiment of the present invention is not limited to the specific implementation of the computer device.
As shown in fig. 5, the computer device may include: a processor 502, a communication interface (Communications Interface) 504, a memory 506, and a communication bus 508.
Wherein: processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508.
A communication interface 504 for communicating with network elements of other devices, such as clients or other servers.
The processor 502 is configured to execute the program 510, and may specifically perform relevant steps in the above-described embodiments of the data processing optimization method.
In particular, program 510 may include program code including computer-operating instructions.
The processor 502 may be a central processing unit CPU, or an Application-specific integrated Circuit ASIC (Application SPECIFIC INTEGRATED Circuit), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in the computer device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
A memory 506 for storing a program 510. Memory 506 may comprise high-speed RAM memory or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 510 may be specifically operable to cause the processor 502 to:
When the face recognition is to be carried out according to the obtained face data, the face data are intercepted, and whether the number of lines of a face data matrix constructed according to the face data exceeds a preset optimization threshold is judged;
If all the line numbers of the face data matrix do not exceed the preset optimization threshold, calling a preset expansion instruction to integrate the face data matrix;
And if any line number of the face data matrix exceeds the preset optimization threshold, performing reduced-order processing on the face data matrix to obtain an optimization matrix of the face data matrix.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (6)
1. A method of optimizing data processing, comprising:
When the face recognition is to be carried out according to the obtained face data, the face data are intercepted, and whether the number of lines of a face data matrix constructed according to the face data exceeds a preset optimization threshold is judged;
If all the line numbers of the face data matrix do not exceed the preset optimization threshold, calling a preset expansion instruction to integrate the face data matrix;
if any line number of the face data matrix exceeds the preset optimization threshold, performing reduced-order processing on the face data matrix to obtain an optimization matrix of the face data matrix;
Before the step-down processing is performed on the face data matrix, the method further comprises the following steps:
Performing data filling on the rows and columns belonging to the odd numbers in the face data matrix so that the rows and columns of the face data matrix are even after the data filling;
the step-down processing is carried out on the face data matrix, and the obtaining of the optimized matrix of the face data matrix comprises the following steps:
The face data matrix is segmented, and the face data matrix containing the segmented matrix is used as an optimization matrix, and the face data matrix comprises the following specific steps: partitioning the face data matrix according to the first order as a unit, and taking all the determined partitioned matrixes as an optimization matrix of the face data matrix;
After the face data matrix is segmented and the face data matrix containing the segmented matrix is used as an optimization matrix, the method further comprises the following steps:
Judging whether the number of rows and the number of columns of the block matrix are smaller than a preset block threshold value or not;
If the number of the blocks is smaller than the preset block threshold, the face data matrix is blocked according to a second order, and all the determined block matrixes are used as an optimization matrix of the face data matrix;
the step of calling a preset expansion instruction to integrate the face data matrix comprises the following steps:
and carrying out recursive operation processing on all the block matrixes contained in the face data matrix by using a preset expansion instruction to obtain a matrix operation result of the face data matrix, wherein the summation expression is an algorithm for carrying out product summation on a plurality of block matrixes.
2. The method according to claim 1, wherein after the step-down processing is performed on the face data matrix to obtain an optimized matrix of the face data matrix, the method further comprises:
and determining the optimized matrix as a face data matrix, and re-executing the step of judging whether the number of lines of the face data matrix constructed according to the face data exceeds a preset optimized threshold.
3. The method according to any one of claims 1-2, wherein the invoking a preset extension instruction to integrate the face data matrix comprises:
and carrying out recursive operation processing on all the block matrixes contained in the face data matrix by using a preset expansion instruction to obtain a matrix operation result of the face data matrix, wherein the summation expression is an algorithm for carrying out product summation on a plurality of block matrixes.
4. An optimization apparatus for data processing, comprising:
The judging module is used for judging whether the number of lines of the face data matrix constructed according to the face data exceeds a preset optimization threshold;
the first processing module is used for calling a preset expansion instruction to integrate the face data matrix if all the line numbers of the face data matrix do not exceed the preset optimization threshold;
The second processing module is used for performing reduced-order processing on the face data matrix if any line number of the face data matrix exceeds the preset optimization threshold value to obtain an optimization matrix of the face data matrix;
The apparatus further comprises: the filling module is used for carrying out data filling on the rows and the columns belonging to the odd numbers in the face data matrix so that the rows and the columns of the face data matrix are even after the data filling;
the second processing module is specifically configured to segment the face data matrix, and take the face data matrix including the segment matrix as an optimization matrix; the face data matrix is segmented according to the first order as a unit, and all the determined segmented matrixes are used as an optimization matrix of the face data matrix;
the apparatus further comprises:
The judging module is used for judging whether the number of rows and the number of columns of the block matrix are smaller than a preset block threshold value or not;
The blocking module is used for blocking the face data matrix according to the second order as a unit if the block number is smaller than the preset blocking threshold value, and taking all the determined blocking matrixes as an optimization matrix of the face data matrix;
The first processing module is specifically configured to perform recursive operation processing on all the block matrixes included in the face data matrix by using a preset expansion instruction to obtain a matrix operation result of the face data matrix, where the summation expression is an algorithm for performing product summation on multiple block matrixes.
5. A storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the method of optimizing data processing according to any one of claims 1-3.
6. A computer device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
The memory is configured to store at least one executable instruction that causes the processor to perform operations corresponding to the method for optimizing data processing according to any one of claims 1-3.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010138933.2A CN111507178B (en) | 2020-03-03 | 2020-03-03 | Data processing optimization method and device, storage medium and computer equipment |
PCT/CN2020/093173 WO2021174691A1 (en) | 2020-03-03 | 2020-05-29 | Data processing optimization method and apparatus, and storage medium and computer device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010138933.2A CN111507178B (en) | 2020-03-03 | 2020-03-03 | Data processing optimization method and device, storage medium and computer equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111507178A CN111507178A (en) | 2020-08-07 |
CN111507178B true CN111507178B (en) | 2024-05-14 |
Family
ID=71868982
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010138933.2A Active CN111507178B (en) | 2020-03-03 | 2020-03-03 | Data processing optimization method and device, storage medium and computer equipment |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111507178B (en) |
WO (1) | WO2021174691A1 (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07249124A (en) * | 1994-03-11 | 1995-09-26 | Dainippon Printing Co Ltd | Id card and id card system |
CN102254193A (en) * | 2011-07-16 | 2011-11-23 | 西安电子科技大学 | Relevance vector machine-based multi-class data classifying method |
CN105894047A (en) * | 2016-06-28 | 2016-08-24 | 深圳市唯特视科技有限公司 | Human face classification system based on three-dimensional data |
CN108171327A (en) * | 2017-12-25 | 2018-06-15 | 郑州云海信息技术有限公司 | A kind of matrix method for transformation, device and medium based on convolution algorithm |
CN110766133A (en) * | 2019-09-18 | 2020-02-07 | 开放智能机器(上海)有限公司 | Data processing method, device, equipment and storage medium in embedded equipment |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2010004958A1 (en) * | 2008-07-10 | 2010-01-14 | 日本電気株式会社 | Personal authentication system and personal authentication method |
CN104572587B (en) * | 2014-12-23 | 2017-11-14 | 中国电子科技集团公司第三十八研究所 | The acceleration operation method and device that data matrix is multiplied |
CN107742150B (en) * | 2016-10-31 | 2020-05-12 | 腾讯科技(深圳)有限公司 | Data processing method and device of convolutional neural network |
CN109542512B (en) * | 2018-11-06 | 2020-09-04 | 腾讯科技(深圳)有限公司 | Data processing method, device and storage medium |
-
2020
- 2020-03-03 CN CN202010138933.2A patent/CN111507178B/en active Active
- 2020-05-29 WO PCT/CN2020/093173 patent/WO2021174691A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07249124A (en) * | 1994-03-11 | 1995-09-26 | Dainippon Printing Co Ltd | Id card and id card system |
CN102254193A (en) * | 2011-07-16 | 2011-11-23 | 西安电子科技大学 | Relevance vector machine-based multi-class data classifying method |
CN105894047A (en) * | 2016-06-28 | 2016-08-24 | 深圳市唯特视科技有限公司 | Human face classification system based on three-dimensional data |
CN108171327A (en) * | 2017-12-25 | 2018-06-15 | 郑州云海信息技术有限公司 | A kind of matrix method for transformation, device and medium based on convolution algorithm |
CN110766133A (en) * | 2019-09-18 | 2020-02-07 | 开放智能机器(上海)有限公司 | Data processing method, device, equipment and storage medium in embedded equipment |
Also Published As
Publication number | Publication date |
---|---|
CN111507178A (en) | 2020-08-07 |
WO2021174691A1 (en) | 2021-09-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11580377B2 (en) | Method and device for optimizing neural network | |
CN112214727B (en) | Operation accelerator | |
CN104915322B (en) | A kind of hardware-accelerated method of convolutional neural networks | |
WO2022037257A1 (en) | Convolution calculation engine, artificial intelligence chip, and data processing method | |
CN111414994B (en) | FPGA-based Yolov3 network computing acceleration system and acceleration method thereof | |
CN108388537B (en) | Convolutional neural network acceleration device and method | |
CN110826719A (en) | Quantum program processing method and device, storage medium and electronic device | |
US11481994B2 (en) | Method and apparatus for extracting image data in parallel from multiple convolution windows, device, and computer-readable storage medium | |
CN109993293B (en) | Deep learning accelerator suitable for heap hourglass network | |
US20230068450A1 (en) | Method and apparatus for processing sparse data | |
US11615607B2 (en) | Convolution calculation method, convolution calculation apparatus, and terminal device | |
CN111768458A (en) | Sparse image processing method based on convolutional neural network | |
CN114138231B (en) | Method, circuit and SOC for executing matrix multiplication operation | |
CN110689045A (en) | Distributed training method and device for deep learning model | |
US9058301B2 (en) | Efficient transfer of matrices for matrix based operations | |
CN109902821B (en) | Data processing method and device and related components | |
CN117574970A (en) | Inference acceleration method, system, terminal and medium for large-scale language model | |
CN116188942A (en) | Image convolution method, device, equipment and storage medium | |
CN113485750B (en) | Data processing method and data processing device | |
CN117435855B (en) | Method for performing convolution operation, electronic device, and storage medium | |
CN111507178B (en) | Data processing optimization method and device, storage medium and computer equipment | |
CN111047037B (en) | Data processing method, device, equipment and storage medium | |
CN112163612B (en) | Big template convolution image matching method, device and system based on fpga | |
CN113836481B (en) | Matrix computing circuit, method, electronic device, and computer-readable storage medium | |
CN111338974A (en) | Tiling algorithm for matrix math instruction set |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |