CN116486831A - Data processing method, device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN116486831A
CN116486831A CN202310168869.6A CN202310168869A CN116486831A CN 116486831 A CN116486831 A CN 116486831A CN 202310168869 A CN202310168869 A CN 202310168869A CN 116486831 A CN116486831 A CN 116486831A
Authority
CN
China
Prior art keywords
data
data size
frame data
frame
size range
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
CN202310168869.6A
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.)
Kunlun Core Beijing Technology Co ltd
Original Assignee
Kunlun Core Beijing 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 Kunlun Core Beijing Technology Co ltd filed Critical Kunlun Core Beijing Technology Co ltd
Priority to CN202310168869.6A priority Critical patent/CN116486831A/en
Publication of CN116486831A publication Critical patent/CN116486831A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/27Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Acoustics & Sound (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data processing method, a device, electronic equipment and a storage medium, which relate to the field of data processing, in particular to the field of voice recognition, the field of computer vision and the like, and the data processing method comprises the following steps: acquiring a plurality of frame data and data size information corresponding to each frame data; determining a data size range to which each frame data belongs based on the data size information; the data size difference of any two frame data in the same data size range is smaller than a set threshold value; responding to that a plurality of frame data in the same data size range meet a set condition, and inputting all frame data meeting the set condition into a corresponding preset reasoning model for reasoning; different preset inference models correspondingly process data in different data size ranges.

Description

Data processing method, device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of data processing, and in particular, to the field of speech recognition and the field of computer vision, and more particularly, to a data processing method, apparatus, electronic device, and storage medium.
Background
For the case of 1 batch (batch) input, i.e. multi-frame input data of a model, the size of each input data is not the same, and when 1 batch is used for reasoning, the following 3 schemes are generally adopted at present: (1) Unpacking 1 batch of data, and respectively processing each frame of input; (2) Selecting data with the maximum data size in 1 batch, aligning other frame data to the maximum data by supplementing 0 so as to obtain a group of data with the same size, and sending the group of data to an inference engine for calculation; (3) The 1 batch of data of different data sizes are fused together, after which the specific location of each frame of data is recorded by another dimension input.
However, although the method in 3 above can use multi-batch to infer a model of a dynamic shape (size), the following problems exist respectively: (1) the reasoning acceleration cannot be performed by utilizing a multi-batch technology; (2) The data of other data sizes need to be subjected to zero padding, and the zero padding part definitely causes the waste of calculation resources; when the size difference of each frame data in a group of batch is larger, the disadvantage of the scheme is more obvious; (3) The method reduces the waste of calculation resources, but increases the size and offset of one-dimensional data for recording each frame, thereby increasing the adaptation difficulty of the model and making the adaptation of the model extremely complex.
Disclosure of Invention
The technical problem to be solved by the present disclosure is to overcome the defects that in the prior art, either a multi-batch technology cannot be utilized to perform reasoning acceleration, or a calculation resource is wasted, and the adaptation difficulty of a model is increased, etc., and to provide a data processing method, a data processing device, an electronic device and a storage medium.
The technical problems are solved by the following technical scheme:
according to an aspect of the present disclosure, there is provided a data processing method including:
acquiring a plurality of frame data and data size information corresponding to each frame data;
determining a data size range to which each frame data belongs based on the data size information;
the data size difference of any two frame data in the same data size range is smaller than a set threshold value;
responding to that a plurality of frame data in the same data size range meet a set condition, and inputting all frame data meeting the set condition into a corresponding preset reasoning model for reasoning;
wherein different preset inference models correspondingly process data in different data size ranges.
According to another aspect of the present disclosure, there is provided a data processing apparatus including:
the frame data acquisition module is used for acquiring a plurality of frame data;
the size information acquisition module is used for acquiring data size information corresponding to each frame data;
a size range determining module, configured to determine, based on the data size information, a data size range to which each frame data belongs;
the data size difference of any two frame data in the same data size range is smaller than a set threshold value;
the data processing module is used for responding to that a plurality of frame data in the same data size range meet a set condition, and inputting all frame data meeting the set condition into a corresponding preset reasoning model for reasoning;
wherein different preset inference models correspondingly process data in different data size ranges.
According to another aspect of the present disclosure, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method described above.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the above-described method.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method described above.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a first flowchart of a data processing method according to a first embodiment of the present disclosure.
Fig. 2 is a second flowchart of a data processing method according to a first embodiment of the present disclosure.
Fig. 3 is a third flowchart of a data processing method according to a first embodiment of the present disclosure.
Fig. 4 is a fourth flowchart of a data processing method according to the first embodiment of the present disclosure.
Fig. 5 is a block diagram of a data processing apparatus according to a second embodiment of the present disclosure.
Fig. 6 is a schematic structural view of an electronic device according to a third embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one 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.
Example 1
As shown in fig. 1, the data processing method of the present embodiment includes:
s101, acquiring a plurality of frame data and data size information corresponding to each frame data;
wherein the frame data includes, but is not limited to, voice frame data, video frame data, each frame data corresponding to a certain shape (i.e., data size).
S102, determining a data size range to which each frame of data belongs based on the data size information;
the data size difference of any two frame data in the same data size range is smaller than a set threshold value;
for example, for a speech recognition scenario, different speech frames and corresponding data sizes over a period of time in the scenario are acquired; counting the data size of each input frame data, and determining N data size ranges; wherein N is more than or equal to 2 and takes a positive integer.
And for any frame of data which is currently input, determining a data size range within which the data falls according to the corresponding data size. For frame data belonging to the same data size range, the data sizes of the frame data are very similar, so that the problem that when the data sizes of the frame data in a group of latches are large in difference, the data processing efficiency is low and unnecessary waste of data resources is caused is avoided.
In addition, the N data size ranges are mutually independent and adjacent, and the data sizes between the two data size ranges are continuous, so as to ensure that all input frame data can be correctly and reasonably distributed to the matched data size ranges.
S103, responding to the fact that a plurality of frame data in the same data size range meet the set conditions, and inputting all frame data meeting the set conditions into a corresponding preset reasoning model for reasoning;
wherein, different preset inference models correspondingly process data in different data size ranges.
The model type corresponding to the preset model is not limited, that is, the data processing method in the embodiment has universality for all models of the dynamic shape.
Specifically, according to the determined N data size ranges, the inference engine applies for a model corresponding to each data size range, where each model is configured to receive data in the corresponding data size range, that is, if the data size of a certain frame of data exceeds the processing range of a certain model, the corresponding model does not respond to inference; therefore, the received multi-path or multi-frame input data are divided and processed in parallel based on the data size of each frame of data, so that the utilization rate of computing resources can be effectively increased, the overall time delay of model reasoning is reduced, the model reasoning process is well optimized, and the instantaneity of data processing is improved.
In the embodiment, the problems of waste of calculation resources or complex operation and the like when the model of the dynamic shape is calculated by using multiple batches are solved, and more paths of data calculation can be supported under the same calculation power of the system; or under the same calculation load, less calculation resources are occupied, and the utilization rate of the calculation resources is effectively increased, so that the model reasoning acceleration is realized, and the purposes of improving the utilization rate of hardware and accelerating the execution efficiency of an algorithm are achieved.
In one embodiment, as shown in fig. 2, step S102 includes:
s201, constructing a plurality of different data size ranges in advance;
s202, determining a data size range in which the data size information falls, so as to obtain the data size range to which each frame of data belongs.
In the scheme, different data size ranges are constructed in advance, so that the data size ranges can be compared and determined for any frame of input data, and the data processing efficiency and reliability are ensured.
In one embodiment, step S201 includes:
acquiring scene characteristic information of a target scene;
specifically, the target scene includes a speech recognition scene, and the frame data includes speech frame data; the target scene comprises a visual model scene and the frame data comprises video frame data.
Based on scene feature information, a first number of data size ranges matching the target scene are pre-constructed.
In the scheme, according to scene characteristics of an actual scene, a corresponding number of data size ranges are set in a matching mode; for example for actual scene a, for K data size ranges; for actual scene B, for J data size ranges; K. j is more than or equal to 2 and takes positive integer,
corresponding data size range standards are adaptively set for different scenes, the number of the data size ranges and the range span can be reset or adjusted according to actual requirements, the processing process is further optimized, and the processing efficiency of multi-frame data input is guaranteed.
In one embodiment, step S201 includes:
and constructing a second number of data size ranges according to the set construction rule.
In the scheme, a default mode for constructing the data size range is preset, and the default construction mode is universally suitable for a general application scene, so that the data processing flow is simplified, and meanwhile, the processing quality of the data is not influenced. Of course, the data range span of the default data size range can be reset or adjusted according to the actual requirement.
The step S103 further includes:
s203, constructing a plurality of cache pools in advance;
the method comprises the steps of applying for different buffer pools in advance, and preparing a plurality of buffer pools in advance to receive input frame data with different data sizes.
Step S103 includes:
s204, storing frame data belonging to the same data size range into the same buffer pool;
s205, acquiring the number of frame data in a buffer pool;
s206, in response to the number of the frame data reaching the single-batch processing threshold, inputting all the frame data of the single-batch processing threshold into a corresponding preset reasoning model for reasoning.
In a practical scenario, steps S204-S206 need to be performed in a loop to perform model reasoning operation continuously.
The capacity of the buffer pool is larger than a single-batch processing threshold value so as to avoid the situation of data overflow; for example, the capacity of the buffer pool may be twice or more than that of a single batch processing threshold, and may be determined or adjusted according to practical situations.
Wherein, the single batch processing threshold value corresponding to the buffer pool is generally predetermined; for example, the batch size is 8, that is, after frame data in a buffer pool of a certain data size range reaches 8 frames (one batch), the 8 frames are input into a corresponding model for reasoning, so that the overall time delay of system reasoning is reduced, and the real-time performance of the system is improved.
The single-batch processing threshold is determined based on influencing factors such as hardware resources, model types and the like, namely the size of the single-batch processing threshold is determined by different influencing factors; of course, the single batch processing threshold may also be adjusted within a certain range according to the actual requirement, so as to meet different data processing requirements.
In one embodiment, the caching pool step S204 includes:
the data size of frame data belonging to the same data size range is complemented to a preset data size, and the data size is stored in a corresponding same cache pool;
wherein the preset data size is less than or equal to the maximum data size in the data size range.
In the scheme, for frame data belonging to the same data size range, the data sizes of the frame data are similar, but the sizes of the frame data are still different to a certain extent, and unified specification is required for all the frame data in the same data size range so as to ensure the feasibility and efficiency of the model feeding process.
Preferably, the data sizes of the frame data in the same data size range are subjected to size filling by adopting zero until the maximum data size in the data size range is reached, and the frame data in the same data size range is stored in the corresponding same cache pool.
In the scheme, the data size falling into a certain data size range is necessarily smaller than or equal to the maximum data size, the maximum data size corresponding to the same data size range is used as a standard, and all frame data input into the buffer pool need to be supplemented to the maximum data size, so that all frame data can be effectively normalized.
The implementation procedure of the data processing method of this embodiment is further specifically described below with reference to fig. 3:
s301, counting the approximate range (namely the data size range) of the shape input by each frame;
s302, creating inference engines (i.e. models) of different-size inputs;
s303, creating cache pools with different sizes;
s304, receiving multiple paths or multiple frames of input data, carrying out zero padding on the input data, unifying the input data to uniform data length, and then storing the input data in a buffer pool with corresponding size;
s305, judging whether the size of one batch is met in the corresponding cache pool, if so, sending frame data of one batch to the corresponding model for reasoning, and re-executing S304;
otherwise, S304 is re-executed.
Specifically, in a speech recognition scene, the data lengths of different speech frames are inconsistent, and most of models used for speech recognition are dynamic shape models; in a high-density computing scenario, such as a multi-path speech recognition scenario or to save computing resources, a single-path multi-frame speech data is formed into 1 batch for computing, so that the data processing scheme of the embodiment can be adopted to achieve the corresponding data processing purpose.
In a computer vision scene, in order to increase the universality, part of the vision model is designed into a dynamic shape mode so as to be suitable for more complex calculation scenes, when the square model of the dynamic shape is used in a large scale, multiple batch is used for optimization, and the data processing scheme of the embodiment can be adopted to achieve the corresponding data processing purpose so as to obtain the purpose of effectively saving calculation resources.
In the same way, in the similar application scenario, the data processing scheme of the embodiment realizes that the multi-batch technology is used for reasoning and accelerating the model of the dynamic shape under the condition of saving computing resources, and the purposes of improving the utilization rate of hardware and accelerating the execution efficiency of an algorithm are also achieved.
In an embodiment, step S103 further includes:
marking all frame data which are input into a preset reasoning model in a cache pool as processed states;
and re-executing the step of acquiring the number of the frame data in the buffer pool for the new frame data newly stored in the buffer pool.
In the scheme, for any cache pool, input frame data can be continuously received, and for the frame data which meets one batch and is input to a model, the frame data is not needed to participate in a subsequent model reasoning process, so that automatic marking processing is needed, the condition of re-or misadjustment is avoided, and the reliability of system reasoning is ensured.
The implementation procedure of the data processing method in the speech recognition scenario is specifically described below with reference to fig. 4:
s401, according to an actual voice recognition scene, classifying the data size range of voice input into 3 types: [1, 128), [128, 256), [256,1024]; s402, initializing an inference engine in the step 3, wherein if the batch size is set to be 8, the input size of the model is as follows: [8,128], [8,256], [8,1024];
s403, creating 3 cache pools, wherein in order to prevent data overflow, the size of the input size of the cache pools is twice as large as that of the batch: [16,128], [16,256], [16,1024];
s404, receiving multiple paths or multiple frames of input data, carrying out zero padding on the input data, unifying the input data to uniform data length, and then storing the input data in a buffer pool with corresponding size; if the size of 1 frame data is [1,64], the data is added to [1,128], and then the data is put into a buffer pool of [16,128 ];
s405, whether the number of the frame data in a certain cache pool is larger than 8 or not, if so, sending 8 frame data of one batch into a corresponding reasoning engine for reasoning; continuing steps S404-S405; otherwise, steps S404-S405 are continued.
For other application scenarios, the implementation procedure is similar to that described above, and thus will not be described in detail here.
Example 2
As shown in fig. 5, the data processing apparatus of the present embodiment includes:
a frame data acquisition module 501, configured to acquire a plurality of frame data;
a size information obtaining module 502, configured to obtain data size information corresponding to each frame data;
the frame data includes, but is not limited to, voice frame data and video frame data, and each frame data corresponds to a certain shape.
A size range determining module 503, configured to determine, based on the data size information, a data size range to which each frame data belongs;
the data size difference of any two frame data in the same data size range is smaller than a set threshold value;
for example, for a speech recognition scenario, different speech frames and corresponding data sizes over a period of time in the scenario are acquired; counting the data size of each input frame data, and determining N data size ranges; wherein N is more than or equal to 2 and takes a positive integer.
And for any frame of data which is currently input, determining a data size range within which the data falls according to the corresponding data size. For frame data belonging to the same data size range, the data sizes of the frame data are very similar, so that the problem that when the data sizes of the frame data in a group of latches are large in difference, the data processing efficiency is low and unnecessary waste of data resources is caused is avoided.
In addition, the N data size ranges are mutually independent and adjacent, and the data sizes between the two data size ranges are continuous, so as to ensure that all input frame data can be correctly and reasonably distributed to the matched data size ranges.
The data processing module 504 is configured to respond to that a plurality of frame data in the same data size range meet a set condition, and input all frame data meeting the set condition to a corresponding preset inference model for inference;
wherein, different preset inference models correspondingly process data in different data size ranges.
The model type corresponding to the preset model is not limited, that is, the data processing method in the embodiment has universality for all models of the dynamic shape.
Specifically, according to the determined N data size ranges, the inference engine applies for a model corresponding to each data size range, where each model is configured to receive data in the corresponding data size range, that is, if the data size of a certain frame of data exceeds the processing range of a certain model, the corresponding model does not respond to inference; therefore, the received multi-path or multi-frame input data are divided and processed in parallel based on the data size of each frame of data, so that the utilization rate of computing resources can be effectively increased, the overall time delay of model reasoning is reduced, the model reasoning process is well optimized, and the instantaneity of data processing is improved.
In the embodiment, the problems of waste of calculation resources or complex operation and the like when the model of the dynamic shape is calculated by using multiple batches are solved, and more paths of data calculation can be supported under the same calculation power of the system; or under the same calculation load, less calculation resources are occupied, and the utilization rate of the calculation resources is effectively increased, so that the model reasoning acceleration is realized, and the purposes of improving the utilization rate of hardware and accelerating the execution efficiency of an algorithm are achieved.
In one embodiment, the size range determination module 503 includes:
a size range construction unit for constructing a plurality of different data size ranges in advance;
and a size range determining unit configured to determine a data size range within which the data size information falls, so as to obtain a data size range to which each frame data belongs.
In the scheme, different data size ranges are constructed in advance, so that the data size ranges can be compared and determined for any frame of input data, and the data processing efficiency and reliability are ensured.
In an embodiment, the size range construction unit is configured to obtain scene feature information of the target scene; based on scene feature information, a first number of data size ranges matching the target scene are pre-constructed.
Specifically, the target scene includes a speech recognition scene, and the frame data includes speech frame data; the target scene comprises a visual model scene and the frame data comprises video frame data.
In the scheme, according to scene characteristics of an actual scene, a corresponding number of data size ranges are set in a matching mode; for example for actual scene a, for K data size ranges; for actual scene B, for J data size ranges; K. j is more than or equal to 2 and takes positive integer,
corresponding data size range standards are adaptively set for different scenes, the number of the data size ranges and the range span can be reset or adjusted according to actual requirements, the processing process is further optimized, and the processing efficiency of multi-frame data input is guaranteed.
In an embodiment, the size range construction unit is configured to construct the second number of data size ranges according to a set construction rule.
In the scheme, a default mode for constructing the data size range is preset, and the default construction mode is universally suitable for a general application scene, so that the data processing flow is simplified, and meanwhile, the processing quality of the data is not influenced. Of course, the data range span of the default data size range can be reset or adjusted according to the actual requirement.
In one embodiment, the data processing apparatus further comprises:
the buffer pool construction module 505 is configured to construct a plurality of buffer pools in advance;
the method comprises the steps of applying for different buffer pools in advance, and preparing a plurality of buffer pools in advance to receive input frame data with different data sizes.
The data processing module 504 includes:
the data storage unit is used for storing the frame data belonging to the same data size range into the same cache pool;
a frame data quantity obtaining unit for obtaining the frame data quantity in the buffer pool;
the data processing unit is used for responding to the fact that the number of the frame data reaches the single-batch processing threshold, and inputting all the frame data of the single-batch processing threshold into a corresponding preset reasoning model for reasoning.
The capacity of the buffer pool is larger than a single-batch processing threshold value so as to avoid the situation of data overflow; for example, the capacity of the buffer pool may be twice or more than that of a single batch processing threshold, and may be determined or adjusted according to practical situations.
Wherein, the single batch processing threshold value corresponding to the buffer pool is generally predetermined; for example, the batch size is 8, that is, after frame data in a buffer pool of a certain data size range reaches 8 frames (one batch), the 8 frames are input into a corresponding model for reasoning, so that the overall time delay of system reasoning is reduced, and the real-time performance of the system is improved.
The single-batch processing threshold is determined based on influencing factors such as hardware resources, model types and the like, namely the size of the single-batch processing threshold is determined by different influencing factors; of course, the single batch processing threshold may also be adjusted within a certain range according to the actual requirement, so as to meet different data processing requirements.
In an embodiment, the data storage unit is configured to complement the data size of the frame data belonging to the same data size range to a preset data size, and store the data size in the corresponding same buffer pool;
wherein the preset data size is less than or equal to the maximum data size in the data size range.
In the scheme, for frame data belonging to the same data size range, the data sizes of the frame data are similar, but the sizes of the frame data are still different to a certain extent, and unified specification is required for all the frame data in the same data size range so as to ensure the feasibility and efficiency of the model feeding process.
In one embodiment, the data storage unit is configured to size-fill the data size of the frame data in the same data size range with zero until the maximum data size in the data size range is reached, and store the data in the corresponding same buffer pool.
In the scheme, the data size falling into a certain data size range is necessarily smaller than or equal to the maximum data size, the maximum data size corresponding to the same data size range is used as a standard, and all frame data input into the buffer pool need to be supplemented to the maximum data size, so that all frame data can be effectively normalized.
In one embodiment, the data processing apparatus further comprises:
the data marking module is used for marking all frame data which are input into the preset reasoning model in the cache pool as processed states;
the data storage unit is further configured to recall the frame data amount acquisition unit for new frame data newly stored in the buffer pool.
In the scheme, for any cache pool, input frame data can be continuously received, and for the frame data which meets one batch and is input to a model, the frame data is not needed to participate in a subsequent model reasoning process, so that automatic marking processing is needed, the condition of re-or misadjustment is avoided, and the reliability of system reasoning is ensured.
It should be noted that, the implementation principle of the data processing apparatus of this embodiment is the same as that of the data processing method of embodiment 1, and thus will not be described herein.
Example 3
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 6 shows a schematic block diagram of an example electronic device 800 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data required for the operation of the device 600 may also be stored. The computing unit 601, ROM 602, and RAM603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Various components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the methods described above. For example, in some embodiments, the methods described above may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into RAM603 and executed by the computing unit 601, one or more steps of the above-described method may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the above-described methods by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that the various forms of flow shown above may be used, reordered, augmented, or performed in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (22)

1. A data processing method, the data processing method comprising:
acquiring a plurality of frame data and data size information corresponding to each frame data;
determining a data size range to which each frame data belongs based on the data size information;
the data size difference of any two frame data in the same data size range is smaller than a set threshold value;
responding to that a plurality of frame data in the same data size range meet a set condition, and inputting all frame data meeting the set condition into a corresponding preset reasoning model for reasoning;
wherein different preset inference models correspondingly process data in different data size ranges.
2. The data processing method of claim 1, wherein the step of determining the data size range to which each of the frame data belongs based on the data size information comprises:
pre-constructing a plurality of different data size ranges;
and determining the data size range in which the data size information falls to obtain the data size range to which each frame data belongs.
3. The data processing method according to claim 1 or 2, the data processing method further comprising:
a plurality of cache pools are built in advance;
the step of inputting all frame data meeting the set condition to a preset reasoning model for reasoning in response to the fact that a plurality of frame data in the same data size range meet the set condition comprises the following steps:
storing frame data belonging to the same data size range into the same cache pool;
acquiring the number of frame data in the buffer pool;
and responding to the frame data quantity reaching a single batch processing threshold, and inputting all frame data of the single batch processing threshold into the corresponding preset reasoning model for reasoning.
4. A data processing method according to claim 3, said step of storing frame data belonging to the same said data size range in the same said buffer pool comprising:
the data size of the frame data belonging to the same data size range is complemented to a preset data size, and the data size is stored in the corresponding same cache pool;
wherein the preset data size is less than or equal to the maximum data size in the data size range.
5. The data processing method according to claim 4, wherein the step of padding the data sizes of the frame data belonging to the same data size range to a preset data size and storing the padded data in the corresponding same buffer pool comprises:
and carrying out size filling on the data sizes of the frame data in the same data size range by adopting zero until the maximum data size in the data size range is reached, and storing the maximum data size in the corresponding same cache pool.
6. The data processing method according to claim 3, wherein after all frame data of the single batch processing threshold are input to the corresponding preset inference model for inference, the method further comprises:
marking all the frame data which are input into the preset reasoning model in the cache pool as processed states;
and re-executing the step of acquiring the number of the frame data in the buffer pool for the new frame data newly stored in the buffer pool.
7. The data processing method of claim 2, said pre-building a plurality of different said data size ranges step comprising:
acquiring scene characteristic information of a target scene;
based on the scene feature information, a first number of the data size ranges matching the target scene are pre-constructed.
8. The data processing method of claim 2, said pre-building a plurality of different said data size ranges step comprising:
and constructing a second number of the data size ranges according to a set construction rule.
9. The data processing method of claim 7, the target scene comprising a speech recognition scene, the frame data comprising speech frame data; or alternatively, the first and second heat exchangers may be,
the target scene comprises a visual model scene and the frame data comprises video frame data.
10. A data processing apparatus, the data processing apparatus comprising:
the frame data acquisition module is used for acquiring a plurality of frame data;
the size information acquisition module is used for acquiring data size information corresponding to each frame data;
a size range determining module, configured to determine, based on the data size information, a data size range to which each frame data belongs;
the data size difference of any two frame data in the same data size range is smaller than a set threshold value;
the data processing module is used for responding to that a plurality of frame data in the same data size range meet a set condition, and inputting all frame data meeting the set condition into a corresponding preset reasoning model for reasoning;
wherein different preset inference models correspondingly process data in different data size ranges.
11. The data processing apparatus of claim 10, the size range determination module comprising:
a size range construction unit, configured to construct a plurality of different data size ranges in advance;
and a size range determining unit configured to determine the data size range within which the data size information falls, so as to obtain the data size range to which each frame data belongs.
12. The data processing apparatus according to claim 10 or 11, the data processing apparatus further comprising:
the cache pool construction module is used for constructing a plurality of cache pools in advance;
the data processing module comprises:
a data storage unit, configured to store frame data belonging to the same data size range into the same buffer pool;
a frame data quantity obtaining unit, configured to obtain the number of frame data in the buffer pool;
and the data processing unit is used for responding to the frame data quantity reaching a single batch processing threshold value, and inputting all the frame data of the single batch processing threshold value into the corresponding preset reasoning model for reasoning.
13. The data processing apparatus according to claim 12, wherein the data storage unit is configured to complement data sizes of the frame data belonging to the same data size range to a preset data size, and store the data sizes in the corresponding same buffer pool;
wherein the preset data size is less than or equal to the maximum data size in the data size range.
14. The data processing apparatus according to claim 13, wherein the data storage unit is configured to size-complement the data sizes of the frame data of the same data size range with zero until a maximum data size in the data size range is reached, and store the data sizes in the corresponding same buffer pool.
15. The data processing apparatus of claim 12, the data processing apparatus further comprising:
the data marking module is used for marking all the frame data which are input into the preset reasoning model in the cache pool as processed states;
the data storage unit is further configured to recall the frame data number acquisition unit for new frame data newly stored in the buffer pool.
16. The data processing apparatus according to claim 11, the size range construction unit being configured to acquire scene feature information of a target scene; based on the scene feature information, a first number of the data size ranges matching the target scene are pre-constructed.
17. The data processing apparatus according to claim 11, the size range construction unit being operable to construct a second number of the data size ranges according to a set construction rule.
18. The data processing apparatus of claim 16, the target scene comprising a speech recognition scene, the frame data comprising speech frame data; or alternatively, the first and second heat exchangers may be,
the target scene comprises a visual model scene and the frame data comprises video frame data.
19. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
20. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-9.
21. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-9.
22. An integrated circuit chip comprising at least one data processing device according to any of claims 10-18.
CN202310168869.6A 2023-02-24 2023-02-24 Data processing method, device, electronic equipment and storage medium Pending CN116486831A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310168869.6A CN116486831A (en) 2023-02-24 2023-02-24 Data processing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310168869.6A CN116486831A (en) 2023-02-24 2023-02-24 Data processing method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116486831A true CN116486831A (en) 2023-07-25

Family

ID=87214382

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310168869.6A Pending CN116486831A (en) 2023-02-24 2023-02-24 Data processing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116486831A (en)

Similar Documents

Publication Publication Date Title
CN114548426B (en) Asynchronous federal learning method, business service prediction method, device and system
CN112488060B (en) Target detection method, device, equipment and medium
WO2022142478A1 (en) Model calculation method and system
CN114422799B (en) Decoding method and device for video file, electronic equipment and program product
CN113778644B (en) Task processing method, device, equipment and storage medium
CN112948081B (en) Method, device, equipment and storage medium for processing tasks in delayed mode
CN116166583B (en) Data precision conversion method and device, DMA controller and medium
CN116594563A (en) Distributed storage capacity expansion method and device, electronic equipment and storage medium
CN116521088A (en) Data processing method, device, equipment and storage medium
CN116227599A (en) Inference model optimization method and device, electronic equipment and storage medium
CN116467235A (en) DMA-based data processing method and device, electronic equipment and medium
CN116486831A (en) Data processing method, device, electronic equipment and storage medium
CN116126916A (en) Data query method, device and equipment based on intelligent network card
CN113377295B (en) Data storage and reading method, device and equipment for multi-producer single-consumer
CN116243978A (en) Data protocol method, device, medium and training system in distributed training
CN116527652A (en) Method, device, equipment and medium for determining file format conversion path
CN113556575A (en) Method, apparatus, device, medium and product for compressing data
CN115086300B (en) Video file scheduling method and device
CN115629879B (en) Load balancing method and device for distributed model training
CN115906982B (en) Distributed training method, gradient communication device and electronic equipment
CN116402141B (en) Model reasoning method and device, electronic equipment and storage medium
CN115292662B (en) Convolution acceleration operation method and device, electronic equipment and storage medium
CN112612980B (en) Picture service method, apparatus, device, storage medium and computer program product
CN113360736B (en) Internet data capturing method and device
CN114860341B (en) Thread configuration method, device, apparatus 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