A data processing method and device based on a neural network model and an electronic device

By computing data in parallel within the multi-level structure of the neural network model and leveraging the fast computing power of general-purpose processors, the problems of long computation time and high latency in the model are solved, achieving more efficient computation and lower latency.

CN116306781BActive Publication Date: 2025-11-28PACHIRA TIMES (ZHUHAI HENGQIN) INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310131157.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-17
Publication Date
2025-11-28
Estimated Expiration
2043-02-17

AI Technical Summary

Technical Problem

The increase in the number of parameters in neural network models leads to challenges in device computing power and increased latency in business applications, hindering the development of models.

Method used

By leveraging the multi-level structure of neural network models, data is applied across network layers through parallel computing, and the fast computing power of general-purpose processors is utilized to shorten computation time and improve processor utilization.

Benefits of technology

It reduces latency in business applications, increases the utilization of general-purpose processors in model computation, and improves computational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116306781B_ABST
    Figure CN116306781B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method and device based on a neural network model and electronic equipment, and relates to the technical field of data processing, and comprises the following steps: merging N network layers of a neural network model to obtain M network layer groups; the network layers in each network layer group are calculated in parallel on a same general processor node; target network layers corresponding to a plurality of first input data are determined, the first input data are expanded based on the dimension characteristics of the target network layer groups to which the target network layers belong, the expanded first input data are calculated through a target general processor node where the target network layer group is located, second input data are output, and the target network layers corresponding to the second input data are updated; and in response to the target network layer being the Nth network layer, third input data output by the Nth network layer are taken as output data of the neural network model. The application shortens the calculation time and reduces the time delay.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a data processing method and device based on a neural network model and an electronic device. BACKGROUND

[0002] At present, with the development of artificial intelligence, the neural network model used is also more and more complex. For example, a deep neural network (DNN) model has more complex distribution or features, is widely used in the fields of speech recognition and image recognition, and can greatly improve the speech transcription accuracy; a recurrent neural network (RNN) model is a deep neural network model that can explicitly model time, and contains a self-connected hidden layer across time points, that is, the feedback and input of the hidden layer are not only transmitted to the next layer, but also transmitted to the current hidden layer at the next time. In the process of neural network model calculation, model inference is an inevitable link, that is, after the data is input into the model, the output result of the model needs to be obtained through model inference, and then the result is applied in the business.

[0003] The inventor found in the process of implementing the present application that the size of the neural network model is directly related to the final effect of the application. Therefore, in order to cope with more complex tasks and environments, the parameter amount of the neural network model is also increasing, but at the same time, the increase of the model poses a great challenge to the computing power of the device, and also increases the time delay of the business application, that is, the user needs to wait for a longer time, which further hinders the development of the neural network model. SUMMARY

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present application provide a data processing method and device based on a neural network model and an electronic device, which utilizes the multi-level structure of the neural network model to apply data in parallel in each network layer of the neural network model, and utilizes the fast computing power of the general processor to perform parallel calculation between each network layer of the model, thereby shortening the calculation time of the neural network model, reducing the time delay of the business application, and improving the utilization rate of the general processor in the model calculation process.

[0005] The embodiments of the present application provide a data processing method based on a neural network model, comprising:

[0006] The N network layers of the neural network model are merged to obtain M network layer groups; the network layers in each network layer group are calculated in parallel on the same general processor node; N and M are integers greater than 1, and N is greater than M; target network layers corresponding to a plurality of first input data are determined, the first input data are feature-extended based on a dimension feature of a target network layer group to which the target network layer belongs, the first input data after the extension are calculated by a target general processor node where the target network layer group is located, second input data are output, and the target network layers corresponding to the second input data are updated; the target network layer belongs to any one of the 1 to N network layers; in response to the target network layer being the Nth network layer, third input data output by the Nth network layer are taken as output data of the neural network model.

[0007] The embodiment of the present application also provides a data processing apparatus based on a neural network model, which comprises:

[0008] A merging module is configured to merge N network layers of a neural network model to obtain M network layer groups; the network layers in each network layer group are calculated in parallel on the same general processor node; N and M are integers greater than 1, and N is greater than M; a calculation module is configured to determine target network layers corresponding to a plurality of first input data, perform feature extension on the first input data based on a dimension feature of a target network layer group to which the target network layer belongs, calculate the first input data after the extension by a target general processor node where the target network layer group is located, output second input data, and update the target network layers corresponding to the second input data; the target network layer belongs to any one of the 1 to N network layers; and an output module is configured to take third input data output by the Nth network layer as output data of the neural network model in response to the target network layer being the Nth network layer.

[0009] The embodiment of the present application also provides an electronic device, which comprises:

[0010] One or more processors; a storage device configured to store one or more programs; and when the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method based on a neural network model as described above.

[0011] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the data processing method based on a neural network model as described above.

[0012] The embodiment of the present application also provides a computer program product, which comprises a computer program or instructions, and the computer program or instructions are executed by a processor to realize the neural network model-based data processing method.

[0013] Compared with the prior art, the technical scheme provided by the embodiment of the present application has at least the following advantages: the neural network model-based data processing method, device, electronic equipment and storage medium provided by the embodiment of the present application utilize the multi-level structure of the neural network model, apply data in each network layer of the neural network model in parallel, and utilize the fast computing capability of the general processor to perform parallel computing between each network layer of the model, thereby shortening the computing time of the neural network model, reducing the time delay of service application, and improving the utilization rate of the general processor in the model computing process. BRIEF DESCRIPTION OF DRAWINGS

[0014] The above and other features, advantages, and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description when taken in conjunction with the accompanying drawings, in which like reference characters designate like elements in the various figures. The drawings are intended for illustrative purposes, and the elements and features are not necessarily drawn to scale.

[0015] Figure 1 A flowchart of a neural network model-based data processing method in an embodiment of the present application;

[0016] Figure 2 A flowchart of a neural network model-based data processing method in another embodiment of the present application;

[0017] Figure 3 A flowchart of a neural network model-based data processing method in the prior art;

[0018] Figure 4 A flowchart of a neural network model-based data processing method in another embodiment of the present application;

[0019] Figure 5 A structural schematic diagram of a neural network model-based data processing device in an embodiment of the present application;

[0020] Figure 6 A structural schematic diagram of a neural network model-based data processing device in another embodiment of the present application;

[0021] Figure 7 A structural schematic diagram of an electronic equipment in an embodiment of the present application. DETAILED DESCRIPTION

[0022] Embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While several embodiments of the disclosure will be described in the drawing and specification, the present application can be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.

[0023] It should be understood that each of the steps recited in the method embodiments of the present application can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit performing the steps shown. The scope of the present application is not limited in this respect.

[0024] The term "comprising" and variations thereof as used herein are used inclusively, i.e., "comprising, but not limited to." The term "based on" is "based at least in part on." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments." Related terms are defined in the description that follows.

[0025] It should be noted that the terms "first", "second", and the like in the present application are used only to distinguish different devices, modules or units, and do not imply the order or interdependence of the functions performed by these devices, modules or units.

[0026] It should be noted that the terms "one", "multiple" in the present application are illustrative and not restrictive, and those skilled in the art should understand that unless otherwise explicitly stated in the context, it should be understood as "one or more".

[0027] In the prior art, the calculation process of the model is mainly completed by the central processing unit (CPU), and the neural network is composed of multiple layers, such as 1, 2, 3...N (e.g. N = 102), and the calculation of the neural network is also performed layer by layer, i.e. the output of the first network layer is calculated as the input of the second network layer, and so on. After inputting multiple sets of data into the neural network model, the calculation sequence is to calculate the output of the first set of data in the first network layer of the neural network, and the output is taken as the input of the second network layer, and the calculation is continued until the output of the first set of data in the Nth layer is calculated, at which time the calculation of the first set of data is completed, and then the second frame is calculated, and so on. Since the data of the latter group needs to wait for the calculation of the data of the former group to be completed, the whole process takes a long time, which increases the time delay of the business application.

[0028] In developing this invention, the inventors discovered that general-purpose processors (GPUs) can significantly shorten the time required for model computation. During model training, GPUs are extensively used for computation because data can be easily processed concurrently, greatly improving GPU efficiency. However, in practical use, it's difficult to accurately predict user waiting time and to perform batch computations across multiple users to fully utilize the GPU's rapid computing power, generally increasing user waiting time. Therefore, GPUs are primarily used for model training computations. However, in practical applications, the cost-effectiveness associated with GPU utilization significantly limits their production deployment.

[0029] This invention utilizes the multi-level structure of a neural network model to apply data concurrently to each layer of the model, enabling the GPU to perform parallel computations between the network layers of the model, thereby improving the utilization rate of the GPU in actual use.

[0030] refer to Figure 1 As shown, this embodiment of the invention provides a flowchart of a data processing method based on a neural network model.

[0031] Step S101: Merge the N network layers of the neural network model to obtain M network layer groups; wherein the network layers in each network layer group are computed in parallel on the same general-purpose processor node.

[0032] Specifically, N and M are both integers greater than 1, with N being greater than M. The neural network models in this patent embodiment are all multi-layered structures, performing data-parallel computation on general-purpose processors across each network layer to improve the utilization of the general-purpose processors. Therefore, after loading the neural network model, it is necessary to determine which network layer computations can be merged. The number of general-purpose processors is the same as the number of network layer groups; that is, the number of network layers to be merged is determined based on the number of general-purpose processors. A general-purpose processor node represents a unit that independently initiates general-purpose processor computation; it is the computation request queue of the general-purpose processor. Each node maintains a queue, and this queue shares the same merged dimensional feature matrix.

[0033] In general, the dimensional features of different network layers may be different (for example, some network layers have a dimension of 64, while others have a dimension of 128). In order to make better use of general-purpose processor resources, the dimensional features of each network layer in the network layer group will be uniformly processed, that is, the dimensional features of each network layer will be merged to form a larger dimensional feature matrix.

[0034] Generally, the unification of the dimension characteristics is completed by supplementing 0, in order to supplement less 0, optionally, the N network layers of the neural network model are combined to obtain M network layer groups, including: determining the number M of general processors according to the general processor computing resources of the system; based on the dimension characteristics of each network layer, the network layers with similar dimension characteristic sizes are combined to obtain the M network layers.

[0035] Wherein, the reasonable number of general processors is determined through the general processor computing resources of the system;And the network layers with similar dimension characteristic sizes will have less 0 supplement when combined, improving the computing efficiency.

[0036] Step S102, determine the target network layer corresponding to each of the plurality of first input data, based on the dimension characteristics of the target network layer group to which the target network layer belongs, the feature expansion is carried out on the first input data, and the target general processor node where the target network layer group is located is used to calculate the expanded first input data, output the second input data, and update the target network layer corresponding to each of the second input data.

[0037] Specifically, the target network layer belongs to any one of the 1 to N network layers. The first input data can be data just input into the model, or data input into the model and completed by several network layers. The target network layer corresponding to the first input data is the network layer to be calculated for the first input data, and the target network layer corresponding to the second input data is the network layer to be calculated for the second input data. Since the general processor node can perform parallel calculation on the network layers under the network layer group, it can process multiple first input data.

[0038] For each first input data, find the target network layer group to which the target network layer belongs, and perform feature expansion on the first input data based on the dimension characteristics of the target network layer group. This part is mainly the alignment of the dimension characteristics, for example, the target network layer of the first input data is the second network layer, the second network layer and the sixth network layer are combined in a target network layer group, and belong to the same target general processor. At this time, the vector dimension of the first input data needs to be aligned with the dimension characteristics of the target network layer group, so as to have correct dimension.

[0039] As some optional embodiments of the present application, the dimension characteristics of the target network layer group can be determined by the following scheme: for each target network layer group, determine the dimension characteristics of each network layer included in the target network layer group;The dimension characteristics of the network layers are combined to generate the dimension characteristics of the target network layer group.

[0040] For example, the target network layer group includes the 2nd network layer and the 6th network layer, which need to be calculated on the same general processor node. The dimension feature of the 2nd network layer is A1, and the dimension feature of the 6th network layer is A2. Then, the dimension features of the 2nd network layer and the 6th network layer are combined into [A1A2], and [A1A2] is taken as the dimension feature of the target network layer group.

[0041] Each network layer contains parameters, and the calculation needs to be completed under the parameters during the calculation. For example, the formula of linear calculation is Ax+b. Wherein, A and b are the parameters of the target network layer corresponding to the first input data, and x is the first input data. After the calculation is completed on the target general processor node, the result of Ax+b is returned, which is the second input data.

[0042] After the calculation is completed on the target general processor node, the second input data is output and stored by the target network layer (the 2nd network layer), and the second input data is transmitted to the input of the corresponding target network layer (the 3rd network layer).

[0043] Optionally, the determining of the target network layer corresponding to each of the first input data comprises: determining the sequence number of the network layer outputting the first input data; performing calculation on the sequence number to obtain a target sequence number; and determining the network layer of the target sequence number as the target network layer of the first input data.

[0044] Specifically, the calculation of the neural network is performed layer by layer, that is, the output of the 1st network layer is taken as the input of the 2nd network layer, and so on. Therefore, in the embodiment, the sequence number of the network layer outputting the first input data is determined, and the sequence number is subjected to +1 operation to obtain a target sequence number. The network layer of the target sequence number is the target network layer of the first input data. Further, if the first input data is the original data input into the model, the sequence number is 0, and after the +1 operation, the target sequence number is 1, that is, the calculation of the 1st network layer is performed after entering the model.

[0045] In step S103, in response to the target network layer being the Nth network layer, the third input data output by the Nth network layer is taken as the output data of the neural network model.

[0046] In this step, it is judged whether the target network layer corresponding to the second input data is the last layer (a total of N network layers, and the target network layer is the Nth layer). If it is not the last layer, step S102 is repeated; if it is the last layer, the third input data output by the Nth network layer is taken as the final output data of the neural network model.

[0047] The technical scheme provided by the embodiment of the application utilizes the multi-level structure of the neural network model, applies data in parallel in each network layer of the neural network model, and utilizes the fast computing capability of the general processor to perform parallel computing between each network layer of the model, thereby shortening the computing time of the neural network model, reducing the time delay of service application, and improving the utilization rate of the general processor in the model computing process. In actual use, the scheme provided by the embodiment of the application can increase the utilization rate of the general processor by more than 3 times.

[0048] As some optional embodiments of the application, the feature expansion of the first input data based on the dimension feature of the target network layer group to which the target network layer belongs comprises: expanding the dimension of the first input data according to the dimension feature of the target network layer group, so that the dimension feature of the first input data is the same as the dimension feature of the target network layer group.

[0049] Specifically, for example, the dimension feature of the first input data is D1, and the dimension feature of the target network layer group is D2, and D2 is greater than D1, so D1 needs to be expanded to

D1, 0

[0050] As some optional embodiments of the embodiment of the application, as shown in Figure 2 A neural network model-based data processing method is disclosed, and the specific scheme of each step is described in the embodiment shown in Figure 1 , which will not be described here, and comprises the following steps:

[0051] Step S201, initialization process, since the embodiment of the application is mainly the multi-level structure of the neural network model, the network layers are merged in this step, and data parallel computing on the general processor is performed between the network layers to improve the utilization rate of the general processor.

[0052] Step S202, for the given input data, find the network layer group and the general processor node corresponding to the current network layer, and expand the dimension feature of the input data.

[0053] Step S203, after the calculation on the general processor (GPU) node and the return of the result (output data), the central processing unit (CPU) is used for processing.

[0054] Step S204, judge whether to calculate to the last layer, if not, execute step S202; if yes, execute step S205.

[0055] Step S205, the current concurrent result is taken as the output result of the neural network model.

[0056] The technical scheme provided by the embodiment of the application utilizes the multi-level structure of the neural network model, applies data in each network layer of the neural network model in parallel, and utilizes the fast computing capability of the general processor to perform parallel computing between each network layer of the model, thereby shortening the computing time of the neural network model, reducing the time delay of the service application, and improving the utilization rate of the general processor in the model computing process.

[0057] As some optional embodiments of the application, the parallel computing of the general processor on data can be performed by the following scheme. Specifically, the method further includes: obtaining a data group, the data group including a plurality of data in a sequential relationship; determining the time when the data is input into the neural network model according to the serial number of the network layer that each general processor node performs parallel computing, so that the general processor node performs parallel computing on a plurality of data.

[0058] In the present scheme, the data group includes L data, L is an integer greater than 1, and the L data needs to be input into the neural network model in sequence for computing. Since the network layers on the same general processor node (belonging to the same network layer group) can perform parallel computing in the present scheme, the time when each data is input into the neural network model can be determined according to the serial number of the network layer that each general processor node performs parallel computing and the order of each data in the data group, so as to ensure that the general processor node can perform parallel computing on at least two data.

[0059] Specifically, one data can be input every certain time (for example, data 1 is input at t0, data 2 is input at t0+t1, data 3 is input at t0+t1+t2; t0+t1+t2 can be the same or different), so that the network layers to be input by the plurality of data belong to the same network layer group, and then the general processor node can perform parallel processing at the same time. For example, the L data include data 1, data 2, data 3, …, data L-1, and data L, the 1st network layer, the 3rd network layer, and the N-1th network layer belong to the same network layer group, the 2nd network layer and the Nth network layer belong to the same network layer group; the network layer to be input by data 1 is the Nth layer, the network layer to be input by data 2 is the N-1th layer, the network layer to be input by data L-2 is the 3rd layer, the network layer to be input by data L-1 is the 2nd layer, and the network layer to be input by data L is the 1st layer, then the general processor node can perform parallel computing on data L, data L-2, and data 2, and perform parallel computing on data L-1 and data 1.

[0060] As a specific application scenario of the embodiment of the application, the neural network model can be applied in a voice assistant service of an intelligent device, to output text from voice recognition, so as to achieve the purpose that the intelligent device can understand what people say and understand the meaning.

[0061] Specifically, the data processing flow based on the neural network model in the prior art is as shown in Figure 3 FIG. 1. As a user inputs 1-second voice, a total of 100 frames, and the network is N layers. The calculation sequence is to first calculate the output of the first frame at the first network layer, the output is taken as the input of the second network layer of the first frame, and the calculation is continued until the output of the first frame at the Nth network layer is calculated, at which time the calculation of the first frame is completed, and then the second frame is calculated, and the like.

[0062] The data processing flow based on the neural network model in the embodiment of the present application is as shown in Figure 4 FIG. 2. The data set can include N frames of voice data of user 1, or N frames of voice data of user 1 and N frames of voice data of user 2. First, the dimensional features of each network layer are different, which forms M general processor nodes, and different network layers are calculated and processed on the M general processor nodes, so that the voice data of different frames is calculated at the same time.

[0063] In one embodiment, referring to Figure 5 FIG. 3, a structural schematic diagram of a data processing device based on a neural network model is provided. The device can be used to execute the data processing method based on the neural network model as shown in any of Figures 1-4 FIGS. 1 to 3. The device includes a merging module 510, a calculation module 520, and an output module 530.

[0064] The merging module 510 is configured to merge N network layers of a neural network model to obtain M network layer groups; the network layers in each network layer group are calculated in parallel on a same general processor node; N and M are integers greater than 1, and N is greater than M; the calculation module 520 is configured to determine target network layers corresponding to a plurality of first input data, perform feature expansion on the first input data based on a dimensional feature of a target network layer group to which the target network layers belong, calculate the expanded first input data through a target general processor node on which the target network layer group is located, output second input data, and update the target network layers corresponding to the second input data; the target network layer belongs to any one of 1 to N network layers; and the output module 530 is configured to, in response to the target network layer being the Nth network layer, take third input data output by the Nth network layer as output data of the neural network model.

[0065] Optionally, the merging module 510 is further configured to determine the number M of general processors according to general processor calculation resources of a system; and merge the network layers with similar dimensional feature sizes based on the dimensional feature of each network layer to obtain the M network layers.

[0066] Optionally, the merging module 510 is further configured to determine, for each target network layer group, dimension features of network layers included in the target network layer group; and merge the dimension features of the network layers to generate a dimension feature of the target network layer group.

[0067] Optionally, the computing module 520 is further configured to expand the dimension of the first input data according to the dimension feature of the target network layer group, so that the dimension feature of the first input data is the same as the dimension feature of the target network layer group.

[0068] Optionally, as shown in Figure 6 Optionally, the apparatus further includes an obtaining module 540 and a determining module 550, wherein,

[0069] The obtaining module 540 is configured to obtain a data group, the data group including a plurality of data in a sequential relationship; and the determining module 550 is configured to determine a time at which the data is input to the neural network model according to a sequence number of a network layer calculated in parallel by each general processor node, so that the general processor node calculates a plurality of data in parallel.

[0070] Optionally, the computing module 520 is further configured to determine a sequence number of a network layer outputting the first input data; calculate a target sequence number from the sequence number; and determine a target network layer of the first input data as the network layer of the target sequence number.

[0071] It should be noted that the data processing apparatus based on the neural network model provided in the embodiments of the present application corresponds to the technical solutions that can be used to execute the above-mentioned method embodiments, and the implementation principles and technical effects are similar, which will not be described here.

[0072] Figure 7 is a structural diagram of an electronic device in an embodiment of the present application. The following will be specifically described with reference to Figure 7 , which shows a structural diagram of an electronic device 700 suitable for implementing the electronic device in the embodiments of the present application. The electronic device 700 in the embodiments of the present application can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable electronic devices, and the like, and fixed terminals such as digital TVs, desktop computers, smart home devices, and the like. Figure 7 The electronic device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.

[0073] As shown in Figure 7As shown, the electronic device 700 can include a processing device (e.g., a central processor, a graphics processor, etc.) 701 that can perform various appropriate actions and processes to implement the methods of the embodiments as described herein according to programs stored in a read-only memory (ROM) 702 or loaded into a random access memory (RAM) 703 from a storage device 708. Various programs and data required by the electronic device 700 for operations are also stored in the RAM 703. The processing device 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0074] Generally, the following devices can be connected to the I / O interface 705: input devices 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 708 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 709. The communication devices 709 can allow the electronic device 700 to exchange data with other devices wirelessly or through wires. Although Figure 7 The electronic device 700 is shown with various devices, but it is understood that all of the illustrated devices are not required, and more or fewer devices can be implemented or included.

[0075] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present application. For example, embodiments of the present application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods illustrated by the flowcharts, thereby implementing the methods as described above. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 709, or installed from the storage devices 708, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above-described functions defined in the methods of the embodiments of the present application are performed.

[0076] It should be noted that the computer readable medium in the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having 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 above. In the present application, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus or device. In the present application, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer readable program code. Such a propagated data signal can take on many forms, including but not limited to, an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium that can send, propagate or transfer a program for use by or in connection with an instruction execution system, apparatus or device. The program code contained on the computer readable medium can be transmitted using any suitable medium, including but not limited to, wire, cable, RF (radio frequency), etc., or any suitable combination of the above.

[0077] In some embodiments, the terminals, servers can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communications of any form or medium (e.g., a communications network). Examples of communications networks include local area networks ("LAN"), wide area networks ("WAN"), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.

[0078] The above computer readable medium can be included in the above electronic device; or can exist separately without being assembled into the electronic device.

[0079] The computer readable medium described above carries one or more programs, when the one or more programs are executed by the electronic device, cause the electronic device to: merge N network layers of a neural network model to obtain M network layer groups; wherein the network layers in each network layer group are calculated in parallel on a same general processor node; N and M are both integers greater than 1, and N is greater than M; determine target network layers to which a plurality of first input data correspond respectively, perform feature expansion on the first input data based on a dimension feature of a target network layer group to which the target network layers belong, calculate the first input data after the expansion through a target general processor node where the target network layer group is located, output second input data, and update the target network layers corresponding to the second input data respectively; wherein the target network layer belongs to any one of the 1 to N network layers; in response to the target network layer being the Nth network layer, take third input data output by the Nth network layer as output data of the neural network model.

[0080] The flowcharts and block diagrams in the drawings illustrate the possible architectural, functional, and operational scenarios of the methods, apparatuses, and computer program products according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing the specified functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in a different order than that noted in the drawings. For example, two blocks that are displayed in succession can actually be executed in parallel, and they can also be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and the combination of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0081] The above description is merely the preferred embodiments and the description of the technical principles of the application. It should be understood by those skilled in the art that the disclosed scope of the present application is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by any combinations of the above technical features or their equivalent features without departing from the disclosed concept. For example, the above technical features can be replaced with the technical features disclosed in the present application (but not limited to) having similar functions to form technical solutions.

Claims

1. A data processing method based on a neural network model, characterized in that, The method includes: Based on the general-purpose processor computing resources of the system, the number M of the general-purpose processors is determined; based on the dimensional features of each network layer, network layers with similar dimensional feature sizes are merged to obtain M network layer groups; wherein, the network layers in each network layer group are computed in parallel on the same general-purpose processor node; N and M are both integers greater than 1, and N is greater than M; The process involves: determining the index of the network layer from which the first input data is to be output; calculating a target index from the index; identifying the network layer with the target index as the target network layer for the first input data; determining the dimensional features of each network layer in each target network layer group; merging the dimensional features of each network layer to generate the dimensional features of the target network layer group; expanding the features of the first input data based on the dimensional features of the target network layer group to which the target network layer belongs, so that the dimensional features of the first input data are the same as the dimensional features of the target network layer group; calculating the expanded first input data through the target general-purpose processor node where the target network layer group is located, outputting second input data, and updating the target network layer corresponding to each second input data; wherein the target network layer belongs to any one of 1 to N network layers. In response to the fact that the target network layer is the Nth network layer, the third input data output by the Nth network layer is used as the output data of the neural network model; The parallel computation of data by the general-purpose processor includes: acquiring a data group, which includes multiple data items with a sequential relationship; determining the time when the multiple data items with a sequential relationship are input into the neural network model according to the sequence number of the network layer to be computed in parallel by each general-purpose processor node, so that the general-purpose processor node computes multiple data items in parallel.

2. A data processing device based on a neural network model, characterized in that, include: The merging module is used to determine the number M of the general-purpose processors based on the general-purpose processor computing resources of the system; Based on the dimensional features of each network layer, network layers with similar dimensional feature sizes are merged to obtain M network layer groups; wherein, the network layers in each network layer group are computed in parallel on the same general-purpose processor node; N and M are both integers greater than 1, and N is greater than M; A calculation module is used to determine the index of the network layer that outputs the first input data; calculate the target index from the index; determine the network layer with the target index as the target network layer of the first input data; for each target network layer group, determine the dimensional features of each network layer included in the target network layer group; merge the dimensional features of each network layer to generate the dimensional features of the target network layer group; based on the dimensional features of the target network layer group to which the target network layer belongs, perform feature expansion on the first input data so that the dimensional features of the first input data are the same as the dimensional features of the target network layer group; calculate the expanded first input data through the target general-purpose processor node where the target network layer group is located, output the second input data, and update the target network layer corresponding to each of the second input data; wherein, the target network layer belongs to any one of 1 to N network layers; The output module is configured to, in response to the target network layer being the Nth network layer, use the third input data output by the Nth network layer as the output data of the neural network model. The computing module further includes a general-purpose processor parallel computing module for data, used to acquire a data group, which includes multiple data with a sequential relationship; and to determine the time when the multiple data with a sequential relationship are input into the neural network model according to the sequence number of the network layer in parallel computing of each general-purpose processor node, so that the general-purpose processor node can compute multiple data in parallel.

3. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method based on a neural network model as described in claim 1.

Citation Information

Patent Citations

  • Data processing method and device based on neural network, equipment and storage medium

    CN110163337A