CN113240084A - Data processing method and device, electronic equipment and readable medium - Google Patents

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

Info

Publication number
CN113240084A
CN113240084A CN202110513551.8A CN202110513551A CN113240084A CN 113240084 A CN113240084 A CN 113240084A CN 202110513551 A CN202110513551 A CN 202110513551A CN 113240084 A CN113240084 A CN 113240084A
Authority
CN
China
Prior art keywords
processing
network layer
frame number
data
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
Application number
CN202110513551.8A
Other languages
Chinese (zh)
Other versions
CN113240084B (en
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 Sogou Technology Development Co Ltd
Original Assignee
Beijing Sogou Technology Development 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 Sogou Technology Development Co Ltd filed Critical Beijing Sogou Technology Development Co Ltd
Priority to CN202110513551.8A priority Critical patent/CN113240084B/en
Publication of CN113240084A publication Critical patent/CN113240084A/en
Application granted granted Critical
Publication of CN113240084B publication Critical patent/CN113240084B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a data processing method and device, electronic equipment and a readable medium. The method comprises the following steps: inputting characteristic data corresponding to the sequence data into a neural network; the method comprises the steps that a plurality of network layers of the neural network are divided into a plurality of network layer groups according to a processing sequence, the network layer groups corresponding to the total frame number are started one by one according to the processing sequence according to the total frame number of sequence data corresponding to inputted feature data, the difference value between the total frame numbers corresponding to every two adjacent network layer groups is the same or different, calculation of the neural network is split, calculation is distributed in a longer time, the problem that the calculation resources occupy peaks when a plurality of frames are inputted is avoided, the problems that the calculation resources at local moments are too high in load and the calculation resources at most moments are too low in load are solved, load peaks are reduced, the power consumption of the whole calculation is reduced, the response speed of the calculation is increased, and meanwhile the waste of the calculation resources is reduced.

Description

Data processing method and device, electronic equipment and readable medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a data processing method, a data processing apparatus, an electronic device, and a machine-readable medium.
Background
The sound of the audio playback is generated over time and is therefore naturally represented as a one-dimensional time series, and such data is called sequence data. Words in the language also appear one by one, and such data is also sequence data, which all contain the notion of time. The method of converting such a Sequence data into a fixed length vector representation is called Sequence modeling (Sequence Models).
Currently, in the sequence modeling of audio data, the general calculation process is: the method comprises the steps of windowing audio signals in frames and extracting features, combining a plurality of frame (for example, W ═ 100 frames) features into a sliding window, inputting a Convolutional neural Network as a whole for calculation, for example, TCN (Temporal Convolutional Network), and obtaining the output (generally 1 frame of features) of the Network as a vector representation result of the segment of feature sequence, sliding the current sliding window backwards for a plurality of frames (for example, H ═ 10 frames), namely, moving a plurality of frames (for example, H ═ 10 frames) in front of the current sliding window out of the sliding window, adding a plurality of new frames (for example, H ═ 10 frames) behind the current sliding window to form a next sliding window, and repeating the backwards sliding window until all the frames are calculated.
The applicant finds that in the neural network calculation process in the sliding window form, the window length of the sliding window is assumed to be W frames, the window is moved to be H frames, H is less than or equal to W, and the input of one calculation performed by the neural network is W frames. When 1 to (W-1) frames are input, the neural network does not calculate because the total frame number is less than W frames; when the W frame is input, the total frame number is more than or equal to the W frame, the condition of generating a first window is met, and the neural network carries out primary calculation; when inputting (W +1) frame to (W + H-1) frame, although the total frame number is more than or equal to W frame, the condition for generating the next window is not satisfied, so the neural network does not calculate; when (W + H) frames are input, the total frame number is more than or equal to W frames, the condition of generating the 2 nd window is met, the neural network carries out calculation once, and the process is repeated until all the frames are calculated. It can be seen from the above process that, in the process of inputting the (W +1) frame to the (W + H-1) frame, the neural network does not perform calculation, and the calculation resource is in an idle state at this time, while when the (W + H) frame is input, the neural network performs calculation, and the calculation resource is in a high load state, which causes a spike to occur in the calculation resource every time the H frame is input, and an imbalance occurs in the occupation of the calculation resource. In general, because there is a frame interval between two adjacent windows, the calculation of the neural network is not performed every frame, and thus, the imbalance of the calculation resource occupation occurs.
Disclosure of Invention
In view of the above problems, embodiments of the present application provide a data processing method, a data processing apparatus, an electronic device, and a machine-readable medium that overcome or at least partially solve the above problems, and embodiments of the present application can solve the problem of uneven usage of computing resources.
In order to solve the above problem, the present application discloses a data processing method, including:
inputting characteristic data corresponding to the sequence data into a neural network; wherein a plurality of network layers of the neural network are divided into a plurality of network layer packets in a processing order;
and according to the total frame number of the sequence data corresponding to the input feature data, starting the processing of the network layer groups corresponding to the total frame number one by one according to the processing sequence, wherein the difference between the total frame numbers corresponding to every two adjacent network layer groups is the same or different.
Optionally, the starting, one by one, processing, according to a total frame number of sequence data corresponding to feature data that has been input, of network layer packets corresponding to the total frame number in a processing order includes:
under the condition that the total frame number reaches a preset processing frame number, calculating a difference value between the total frame number and the preset processing frame number, and an integer quotient and a remainder of dividing the difference value by a preset step length;
determining the characteristic data to be processed of the neural network according to the integer quotient; the frame number of the sequence data corresponding to the feature data to be processed is the preset processing frame number;
and according to the remainder, starting the processing of the network layer packets corresponding to the remainder one by one according to the processing sequence, and processing the characteristic data to be processed.
Optionally, a ratio of the preset step length to the number of the network layer packets is a preset integer value, and the processing of the next network layer packet is started every time the preset integer value is increased by the remainder. .
Optionally, before the inputting the feature data corresponding to the sequence data into the neural network, the method further comprises:
generating test characteristic data;
inputting the test characteristic data into the neural network for processing;
counting the calculation load of each network layer;
and dividing the plurality of network layers into a preset number of network layer groups according to the processing sequence according to the calculation load of each network layer, so that the maximum value of the difference value between the calculation loads of every two network layer groups is lower than the preset minimum value.
The embodiment of the present application further discloses a data processing apparatus, including:
the data input module is used for inputting the characteristic data corresponding to the sequence data into the neural network; wherein a plurality of network layers of the neural network are divided into a plurality of network layer packets in a processing order;
and the processing starting module is used for starting the processing of the network layer groups corresponding to the total frame number one by one according to the processing sequence according to the total frame number of the sequence data corresponding to the input characteristic data, wherein the difference value between the total frame numbers corresponding to every two adjacent network layer groups is the same or different.
Optionally, the process starting module includes:
the calculation submodule is used for calculating the difference value between the total frame number and the preset processing frame number and the integer quotient and the remainder of the difference value divided by the preset step length under the condition that the total frame number reaches the preset processing frame number;
the data determination submodule is used for determining the characteristic data to be processed of the neural network according to the integer quotient; the frame number of the sequence data corresponding to the feature data to be processed is the preset processing frame number;
and the processing submodule is used for starting the processing of the network layer packets corresponding to the remainders one by one according to the processing sequence according to the remainders and processing the characteristic data to be processed.
Optionally, a ratio of the preset step length to the number of the network layer packets is a preset integer value, and the processing of the next network layer packet is started every time the preset integer value is increased by the remainder. .
Optionally, the apparatus further comprises:
the test data generation module is used for generating test characteristic data before inputting the sequence data into the neural network;
the test processing module is used for inputting the test characteristic data into the neural network for processing;
the load counting module is used for counting the calculation load of each network layer;
and the grouping module is used for dividing the plurality of network layers into a preset number of network layer groups according to the processing sequence according to the calculation load of each network layer, so that the maximum value of the difference value between the calculation loads of every two network layer groups is lower than the preset minimum value.
The embodiment of the application also discloses electronic equipment which is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory finish mutual communication through the communication bus;
a memory for storing a computer program;
the processor, when executing the program stored in the memory, implements the method steps as described above.
The embodiment of the application also discloses a machine readable medium, wherein instructions are stored on the machine readable medium, and when the instructions are executed by one or more processors, the device is caused to execute the data processing method.
The embodiment of the application has the following advantages:
in summary, according to the embodiments of the present application, the feature data corresponding to the sequence data is input into the neural network; the method comprises the steps that a plurality of network layers of the neural network are divided into a plurality of network layer groups according to a processing sequence, the network layer groups corresponding to the total frame number are started one by one according to the processing sequence according to the total frame number of sequence data corresponding to inputted feature data, the difference value between the total frame numbers corresponding to every two adjacent network layer groups is the same or different, calculation of the neural network is split, calculation is distributed in a longer time, the problem that the calculation resources occupy peaks when a plurality of frames are inputted is avoided, the problems that the calculation resources at local moments are too high in load and the calculation resources at most moments are too low in load are solved, load peaks are reduced, the power consumption of the whole calculation is reduced, the response speed of the calculation is increased, and meanwhile the waste of the calculation resources is reduced.
Drawings
FIG. 1 shows a flow chart of the steps of an embodiment of a data processing method of the present application;
FIG. 2 is a flow chart illustrating the steps of one data processing method embodiment of the present application;
FIG. 3 is a block diagram illustrating an embodiment of a data processing apparatus of the present application;
FIG. 4 is a block diagram illustrating an electronic device in accordance with an exemplary embodiment;
and FIG. 5 is a schematic diagram of a server in some embodiments of the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a data processing method according to the present application is shown, which may specifically include the following steps:
step 101, inputting characteristic data corresponding to the sequence data into a neural network; wherein the plurality of network layers of the neural network are divided into a plurality of network layer packets in a processing order.
In this embodiment of the present invention, the sequence data includes audio data and other data having a sequential relationship, or any other suitable data, which is not limited in this embodiment of the present invention. In sequence modeling, sequence data is typically framed and windowed, and features are extracted to obtain feature data.
In the embodiment of the invention, the characteristic data corresponding to the sequence data form a sliding window, and the sliding window is input into a neural network as a whole for calculation, so that the output of the network is used as a vector representation result of the characteristic data. The neural network comprises a plurality of network layers, and for a section of characteristic data, the plurality of network layers are sequentially processed according to a processing sequence in one calculation of the neural network. In order to avoid that the neural network performs centralized calculation when characteristic data corresponding to a plurality of frame sequence data are input, the peak occurs in the occupation of calculation resources, a plurality of network layers are divided into a plurality of network layer groups according to the processing sequence for respectively controlling and starting the processing of each network layer group, and the network structure of the neural network is not influenced by the network layer groups. The number of network layers included in each network layer packet may be the same or different, for example, the neural network includes L network layers, each network layer packet includes L1, L2, …, and LH layers, and L1+ L2+ … + LH is satisfied.
And 102, according to the total frame number of the sequence data corresponding to the input feature data, starting the processing of the network layer groups corresponding to the total frame number one by one according to the processing sequence, wherein the difference between the total frame numbers corresponding to every two adjacent network layer groups is the same or different.
In the embodiment of the invention, the neural network can process the feature data with fixed length at one time, and the frame number of the sequence data corresponding to the feature data processed at one time is recorded as the preset processing frame number. The preset processing frame number is determined by the design of the neural network.
In the embodiment of the invention, after the characteristic data corresponding to the sequence data is input into the neural network, when the total frame number of the sequence data corresponding to the input characteristic data does not reach the preset processing frame number, the neural network does not process the sequence data. When the total frame number of the sequence data corresponding to the input feature data reaches the preset processing frame number, the neural network can start the first processing, but not directly start the processing of all network layers, but start the processing of the first network layer grouping according to the processing sequence, and then start the processing of the subsequent network layer grouping one by one along with the increase of the total frame number of the sequence data corresponding to the input feature data, so that a peak does not appear when a plurality of frames are input in the computing resource, and the occupation of the computing resource is more balanced.
In the embodiment of the invention, the difference value between the total frame numbers corresponding to every two adjacent network layer groups is the same or different. In one case, the difference between the total number of frames corresponding to two adjacent network layer packets may all be the same, i.e., for all network layer packets, the total number of frames may initiate the processing of the next network layer packet every same number of frames. For example, the total number of frames starts the processing of 1 network layer packet every 2 frames. In another case, the difference between the total frame numbers corresponding to two adjacent network layer packets may also be all different, that is, for all network layer packets, the total frame numbers at intervals are all different each time the processing of the next network layer packet is started. For example, a total of four network layer packets, the processing of the first network layer packet is started when the total frame number is 3, the processing of the second network layer packet is started when the total frame number is 5, the processing of the third network layer packet is started when the interval is 2, the processing of the third network layer packet is started when the total frame number is 9, the interval is 4, and the processing of the fourth network layer packet is started when the total frame number is 10, and the interval is 1. In another case, the difference between the total number of frames corresponding to two adjacent network layer packets may be partially the same, and partially different, that is, for all network layer packets, every time the processing of the next network layer packet is started, the total number of frames apart is sometimes the same, and sometimes is different. For example, a total of four network layer packets, when the total frame number is 1, the processing of the first network layer packet is started, when the total frame number is 2, the processing of the second network layer packet is started, when the interval is 1, when the total frame number is 4, the processing of the third network layer packet is started, when the interval is 2, and when the total frame number is 6, the processing of the fourth network layer packet is started, and the interval is 2.
In the embodiment of the present invention, according to the total frame number of the sequence data corresponding to the feature data that has been input, the implementation manner of starting the processing of the network layer packets corresponding to the total frame number one by one according to the processing sequence may include multiple types, for example, a correspondence relationship between the total frame number and each network layer packet is preset, and the processing of the network layer packets corresponding to the total frame number is started one by one according to the processing sequence; or calculating the difference between the total frame number and the preset processing frame number, and dividing the difference by the integer quotient and remainder of the preset step length; determining the characteristic data to be processed of the neural network according to the integer quotient of the difference value divided by the preset step length; the frame number of the sequence data corresponding to the characteristic data to be processed is a preset processing frame number; and according to the remainder obtained by dividing the difference by the preset step length, starting the processing of the network layer packets corresponding to the remainder one by one according to the processing sequence, and processing the feature data to be processed, or performing any other suitable implementation manner, which is not limited in this embodiment of the present invention.
In summary, according to the embodiments of the present application, the feature data corresponding to the sequence data is input into the neural network; the method comprises the steps that a plurality of network layers of the neural network are divided into a plurality of network layer groups according to a processing sequence, the network layer groups corresponding to the total frame number are started one by one according to the processing sequence according to the total frame number of sequence data corresponding to inputted feature data, the difference value between the total frame numbers corresponding to every two adjacent network layer groups is the same or different, calculation of the neural network is split, calculation is distributed in a longer time, the problem that the calculation resources occupy peaks when a plurality of frames are inputted is avoided, the problems that the calculation resources at local moments are too high in load and the calculation resources at most moments are too low in load are solved, load peaks are reduced, the power consumption of the whole calculation is reduced, the response speed of the calculation is increased, and meanwhile the waste of the calculation resources is reduced.
In this embodiment of the present invention, optionally, before inputting the feature data corresponding to the sequence data into the neural network, the method may further include: generating test characteristic data; inputting the test characteristic data into the neural network for processing; counting the calculation load of each network layer; and dividing the plurality of network layers into a preset number of network layer groups according to the processing sequence according to the calculation load of each network layer, so that the maximum value of the difference value between the calculation loads of every two network layer groups is lower than the preset minimum value.
To make the computational load more balanced, the computational load of multiple network layer packets may be made as equal as possible. When grouping a plurality of network layers of the neural network, test feature data is generated, and a method for generating the test feature data may include various methods, for example, generating the test feature data using a random number; or using data of a real scene, such as an audio file, an image file and a video file, and obtaining test characteristic data by means of characteristic extraction and the like; or a combination of the test feature data generated by the two methods, or any other suitable generation method, which is not limited in this embodiment of the present invention.
Inputting the test characteristic data into a neural network for calculation, and counting the calculation load of each network layer, wherein the statistical dimensions of the calculation load include but are not limited to: the time required for each network layer computation, the number of processor clock cycles required for each network layer computation, a weighted sum of the time required for each network layer computation and the number of processor clock cycles, and the like. The method comprises the steps of dividing a plurality of network layers into a preset number of network layer groups according to a processing sequence, and ensuring that the maximum value of the difference value between the calculation loads of every two network layer groups is lower than a preset minimum value, namely the calculation loads of the network layer groups are equal as much as possible. The preset number can be set according to needs, the preset minimum value can be set according to actual conditions, and the smaller the better. For example, when the neural network performs calculation in the form of a sliding window, the preset number may be equal to the window shift number, or the window shift number is a set multiple of the preset number.
Referring to fig. 2, a flowchart illustrating steps of another embodiment of a data processing method according to the present application is shown, which may specifically include the following steps:
step 201, inputting characteristic data corresponding to the sequence data into a neural network; wherein the plurality of network layers of the neural network are divided into a plurality of network layer packets in a processing order.
In the embodiment of the present invention, the specific implementation manner of this step may refer to the description in the foregoing embodiment, and details are not described herein.
Step 202, under the condition that the total frame number reaches a preset processing frame number, calculating a difference value between the total frame number and the preset processing frame number, and an integer quotient and a remainder of the difference value divided by a preset step length.
In the embodiment of the invention, under the condition that the total frame number does not reach the preset processing frame number, the neural network does not calculate. And under the condition that the total frame number reaches the preset processing frame number, calculating a difference value between the current total frame number and the preset processing frame number, and dividing the difference value by an integer quotient and a remainder of a preset step length. The preset processing frame number is the window length of a window, the preset step length is window movement, each time characteristic data corresponding to the sequence data of the preset step length is input, a new window is formed, and the neural network processes the characteristic data corresponding to the new window. For example, the current sliding window slides backwards by several frames (for example, window shift H ═ 10 frames), that is, several frames (for example, H ═ 10 frames) before the current sliding window are shifted out of the sliding window, and several new frames (for example, H ═ 10 frames) are added after the current sliding window to form the next sliding window, that is, the feature data to be processed.
Step 203, determining the characteristic data to be processed of the neural network according to the integer quotient; and the frame number of the sequence data corresponding to the characteristic data to be processed is the preset processing frame number.
In the embodiment of the invention, the feature data which needs to be processed at this time by the neural network can be determined according to the integer quotient obtained by dividing the difference value by the preset step length and is recorded as the feature data to be processed. And obtaining a first group of characteristic data to be processed after the total frame number reaches a preset processing frame number, and then, satisfying the condition of forming the next group of characteristic data to be processed when the integer quotient is increased every time so as to determine a new group of characteristic data to be processed.
For example, the preset processing frame number is a W frame, the preset step length is an H frame, and when 1 to (W-1) frames are input, the neural network does not perform calculation because the total frame number is less than the W frame; when a W frame is input, the total frame number is greater than or equal to the W frame, namely the integer quotient is 0, the condition for generating the 1 st window is correspondingly met, a first group of characteristic data to be processed is obtained, the neural network can start calculation, when a (W +1) frame is input to a (W + H-1) frame, although the total frame number is greater than or equal to the W frame, the integer quotient is still 0, the condition for generating the next window is correspondingly not met, when a (W + H) frame is input, the total frame number is greater than or equal to the W frame, the integer quotient is 1, the condition for generating the 2 nd window is correspondingly met, a second group of characteristic data to be processed is obtained, when a (W + H +1) frame is input to a (W +2H-1) frame, although the total frame number is greater than or equal to the W frame, the integer quotient is still not 1, the condition for generating the next window is correspondingly not met, and the rest on.
And 204, according to the remainder, starting the processing of the network layer packets corresponding to the remainder one by one according to the processing sequence, and processing the feature data to be processed.
In the embodiment of the invention, for each group of feature data to be processed, each network layer of the neural network needs to be processed, when a group of feature data to be processed is just formed, the remainder is 0, and the processing of the first network layer packet is started first.
In this embodiment of the present invention, the corresponding relationship between the remainder and the network layer packet may be set as needed, for example, after the first network layer packet is started, the next network layer packet is started every time the remainder is increased by a set number, or different corresponding relationships between the remainder and the network layer packet are set, or any other suitable corresponding relationship is set, which is not limited in this embodiment of the present invention. And according to the remainder, starting the processing of the network layer packets corresponding to the current remainder one by one according to the processing sequence, and processing the current group of feature data to be processed.
In the embodiment of the present invention, optionally, a ratio between a preset step length and the number of the network layer packets is a preset integer value, and when the remainder increases the preset integer value, processing of a next network layer packet is started, so that a form of performing calculation once when the original total frame number increases the preset step length is split into a form of performing calculation once when the original total frame number increases the preset integer value, and calculation load is more balanced.
For example, when a W frame is input, the total frame number is greater than or equal to the W frame, and the condition for generating the 1 st window is satisfied, the neural network may perform one calculation, but only L1 network layers included in the 1 st network layer packet are calculated this time; when inputting (W +1) frame to (W + H-1) frame, although the total frame number is more than or equal to W frame, the condition for generating the next window is not satisfied, so the next window is not generated, at this time, each frame calculates L2 network layers to LH network layers contained in 2 nd to H network layer packets; when (W + H) frames are input, the total frame number is more than or equal to W frames, the condition of generating a 2 nd window is met, the neural network can perform calculation once, but only the L1 network layers contained in the 1 st network layer packet are calculated at this time; when inputting (W + H +1) frame to (W +2H-1) frame, although the total frame number is more than or equal to W frame, it does not satisfy the condition of generating the next window, so the next window is not generated, at this time, each frame calculates L2 network layers to LH network layers contained in 2 nd to H network layer packets; the above process is repeated until all frames are calculated.
In summary, according to the embodiments of the present application, the feature data corresponding to the sequence data is input into the neural network; the method comprises the steps that a plurality of network layers of a neural network are divided into a plurality of network layer groups according to a processing sequence, under the condition that the total frame number reaches a preset processing frame number, the difference value between the total frame number and the preset processing frame number is calculated, and the integer quotient and the remainder of the difference value divided by a preset step length are calculated, and characteristic data to be processed of the neural network are determined according to the integer quotient; the frame number of the sequence data corresponding to the feature data to be processed is the preset processing frame number, the processing of the network layer groups corresponding to the remainder is started one by one according to the processing sequence of the remainder, the feature data to be processed is processed, the calculation of the neural network is split, the calculation is distributed in a longer time, the problem that the calculation resources occupy peaks when a plurality of frames are input is avoided, the problems that the calculation resource load at local moments is too high and the calculation resource load at most moments is too low are solved, the load peak value is reduced, the power consumption of the whole calculation is reduced, the response speed of the calculation is accelerated, and meanwhile the waste of the calculation resources is reduced.
It should be noted that, for simplicity of description, the method embodiments are described as a series of motion combinations, but those skilled in the art should understand that the embodiment of the present application is not limited by the described sequence of motion actions, because some steps may be performed in other sequences or simultaneously according to the embodiment of the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are preferred and that the motions described are not necessarily required for the embodiments of the present application.
Referring to fig. 3, a block diagram of a data processing apparatus according to an embodiment of the present application is shown, which may specifically include:
a data input module 301, configured to input feature data corresponding to the sequence data into a neural network; wherein a plurality of network layers of the neural network are divided into a plurality of network layer packets in a processing order;
a processing starting module 302, configured to start processing of network layer packets corresponding to the total frame number one by one according to the total frame number of the sequence data corresponding to the input feature data, where differences between the total frame numbers corresponding to two adjacent network layer packets are the same or different.
In this embodiment of the present invention, optionally, the processing start module includes:
the calculation submodule is used for calculating the difference value between the total frame number and the preset processing frame number and the integer quotient and the remainder of the difference value divided by the preset step length under the condition that the total frame number reaches the preset processing frame number;
the data determination submodule is used for determining the characteristic data to be processed of the neural network according to the integer quotient; the frame number of the sequence data corresponding to the feature data to be processed is the preset processing frame number;
and the processing submodule is used for starting the processing of the network layer packets corresponding to the remainders one by one according to the processing sequence according to the remainders and processing the characteristic data to be processed.
In this embodiment of the present invention, optionally, a ratio between the preset step size and the number of the network layer packets is a preset integer value, and when the remainder is increased by the preset integer value, the processing of the next network layer packet is started. .
In this embodiment of the present invention, optionally, the apparatus further includes:
the test data generation module is used for generating test characteristic data before inputting the sequence data into the neural network;
the test processing module is used for inputting the test characteristic data into the neural network for processing;
the load counting module is used for counting the calculation load of each network layer;
and the grouping module is used for dividing the plurality of network layers into a preset number of network layer groups according to the processing sequence according to the calculation load of each network layer, so that the maximum value of the difference value between the calculation loads of every two network layer groups is lower than the preset minimum value.
In summary, according to the embodiments of the present application, the feature data corresponding to the sequence data is input into the neural network; the method comprises the steps that a plurality of network layers of the neural network are divided into a plurality of network layer groups according to a processing sequence, the network layer groups corresponding to the total frame number are started one by one according to the processing sequence according to the total frame number of sequence data corresponding to inputted feature data, the difference value between the total frame numbers corresponding to every two adjacent network layer groups is the same or different, calculation of the neural network is split, calculation is distributed in a longer time, the problem that the calculation resources occupy peaks when a plurality of frames are inputted is avoided, the problems that the calculation resources at local moments are too high in load and the calculation resources at most moments are too low in load are solved, load peaks are reduced, the power consumption of the whole calculation is reduced, the response speed of the calculation is increased, and meanwhile the waste of the calculation resources is reduced.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
Fig. 4 is a block diagram illustrating an electronic device 700 according to an example embodiment. For example, the apparatus 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, the apparatus 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and a communication component 716.
The processing component 702 generally controls overall operation of the device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing element 702 may include one or more processors 720 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 702 may include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 can include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operation at the device 700. Examples of such data include instructions for any application or method operating on device 700, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 704 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 706 provides power to the various components of the device 700. The power components 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 700.
The multimedia component 708 includes a screen that provides an output interface between the device 700 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 700 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 710 is configured to output and/or input audio signals. For example, audio component 710 includes a Microphone (MIC) configured to receive external audio signals when apparatus 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 714 includes one or more sensors for providing status assessment of various aspects of the apparatus 700. For example, sensor assembly 714 may detect an open/closed state of device 700, the relative positioning of components, such as a display and keypad of apparatus 700, sensor assembly 714 may also detect a change in position of apparatus 700 or a component of apparatus 700, the presence or absence of user contact with apparatus 700, orientation or acceleration/deceleration of apparatus 700, and a change in temperature of apparatus 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate wired or wireless communication between the apparatus 700 and other devices. The apparatus 700 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication section 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 704 comprising instructions, executable by the processor 720 of the device 700 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 5 is a schematic diagram of a server in some embodiments of the present application. The server 1900 may vary widely by configuration or performance and may include one or more Central Processing Units (CPUs) 1922 (e.g., one or more processors) and memory 1932, one or more storage media 1930 (e.g., one or more mass storage devices) storing applications 1942 or data 1944. Memory 1932 and storage medium 1930 can be, among other things, transient or persistent storage. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a series of instructions operating on a server. Still further, a central processor 1922 may be provided in communication with the storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the server 1900.
The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input-output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
A non-transitory computer readable storage medium in which instructions, when executed by a processor of an apparatus (smart terminal or server), enable the apparatus to perform a data processing method, the method comprising:
inputting characteristic data corresponding to the sequence data into a neural network; wherein a plurality of network layers of the neural network are divided into a plurality of network layer packets in a processing order;
and according to the total frame number of the sequence data corresponding to the input feature data, starting the processing of the network layer groups corresponding to the total frame number one by one according to the processing sequence, wherein the difference between the total frame numbers corresponding to every two adjacent network layer groups is the same or different.
Optionally, the starting, one by one, processing, according to a total frame number of sequence data corresponding to feature data that has been input, of network layer packets corresponding to the total frame number in a processing order includes:
under the condition that the total frame number reaches a preset processing frame number, calculating a difference value between the total frame number and the preset processing frame number, and an integer quotient and a remainder of dividing the difference value by a preset step length;
determining the characteristic data to be processed of the neural network according to the integer quotient; the frame number of the sequence data corresponding to the feature data to be processed is the preset processing frame number;
and according to the remainder, starting the processing of the network layer packets corresponding to the remainder one by one according to the processing sequence, and processing the characteristic data to be processed.
Optionally, a ratio of the preset step length to the number of the network layer packets is a preset integer value, and the processing of the next network layer packet is started every time the preset integer value is increased by the remainder. .
Optionally, before the inputting the feature data corresponding to the sequence data into the neural network, the method further comprises:
generating test characteristic data;
inputting the test characteristic data into the neural network for processing;
counting the calculation load of each network layer;
and dividing the plurality of network layers into a preset number of network layer groups according to the processing sequence according to the calculation load of each network layer, so that the maximum value of the difference value between the calculation loads of every two network layer groups is lower than the preset minimum value.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. 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 terminal that comprises the element.
The foregoing detailed description is directed to a data processing method, a data processing apparatus, an electronic device, and a machine-readable medium, which are provided by the present application, and specific examples are applied herein to explain the principles and embodiments of the present application, and the descriptions of the foregoing examples are only used to help understand the method and the core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A data processing method, comprising:
inputting characteristic data corresponding to the sequence data into a neural network; wherein a plurality of network layers of the neural network are divided into a plurality of network layer packets in a processing order;
and according to the total frame number of the sequence data corresponding to the input feature data, starting the processing of the network layer groups corresponding to the total frame number one by one according to the processing sequence, wherein the difference between the total frame numbers corresponding to every two adjacent network layer groups is the same or different.
2. The method according to claim 1, wherein said starting the processing of the network layer packets corresponding to the total number of frames one by one in the processing order based on the total number of frames of the sequence data corresponding to the feature data that has been input comprises:
under the condition that the total frame number reaches a preset processing frame number, calculating a difference value between the total frame number and the preset processing frame number, and an integer quotient and a remainder of dividing the difference value by a preset step length;
determining the characteristic data to be processed of the neural network according to the integer quotient; the frame number of the sequence data corresponding to the feature data to be processed is the preset processing frame number;
and according to the remainder, starting the processing of the network layer packets corresponding to the remainder one by one according to the processing sequence, and processing the characteristic data to be processed.
3. The method according to claim 2, wherein the ratio of the preset step size to the number of the network layer packets is a preset integer value, and the processing of the next network layer packet is started every time the remainder is increased by the preset integer value.
4. The method of any one of claims 1-3, wherein prior to the inputting feature data corresponding to the sequence data into a neural network, the method further comprises:
generating test characteristic data;
inputting the test characteristic data into the neural network for processing;
counting the calculation load of each network layer;
and dividing the plurality of network layers into a preset number of network layer groups according to the processing sequence according to the calculation load of each network layer, so that the maximum value of the difference value between the calculation loads of every two network layer groups is lower than the preset minimum value.
5. A data processing apparatus, comprising:
the data input module is used for inputting the characteristic data corresponding to the sequence data into the neural network; wherein a plurality of network layers of the neural network are divided into a plurality of network layer packets in a processing order;
and the processing starting module is used for starting the processing of the network layer groups corresponding to the total frame number one by one according to the processing sequence according to the total frame number of the sequence data corresponding to the input characteristic data, wherein the difference value between the total frame numbers corresponding to every two adjacent network layer groups is the same or different.
6. The apparatus of claim 5, wherein the process initiation module comprises:
the calculation submodule is used for calculating the difference value between the total frame number and the preset processing frame number and the integer quotient and the remainder of the difference value divided by the preset step length under the condition that the total frame number reaches the preset processing frame number;
the data determination submodule is used for determining the characteristic data to be processed of the neural network according to the integer quotient; the frame number of the sequence data corresponding to the feature data to be processed is the preset processing frame number;
and the processing submodule is used for starting the processing of the network layer packets corresponding to the remainders one by one according to the processing sequence according to the remainders and processing the characteristic data to be processed.
7. The apparatus of claim 6, wherein a ratio of the predetermined step size to the number of network layer packets is a predetermined integer value, and wherein the processing of a next network layer packet is started for each increment of the remainder by the predetermined integer value. .
8. The apparatus of any one of claims 5-7, further comprising:
the test data generation module is used for generating test characteristic data before inputting the sequence data into the neural network;
the test processing module is used for inputting the test characteristic data into the neural network for processing;
the load counting module is used for counting the calculation load of each network layer;
and the grouping module is used for dividing the plurality of network layers into a preset number of network layer groups according to the processing sequence according to the calculation load of each network layer, so that the maximum value of the difference value between the calculation loads of every two network layer groups is lower than the preset minimum value.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
10. A machine-readable medium having stored thereon instructions which, when executed by one or more processors, cause an apparatus to perform a data processing method as claimed in one or more of claims 1 to 4.
CN202110513551.8A 2021-05-11 2021-05-11 Data processing method and device, electronic equipment and readable medium Active CN113240084B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110513551.8A CN113240084B (en) 2021-05-11 2021-05-11 Data processing method and device, electronic equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110513551.8A CN113240084B (en) 2021-05-11 2021-05-11 Data processing method and device, electronic equipment and readable medium

Publications (2)

Publication Number Publication Date
CN113240084A true CN113240084A (en) 2021-08-10
CN113240084B CN113240084B (en) 2024-02-02

Family

ID=77133556

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110513551.8A Active CN113240084B (en) 2021-05-11 2021-05-11 Data processing method and device, electronic equipment and readable medium

Country Status (1)

Country Link
CN (1) CN113240084B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3331206A1 (en) * 2016-12-05 2018-06-06 Alcatel Lucent Classifying of data packets
CN109509475A (en) * 2018-12-28 2019-03-22 出门问问信息科技有限公司 Method, apparatus, electronic equipment and the computer readable storage medium of speech recognition
CN109993277A (en) * 2017-12-29 2019-07-09 英特尔公司 Calculation optimization mechanism for deep neural network
CN110298437A (en) * 2019-06-28 2019-10-01 Oppo广东移动通信有限公司 Separation calculation method, apparatus, storage medium and the mobile terminal of neural network
US20200121256A1 (en) * 2018-10-19 2020-04-23 Microsoft Technology Licensing, Llc Video-based physiological measurement using neural networks
CN111105023A (en) * 2019-11-08 2020-05-05 中国科学院深圳先进技术研究院 Data stream reconstruction method and reconfigurable data stream processor
CN111210017A (en) * 2019-12-24 2020-05-29 北京迈格威科技有限公司 Method, device, equipment and storage medium for determining layout sequence and processing data
US20200294249A1 (en) * 2019-02-25 2020-09-17 Shenzhen Sensetime Technology Co., Ltd. Network module and distribution method and apparatus, electronic device, and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3331206A1 (en) * 2016-12-05 2018-06-06 Alcatel Lucent Classifying of data packets
CN109993277A (en) * 2017-12-29 2019-07-09 英特尔公司 Calculation optimization mechanism for deep neural network
US20200121256A1 (en) * 2018-10-19 2020-04-23 Microsoft Technology Licensing, Llc Video-based physiological measurement using neural networks
CN109509475A (en) * 2018-12-28 2019-03-22 出门问问信息科技有限公司 Method, apparatus, electronic equipment and the computer readable storage medium of speech recognition
US20200294249A1 (en) * 2019-02-25 2020-09-17 Shenzhen Sensetime Technology Co., Ltd. Network module and distribution method and apparatus, electronic device, and storage medium
CN110298437A (en) * 2019-06-28 2019-10-01 Oppo广东移动通信有限公司 Separation calculation method, apparatus, storage medium and the mobile terminal of neural network
CN111105023A (en) * 2019-11-08 2020-05-05 中国科学院深圳先进技术研究院 Data stream reconstruction method and reconfigurable data stream processor
CN111210017A (en) * 2019-12-24 2020-05-29 北京迈格威科技有限公司 Method, device, equipment and storage medium for determining layout sequence and processing data

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
DA CHEN ET AL.: "Hierarchical Sequence Representation with Graph Network", 《 ICASSP 2020 - 2020 IEEE INTERNATIONAL CONFERENCE ON ACOUSTICS, SPEECH AND SIGNAL PROCESSING 》 *
孙俊扬;: "UDS诊断协议工作原理和诊断协议栈的开发", 汽车与配件, no. 05 *
李旗堂, 李娜, 宋国杰: "一个面向大规模BP神经网络并行算法", 河南广播电视大学学报, no. 01 *

Also Published As

Publication number Publication date
CN113240084B (en) 2024-02-02

Similar Documents

Publication Publication Date Title
CN107105314B (en) Video playing method and device
CN113766313B (en) Video data processing method and device, electronic equipment and storage medium
CN110557547B (en) Lens position adjusting method and device
CN111340731B (en) Image processing method and device, electronic equipment and storage medium
CN107967459B (en) Convolution processing method, convolution processing device and storage medium
CN110941727B (en) Resource recommendation method and device, electronic equipment and storage medium
CN109685041B (en) Image analysis method and device, electronic equipment and storage medium
CN112070235A (en) Abnormity positioning method and device of deep learning framework and storage medium
WO2023024791A1 (en) Frame rate adjustment method and apparatus, electronic device, storage medium, and program
CN109358788B (en) Interface display method and device and terminal
CN110764627A (en) Input method and device and electronic equipment
CN112861145B (en) Data processing method and device for data processing
CN109309764B (en) Audio data processing method and device, electronic equipment and storage medium
CN106021130A (en) Memory processing method and device
CN115512116B (en) Image segmentation model optimization method and device, electronic equipment and readable storage medium
CN112784701A (en) Video semantic segmentation method and device and storage medium
CN110148424B (en) Voice processing method and device, electronic equipment and storage medium
CN109325141B (en) Image retrieval method and device, electronic equipment and storage medium
CN111369438A (en) Image processing method and device, electronic equipment and storage medium
CN113240084B (en) Data processing method and device, electronic equipment and readable medium
CN115988092A (en) Image processing method, device, equipment, medium and product
CN114549327A (en) Video super-resolution method, device, electronic equipment and storage medium
CN113761275A (en) Video preview moving picture generation method, device and equipment and readable storage medium
CN110046035B (en) System switching method and device and electronic equipment
CN112434714A (en) Multimedia identification method, device, storage medium and electronic equipment

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