CN111507178A - 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 PDF

Info

Publication number
CN111507178A
CN111507178A CN202010138933.2A CN202010138933A CN111507178A CN 111507178 A CN111507178 A CN 111507178A CN 202010138933 A CN202010138933 A CN 202010138933A CN 111507178 A CN111507178 A CN 111507178A
Authority
CN
China
Prior art keywords
face data
matrix
data matrix
optimization
preset
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.)
Pending
Application number
CN202010138933.2A
Other languages
Chinese (zh)
Inventor
张艳
孙太武
周超勇
刘玉宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010138933.2A priority Critical patent/CN111507178A/en
Priority to PCT/CN2020/093173 priority patent/WO2021174691A1/en
Publication of CN111507178A publication Critical patent/CN111507178A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/94Hardware or software architectures specially adapted for image or video understanding

Abstract

The invention discloses an optimization method and device for data processing, a storage medium and computer equipment, relates to the technical field of data processing, and mainly aims to solve the problems that a large amount of time is consumed in code operation by pure multiplication among existing matrixes, the calculated amount of a computer is increased when the order of the matrixes is large, a large amount of CPU (Central processing Unit) resources are occupied, and the efficiency of data processing is reduced. The method comprises the following steps: judging whether the line number of a face data matrix constructed according to the face data exceeds a preset optimization threshold value or not; if all the line numbers of the face data matrix do not exceed the preset optimization threshold, calling a preset extension instruction to carry out integration processing on the face data matrix; and if the arbitrary line number of the face data matrix exceeds the preset optimization threshold, performing order reduction processing on the face data matrix to obtain an optimization matrix of the face data matrix.

Description

Data processing optimization method and device, storage medium and computer equipment
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for optimizing data processing, a storage medium, and a computer device.
Background
With the rapid development of big data processing, computers as computing devices need to process more and more data, and the form of processing data is more and more complex. In the fields of process control, image processing, scientific calculation, signal processing, cryptography, computer timing analysis, and the like, the matrix has become a basic data unit for large data processing.
At present, in the existing face recognition process, the face data is required to be used as basic data of a recognition model for operation after the face data is acquired, in the process, when the face data is required to be subjected to multiplication operation processing in a matrix form, namely, the face data is subjected to code conversion operation processing according to the multiplication between a commonly used matrix and a matrix, however, 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 code operation is utilized, and when the order of the matrix 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 the above, the present invention provides an optimization method and apparatus for data processing, a storage medium, and a computer device, and mainly aims to solve the problems that a large amount of time is consumed in performing code operation by simple multiplication between existing matrices, and when the order of a matrix is large, the amount of calculation of a computer is increased, a large amount of CPU resources are occupied, and the efficiency of data processing is reduced.
According to an aspect of the present invention, there is provided a data processing optimization method, including:
when face recognition is to be performed according to the acquired face data, intercepting the face data, and judging whether the line number of a face data matrix constructed according to the face data exceeds a preset optimization threshold value or not;
if all the line numbers of the face data matrix do not exceed the preset optimization threshold, calling a preset extension instruction to carry out integration processing on the face data matrix;
and if the arbitrary line number of the face data matrix exceeds the preset optimization threshold, performing order reduction processing on the face data matrix to obtain an optimization matrix of the face data matrix.
Further, after the order reduction processing is performed on the face data matrix to obtain an optimized matrix of the face data matrix, the method further includes:
and determining the optimization matrix as a face data matrix, and re-executing the step of judging whether the line number of the face data matrix constructed according to the face data exceeds a preset optimization threshold value.
Further, the step reduction processing on 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 partitioning the face data matrix and taking the face data matrix containing the partitioning matrix as an optimization matrix, the method further includes:
and filling data in the row number and the column number which belong to the odd number in the face data matrix.
Further, the partitioning the face data matrix, and using the face data matrix including the partitioned matrix as an optimization matrix includes:
and partitioning the face data matrix according to the first order as a unit, and taking all determined partitioned matrixes as the optimization matrix of the face data matrix.
Further, after the partitioning the face data matrix and taking the face data matrix containing the partitioning matrix 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;
and if the number of the blocks is smaller than the preset blocking threshold, blocking the face data matrix by taking a second order as a unit, and taking all determined blocking matrixes as the optimization matrixes of the face data matrix.
Further, the invoking a preset extension instruction to perform integration processing on the face data matrix includes:
and performing recursive operation processing of sum expressions on all block matrixes contained in the face data matrix by using a preset extension instruction to obtain a matrix operation result of the face data matrix, wherein the sum expression is an algorithm for performing product summation on a plurality of block matrixes.
According to another aspect of the present invention, there is provided an optimization apparatus for data processing, including:
the judging module is used for intercepting the face data when face recognition is to be carried out according to the acquired face data, and judging whether the line number of a face data matrix constructed according to the face data exceeds a preset optimization threshold value or not;
the first processing module is used for calling a preset extension instruction to carry out integration processing on 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 order reduction processing on the face data matrix to obtain an optimized matrix of the face data matrix if any line number of the face data matrix exceeds the preset optimized threshold.
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 line number of the face data matrix constructed according to the face data exceeds a preset optimization threshold value.
Further, the second processing module is specifically configured to block the face data matrix, and use the face data matrix including the block matrix as an optimization matrix.
Further, the apparatus further comprises:
and the filling module is used for filling data in the row number and the column number which belong 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 a unit of a first order, and use all determined block matrices as an optimization matrix of the face data matrix.
Further, the first 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;
and the blocking module is used for blocking the face data matrix according to a second order as a unit and taking all the determined blocking matrixes as the optimization matrixes of the face data matrix if the blocking threshold is smaller than the preset blocking threshold.
Further, the first processing module is specifically configured to perform recursive operation processing on all block matrices included in the face data matrix by using a preset extended instruction and perform sum expression to obtain a matrix operation result of the face data matrix, where the sum expression is an algorithm for performing product summation on a plurality of block matrices.
According to still another aspect of the present invention, there is provided a storage medium having at least one executable instruction stored therein, the executable instruction 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 system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication 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 optimization method.
By the technical scheme, the technical scheme provided by the embodiment of the invention at least has the following advantages:
the invention provides an optimization method and device for data processing, a storage medium and computer equipment, compared with the prior art that the code conversion operation processing is carried out according to the multiplication between common matrixes and matrixes, the embodiment of the invention carries out reduction processing on a face data matrix to obtain an optimized matrix by judging that the number of lines of the face data matrix exceeds a preset optimized threshold, and carries out sum expression operation processing on the face data matrix by utilizing a preset extended instruction if the number of lines of the face data matrix does not exceed the preset optimized threshold, so that the time consumption of code iterative operation during the multiplication of a simple matrix is reduced, the CPU resource occupation is reduced, the data processing quantity is reduced, and the data processing efficiency is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
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 refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow chart of an optimization method for data processing according to an embodiment of the present invention;
FIG. 2 is a flow chart of another data processing optimization method provided by the embodiment of the invention;
FIG. 3 is a block diagram illustrating an apparatus for optimizing data processing according to an embodiment of the present invention;
FIG. 4 is a block diagram of an apparatus for optimizing data processing according to another 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.
An embodiment of the present invention provides an optimization method for data processing, as shown in fig. 1, the method includes:
101. when face recognition is to be performed according to the acquired face data, intercepting the face data, and judging whether the line number of a face data matrix constructed according to the face data exceeds a preset optimization threshold value.
The face data matrix comprises 2 matrixes which need to be subjected to matrix multiplication, and the row number and the column number of each matrix can be obtained by utilizing a method for searching and counting the row number and the column number. In the embodiment of the present invention, for setting the preset optimization threshold, in order to balance the matrix optimization calculation when the matrix is calculated, the preset optimization threshold is set to 32, for example, it is determined whether the number of rows of the face data matrix exceeds 32 rows, which is not specifically limited in the embodiment of the present invention.
102a, if all the line numbers of the face data matrix do not exceed the preset optimization threshold, calling a preset extension instruction to carry out integration processing on the face data matrix.
In the embodiment of the invention, the face data matrix can be 2 matrixes which are used for multiplication, so when all functions of the 2 matrixes are judged not to exceed the preset optimization threshold, the multiplication among the matrixes can be operated and processed by using the preset expansion instruction in a form of a sum expression. The preset expansion instruction is an arm neon-based expansion instruction, specifically, an arm neon-based matrix multiplication instruction, and the embodiment of the present invention is not particularly limited.
102b, if any row number of the face data matrix exceeds the preset optimization threshold, performing order reduction 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 and improve the operation efficiency when the multiplication operation is performed on the face data matrix with the line number larger than the preset optimization threshold, when the line number of any matrix in the face data matrix exceeds the preset optimization threshold, for example, 32 lines, the face data matrix is subjected to order reduction processing to obtain the optimized matrix.
It should be noted that, after the optimized matrix is obtained, in order to further calculate the matrix and determine whether optimization is needed, the optimized matrix is returned to step 101 as the face data matrix for re-determination until none of the rows in the face data matrix exceeds the preset optimization threshold, and a preset extension instruction is invoked to perform integration processing on the face data matrix.
The invention provides an optimization method for data processing, compared with the prior art that the code conversion operation processing is carried out according to the multiplication between a common matrix and a matrix, the embodiment of the invention carries out reduction processing on a face data matrix to obtain an optimized matrix by judging that the number of rows of the face data matrix exceeds a preset optimized threshold, and carries out sum expression operation processing on the face data matrix by using a preset extended instruction if the number of rows of the face data matrix does not exceed the preset optimized threshold, so that the time consumption of code iterative operation during the multiplication of a simple matrix is reduced, the CPU resource occupation is reduced, the data processing quantity is reduced, and the data processing efficiency is improved.
An embodiment of the present invention provides another data processing optimization method, as shown in fig. 2, the method includes:
201. when face recognition is to be performed according to the acquired face data, intercepting the face data, and judging whether the line number of a face data matrix constructed according to the face data exceeds a preset optimization threshold value.
This step is the same as step 101 shown in fig. 1, and is not described herein again.
It should be noted that, if the face data matrix to be determined is the optimized matrix, it is determined whether the number of blocks in each row in the optimized matrix is the number of columns and the number of blocks in each column is the number of rows, which exceeds the preset optimization threshold.
202a, if all the line numbers of the face data matrix do not exceed the preset optimization threshold, calling a preset extension instruction to carry out integration processing on the face data matrix.
This step is the same as step 102a shown in fig. 1, and is not described herein again.
Further, if it is determined that the number of lines of the face data matrix exceeds a preset optimization threshold, performing order reduction on the face data matrix, performing operation to obtain an optimization matrix of the face data matrix, and using the optimization matrix as the face data matrix to determine that the number of lines does not exceed the preset optimization threshold, the step of calling a preset extension instruction to perform integration processing on the face data matrix may specifically be: and performing recursive operation processing of sum expressions on all block matrixes contained in the face data matrix by using a preset extension instruction to obtain a matrix operation result of the face data matrix, wherein the sum expression is an algorithm for performing product summation on a plurality of block matrixes.
If the number of lines of the face data matrix does not exceed the preset optimization threshold, the number of the orders of the face data matrix is suitable for calculation by a calculation instruction in a computer, the calculation process does not increase time consumption, and the occupied CPU resource is small. Therefore, when all the line numbers in the face data matrix do not exceed the preset optimization threshold, that is, the line numbers of the 2 matrixes to be subjected to matrix multiplication do not exceed the preset optimization threshold, all the block matrixes contained in the face data matrix are subjected to recursive operation processing of the expressions by using the preset extension instruction, and a matrix operation result is obtained.
It should be noted that, since the step 202a is a parallel step with the step 202b, and after the step 202b, the 2 optimized matrices serving as face data matrices again respectively include a plurality of block matrices, when performing recursive operation processing of sum expressions by using a preset extended instruction, it is necessary to perform multiplication processing on the plurality of block matrices in one optimized face data matrix individually. In the embodiment of the invention, because the face data matrix with the number of rows not exceeding the preset optimization threshold value may be a matrix subjected to reduction processing for multiple times, the face data matrix comprises a plurality of block matrixes, namely the block matrixes also comprise sub-block matrixes, when the recursive operation processing of the sum expression is performed by using the preset extension instruction, the sub-block matrixes belonging to the block matrixes need to be firstly subjected to multiplication operation, then the block matrixes are subjected to multiplication operation, and each block matrix is subjected to operation processing in sequence recursively, so that the operation result of the face data matrix is finally obtained.
For example, the face data matrix is
Figure BDA0002398338160000071
a11、a12、a21、a22、b11、b12、b21、b22Is a block matrix, and formula a of the expressioni1b1j+ai2b2j=cijAnd 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, which specifically includes: taking 4 floating point type float data from the data source address src to form a floating point type 32 x 4 matrix, namely float32 x 4_ t, and returning, and specifically, inputting a float, copying and pasting 4 times to form a float32 x 4_ t, and returning. Writing a float32 x 4_ t to the data source address dst corresponds to writing 4 floating point data floats at a time. And adding corresponding elements of dst in src respectively, and multiplying to obtain a result. Multiplying the V1 elements in src by s1, adding the result to the elements at the corresponding position of V2 in dst, writing the result to V0, calculating a 4 × 4 block each time, so as not to reduce the calculation times of multiplication and addition, but reducing the value times of b matrix to the original 1/4, multiplying the V1 and each corresponding element of V2 to obtain V3, adding the V3 to each corresponding element of V3, writing the V0, so that the compiler aligns according to 4 byte boundaries when setting variable addresses, the data are concentrated, and the cache captures the data around the cache while capturing the data, thereby realizing the multiplication calculation of a plurality of matrices together.
202b, if any row 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, because the line number of the face data matrix exceeds the preset optimization threshold, the order number of the face data matrix is too large, 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, and the consumed time is too long, therefore, the block matrix in the face data matrix is firstly determined, so that the order reduction processing is realized.
For the embodiment of the present invention, in order to avoid that the determined block matrix lacks corresponding rows or columns and cannot be completely blocked, the step of blocking the face data matrix further includes, before the step of using the face data matrix including the block matrix as an optimization matrix: and filling data in the row number and the column number which belong to the odd number in the face data matrix.
Firstly, the parity is judged according to 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: and judging whether the columns of the first matrix and the rows of the second matrix in the face data matrix are even numbers, and if so, judging whether the columns of the second matrix are even numbers. The filling process may specifically directly increase odd-numbered rows or columns to even-numbered rows or columns according to a preset numerical value, in the embodiment of the present invention, a row or a column is increased, where the filled numerical value may be any non-zero natural number, and the embodiment of the present invention is not limited specifically.
For further explanation and limitation of the embodiment of the present invention, step 202b specifically includes: and partitioning the face data matrix according to the first order as a unit, and taking all determined partitioned matrixes as the optimization matrix of the face data matrix.
When the face data matrix is partitioned, in order to improve the efficiency of partitioning and the operation speed in the operation process, the partitioning may be performed in units of a first order, where the first order may be an order determined by dividing the number of rows and columns by 2, for example, the face data matrix is a matrix with 100 rows and × 100 columns, and the number of rows and columns divided by 2 is 50, and then the obtained optimized matrix is a matrix with 50 rows and × 50 columns, where 2 is the partitioning order.
For the embodiment of the present invention, in order to avoid the influence on the operation speed due to the multiplication of the blocking matrix and the two matrices 1 × 1, after the step 202b, the method may further include determining whether the number of rows and the number of columns of the blocking matrix are smaller than a preset blocking threshold, blocking the face data matrix according to a second order as a unit if the number of rows and the number of columns of the blocking matrix are smaller than the preset blocking threshold, and using all the determined blocking matrices as the optimization matrices of the face data matrix.
Wherein the preset blocking threshold may be 2 for determining blockingi×2iNumber of rows and columns corresponding to the order, 0<i<k, k ═ 1, 2. When the number of rows and columns of the blocking matrix is smaller than a preset blocking threshold value, blocking the face data matrix according to a second receiving unit, wherein the second order number can be the number of rows and columns divided by 2iAnd determining the order, and blocking the face data matrix according to the order, and taking all the determined blocking matrixes as the optimization matrix of the face data matrix.
For the embodiment of the present invention, in order to complete that the obtained optimization matrix can be subjected to multiplication processing, the step after step 202b determines the optimization matrix as a face data matrix, and re-executes 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.
The invention provides another optimization method for data processing, compared with the prior art that the code conversion operation processing is carried out according to the multiplication between the commonly used matrixes and the matrixes, the embodiment of the invention carries out the order reduction processing on the human face data matrix to obtain the optimized matrix by judging that the line number of the human face data matrix exceeds the preset optimized threshold value, and carries out the sum expression operation processing on the human face data matrix by utilizing the preset extended instruction if the line number of the human face data matrix does not exceed the preset optimized threshold value, so that the time consumption of code iterative operation during the multiplication of a simple matrix is reduced, the CPU resource occupation is reduced, 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 optimization apparatus for data processing, as shown in fig. 3, the apparatus includes: a judgment 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 acquired 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, if all the line numbers of the face data matrix do not exceed the preset optimization threshold, invoke a preset extension instruction to perform integration processing on the face data matrix;
the second processing module 33 is configured to perform order reduction processing on the face data matrix to obtain an optimized matrix of the face data matrix if any number of rows of the face data matrix exceeds the preset optimized threshold.
The invention provides an optimization device for data processing, compared with the prior art that the code conversion operation processing is carried out according to the multiplication between a common matrix and a matrix, the embodiment of the invention carries out the order reduction processing on a face data matrix to obtain an optimized matrix by judging that the line number of the face data matrix exceeds a preset optimized threshold, and carries out the sum expression operation processing on the face data matrix by utilizing a preset extended instruction if the line number of the face data matrix does not exceed the preset optimized threshold, so that the time consumption of code iterative operation during the multiplication of a simple matrix is reduced, the CPU resource occupation is reduced, 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 optimization apparatus is provided in an embodiment of the present invention, and as shown in fig. 4, the apparatus includes: a judgment module 41, a first processing module 42, a second processing module 43, a determination module 44, a filling module 45, a judgment 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 acquired 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, if all the line numbers of the face data matrix do not exceed the preset optimization threshold, invoke a preset extension instruction to perform integration processing on the face data matrix;
and a second processing module 43, configured to perform order reduction processing on the face data matrix to obtain an optimized matrix of the face data matrix if any number of rows of the face data matrix exceeds the preset optimized threshold.
Further, the apparatus further comprises:
and 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 use the face data matrix including the block matrix as an optimization matrix.
Further, the apparatus further comprises:
and a filling module 45, configured to perform data filling on the number of rows and columns in the face data matrix, where the rows and columns belong to odd numbers.
Further, the second processing module 43 is specifically configured to block the face data matrix according to a first order as a unit, and use all determined block matrices as an optimization matrix of the face data matrix.
Further, the first apparatus further comprises:
a judging module 46, configured to judge whether the number of rows and the number of columns of the blocking matrix are smaller than a preset blocking threshold;
and the blocking module 47 is configured to block the face data matrix according to a second order as a unit if the number of blocks is smaller than the preset blocking threshold, and use all determined blocking matrices as the optimization matrices of the face data matrix.
Further, the first processing module 42 is specifically configured to perform recursive operation processing on all block matrices included in the face data matrix by using a preset extended instruction and perform sum expression to obtain a matrix operation result of the face data matrix, where the sum expression is an algorithm for performing product summation on a plurality of block matrices.
The invention provides another data processing optimization device, compared with the prior art that the code conversion operation processing is carried out according to the multiplication between the commonly used matrixes and the matrixes, the embodiment of the invention carries out the order reduction processing on the human face data matrix to obtain the optimized matrix by judging that the line number of the human face data matrix exceeds the preset optimized threshold value, and carries out the sum expression operation processing on the human face data matrix by utilizing the preset extended instruction if the line number of the human face data matrix does not exceed the preset optimized threshold value, so that the time consumption of code iterative operation during the multiplication of the pure matrixes is reduced, the CPU resource occupation is reduced, the data processing quantity is reduced, and the data processing efficiency is improved.
According to an embodiment of the present invention, a storage medium is provided, the storage medium storing at least one executable instruction, and the computer executable instruction can execute the optimization method of data processing in any of the above method embodiments.
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 does not limit the specific implementation of the computer device.
As shown in fig. 5, the computer apparatus may include: a processor (processor)502, a Communications Interface 504, a memory 506, and a communication bus 508.
Wherein: the processor 502, communication interface 504, and memory 506 communicate with one another via a 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 data processing optimization method embodiment.
In particular, program 510 may include program code that includes computer operating instructions.
The processor 502 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the invention. The computer device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 506 for storing a program 510. The memory 506 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 510 may specifically be used to cause the processor 502 to perform the following operations:
when face recognition is to be performed according to the acquired face data, intercepting the face data, and judging whether the line number of a face data matrix constructed according to the face data exceeds a preset optimization threshold value or not;
if all the line numbers of the face data matrix do not exceed the preset optimization threshold, calling a preset extension instruction to carry out integration processing on the face data matrix;
and if the arbitrary line number of the face data matrix exceeds the preset optimization threshold, performing order reduction processing on the face data matrix to obtain an optimization matrix of the face data matrix.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for optimizing data processing, comprising:
when face recognition is to be performed according to the acquired face data, intercepting the face data, and judging whether the line number of a face data matrix constructed according to the face data exceeds a preset optimization threshold value or not;
if all the line numbers of the face data matrix do not exceed the preset optimization threshold, calling a preset extension instruction to carry out integration processing on the face data matrix;
and if the arbitrary line number of the face data matrix exceeds the preset optimization threshold, performing order reduction processing on the face data matrix to obtain an optimization matrix of the face data matrix.
2. The method of claim 1, wherein after performing the order reduction on the face data matrix to obtain an optimized matrix of the face data matrix, the method further comprises:
and determining the optimization matrix as a face data matrix, and re-executing the step of judging whether the line number of the face data matrix constructed according to the face data exceeds a preset optimization threshold value.
3. The method of claim 2, wherein the step of reducing the face data matrix to obtain an optimized matrix of the face data matrix comprises:
and partitioning the face data matrix, and taking the face data matrix containing the partitioned matrix as an optimization matrix.
4. The method of claim 3, wherein before the partitioning the face data matrix and using the face data matrix containing the partitioned matrix as an optimization matrix, the method further comprises:
and filling data in the row number and the column number which belong to the odd number in the face data matrix.
5. The method of claim 4, wherein the partitioning the face data matrix and using the face data matrix containing the partitioned matrix as an optimization matrix comprises:
and partitioning the face data matrix according to the first order as a unit, and taking all determined partitioned matrixes as the optimization matrix of the face data matrix.
6. The method of claim 5, wherein after partitioning the face data matrix and using the face data matrix containing the partitioned matrix as an optimization matrix, the method further comprises:
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 if the number of the blocks is smaller than the preset blocking threshold, blocking the face data matrix by taking a second order as a unit, and taking all determined blocking matrixes as the optimization matrixes of the face data matrix.
7. The method according to any one of claims 1 to 6, wherein the invoking of the preset extension instruction to perform the integration processing on the face data matrix comprises:
and performing recursive operation processing of sum expressions on all block matrixes contained in the face data matrix by using a preset extension instruction to obtain a matrix operation result of the face data matrix, wherein the sum expression is an algorithm for performing product summation on a plurality of block matrixes.
8. An apparatus for optimizing data processing, comprising:
the judging module is used for judging whether the line number of a face data matrix constructed according to the face data exceeds a preset optimization threshold value or not;
the first processing module is used for calling a preset extension instruction to carry out integration processing on 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 order reduction processing on the face data matrix to obtain an optimized matrix of the face data matrix if any line number of the face data matrix exceeds the preset optimized threshold.
9. 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 according to any one of claims 1 to 7.
10. A computer device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the optimization method of the data processing according to any one of claims 1-7.
CN202010138933.2A 2020-03-03 2020-03-03 Data processing optimization method and device, storage medium and computer equipment Pending CN111507178A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010138933.2A CN111507178A (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 CN111507178A (en) 2020-03-03 2020-03-03 Data processing optimization method and device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN111507178A true CN111507178A (en) 2020-08-07

Family

ID=71868982

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010138933.2A Pending CN111507178A (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) CN111507178A (en)
WO (1) WO2021174691A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
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
US20110135167A1 (en) * 2008-07-10 2011-06-09 Nec Corporation Personal authentication system and personal authentication method
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
US20190147299A1 (en) * 2016-10-31 2019-05-16 Tencent Technology (Shenzhen) Company Limited Data processing method and apparatus for convolutional neural network
CN110766133A (en) * 2019-09-18 2020-02-07 开放智能机器(上海)有限公司 Data processing method, device, equipment and storage medium in embedded equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572587B (en) * 2014-12-23 2017-11-14 中国电子科技集团公司第三十八研究所 The acceleration operation method and device that data matrix is multiplied
CN109542512B (en) * 2018-11-06 2020-09-04 腾讯科技(深圳)有限公司 Data processing method, device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
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
US20110135167A1 (en) * 2008-07-10 2011-06-09 Nec Corporation Personal authentication system and personal authentication method
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
US20190147299A1 (en) * 2016-10-31 2019-05-16 Tencent Technology (Shenzhen) Company Limited Data processing method and apparatus for convolutional neural network
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
WO2021174691A1 (en) 2021-09-10

Similar Documents

Publication Publication Date Title
CN108133270B (en) Convolutional neural network acceleration method and device
US10445638B1 (en) Restructuring a multi-dimensional array
CN104915322B (en) A kind of hardware-accelerated method of convolutional neural networks
WO2022037257A1 (en) Convolution calculation engine, artificial intelligence chip, and data processing method
US20230068450A1 (en) Method and apparatus for processing sparse data
CN115880132B (en) Graphics processor, matrix multiplication task processing method, device and storage medium
CN114138231B (en) Method, circuit and SOC for executing matrix multiplication operation
US9058301B2 (en) Efficient transfer of matrices for matrix based operations
CN111210004B (en) Convolution calculation method, convolution calculation device and terminal equipment
CN109993293B (en) Deep learning accelerator suitable for heap hourglass network
WO2022068328A1 (en) Data migration method and apparatus, and processor and calculation device
CN108053361B (en) Multi-interconnection vision processor and image processing method adopting same
CN110689045A (en) Distributed training method and device for deep learning model
CN111047037A (en) Data processing method, device, equipment and storage medium
CN109902821B (en) Data processing method and device and related components
CN111507178A (en) Data processing optimization method and device, storage medium and computer equipment
CN114936633B (en) Data processing unit for transposition operation and image transposition operation method
CN115860080A (en) Computing core, accelerator, computing method, device, equipment, medium and system
Bhagavathi et al. Square meshes are not optimal for convex hull computation
CN112163612B (en) Big template convolution image matching method, device and system based on fpga
CN115346099A (en) Image convolution method, chip, equipment and medium based on accelerator chip
US11467973B1 (en) Fine-grained access memory controller
CN113705784A (en) Neural network weight coding method based on matrix sharing and hardware system
CN112183732A (en) Convolutional neural network acceleration method and device and computer equipment
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