CN114090231A - Data processing method, controller and readable storage medium - Google Patents
Data processing method, controller and readable storage medium Download PDFInfo
- Publication number
- CN114090231A CN114090231A CN202111185865.6A CN202111185865A CN114090231A CN 114090231 A CN114090231 A CN 114090231A CN 202111185865 A CN202111185865 A CN 202111185865A CN 114090231 A CN114090231 A CN 114090231A
- Authority
- CN
- China
- Prior art keywords
- data
- row
- calculation
- line
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0877—Cache access modes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Biophysics (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Computational Linguistics (AREA)
- Artificial Intelligence (AREA)
- Mathematical Physics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Information Transfer Systems (AREA)
Abstract
The invention discloses a data processing method, a controller and a readable storage medium. The data processing method comprises the following steps: acquiring line data corresponding to a target row of a data matrix, and storing the acquired line data into line buffers, wherein each line buffer stores one line data corresponding to the target row, and the target row presets a data row associated with a calculation window; controlling the line buffer to output first subdata corresponding to the preset calculation window to the calculation module; acquiring second subdata corresponding to the preset calculation window from the data matrix, and inputting the second subdata into the calculation module, wherein the data corresponding to the preset calculation window comprises the first subdata and the second subdata; and determining a calculation result corresponding to the data in the preset calculation window through the calculation module. The present invention aims to improve the efficiency of the POOL operation.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing method, a controller, and a readable storage medium.
Background
The POOL algorithm is a commonly used algorithm in neural network computing, and it reduces the number of output feature vectors in a downsampling manner.
In the related art, a common operation of the POOL algorithm in the neural network is to constantly read data from a calculation window by moving the calculation window to perform MAX POOL (maximum value of data in the calculation window) or Average POOL (Average value of data in the calculation window). However, the calculation windows at different positions use a lot of repeated data, which are repeatedly read from the memory, consuming a lot of operation time, thus reducing the efficiency of the POOL operation.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The present invention provides a data processing method, a controller and a readable storage medium, which aims to solve the technical problem that the POOL operation needs to repeatedly read repeated data from a memory, and to improve the efficiency of the POOL operation.
In order to achieve the above object, the present invention provides a data processing method applied to a controller of a data processing system, wherein the controller is configured to control a line buffer of the data processing system to perform data caching, and is configured to control the line buffer to output data to a first computing module of the data processing system, and the data processing method includes:
acquiring line data corresponding to a target row of a data matrix, and storing the acquired line data into line buffers, wherein each line buffer stores one line data corresponding to the target row, and the target row presets a data row associated with a calculation window;
controlling the line buffer to output first subdata corresponding to the preset calculation window to the calculation module;
acquiring second subdata corresponding to the preset calculation window from the data matrix, and inputting the second subdata into the calculation module, wherein the data corresponding to the preset calculation window comprises the first subdata and the second subdata;
and determining a calculation result corresponding to the data in the preset calculation window through the calculation module.
Optionally, the data processing method further includes:
and when the preset calculation window moves, acquiring a first step length of the movement of the preset calculation window in the horizontal direction and a second step length of the movement of the preset calculation window in the vertical direction.
Determining the calculation range of the calculation module according to the first step length and the second step length;
and updating and determining a data line to be updated according to the calculation range, and updating the data stored in the line buffer according to the data corresponding to the data line to be updated.
Optionally, the data processing method further includes:
the first subdata is the row data except the last row in the row data corresponding to the preset calculation window, and the second subdata is the row data of the last row in the row data corresponding to the preset calculation window.
Optionally, the data processing method further includes:
controlling a first row buffer to store first target row data of a data matrix;
and judging whether second target line data is the line data of the last line in the line where the preset computing window is located, wherein the second target line data is the line data corresponding to the next line of the line corresponding to the first target line data.
Optionally, the data processing method further includes:
if the second target line data is not the line data of the last line, controlling the first line buffer to store the second target line data, and simultaneously, the first line buffer outputs the first target line data to the second line buffer, and controlling the second line buffer to store the first target line data output by the first line buffer;
and if the second target line of data is the last line of data, executing the step of controlling the line buffer to output first subdata corresponding to the preset calculation window to the calculation module.
Optionally, the data processing method further includes:
the calculation module comprises a first calculation module and a second calculation module, and the step of determining the calculation result corresponding to the data in the preset calculation window through the calculation module comprises the following steps:
the calculation module comprises a first calculation module and a second calculation module, and the step of determining the calculation result corresponding to the data in the preset calculation window through the calculation module comprises the following steps:
controlling the first computing module to receive the first subdata and the second subdata and process the first subdata and the second subdata according to a first preset computing mode to obtain a first computing result;
and outputting the first calculation result to the second calculation module, and processing according to a second preset calculation mode to obtain a second calculation result.
Optionally, the data processing method further includes:
the calculation module is used for calculating the maximum value or the average value of the data in the preset window.
Further, to achieve the above object, the present invention also provides a controller of a data processing system, the controller including: a memory, a processor and a data processing program stored on the memory and executable on the processor, the data processing program, when executed by the processor, implementing the steps of the data processing method as described above.
Furthermore, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a data processing program, which when executed by a processor, implements the steps of the data processing method as described above.
The data processing method is applied to a controller of a data processing system, firstly, row data corresponding to a target row of a data matrix are obtained, the obtained row data are stored in row buffers, each row buffer stores one row data corresponding to the target row, and the target row presets any row of a calculation window except the last row in the row; controlling the line buffer to output the stored line data to the computing module; and acquiring the row data corresponding to the last row in the row where the preset calculation window is located from the data matrix and inputting the row data into the calculation module. Compared with the traditional POOL operation, the data processing method provided by the embodiment of the invention does not need to repeatedly read repeated data, so that a large amount of operation time is reduced, and the efficiency of the POOL operation is improved.
Drawings
Fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a data processing method according to an embodiment of the present invention;
FIG. 3 is a first diagram illustrating an application scenario of an embodiment of a data processing method according to the present invention;
FIG. 4 is a second diagram illustrating an application scenario of an embodiment of a data processing method according to the present invention;
FIG. 5 is a flowchart illustrating a data processing method according to another embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic diagram of a controller structure of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the controller may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the controller configuration shown in fig. 1 does not constitute a limitation of the controller, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
In the terminal shown in fig. 1, the processor 1001 may be configured to call a data processing program stored in the memory 1005 and perform the following operations:
acquiring line data corresponding to a target row of a data matrix, and storing the acquired line data into line buffers, wherein each line buffer stores one line data corresponding to the target row, and the target row presets a data row associated with a calculation window;
controlling the line buffer to output first subdata corresponding to the preset calculation window to the calculation module;
acquiring second subdata corresponding to the preset calculation window from the data matrix, and inputting the second subdata into the calculation module, wherein the data corresponding to the preset calculation window comprises the first subdata and the second subdata;
and determining a calculation result corresponding to the data in the preset calculation window through the calculation module.
Further, the processor 1001 may call the data processing program stored in the memory 1005, and also perform the following operations:
and when the preset calculation window moves, acquiring a first step length of the movement of the preset calculation window in the horizontal direction and a second step length of the movement of the preset calculation window in the vertical direction.
Determining the calculation range of the calculation module according to the first step length and the second step length;
and updating and determining a data line to be updated according to the calculation range, and updating the data stored in the line buffer according to the data corresponding to the data line to be updated.
Further, the processor 1001 may call the data processing program stored in the memory 1005, and also perform the following operations:
the first subdata is the row data except the last row in the row data corresponding to the preset calculation window, and the second subdata is the row data of the last row in the row data corresponding to the preset calculation window.
Further, the processor 1001 may call the data processing program stored in the memory 1005, and also perform the following operations:
controlling a first row buffer to store first target row data of a data matrix;
and judging whether second target line data is the line data of the last line in the line where the preset computing window is located, wherein the second target line data is the line data corresponding to the next line of the line corresponding to the first target line data.
Further, the processor 1001 may call the data processing program stored in the memory 1005, and also perform the following operations:
if the second target line data is not the line data of the last line, controlling the first line buffer to store the second target line data, and simultaneously, the first line buffer outputs the first target line data to the second line buffer, and controlling the second line buffer to store the first target line data output by the first line buffer;
and if the second target line of data is the last line of data, executing the step of controlling the line buffer to output first subdata corresponding to the preset calculation window to the calculation module.
Further, the processor 1001 may call the data processing program stored in the memory 1005, and also perform the following operations:
the calculation module comprises a first calculation module and a second calculation module, and the step of determining the calculation result corresponding to the data in the preset calculation window through the calculation module comprises the following steps:
controlling the first computing module to receive the first subdata and the second subdata and process the first subdata and the second subdata according to a first preset computing mode to obtain a first computing result;
and outputting the first calculation result to the second calculation module, and processing according to a second preset calculation mode to obtain a second calculation result.
Further, the processor 1001 may call the data processing program stored in the memory 1005, and also perform the following operations:
the calculation module is used for calculating the maximum value or the average value of the data in the preset window.
The POOL algorithm is a commonly used algorithm in neural network computing, and it reduces the number of output feature vectors in a downsampling manner.
In the related art, a common operation of the POOL algorithm in the neural network is to continuously read data from a calculation window for calculation by moving the calculation window, but the calculation windows at different positions use a large amount of repeated data, and the repeated data are repeatedly read from a memory, which consumes a large amount of operation time, thereby reducing the efficiency of the POOL operation.
In order to reduce the operation time and improve the efficiency of the POOL operation, the embodiment of the invention provides a data processing method, a controller and a readable storage medium, wherein the method mainly comprises the following steps:
acquiring line data corresponding to a target row of a data matrix, and storing the acquired line data into line buffers, wherein each line buffer stores one line data corresponding to the target row, and the target row presets a data row associated with a calculation window;
controlling the line buffer to output first subdata corresponding to the preset calculation window to the calculation module;
acquiring second subdata corresponding to the preset calculation window from the data matrix, and inputting the second subdata into the calculation module, wherein the data corresponding to the preset calculation window comprises the first subdata and the second subdata;
and determining a calculation result corresponding to the data in the preset calculation window through the calculation module.
Therefore, based on the scheme provided by the embodiment, the data reading time can be reduced, and the efficiency of the POOL operation can be improved.
Hereinafter, the contents of the claims of the present invention are explained by specific exemplary embodiments so that those skilled in the art can better understand the scope of the claims of the present invention. It is to be understood that the following exemplary embodiments are not intended to limit the scope of the present invention, but are merely illustrative of the present invention.
Exemplarily, referring to fig. 2, in an embodiment of the data processing method of the present invention, the data processing method includes the steps of:
step S10, obtaining line data corresponding to a target row of a data matrix, and storing the obtained line data into line buffers, wherein each line buffer stores one line data corresponding to the target row, and the target row presets a data row associated with a calculation window;
in this embodiment, the data matrix is an M × N matrix composed of several elements, which may be numbers or feature vectors from picture recognition, and each row of the matrix has the same number of rows and each column of the matrix has the same number of columns.
Optionally, the line buffer corresponds to a target line, so that there is at least one line buffer, and when the line data of the corresponding line is stored, the line data may be stored from left to right, or from right to left, or the line data may be stored in a row-by-row manner.
Specifically, the Line Buffer may be a plurality of Line buffers instantiated in advance for data storage, or may be directly instantiated according to a preset calculation window, the number of Line buffers is related to the number of lines (KH) of the preset calculation window, and the depth of the Line buffers is related to the width (W) of the data matrix. The Line Buffer is realized by FIFO, and the FIFO is a first-in first-out memory, so that data which is input first comes out first. The FIFO is full of data which can be read and written. Therefore, the data in the calculation window needing to be processed first can be ensured to be saved and output first, so that the data can be processed first.
Optionally, the preset calculation window may be a default width and height of the system, or may be a setting of the preset calculation window by the user through the user interface according to a requirement before the data processing operation is performed.
Step S20, controlling the line buffer to output the first subdata corresponding to the preset calculation window to the calculation module;
in this embodiment, the controller of the data processing system controls all the line buffers to output the stored first subdata to the computing module, and each line buffer outputs data at the same time, so that the computing module can process data in a preset computing window at the same time, and the efficiency of the computing module in receiving data is improved.
Optionally, the sequence of the data output by each line buffer should be consistent with the sequence of the stored data during storage, so as to ensure that the data processed by the computing module first is consistent with the preset processing sequence.
Step S30, obtaining second subdata corresponding to the preset calculation window from the data matrix, and inputting the second subdata into the calculation module, where the data corresponding to the preset calculation window includes the first subdata and the second subdata;
in this embodiment, the data corresponding to the preset calculation window includes first sub data and second sub data, where the second sub data may be data corresponding to the preset calculation window, may be multiple line data corresponding to the preset calculation window, may also be line data corresponding to one preset calculation window, or may not contain data corresponding to the preset calculation window, and if the data corresponding to the preset calculation window is not contained, the second sub data corresponding to the preset calculation window does not need to be obtained from the data matrix.
Optionally, the first subdata is row data of a row except the last row in the row where the preset computing window is located, and the second subdata is row data of the last row in the row where the preset computing window is located, so that the number of required row buffers is KH-1, and the depth of the row buffers is W, on one hand, smoothness of a channel during data transmission is guaranteed, on the other hand, use of the row buffers is reduced, and resources are saved.
Specifically, a first line buffer is controlled to store first target line data of a data matrix;
and judging whether second target line data is the line data of the last line in the line where the preset computing window is located, wherein the second target line data is the line data corresponding to the next line of the line corresponding to the first target line data. If the second target line data is not the line data of the last line, controlling the first line buffer to store the second target line data, and simultaneously, the first line buffer outputs the first target line data to the second line buffer, and controlling the second line buffer to store the first target line data output by the first line buffer; and if the second target line data is the line data of the last line, executing the step of controlling the line buffer to output the first subdata calculation module corresponding to the preset calculation window. In this way, the data received by the computing module in this embodiment comes from the line buffer and the data matrix, so that the time for inputting the row data into the line buffer can be reduced, and resources can be saved.
And step S40, determining a calculation result corresponding to the data in the preset calculation window through the calculation module.
In this embodiment, the calculation module receives the first sub-data output by the line buffer and the second data obtained from the data matrix, and performs data processing on the first sub-data and the second data, thereby obtaining a calculation result. The calculation module is used for calculating the maximum value or the average value of the data in the preset window, and the calculation module may include a first calculation module and a second calculation module, controls the first calculation module to receive the first subdata and the second subdata, processes the first subdata and the second subdata according to a preset calculation mode, and may calculate the maximum value or the accumulated value of the first subdata to obtain a first calculation result; and outputting the first calculation result to a second calculation module, and processing according to a preset calculation mode, wherein the maximum value calculation or the average value of the first calculation result can be used for obtaining a second calculation result.
It can be understood that, the first subdata and the second subdata are simultaneously input to the calculation module, which is equivalent to inputting the corresponding column data in the preset window to the calculation module, and calculating the column data, and the number of the obtained calculation results is determined by the width of the preset calculation window.
It is understood that the processing of the calculation results of the first calculation module by the second calculation module is performed by grouping the calculation results according to the preset calculation windows at different positions, and the number of the second calculation results is related to the number of times the preset calculation window moves.
Referring to fig. 3, in an application scenario of this embodiment, there is a data matrix with a width of 8 and a height of 8, the preset calculation window has a width of 3 and a height of 3, a first moving step in the horizontal direction is 1, and a second moving step in the vertical direction is 1, and referring to fig. 3, the specific operation steps are as follows: acquiring row data corresponding to a target row of a data matrix, namely a first row and a second row; storing the obtained Line data into the Line Buffer, controlling the Line data corresponding to the first Line to be stored into a Line Buffer0 until the data storage of the first Line is completed, controlling the data of the first Line to be stored into a Line Buffer0 until the data storage of the first Line is completed, and simultaneously controlling the Line data corresponding to the second Line to be stored into a Line Buffer 0; controlling the Line Buffer0 and the Line Buffer1 to output data to the first calculation module at the same time, inputting data of a third row at the same time, inputting three rows of data (data in a solid Line frame) of a preset calculation window at an initial position three times, finishing outputting, performing maximum value calculation processing on the data to obtain a first row data maximum value 16, a second row data maximum value 17 and a third row data maximum value 18, wherein the three maximum values are first calculation results corresponding to the preset calculation window at the initial position, inputting the first calculation result into the second calculation module, performing maximum value calculation on the first calculation result to obtain a second calculation result 18, namely a maximum value of data corresponding to the preset calculation window at the initial position, outputting for the fourth time to obtain a fourth row data maximum value 19, a second row data maximum value 17, a third row data maximum value 18 and a fourth row data maximum value 19, namely, the first calculation result corresponding to the moved preset calculation window is input into the second calculation module, and the maximum value operation is performed on the first calculation result to obtain a second calculation result 19, namely, the maximum value of the data (data in the dashed frame) corresponding to the moved preset calculation window.
In this embodiment, by acquiring line data corresponding to a target row of a data matrix and storing the acquired line data in line buffers, each line buffer stores line data corresponding to one target row, and the target row presets a data row associated with a calculation window; and then controlling the line buffer to output first subdata corresponding to a preset calculation window to the first calculation module, acquiring second subdata corresponding to the preset calculation window from the data matrix, and inputting the second subdata into the first calculation module, wherein the data corresponding to the preset calculation window comprises the first subdata and the second subdata, and the first calculation module processes the data of the preset calculation window and outputs a calculation result. Repeated data corresponding to a preset calculation window does not need to be repeatedly read in the POOL operation, a large amount of operation time is reduced, and the POOL operation efficiency is improved.
Optionally, referring to fig. 5, based on any one of the above embodiments, in another embodiment of the data processing method of the present invention, the data processing method includes:
step S50, when the preset calculation window moves, acquiring a first step length of the movement of the preset calculation window in the horizontal direction and a second step length of the movement of the preset calculation window in the vertical direction;
in the embodiment, the preset calculation window moves in the horizontal direction or in the vertical direction on the data matrix, the moving step length cannot be changed, the movement of the preset calculation window in the horizontal direction is consistent with the direction of the target row, the movement in the vertical direction occurs after the movement in the horizontal direction, and then the movement in the horizontal direction is continued; the horizontal direction of the preset window determines the sequence of data stored in the line buffer, so as to ensure that the output calculation result can correspond to the calculation window.
Optionally, the first step size and the second step size may be default of the system, or may be set by a user for moving a preset calculation window through a user interface as required before performing data processing operation.
And step S60, determining the calculation range of the calculation module according to the first step length and the second step length.
In this embodiment, the preset calculation window moves horizontally or vertically on the data matrix, referring to fig. 3, the preset calculation window (within the dashed line frame) moves horizontally from the position a to the position B, and then moves to the position C, and the position C moves vertically compared to the position B, and new line data to be calculated is generated when the preset calculation window moves horizontally, and new line data to be calculated is generated when the preset calculation window moves vertically, and the first step determines the data output from the line buffer to the calculation module and the data input from the data matrix to the calculation module.
It is understood that the vertical direction movement mentioned in the present embodiment is the vertical direction movement of the preset calculation window with respect to the previous position, not the actual movement path of the preset calculation window, and the second step is the distance of the vertical direction movement of the preset calculation window with respect to the previous position.
When the calculation range is determined through the first step length, the width of a preset calculation window is required to be obtained, and then the step length is compared with the width of the preset calculation window; if the step length is larger than the width of the preset calculation window, the calculation range is the data which is received by the calculation module and corresponds to the coverage area when the preset calculation window moves, each time the preset calculation window moves, part of the data can be skipped, the calculation module does not calculate the data which can not be covered by the preset calculation window, and the time for the calculation module to process the data can be reduced. If the step length is smaller than or equal to the width of the preset calculation window, the calculation range is the data received by the calculation module and corresponding to the coverage area when the preset calculation window moves, all the data corresponding to the preset calculation window are selected when the preset calculation window moves, calculation needs to be performed on all the data, and the calculation module needs to perform calculation processing on all the data.
In this embodiment, the calculation module may preset the row data corresponding to the calculation window for calculation, when the calculation window is preset at an initial position, the calculation module may generate a calculation result corresponding to the initial position, the preset calculation window may correspond to new data each time the calculation window moves, the calculation module only needs to calculate the new data and obtain a new calculation result, and the new calculation result may be combined with a calculation result at a position above the preset calculation window to obtain a calculation result corresponding to the moved preset calculation window.
And step S70, updating and determining the data line to be updated according to the calculation range, and updating the data stored in the line buffer according to the data corresponding to the data line to be updated.
In this embodiment, the preset calculation window moves in the horizontal direction or in the vertical direction on the data matrix, new line data to be calculated is generated when the calculation window moves in the horizontal direction, new row data to be calculated is generated when the calculation window moves in the vertical direction, and the second step determines the calculation range of the row data input into the calculation module.
When a preset calculation window moves in the vertical direction, a new calculation range is generated, a new data line is correspondingly generated, a corresponding line of the calculation range is compared with a data line in the line buffer, the data line to be updated is a corresponding line of the calculation range which is not stored in the line buffer, line data corresponding to the updated data line is obtained from a data matrix, and the line data corresponding to the updated data line is stored in the line buffer. If the line data which is not stored in the line buffer exists in the line data corresponding to the moved preset calculation window, the data in the line buffer needs to be updated. And acquiring row data required by the calculation range, judging whether the row data are not stored in the row data of the row buffer, and acquiring the row data from the data matrix and storing the row data into the buffer if the row data are not stored in the row buffer, wherein each row buffer stores one row data.
Alternatively, since each line buffer stores one line data, when each line buffer stores a new line data, one line data stored by the line buffer will flow out, and this flowing out line data is the line data stored first in the line data stored by the line buffer, and synchronously, the line data next to the line data stored first will be input to the line buffer corresponding to the line data stored first, and the whole process is a data flow process, and as long as a new line data is stored in the line buffer, the data flow in the line buffer will be caused.
Referring to fig. 3, in an application scenario of this embodiment, there is a data matrix with a width of 8 and a height of 8, the preset calculation window has a width of 3 and a height of 3, a first moving step in the horizontal direction is 1, a second moving step in the vertical direction is 1, and referring to fig. 4, the specific operation steps are as follows: the preset window moves on the data matrix, the moving direction is that, as the preset window moves on the data matrix in the horizontal direction, a new calculation range is generated, namely fourth column data needing to be calculated, the first step length of the horizontal direction movement of the calculation window is obtained, the calculation range is determined to be 2 nd column data, 3 rd column data and 4 th column data, as the 2 nd column data and the 3 rd column data are input into the calculation module and result is obtained, the row buffer only needs to output data to the first calculation module once again to obtain the 4 th column data maximum value 19, the 2 nd column data, the 3 rd column data and the 4 th column data first calculation result are input into the second calculation module, the first calculation result is subjected to maximum value operation to obtain the second calculation result 19, namely the maximum value of the data corresponding to the preset calculation window (in the dotted frame) after the movement.
After the movement in the horizontal direction is completed, the preset calculation window moves in the vertical direction, referring to fig. 3, the preset calculation window moves from the position B to the position C, a new calculation range is correspondingly generated, that is, fourth Line data to be calculated, the data stored in the Line Buffer0 at present is second Line data, the data stored in the Line Buffer1 is first Line data, the third Line data is input into the Line Buffer0, synchronously, the second Line data of the Line Buffer0 is input into the Line Buffer1, the original first Line data in the Line Buffer1 flows out, the data flows in the Line Buffer, and the first Line data flows out until the third Line data is input. And the preset calculation window moves in the horizontal direction again, the moving direction is the same as the moving direction in the previous horizontal direction, the Line Buffer0 and the Line Buffer1 are controlled to output data to the first calculation module at the same time, and the Line data corresponding to the fourth Line is input to the in-out calculation module at the same time to perform a new round of calculation.
In this embodiment, a preset calculation window may move in a horizontal direction or a vertical direction on a data matrix according to a preset step length, and when the preset calculation window moves, a first step length of the horizontal direction movement and a second step length of the vertical direction movement of the preset calculation window are obtained; determining the calculation range of the calculation module according to the first step length and the second step length; and updating and determining a data line to be updated according to the calculation range, updating the data stored in the line buffer according to the data corresponding to the data line to be updated, determining the calculation range by acquiring the first step length and the second step length, and updating the data in the line buffer, so that unnecessary data reading processes are reduced, the data processing time is reduced, and the data processing efficiency is improved.
In addition, an embodiment of the present invention further provides a controller of a data processing system, where the controller includes: a memory, a processor and a data processing program stored on the memory and executable on the processor, the data processing program, when executed by the processor, implementing the steps of the data processing method as described above.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a data processing program is stored, and when the data processing program is executed by a processor, the data processing program implements the steps of the data processing method as described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111185865.6A CN114090231B (en) | 2021-10-11 | 2021-10-11 | A data processing method, controller and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111185865.6A CN114090231B (en) | 2021-10-11 | 2021-10-11 | A data processing method, controller and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114090231A true CN114090231A (en) | 2022-02-25 |
CN114090231B CN114090231B (en) | 2025-04-15 |
Family
ID=80296706
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111185865.6A Active CN114090231B (en) | 2021-10-11 | 2021-10-11 | A data processing method, controller and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114090231B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116634166A (en) * | 2023-04-26 | 2023-08-22 | 海宁奕斯伟集成电路设计有限公司 | Video processing device, method and equipment |
CN117273102A (en) * | 2023-11-23 | 2023-12-22 | 深圳鲲云信息科技有限公司 | Apparatus and method for pooling accelerators and chip circuitry and computing device |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AUPO647997A0 (en) * | 1997-04-30 | 1997-05-22 | Canon Information Systems Research Australia Pty Ltd | Memory controller architecture |
CN108573305A (en) * | 2017-03-15 | 2018-09-25 | 杭州海康威视数字技术股份有限公司 | A kind of data processing method, equipment and device |
CN108629406A (en) * | 2017-03-24 | 2018-10-09 | 展讯通信(上海)有限公司 | Arithmetic unit for convolutional neural networks |
WO2018196863A1 (en) * | 2017-04-28 | 2018-11-01 | 北京市商汤科技开发有限公司 | Convolution acceleration and calculation processing methods and apparatuses, electronic device and storage medium |
CN108780524A (en) * | 2017-10-31 | 2018-11-09 | 深圳市大疆创新科技有限公司 | Arithmetic unit, circuit and correlation technique for neural network |
CN108804973A (en) * | 2017-04-27 | 2018-11-13 | 上海鲲云信息科技有限公司 | Hardware Architecture and Implementation Method of Object Detection Algorithm Based on Deep Learning |
CN109919312A (en) * | 2019-03-29 | 2019-06-21 | 北京智芯微电子科技有限公司 | Operation method, device and DPU of convolutional neural network |
US20190304057A1 (en) * | 2018-03-29 | 2019-10-03 | Thinkforce Electronic Technology Co., Ltd | Pooling method, device, and system, computer-readable storage medium |
CN111552652A (en) * | 2020-07-13 | 2020-08-18 | 深圳鲲云信息科技有限公司 | Data processing method, device and storage medium based on artificial intelligence chip |
CN112862091A (en) * | 2021-01-26 | 2021-05-28 | 合肥工业大学 | Resource multiplexing type neural network hardware accelerating circuit based on quick convolution |
-
2021
- 2021-10-11 CN CN202111185865.6A patent/CN114090231B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AUPO647997A0 (en) * | 1997-04-30 | 1997-05-22 | Canon Information Systems Research Australia Pty Ltd | Memory controller architecture |
CN108573305A (en) * | 2017-03-15 | 2018-09-25 | 杭州海康威视数字技术股份有限公司 | A kind of data processing method, equipment and device |
CN108629406A (en) * | 2017-03-24 | 2018-10-09 | 展讯通信(上海)有限公司 | Arithmetic unit for convolutional neural networks |
CN108804973A (en) * | 2017-04-27 | 2018-11-13 | 上海鲲云信息科技有限公司 | Hardware Architecture and Implementation Method of Object Detection Algorithm Based on Deep Learning |
WO2018196863A1 (en) * | 2017-04-28 | 2018-11-01 | 北京市商汤科技开发有限公司 | Convolution acceleration and calculation processing methods and apparatuses, electronic device and storage medium |
CN108780524A (en) * | 2017-10-31 | 2018-11-09 | 深圳市大疆创新科技有限公司 | Arithmetic unit, circuit and correlation technique for neural network |
US20190304057A1 (en) * | 2018-03-29 | 2019-10-03 | Thinkforce Electronic Technology Co., Ltd | Pooling method, device, and system, computer-readable storage medium |
CN109919312A (en) * | 2019-03-29 | 2019-06-21 | 北京智芯微电子科技有限公司 | Operation method, device and DPU of convolutional neural network |
CN111552652A (en) * | 2020-07-13 | 2020-08-18 | 深圳鲲云信息科技有限公司 | Data processing method, device and storage medium based on artificial intelligence chip |
CN112862091A (en) * | 2021-01-26 | 2021-05-28 | 合肥工业大学 | Resource multiplexing type neural network hardware accelerating circuit based on quick convolution |
Non-Patent Citations (2)
Title |
---|
MHD RASHED AL KOUTAYNI等: "Real-Time Energy Efficient Hand Pose Estimation: A Case Study", SENSORS, 16 May 2020 (2020-05-16), pages 5 * |
徐欣, 刘强, 王少军: "一种高度并行的卷积神经网络加速器设计方法", 哈尔滨工业大学学报, vol. 52, no. 4, 19 June 2020 (2020-06-19), pages 31 - 37 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116634166A (en) * | 2023-04-26 | 2023-08-22 | 海宁奕斯伟集成电路设计有限公司 | Video processing device, method and equipment |
CN117273102A (en) * | 2023-11-23 | 2023-12-22 | 深圳鲲云信息科技有限公司 | Apparatus and method for pooling accelerators and chip circuitry and computing device |
CN117273102B (en) * | 2023-11-23 | 2024-05-24 | 深圳鲲云信息科技有限公司 | Apparatus and method for pooling accelerators and chip circuitry and computing device |
Also Published As
Publication number | Publication date |
---|---|
CN114090231B (en) | 2025-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107742150B (en) | Data processing method and device of convolutional neural network | |
CN108573305B (en) | Data processing method, equipment and device | |
CN114090231A (en) | Data processing method, controller and readable storage medium | |
CN109035158B (en) | Image blurring processing method, image blurring processing device, storage medium and electronic equipment | |
WO2022206556A1 (en) | Matrix operation method and apparatus for image data, device, and storage medium | |
EP3779769B1 (en) | Optical flow computing method and computing device | |
CN110598717A (en) | Image feature extraction method and device and electronic equipment | |
KR101953133B1 (en) | Apparatus and method for rendering | |
JP2023525728A (en) | Touch capacity data adjustment method and device, electronic device, storage medium | |
CN113888524A (en) | Defect detection model training method, apparatus, device and readable storage medium | |
WO2021111633A1 (en) | Parameter optimization device, parameter optimization method, and parameter optimization program | |
CN110824496B (en) | Motion estimation method, motion estimation device, computer equipment and storage medium | |
KR20190133548A (en) | Artificial neural network device and operating method for the same | |
CN110263110B (en) | Geographic space data loading method and device based on rarefying algorithm and storage medium | |
CN109727187B (en) | Method and device for adjusting storage position of multiple region of interest data | |
CN110322389B (en) | Pooling method, apparatus and system, computer readable storage medium | |
CN107977923B (en) | Image processing method, image processing device, electronic equipment and computer readable storage medium | |
CN110322388B (en) | Pooling method and apparatus, pooling system, and computer-readable storage medium | |
CN108198125A (en) | A kind of image processing method and device | |
CN114972404B (en) | High-precision image cutting method, device, terminal equipment and computer-readable storage medium | |
JP2021015569A5 (en) | ||
US11663453B2 (en) | Information processing apparatus and memory control method | |
CN114998158A (en) | Image processing method, terminal device and storage medium | |
CN114330684B (en) | Hardware acceleration method, device, system and readable storage medium for pooling algorithm | |
CN114330706A (en) | Filling method, apparatus, system and computer readable storage medium |
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 |