CN115860070A - Data processing method and device, electronic equipment and computer readable storage medium - Google Patents

Data processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN115860070A
CN115860070A CN202211490311.1A CN202211490311A CN115860070A CN 115860070 A CN115860070 A CN 115860070A CN 202211490311 A CN202211490311 A CN 202211490311A CN 115860070 A CN115860070 A CN 115860070A
Authority
CN
China
Prior art keywords
data
processed
neural network
data set
length
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
CN202211490311.1A
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.)
Beijing Lynxi Technology Co Ltd
Original Assignee
Beijing Lynxi Technology 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 Beijing Lynxi Technology Co Ltd filed Critical Beijing Lynxi Technology Co Ltd
Priority to CN202211490311.1A priority Critical patent/CN115860070A/en
Publication of CN115860070A publication Critical patent/CN115860070A/en
Pending legal-status Critical Current

Links

Images

Abstract

The present disclosure provides a data processing method and apparatus, an electronic device, and a computer-readable storage medium, wherein the method includes: acquiring at least two data to be processed; distributing the at least two data to be processed into at least two data sets according to the lengths of the at least two data to be processed, wherein each data set in the at least two data sets corresponds to a data length range, and the corresponding data length ranges between every two data sets are not overlapped; and if the at least two data sets comprise data sets meeting the output condition, forming batch data by the data to be processed in the at least one data set meeting the output condition, and transmitting the batch data to a processing unit corresponding to the target time sequence neural network. According to the embodiment of the disclosure, the length difference of the data to be processed transmitted to the target time sequence neural network is maintained within a certain range, so that the speed of the target time sequence neural network for processing the data to be processed is increased, and the acceleration performance of the target time sequence neural network is optimized.

Description

Data processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of Artificial Intelligence (AI), and in particular, to a data processing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
At present, the time sequence type neural network is widely applied to various scenes, and based on the fact, the requirement of the time sequence type neural network for acceleration is gradually popularized. However, the conventional method for accelerating the time sequence neural network is limited by the difference of the input data of the time sequence neural network, and the acceleration performance is poor.
Disclosure of Invention
The disclosure provides a data processing method and device, electronic equipment and a computer readable storage medium.
In a first aspect, the present disclosure provides a data processing method, including:
acquiring at least two data to be processed, wherein the at least two data to be processed comprise two data with different lengths;
distributing the at least two data to be processed into at least two data sets according to the lengths of the at least two data to be processed, wherein each data set in the at least two data sets corresponds to a data length range, and the corresponding data length ranges between every two data sets are not overlapped;
if the at least two data sets comprise data sets meeting the output condition, forming data to be processed in at least one data set meeting the output condition into batch data, and transmitting the batch data to a processing unit corresponding to a target time sequence neural network so as to trigger the processing unit to execute processing operation based on the target time sequence neural network, wherein the batch data refers to a group of data of which the data quantity meets the target quantity.
In a second aspect, the present disclosure provides a data processing apparatus comprising:
the processing module is used for acquiring at least two pieces of data to be processed, wherein the at least two pieces of data to be processed comprise two pieces of data with different lengths;
the distribution module is used for distributing the at least two data to be processed into at least two data sets according to the lengths of the at least two data to be processed, each data set in the at least two data sets corresponds to a data length range, and the corresponding data length ranges of every two data sets are not overlapped;
and the transmission module is used for forming batch data by the data to be processed in at least one data set meeting the output condition and transmitting the batch data to the processing unit corresponding to the target time sequence neural network if the at least two data sets comprise the data set meeting the output condition, so as to trigger the processing unit to execute processing operation based on the target time sequence neural network, wherein the batch data refers to a group of data of which the data quantity meets the target quantity.
In a third aspect, the present disclosure provides an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, the one or more computer programs being executable by the at least one processor to enable the at least one processor to perform the data processing method described above.
In a fourth aspect, the present disclosure provides a computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor/processing core, implements the data processing method described above.
The embodiment provided by the disclosure is applied to a data preprocessing stage, after at least two pieces of data to be processed are obtained, and before the at least two pieces of data to be processed are transmitted to a target time sequence neural network, the at least two pieces of data to be processed are distributed into at least two data sets according to the lengths of the at least two pieces of data to be processed. Further, if the at least two data sets include a data set meeting the output condition, the data to be processed in the at least one data set meeting the output condition is formed into batch data, and the batch data is transmitted to the processing unit corresponding to the target time sequence neural network, so as to trigger the processing unit to execute processing operation based on the target time sequence neural network, wherein the batch data refers to a group of data of which the data quantity meets the target quantity. The at least two data to be processed comprise two data with different lengths, each data set in the at least two data sets corresponds to a data length range, and the corresponding data length ranges of the at least two data sets are not overlapped.
That is, at least two data to be processed are distributed into at least two data sets according to the length of the data to be processed, each data set is a set of data in a length range, so that the lengths of the data to be processed in each data set are not very different, and then, batch data transmitted to the processing unit of the target time sequence neural network by taking the data sets as units is beneficial to maintaining the length difference of the data to be processed transmitted to the processing unit of the target time sequence neural network within a certain range, thereby being beneficial to improving the speed of the target time sequence neural network for processing the data to be processed, and further optimizing the acceleration performance of the target time sequence neural network.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the principles of the disclosure and not to limit the disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing in detail exemplary embodiments thereof with reference to the attached drawings, in which:
fig. 1 is a flowchart of a data processing method provided in an embodiment of the present disclosure;
fig. 2 is a schematic data flow diagram of an exemplary data processing method provided in an embodiment of the present disclosure;
fig. 3 is a schematic data flow diagram of another exemplary data processing method provided in an embodiment of the present disclosure;
fig. 4 is a block diagram of a data processing apparatus provided in an embodiment of the present disclosure;
fig. 5 is a block diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
To enable those skilled in the art to better understand the technical aspects of the present disclosure, exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the present disclosure are included to assist understanding, and they should be considered as being merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," 8230; \8230 "; when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The embodiment of the disclosure relates to the field of Neural Network acceleration, and in particular relates to acceleration of a time sequence type Neural Network, wherein the time sequence type Neural Network can include, for example, a Recurrent Neural Network (RNN), a Spiking Neural Network (SNN), and the like, and the Neural Network acceleration is to improve the calculation speed of the Neural Network.
The time sequence type neural network can be logically equivalent to a plurality of neural network units arranged according to the time dimension, each neural network unit inputs the data sequence of the time step where the neural network unit is located and the output result of the neural network unit of the previous time step, and then the output result of the neural network unit is transmitted to the neural network unit corresponding to the next time step. That is, from the logic function level, the operation logic of the time-series neural network may be to divide the data to be processed into a plurality of data segments, where each data segment corresponds to a time step, and the corresponding data segment is processed at each time step.
Time-series neural networks, typified by RNN and SNN, are commonly used to handle sequence data problems, such as text classification, speech recognition, text translation, and the like. The network has one or more basic time sequence neural network units composed of a plurality of neurons, and common time sequence neural network units (RNN units) include an LSTM (Long Short-Term Memory) Unit, a GRU (Gate recovery Unit, gated cycle) Unit, and the like. The sequential neural network unit (RNN unit) is recycled on the time dimension, an input in a corresponding input sequence and an intermediate result of the RNN unit in the previous time step are obtained on each time step, the intermediate result of the current time step is used as one of the inputs of the next time step, and finally the calculation of a certain time step is completed on the same calculation unit. The RNN can thus be represented in time, and one sequential neural network element shares a set of weights at different time steps.
And the impulse neural network which is more similar to the human brain neural network also has the similar time sequence characteristic with the RNN. SNNs encode information using pulse sequences, and during execution, each neuron maintains its membrane potential information (or other information indicative of an intermediate state). After the SNN processes a time-series input sample, the membrane potential is reset to the resting potential. So we can record each time the SNN neuron updates the membrane potential as a time step. The process of SNN processing an input sample can equally be viewed as a time-step unwrapping approach.
At present, the time sequence type neural network is widely applied to various scenes, and based on the fact, the requirement of the time sequence type neural network for acceleration is gradually popularized. Because a single input data is input into an accelerator or an acceleration module for data processing, all computing power of the accelerator cannot be occupied normally, in the acceleration execution process of the related time sequence type neural network, the input data is processed in batches (according to batch), namely in the acceleration scheme of the time sequence type neural network, the input data is uniformly input into the accelerator after N input data are received, the batch of data is uniformly processed by the accelerator, and the computing power of the accelerator can be fully utilized, the computing utilization rate of the accelerator is improved, the computing process covers the time of data transmission and control, and the processing efficiency of the time sequence type neural network is improved.
However, the data received by the acceleration module usually have different lengths, and the lengths may even be different, and based on the operation principle of the time-series neural network, the time-series neural network needs to process a batch of data to be processed into data with equal length, and then process each data according to the length. One conventional operation for processing data into equal length is to align the data with the largest length among the multiple data and fill other data with relatively shorter length, and this way may cause some time series neural network units to have no corresponding data segment to be processed, thereby reducing the utilization rate of the time series neural network and further making the acceleration performance worse.
In view of this, an embodiment of the present disclosure provides a data processing method, after at least two pieces of to-be-processed data are obtained, the at least two pieces of to-be-processed data are allocated to at least two data sets according to lengths of the at least two pieces of to-be-processed data, where each data set corresponds to a data length range. And then, forming batch data by taking the data set as a unit and transmitting the data to be processed to the target time sequence neural network. The length difference of the data to be processed in each data set is not large, so that the length difference of the data to be processed in the batch of data transmitted to the target time sequence neural network is favorably maintained within a certain range, the speed of the target time sequence neural network for processing the data to be processed is favorably improved, and the acceleration performance of the target time sequence neural network is optimized.
The data processing method according to the embodiment of the present disclosure may be performed by an electronic device, which may be an in-vehicle device, a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, an in-vehicle device, a wearable device, or the like, and may be implemented by a processor calling a computer-readable program instruction stored in a memory. The electronic device may be used as a terminal device or a server.
Fig. 1 is a flowchart of a data processing method according to an embodiment of the present disclosure. Referring to fig. 1, the method includes:
in step S11, at least two pieces of data to be processed are acquired.
The data to be processed refers to data to be input into the target time sequence neural network for processing. The at least two pieces of data to be processed may be any one of image data, voice data, text data, video data, and the like, according to different implementation scenarios, and the embodiment of the present disclosure is not limited thereto.
In some implementations, in the at least two pieces of data to be processed according to the embodiment of the present disclosure, lengths of a part of the data to be processed may be the same, and the length of the part of the data to be processed is different from lengths of other data to be processed in the at least two pieces of data to be processed. In other implementations, the lengths of the at least two pieces of data to be processed according to the embodiments of the present disclosure may be different from each other. That is, the at least two pieces of data to be processed include two pieces of data having different lengths.
In step S12, the at least two pieces of data to be processed are allocated into at least two data sets according to the lengths of the at least two pieces of data to be processed.
Each of the at least two data sets corresponds to a data length range, and the corresponding data length ranges between every two of the at least two data sets may not overlap.
In some implementations, the electronic device can set at least two data length ranges S by data length i ,E i ]Wherein i is an integer greater than or equal to 1, i is the ith data length range of the at least two data length ranges, S i Refers to the smallest data length in the ith data length range, E i Refers to the maximum data length in the ith data length range. Further, if the length l E of any data to be processed is [ S ] i ,E i ]Assigning the data to be processed to a data length range of [ S ] i ,E i ]Is collected.
Illustratively, the length of the data to be processed is typically a power exponent of 2, based on which the data length ranges may be divided by a power exponent of 2, e.g., a data length range [1,4], a data length range [5,16], a data length range [17,64], a data length range [65,256], and so on.
It is noted that the electronic device typically buffers the at least two pieces of data to be processed before transmitting the at least two pieces of data to be processed to the target sequential neural network.
Based on this, in some implementations, the electronic device may divide the storage space into at least two storage areas in advance according to the data length range corresponding to the data set, where each storage area corresponds to one data set. Furthermore, for each piece of data to be processed in at least two pieces of data to be processed, after receiving the data to be processed, the electronic device detects the length of the data to be processed, and then allocates the data to be processed to a storage area corresponding to a corresponding data set according to the length of the data to be processed. As described in the exemplary data processing method illustrated in fig. 2.
In other implementation manners, the electronic device may store all of the at least two pieces of data to be processed in the storage space, and further allocate each piece of data to be processed to the at least two data sets according to a length of each piece of data to be processed in the at least two pieces of data to be processed. Specifically, the at least two pieces of data to be processed may be all stored in the storage space, and the batch distributor may count which data set each piece of data to be processed belongs to according to the length of each piece of data to be processed in the at least two pieces of data to be processed, and record the number counted in different data sets. As described in the exemplary data processing method illustrated in fig. 3.
In step S13, if the at least two data sets include a data set that satisfies an output condition, the data to be processed in the at least one data set that satisfies the output condition is grouped into batch data and transmitted to a processing unit corresponding to a target time-series neural network, so as to trigger the processing unit to execute a processing operation based on the target time-series neural network.
The processing unit of the target time series neural network may process data in units of batches, where a "batch" may also be referred to as a "batch", and the data quantity of a batch may be a fixed value preset according to a specific implementation of data to be processed.
The output conditions described in the embodiments of the present disclosure may be preset. The output condition may be: the total amount of the data to be processed in the data set reaches a preset threshold corresponding to the data set, and/or the storage time length of the data to be processed with the longest storage time in the data set reaches a preset time length corresponding to the data set.
Furthermore, the distribution of the number of the data to be processed in different data length ranges of the minimum length and the maximum length may be different for different implementation scenarios, for example, in the data to be processed in a certain implementation scenario, the number of the data to be processed whose data length belongs to the data length range [1,4] is relatively small, and the number of the data to be processed whose data length belongs to the data length ranges [65,256] and [257,1024] is relatively large. For another example, in the data to be processed of another implementation scenario, the number of data to be processed having a data length in the data length range [5,16] is relatively small, and the number of data to be processed having a data length in the data length range [17,64] to [65,256] is relatively large. Based on this, in the embodiment of the present disclosure, the preset threshold of the total amount of the to-be-processed data corresponding to each data set may be flexibly set according to a requirement, and the preset duration of the to-be-processed data with the longest storage time corresponding to each data set may also be flexibly set according to a requirement.
Further, since the target number is a preset fixed value, the preset threshold corresponding to the data to be processed in different data sets and the total number of the data to be processed in different data sets may be different. Based on this, the target number may be the same as the preset threshold corresponding to a portion of the data sets in the at least two data sets, or the target number may be different from the preset threshold corresponding to each of the data sets in the at least two data sets. Based on this, when the at least two data sets include the data set satisfying the output condition, the target amount of data to be processed may be obtained according to the relevant data sets in different implementation manners according to the condition of the data set satisfying the output condition, so as to obtain the batch of data.
In some implementations, when the total amount of data to be processed in the at least one data set satisfying the output condition is greater than or equal to the target amount, the target amount of data in the at least one data set satisfying the output condition is transmitted to the processing unit corresponding to the target time-series neural network as the batch of data.
For example, taking the data set of the ith data length range in at least two data sets as an example, the preset threshold of the total amount of data to be processed corresponding to the data set is, for example, N i ,N i For example, the preset time length of the data to be processed with the longest storage time in the data set is T, which is greater than the target number corresponding to the batch of data i . If the total amount of the data to be processed in the data set reaches a preset threshold value N i Or the storage time of the data to be processed with the longest storage time in the data set reaches the preset time T i And at this time the ith data length rangeThe data set comprises a target amount of data to be processed, and the target amount of data to be processed in the data set can be transmitted to the processing unit of the target time sequence neural network as a batch of data.
In other implementation manners, corresponding to any one of the at least two data sets, if the storage duration of the to-be-processed data with the longest storage time in the data set reaches the preset duration corresponding to the data set, but the total number of the to-be-processed data in the data set does not reach the target number, or if the total number of the to-be-processed data in the data set is greater than the target number, but one batch of data is output, so that the remaining amount of the to-be-processed data is less than the target number, the electronic device may form the batch of data from the data set and the to-be-processed data in at least one data set adjacent to the data set, and transmit the batch of data to the processing unit corresponding to the target time series neural network.
For example, the data set adjacent to the data set according to the embodiment of the present disclosure refers to a data set whose maximum length in the data length range is adjacent to the minimum length in the data length range corresponding to the data set, and a data set whose minimum length in the data length range is adjacent to the maximum length in the data length range corresponding to the data set. For example, a data set adjacent to a data set having a data length range of [5,16] includes: a data set with a data length range of [1,4] and a data set with a data length range of [17,64 ].
For example, still taking the data set of the ith data length range in the at least two data sets as an example, if the storage duration of the to-be-processed data with the longest storage time in the data set reaches the preset duration T i And in a scene that i is equal to 1, the electronic device may acquire the data to be processed from the data set in the (i + 1) th data length range, and combine with all the data to be processed in the data set in the i-th data length range to form batch data meeting the target number, so as to transmit the batch data to the processing unit corresponding to the target timing neural network. In the scene that i is greater than or equal to 2, the electronic equipment can be selected according to requirementsAnd (3) acquiring a sufficient amount of data to be processed from the data set in the (i-1) th data length range and the data set to form batch data, and transmitting the batch data to a processing unit corresponding to the target time sequence neural network.
It is to be understood that, in the present implementation, it is not limited to make up only data in two adjacent data sets into a batch of data, but data in multiple different data sets may be made up into a batch of data, so as to transmit the batch of data to a corresponding processing unit.
By adopting the implementation mode, the data to be processed with longer storage time can be transmitted to the processing unit corresponding to the target time sequence neural network for preferential processing, and the batch data meeting the quantity condition can be acquired and transmitted to the target time sequence neural network, so that the calculation efficiency of the target time sequence neural network can be improved under the condition of timely processing each data to be processed.
In still other implementations, when the at least two data sets include two or more data sets that satisfy the output condition, batch data may be obtained according to a certain priority and transmitted to the processing unit corresponding to the target time-series neural network.
Illustratively, if two or more data sets in the at least two data sets and the total amount of data to be processed all reach the preset threshold corresponding to the corresponding data set, the target amount of data is obtained from at least a plurality of priorities according to the total amount of the data to be processed, and the batch of data is transmitted to the processing unit corresponding to the target time sequence neural network.
Illustratively, if the storage time length of the data to be processed with the longest storage time reaches the preset time length corresponding to the corresponding data set in two or more data sets of the at least two data sets, the target amount of data is obtained according to the storage time from the priority from long to short, and the batch of data is transmitted to the processing unit corresponding to the target time sequence neural network.
For example, taking the ith and (i + x) th data length range data sets of the at least two data sets as an example, the (i + x) th data length range data sets correspond toThe predetermined threshold of the total amount of the data to be processed is, for example, N i+x The preset time length of the data to be processed with the longest storage time in the data set of the (i + x) th data length range is T i+x . Wherein N is i+x E.g. greater than N i ,T i+x E.g. less than T i . x is an integer other than 0. If the total quantity of the data to be processed in the ith data set reaches a preset threshold value N i And the total amount of the data to be processed in the (i + x) th data set reaches a preset threshold value N i+x Then, a batch of data meeting the target quantity condition can be preferentially selected from the data to be processed in the (i + x) th data set and transmitted to the processing unit corresponding to the target time sequence neural network. Or, if the storage time of the data to be processed with the longest storage time in the ith data set reaches the preset time T i And the total amount of the data to be processed in the (i + x) th data set reaches a preset threshold value T i+x And preferentially selecting batch data meeting the target quantity condition from the ith data set according to the sequence of the storage time from large to small, and transmitting the batch data to the processing unit corresponding to the target time sequence neural network.
It is to be understood that the above is merely an illustrative description of selecting a data set and does not limit embodiments of the present disclosure. In an actual implementation process, the transmission conditions corresponding to other data sets may also be set as required based on implementation scenarios and the like. And will not be described in detail herein.
According to the embodiment of the disclosure, data sets with different data length ranges are preset, each data set corresponds to one data length range, at least two data to be processed are distributed to at least two data sets according to the lengths of the at least two data to be processed, and then batch data are obtained by taking the data sets as units and are transmitted to a target time sequence neural network. The length difference of the data to be processed in each data set is small, so that the length difference of the batch data transmitted to the target time sequence neural network is favorably maintained within a certain range, the speed of processing the batch data by the target time sequence neural network is favorably improved, and the acceleration performance of the target time sequence neural network is optimized.
A data processing method according to an embodiment of the present disclosure is explained below with reference to an example.
As can be seen from the foregoing description of the implementation scenario of the embodiment of the present disclosure, the data processing method according to the embodiment of the present disclosure is applied to the data preprocessing stage in the field of neural network acceleration, and the device logic for executing the data preprocessing part is equivalent to a neural network acceleration device in the following description.
Fig. 2 is a schematic data flow diagram of an exemplary data processing method according to an embodiment of the present disclosure, where the neural network acceleration device shown in fig. 2 includes, for example, a buffer allocator, a plurality of buffer intervals, and a neural network processing unit, and the plurality of buffer intervals respectively correspond to a plurality of data length ranges. The data length range is as described in the previous implementation and will not be described in detail here.
In the example illustrated in fig. 2, after the neural network acceleration device receives a plurality of input data, the buffer allocator allocates the input data with different lengths to different buffer intervals for storage according to the length of each input data, and accordingly, each buffer interval stores one data set, and the length of each data set belongs to the data length range corresponding to the corresponding buffer interval.
It should be noted that, in the implementation illustrated in fig. 2, for each input data received by the neural network acceleration device, the buffer allocator may directly detect the data length, and then store the data length in the corresponding buffer interval.
Further, when the buffer interval meeting the output condition is detected, batch data is obtained according to input data stored in the buffer interval meeting the output condition, and the obtained batch data is transmitted to the neural network processing unit. The neural network processing unit may batch process the input data. The implementation process of transmitting the output condition and the data set satisfying the output condition to the neural network processing unit may refer to the foregoing description in this specification, and is not described herein again.
For example, in the implementation illustrated in fig. 2, the neural network acceleration device may transmit the input data of the buffer interval to the neural network processing unit through an additionally deployed controller or processor.
It should be understood that the implementation illustrated in fig. 2 is only one implementation of the embodiments of the present disclosure, and that other implementations may also be included in the embodiments of the present disclosure. For example, fig. 3 is a schematic data flow diagram of another exemplary data processing method provided in the embodiment of the present disclosure, and unlike the implementation of fig. 2, the neural network acceleration device referred to in fig. 3 includes, for example, a cache, a data distributor, and a neural network processing unit. For example, a plurality of data length ranges may be pre-deployed in the data distributor, and the data length ranges are as described in the foregoing implementation and will not be described in detail here.
In the example illustrated in fig. 3, after receiving the plurality of input data, the neural network acceleration device stores the plurality of input data in the cache. In this example, the input data may be directly stored, not based on the length of each data. The data distributor extracts each input data in the cache, detects the length of each input data, and distributes the input data according to a plurality of data length ranges which are deployed in advance to obtain a plurality of data sets. After detecting the data set satisfying the output condition, the data distributor may transmit the input data acquisition batch data in the data set satisfying the output condition to the neural network processing unit, so that the neural network processing unit may perform batch processing on the input data. And will not be described in detail herein.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted. Those skilled in the art will appreciate that in the above methods of the specific embodiments, the specific order of execution of the steps should be determined by their function and possibly their inherent logic.
In addition, the present disclosure also provides a data processing apparatus, an electronic device, and a computer-readable storage medium, which can be used to implement any data processing method provided by the present disclosure, and the corresponding technical solutions and descriptions and corresponding descriptions in the method sections are not repeated.
Fig. 4 is a block diagram of a data processing apparatus according to an embodiment of the present disclosure.
Referring to fig. 4, an embodiment of the present disclosure provides a data processing apparatus, including: a processing module 41, an allocation module 42 and a transmission module 43.
For example, the processing module 41 may be configured to obtain at least two pieces of data to be processed, where the at least two pieces of data to be processed include two pieces of data with different lengths; the allocating module 42 may be configured to allocate the at least two pieces of data to be processed to at least two data sets according to lengths of the at least two pieces of data to be processed, where each data set of the at least two data sets corresponds to a data length range, and corresponding data length ranges between every two data sets do not overlap; the transmission module 43 may be configured to, if the at least two data sets include a data set that meets the output condition, form data to be processed in at least one data set that meets the output condition into batch data, and transmit the batch data to a processing unit corresponding to the target time-series neural network, so as to trigger the processing unit to execute a processing operation based on the target time-series neural network, where the batch data refers to a group of data whose data quantity meets the target quantity.
For other functions of each module, refer to corresponding descriptions in the method section, and are not described herein again.
Fig. 5 is a block diagram of an electronic device provided in an embodiment of the present disclosure.
Referring to fig. 5, an embodiment of the present disclosure provides an electronic device including: at least one processor 501; at least one memory 502, and one or more I/O interfaces 503 coupled between the processor 501 and the memory 502; the memory 502 stores one or more computer programs that can be executed by the at least one processor 501, and the one or more computer programs are executed by the at least one processor 501 to enable the at least one processor 501 to perform the data processing method described above.
The disclosed embodiments also provide a computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor/processing core, implements the data processing method described above. The computer readable storage medium may be a volatile or non-volatile computer readable storage medium.
The disclosed embodiments also provide a computer program product, which includes computer readable code or a non-volatile computer readable storage medium carrying computer readable code, when the computer readable code runs in a processor of an electronic device, the processor in the electronic device executes the above data processing method.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable storage media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable program instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, random Access Memory (RAM), read Only Memory (ROM), erasable Programmable Read Only Memory (EPROM), static Random Access Memory (SRAM), flash memory or other memory technology, portable compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by the computer. In addition, communication media typically embodies computer readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as is well known to those skilled in the art.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
The computer program product described herein may be embodied in hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK) or the like.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted in a generic and descriptive sense only and not for purposes of limitation. In some instances, features, characteristics and/or elements described in connection with a particular embodiment may be used alone or in combination with features, characteristics and/or elements described in connection with other embodiments, unless expressly stated otherwise, as would be apparent to one skilled in the art. Accordingly, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the disclosure as set forth in the appended claims.

Claims (11)

1. A method of data processing, comprising:
acquiring at least two data to be processed, wherein the at least two data to be processed comprise two data with different lengths;
distributing the at least two data to be processed into at least two data sets according to the lengths of the at least two data to be processed, wherein each data set in the at least two data sets corresponds to a data length range, and the corresponding data length ranges between every two data sets are not overlapped;
if the at least two data sets comprise data sets meeting the output condition, forming data to be processed in at least one data set meeting the output condition into batch data, and transmitting the batch data to a processing unit corresponding to a target time sequence neural network so as to trigger the processing unit to execute processing operation based on the target time sequence neural network, wherein the batch data refers to a group of data of which the data quantity meets the target quantity.
2. The data processing method according to claim 1, wherein said allocating the at least two data to be processed into at least two data sets according to the length of the at least two data to be processed comprises:
for each data to be processed in the at least two data to be processed, after receiving the data to be processed, detecting the length of the data to be processed;
and distributing the data to be processed to a storage area corresponding to the corresponding data set according to the length of the data to be processed.
3. The data processing method according to claim 1, wherein said allocating the at least two data to be processed into at least two data sets according to the length of the at least two data to be processed comprises:
storing the at least two data to be processed;
and distributing each data to be processed to the at least two data sets according to the length of each data to be processed in the at least two data to be processed.
4. The data processing method of claim 1, wherein the output condition comprises at least one of:
the total amount of the data to be processed in the data set reaches a preset threshold corresponding to the data set;
and the storage time length of the data to be processed with the longest storage time in the data set reaches the preset time length corresponding to the data set.
5. The data processing method according to claim 1 or 4, wherein if the at least two data sets include a data set satisfying an output condition, transmitting data to be processed in at least one data set satisfying the output condition to a processing unit corresponding to the target sequential neural network as batch data, including:
and when the total quantity of the data to be processed in the at least one data set meeting the output condition is greater than or equal to the target quantity, transmitting the data of the target quantity in the at least one data set meeting the output condition as the batch of data to a processing unit corresponding to the target time sequence neural network.
6. The data processing method according to claim 1 or 4, wherein if the at least two data sets include a data set satisfying an output condition, transmitting data to be processed in at least one data set satisfying the output condition to a processing unit corresponding to the target sequential neural network as batch data, including:
corresponding to any one of the at least two data sets,
if the storage time length of the data to be processed with the longest storage time in the data set reaches the preset time length corresponding to the data set, but the total quantity of the data to be processed in the data set does not reach the target quantity, the data to be processed in the data set and at least one data set adjacent to the data set form batch data, and the batch data are transmitted to a processing unit corresponding to the target time sequence neural network;
the data set adjacent to the data set refers to a data set in which the maximum length in the data length range is adjacent to the minimum length in the data length range corresponding to the data set, and a data set in which the minimum length in the data length range is adjacent to the maximum length in the data length range corresponding to the data set.
7. The data processing method according to claim 5, wherein when the at least two data sets include two or more data sets that satisfy the output condition, transmitting data to be processed in at least one data set that satisfies the output condition to a processing unit corresponding to a target sequential neural network in batches, the method includes:
if the total number of the data to be processed reaches a preset threshold corresponding to the corresponding data set, acquiring the data of the target number from at least one priority according to the total number of the data to be processed to obtain the batch of data, and transmitting the batch of data to a processing unit corresponding to the target time sequence neural network; alternatively, the first and second electrodes may be,
if the storage time of the data to be processed with the longest storage time in two or more data sets reaches the preset time corresponding to the corresponding data set, the target number of data is obtained according to the storage time from the long priority to the short priority, and the batch of data is transmitted to the processing unit corresponding to the target time sequence neural network.
8. The method of claim 1, wherein the target time-series neural network comprises a plurality of neural network elements arranged in a time dimension, each neural network element inputting a data sequence of a corresponding time step of the corresponding neural network element and a result output by a neural network element on the corresponding neural network element, and wherein the target time-series neural network is a Recurrent Neural Network (RNN) or a Spiking Neural Network (SNN).
9. A data processing apparatus, comprising:
the processing module is used for acquiring at least two pieces of data to be processed, wherein the at least two pieces of data to be processed comprise two pieces of data with different lengths;
the distribution module is used for distributing the at least two data to be processed into at least two data sets according to the lengths of the at least two data to be processed, each data set in the at least two data sets corresponds to a data length range, and the corresponding data length ranges between every two data sets are not overlapped;
and the transmission module is used for forming batch data by the data to be processed in at least one data set meeting the output condition and transmitting the batch data to the processing unit corresponding to the target time sequence neural network if the at least two data sets comprise the data set meeting the output condition, so as to trigger the processing unit to execute processing operation based on the target time sequence neural network, wherein the batch data refers to a group of data of which the data quantity meets the target quantity.
10. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores one or more computer programs executable by the at least one processor to enable the at least one processor to perform the data processing method of any one of claims 1-8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the data processing method of any one of claims 1 to 8.
CN202211490311.1A 2022-11-25 2022-11-25 Data processing method and device, electronic equipment and computer readable storage medium Pending CN115860070A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211490311.1A CN115860070A (en) 2022-11-25 2022-11-25 Data processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211490311.1A CN115860070A (en) 2022-11-25 2022-11-25 Data processing method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115860070A true CN115860070A (en) 2023-03-28

Family

ID=85666489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211490311.1A Pending CN115860070A (en) 2022-11-25 2022-11-25 Data processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115860070A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115883022A (en) * 2023-01-06 2023-03-31 北京象帝先计算技术有限公司 DMA (direct memory access) transmission control method and device, electronic equipment and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115883022A (en) * 2023-01-06 2023-03-31 北京象帝先计算技术有限公司 DMA (direct memory access) transmission control method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
KR20210054563A (en) Text sequence recognition method and device, electronic device and storage medium
CN110929865B (en) Network quantification method, service processing method and related product
CN111104954B (en) Object classification method and device
US20200210815A1 (en) Output method and apparatus for multiple neural network, server and computer readable storage medium
CN110737401B (en) Method, apparatus and computer program product for managing redundant array of independent disks
CN110750341A (en) Task scheduling method, device, system, terminal equipment and storage medium
JP2020170495A (en) Single pixel attack sample generating method, device, facility, and storage medium
CN115860070A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN110852882A (en) Packet consensus method, apparatus, device, and medium for blockchain networks
CN108920183B (en) Service decision method, device and equipment
CN109214543A (en) Data processing method and device
CN113568836B (en) Multi-time-series sample feature extraction method and software detection method applying same
US20240147314A1 (en) Optimizing key allocation during roaming using machine learning
CN112799793A (en) Scheduling method and device, electronic equipment and storage medium
CN114581966A (en) Method, electronic device and computer program product for information processing
US11966851B2 (en) Construction of a machine learning model
RU2553093C1 (en) Information search apparatus
CN114881221A (en) Mapping scheme optimization method and device, electronic equipment and readable storage medium
CN112764791B (en) Incremental update malicious software detection method and system
CN112825071B (en) Learning path planning method, device, equipment and storage medium
Krasilenko et al. Design and simulation of programmable relational optoelectronic time-pulse coded processors as base elements for sorting neural networks
KR20210006429A (en) Object detection method, apparatus, equipment and computer-readable storage medium
CN112489630A (en) Voice recognition method and device
CN113127159B (en) Application processing method and device, electronic equipment and storage medium
CN114158073B (en) Network slice deployment method, device, equipment and 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