Data processing method, device, electronic device and storage medium

By calculating the revenue information of the offline model and dynamically adjusting the batch number, the computing power and memory waste of artificial intelligence chips when scene changes are solved, and efficient resource utilization and cost-effective improvements are achieved.

CN114416335BActive Publication Date: 2024-11-08ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111486828.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-07
Publication Date
2024-11-08
Estimated Expiration
2041-12-07

AI Technical Summary

Technical Problem

The offline model engines of most artificial intelligence chips only support fixed batch processing methods, resulting in wasted computing power and memory when the number of scenes changes, and cannot effectively exert the advantages of large computing power.

Method used

By calculating the revenue information of the offline model, selecting the appropriate model set to process the data to be processed, dynamically adjusting the number of batches, saving computing power and memory resources.

Benefits of technology

Effectively save computing power and memory resources, improve the utilization rate of computing resources, improve the cost-effectiveness of the equipment, and be able to run more algorithm services on the same equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114416335B_ABST
    Figure CN114416335B_ABST
Patent Text Reader

Abstract

The present invention provides a data processing method, device, electronic device and storage medium. The data processing method comprises: obtaining a first offline model set; calculating the revenue information of each offline model in the first offline model set, and selecting some offline models from the first offline model set to form a second offline model set based on the revenue information; and processing the data to be processed using at least some offline models in the second offline model set. The method can save the waste of computing power and memory, and effectively give play to the advantages of large computing power.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of neural network technology, and in particular to a data processing method, device, electronic equipment and storage medium. Background Art

[0002] With the development and widespread application of artificial intelligence technology, there are more and more high-computing artificial intelligence chips. However, the offline model engines of most chips currently only support fixed batch processing (batchsize). When the number of scenes changes frequently, even if only 1 batchsize of images is sent for forward reasoning, the device will still use high batchsize computing power, which will cause a lot of computing power and memory waste. However, if a low fixed batchsize number is used, the batch benefit of the chip cannot be used, and the advantage of high computing power cannot be effectively exerted per unit time. Summary of the invention

[0003] The present invention provides a data processing method, device, electronic device and storage medium, which can save waste of computing power and memory and effectively give play to the advantages of large computing power.

[0004] To solve the above technical problems, the first technical solution provided by the present invention is: providing a data processing method, including: obtaining a first offline model set; calculating the profit information of each offline model in the first offline model set, and selecting some offline models from the first offline model set to form a second offline model set based on the profit information; using at least some offline models in the second offline model set to process the data to be processed.

[0005] Among them, the step of calculating the benefit information of each offline model in the first offline model set includes: determining the performance benefit, memory benefit, performance weight, and memory weight of each offline model in the first offline model set; determining the scoring information of each offline model based on the performance benefit, memory benefit, performance weight, and memory weight; and determining the benefit information of each offline model based on the scoring information.

[0006] Among them, the rating information is positively correlated with the income information.

[0007] Among them, the method for determining the performance benefit includes: determining the average performance time corresponding to a single batch processing process of the offline model based on the batch processing number of each offline model and the corresponding performance time; determining the performance benefit of the offline model based on the average performance time and the preset performance time corresponding to the preset single batch processing process.

[0008] Among them, the method for determining memory benefits includes: determining the average memory consumption corresponding to a single batch processing process of the offline model based on the batch processing quantity of each offline model and the corresponding memory consumption; determining the memory benefit of the offline model based on the average memory consumption and the preset memory consumption corresponding to the preset single batch processing process.

[0009] Among them, the step of selecting some offline models from the first offline model set to form the second offline model set based on the profit information includes: calculating the profit information of the offline models in the first offline model set one by one, and comparing the profit information of the currently calculated offline model with the profit information of the previous offline model; retaining the offline models with larger profit information to form the second offline model set; wherein, the second offline model set includes at least 1 batch of offline models.

[0010] Among them, the step of retaining the offline model with large profit information to form the second offline model set includes: eliminating the offline model with small profit information; comparing the profit information of the currently calculated offline model with the profit information of the previously retained offline model; retaining the offline model with large profit information.

[0011] The step of using at least some offline models in the second offline model set to process the data to be processed includes: selecting at least one offline model from the second offline model set to perform data processing on the data to be processed at least once.

[0012] In order to solve the above technical problems, the second technical solution provided by the present invention is: to provide a data processing device, including: an acquisition module, used to acquire a first offline model set; a calculation module, used to calculate the profit information of each offline model in the first offline model set, and select some offline models from the first offline model set based on the profit information to form a second offline model set; a processing module, used to use at least some offline models in the second offline model set to process the data to be processed.

[0013] To solve the above technical problems, the third technical solution provided by the present invention is: to provide an electronic device, comprising: a memory and a processor, wherein the memory stores program instructions, and the processor calls the program instructions from the memory to execute any of the above methods.

[0014] In order to solve the above technical problems, the fourth technical solution provided by the present invention is: providing a computer-readable storage medium storing a program file, and the program file can be executed to implement any of the above methods.

[0015] The beneficial effect of the present invention is that, different from the prior art, the present invention calculates the revenue information of the offline model and selects the offline model to process the data to be processed based on the revenue information, which can save the waste of computing power and memory and effectively give play to the advantages of large computing power. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work, among which:

[0017] Figure 1 A schematic diagram of a flow chart of an embodiment of a data processing method of the present invention;

[0018] Figure 2 for Figure 1 A schematic flow chart of an embodiment of step S12;

[0019] Figure 3 for Figure 1 A schematic flow chart of another embodiment of step S12;

[0020] Figure 4 A schematic diagram of the structure of a data processing device according to an embodiment of the present invention;

[0021] Figure 5 It is a structural schematic diagram of an embodiment of an electronic device of the present invention;

[0022] Figure 6 It is a schematic diagram of the structure of an embodiment of a computer-readable storage medium of the present invention. DETAILED DESCRIPTION

[0023] At present, most of the artificial intelligence application scenarios can be simply summarized as target detection and recognition. The number of targets detected in the picture will change greatly with the change of application scenarios. If the neural network always uses an offline network model with a fixed batchsize, a lot of computing resources will be wasted. The present application proposes a dynamic multi-batch model that can dynamically and real-time change the number of batches actually running the forward reasoning engine according to the number of batches specified by the user. Compared with the fixed batch model, the performance will be greatly improved. The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0024] See also Figure 1 , is a flow chart of an embodiment of a data processing method of the present invention, which specifically includes:

[0025] Step S11: Acquire a first offline model set.

[0026] Specifically, multiple fixed batch data batchsize models are obtained, and multiple fixed batch data batchsize models are packaged into a large model to form a first offline model set. In the first offline model set, each model corresponds to batch data, that is, batchsize. In the prior art, taking target detection as an example, if the batchsize required for the data to be processed is 2, if a fixed 16batchsize is used for processing, a lot of resources will be wasted. The method of the present application dynamically selects a model with a suitable batchsize for the data to be processed, which can save resources and achieve optimal performance.

[0027] Step S12: Calculate the revenue information of each offline model in the first offline model set, and select some offline models from the first offline model set to form a second offline model set based on the revenue information.

[0028] Specifically, the revenue information of each offline model is calculated, and based on the revenue information and batch processing information batchsize of the data to be processed, some offline models suitable for the data to be processed are selected from the first offline model set to form a second offline model set.

[0029] For details, please combine Figure 2 , step S12 specifically includes:

[0030] Step S21: Determine the performance benefit, memory benefit, performance weight, and memory weight of each offline model in the first offline model set.

[0031] Calculate the performance benefit, memory benefit, performance weight, and memory weight of each offline model in the first offline model set.

[0032] It should be noted that the performance weight can be set based on experience. Assuming the performance weight is α, the memory weight is 1-α.

[0033] In one embodiment, the method for determining the performance benefit includes: determining the average performance time corresponding to a single batch process of the offline model based on the number of batches of each offline model and the corresponding performance time; determining the performance benefit of the offline model based on the average performance time and the preset performance time corresponding to the preset single batch process. Specifically, assuming that the performance time corresponding to a single batch process (i.e., 1 batch) is 1 ms, and the performance time corresponding to the 2-batch offline model A is 1.8 ms, that is, the average performance time corresponding to each 1 batch of the 2-batch offline model is determined to be 0.9 ms, that is, the performance benefit corresponding to the offline model A is (1-0.9) / 2=0.05. For another example, assuming that the performance time corresponding to the preset single batch process (i.e., 1 batch) is 2 ms, and the performance time corresponding to the 2-batch offline model B is 3 ms, that is, the average performance time corresponding to each 1 batch of the 2-batch offline model is determined to be 1.5 ms, that is, the performance benefit corresponding to the offline model B is (2-1.5) / 2=0.25. For another example, assuming that the performance time corresponding to the preset single batch processing process (that is, 1 batch) is 2ms, and the performance time corresponding to the 2-batch offline model B is 5ms, that is, the average performance time corresponding to each batch of the 2-batch offline model is determined to be 2.5ms, that is, the performance benefit corresponding to the offline model B is (2-2.5) / 2=-0.25, that is, the current 2-batch offline model B cannot generate performance benefits and will be discarded in actual applications.

[0034] The method for determining the memory benefit includes: determining the average memory consumption corresponding to a single batch process of the offline model based on the batch number of each offline model and the corresponding memory consumption; determining the memory benefit of the offline model based on the average memory consumption and the preset memory consumption corresponding to the preset single batch process. Specifically, assuming that the preset memory consumption corresponding to the preset single batch process (that is, 1 batch) is 10M, and the memory consumption corresponding to the 2-batch offline model A is 24M, that is, the average memory consumption corresponding to each 1 batch of the 2-batch offline model is determined to be 12M, and the corresponding memory benefit is (10-12) / 10=-0.2, that is, the 2-batch offline model A consumes more memory resources per 1 batch than the preset 1 batch. For another example, assuming that the preset memory consumption corresponding to a single batch processing process (that is, 1 batch) is 10M, and the memory consumption corresponding to the 2-batch offline model A is 16M, that is, the average memory consumption corresponding to each batch of the 2-batch offline model is determined to be 8M, and the corresponding memory benefit is (10-8) / 10=0.2, that is, the 2-batch offline model A consumes less memory resources per batch than the preset 1 batch.

[0035] Step S22: Determine the scoring information of each offline model based on the performance benefit, memory benefit, performance weight, and memory weight.

[0036] Specifically, the scoring information of each offline model is determined using the following formula:

[0037] score[i]=α*b[i]+(1-α)*m[i];

[0038] Among them, score[i] is the score information of the i-th offline model, α is the performance weight, (1-α) is the memory weight, b[i] is the performance benefit of the i-th offline model, and m[i] is the memory benefit of the i-th offline model.

[0039] Step S23: Determine the revenue information of each offline model based on the scoring information.

[0040] After the score information of each offline model is determined, the revenue information of each offline model is determined based on the score information.

[0041] In one embodiment, the score information is positively correlated with the revenue information, that is, the higher the score information, the greater the revenue information; and the lower the score information, the lower the revenue information.

[0042] Specifically, assume that the performance weight of the 2batch offline model 1 is 0.6, the memory weight is 0.4, the performance benefit is 0.25, and the memory benefit is 0.2. The performance benefit of 0.25 indicates that the performance of the 2batch offline model 1 is improved by 25% compared with the 1batch; the memory benefit of 0.2 indicates that the memory of the 2batch offline model 1 is optimized by 20% compared with the 1batch. Then the score information of the 2batch offline model 1 is score=0.6×(1+25%)+0.4×(1+20%)=1.23, while the score information of the 1batch offline model is score=0.6×1+0.4×1=1. The score information of the 2batch offline model 1 is greater than the score information of the 1batch offline model, indicating that the benefit information of the 2batch offline model 1 is greater than the benefit information of the 1batch offline model, and the 2batch offline model 1 is retained. In another embodiment, assume that the performance weight of the 2batch offline model 1 is 0.6, the memory weight is 0.4, the performance benefit is -0.25, and the memory benefit is 0.2. The performance gain of -0.25 indicates that the performance of 2batch offline model 1 is 25% lower than that of 1batch; the memory gain of 0.2 indicates that the memory of 2batch offline model 1 is 20% better than that of 1batch. Then the score information of 2batch offline model 1 is score=0.6×(1-25%)+0.4×(1+20%)=0.93, while the score information of 1batch offline model is score=0.6×1+0.4×1=1. The score information of 2batch offline model 1 is less than that of 1batch offline model, which means that the benefit information of 2batch offline model 1 is less than that of 1batch offline model, and 2batch offline model 1 is discarded.

[0043] For details, please combine Figure 3 The step of selecting some offline models from the first offline model set to form a second offline model set based on the revenue information includes:

[0044] Step S31: Calculate the revenue information of the offline models in the first offline model set one by one, and compare the revenue information of the currently calculated offline model with the revenue information of the previous offline model.

[0045] Step S32: retain the offline models with large revenue information to form a second offline model set.

[0046] Specifically, offline models with small profit information are eliminated; the profit information of the currently calculated offline model is compared with the profit information of the previously retained offline model; and the offline model with large profit information is retained.

[0047] In one embodiment, assuming that the first offline model set includes offline models of 1batch, 2batch, 4batch, 6batch, 8batch, 10batch, 12batch, 14batch, and 16batch, the revenue information corresponding to the offline model of 1batch is first determined; then the revenue information of the offline model of 2batch is calculated, if the revenue information of the offline model of 2batch is better than the revenue information corresponding to the offline model of 1batch, the offline model of 2batch is retained, otherwise the offline model of 2batch is eliminated; further, the revenue information of the offline model of 4batch is calculated, if the revenue information of the offline model of 4batch is better than the revenue information corresponding to the previously saved offline model (if the offline model of 2batch is retained, the revenue of the offline model of 4batch is compared with that of the offline model of 2batch), the offline model of 4batch is retained, otherwise the offline model of 4batch is eliminated; until the revenue information of the offline model of 16batch is calculated and compared with the previously saved offline model.

[0048] Specifically, assuming that the weight of the performance benefit is 0.6 and the weight of the memory benefit is 0.4, assuming that the performance benefit corresponding to 1batch is 1 and the memory benefit corresponding to 1batch is 1, then the resources consumed by 1batch are 1×0.6+0.4×1=1, the performance benefit corresponding to 2batch is 0.2, and the memory benefit corresponding to 2batch is -0.2, then the benefit information of 2batch is (1+0.2)×0.6+0.4×(1-0.2)=1.04, that is, 2batch has an overall benefit relative to 1batch, so 2batch is retained.

[0049] It can be understood that the second offline model set includes at least 1 batch of offline models.

[0050] Step S13: using at least part of the offline models in the second offline model set to process the data to be processed.

[0051] Through the above method, the offline model with the highest benefit has been selected from the first offline model set, and the second offline model set has been obtained. At least part of the offline models are selected from the second offline model set to process the data to be processed.

[0052] In one embodiment, it is assumed that the second offline model set that is ultimately retained is 1batch, 2batch, 4batch, and 8batch; if the data to be processed input by the user is 10batch data, the 8batch+2batch offline model is first selected to process the data to be processed; if the data to be processed input by the user is 7batch data, the 4batch+2batch+1batch offline model is first selected to process the data to be processed.

[0053] It can be understood that if the data to be processed input by the user is 7 batches of data, then the largest batch not larger than 7 batches is selected from the second offline model set. According to the offline models of 1 batch, 2 batches, 4 batches, and 8 batches in the second offline model set, the largest batch is 4 batches. After being processed by the 4 batch offline model, the data to be processed becomes 3 batches. At this time, a larger batch not larger than 3 batches, that is, 2 batches, is further selected from the second offline model set. After being processed by the 2 batch offline model, the data to be processed becomes 1 batch. At this time, the 1 batch offline model is selected for processing. After being processed by the 1 batch offline model, the data to be processed becomes 0, which means that all data processing is completed. Therefore, the 7 batches of data to be processed can be segmented and processed using the 4 batch + 2 batch + 1 batch offline model to improve data processing efficiency.

[0054] The technical solution designed in this application can take advantage of large computing power, effectively improve the utilization of computing resources, and reduce the memory consumption of the neural network offline model. Using the method proposed in this case, more algorithm services can be run on the same edge device, improving the cost-effectiveness of the device.

[0055] See also Figure 4 , is a structural diagram of an embodiment of a data processing device of the present invention, which specifically includes: an acquisition module 41, a calculation module 42 and a processing module 43.

[0056] The acquisition module 41 is used to acquire the first offline model set.

[0057] The calculation module 42 is used to calculate the revenue information of each offline model in the first offline model set, and select some offline models from the first offline model set to form a second offline model set based on the revenue information.

[0058] In one embodiment, the calculation module 42 is used to determine the performance benefit, memory benefit, performance weight, and memory weight of each offline model in the first offline model set. The method for determining the performance benefit includes: determining the average performance time corresponding to a single batch process of the offline model based on the batch number and the corresponding performance time of each offline model; determining the performance benefit of the offline model based on the average performance time and the preset performance time corresponding to the preset single batch process. Specifically, assuming that the performance time corresponding to the preset single batch processing process (that is, 1 batch) is 1ms, and the performance time corresponding to the 2-batch offline model A is 1.8ms, it is determined that the average performance time corresponding to each batch of the 2-batch offline model is 0.9ms, that is, the performance benefit corresponding to the offline model A is (1-0.9) / 2=0.05; for another example, assuming that the performance time corresponding to the preset single batch processing process (that is, 1 batch) is 2ms, and the performance time corresponding to the 2-batch offline model B is 3ms, that is, the average performance time corresponding to each batch of the 2-batch offline model is 1.5ms, that is, the performance benefit corresponding to the offline model B is (2-1.5) / 2=0.25. For another example, assuming that the performance time corresponding to the preset single batch processing process (that is, 1 batch) is 2ms, and the performance time corresponding to the 2batch offline model B is 5ms, that is, the average performance time corresponding to each batch of the 2batch offline model is determined to be 2.5ms, that is, the performance benefit corresponding to the offline model B is (2-2.5) / 2=-0.25, that is, the current 2batch offline model B cannot generate performance benefits, and in actual applications, it will be abandoned.

[0059] The method for determining the memory benefit includes: determining the average memory consumption corresponding to a single batch process of the offline model based on the batch number of each offline model and the corresponding memory consumption; determining the memory benefit of the offline model based on the average memory consumption and the preset memory consumption corresponding to the preset single batch process. Specifically, assuming that the preset memory consumption corresponding to the preset single batch process (that is, 1 batch) is 10M, and the memory consumption corresponding to the 2-batch offline model A is 24M, that is, the average memory consumption corresponding to each 1 batch of the 2-batch offline model is determined to be 12M, and the corresponding memory benefit is (10-12) / 10=-0.2, that is, the 2-batch offline model A consumes more memory resources per 1 batch than the preset 12 batches. For another example, assuming that the preset memory consumption corresponding to a single batch processing process (that is, 1 batch) is 10M, and the memory consumption corresponding to the 2-batch offline model A is 16M, that is, the average memory consumption corresponding to each batch of the 2-batch offline model is determined to be 8M, and the corresponding memory benefit is (10-8) / 10=0.2, that is, the 2-batch offline model A consumes less memory resources per batch than the preset 1 batch.

[0060] In one embodiment, the performance weight may be set based on experience. Assuming the performance weight is α, the memory weight is 1-α.

[0061] The calculation module 42 is used to determine the score information of each offline model based on the performance benefit, the memory benefit, the performance weight, and the memory weight. Specifically, the calculation module 42 determines the score information of each offline model using the following formula:

[0062] score[i]=α*b[i]+(1-α)*m[i];

[0063] Among them, score[i] is the score information of the i-th offline model, α is the performance weight, (1-α) is the memory weight, b[i] is the performance benefit of the i-th offline model, and m[i] is the memory benefit of the i-th offline model.

[0064] The calculation module 42 is used to determine the revenue information of each offline model based on the score information. In one embodiment, the score information is positively correlated with the revenue information. That is, the higher the score information, the greater the revenue information; and the lower the score information, the lower the revenue information.

[0065] Specifically, assume that the performance weight of the 2batch offline model 1 is 0.6, the memory weight is 0.4, the performance benefit is 0.25, and the memory benefit is 0.2. The performance benefit of 0.25 indicates that the performance of the 2batch offline model 1 is improved by 25% compared with the 1batch; the memory benefit of 0.2 indicates that the memory of the 2batch offline model 1 is optimized by 20% compared with the 1batch. Then the score information of the 2batch offline model 1 is score=0.6×(1+25%)+0.4×(1+20%)=1.23, while the score information of the 1batch offline model is score=0.6×1+0.4×1=1. The score information of the 2batch offline model 1 is greater than the score information of the 1batch offline model, indicating that the benefit information of the 2batch offline model 1 is greater than the benefit information of the 1batch offline model, and the 2batch offline model 1 is retained. In another embodiment, assume that the performance weight of the 2batch offline model 1 is 0.6, the memory weight is 0.4, the performance benefit is -0.25, and the memory benefit is 0.2. The performance gain of -0.25 indicates that the performance of 2batch offline model 1 is 25% lower than that of 1batch; the memory gain of 0.2 indicates that the memory of 2batch offline model 1 is 20% better than that of 1batch. Then the score information of 2batch offline model 1 is score=0.6×(1-25%)+0.4×(1+20%)=0.93, while the score information of 1batch offline model is score=0.6×1+0.4×1=1. The score information of 2batch offline model 1 is less than that of 1batch offline model, which means that the benefit information of 2batch offline model 1 is less than that of 1batch offline model, and 2batch offline model 1 is discarded.

[0066] In one embodiment, the calculation module 42 is further used to calculate the revenue information of the offline models in the first offline model set one by one, and compare the revenue information of the currently calculated offline model with the revenue information of the previous offline model.

[0067] The calculation module 42 is also used to retain the offline models with large revenue information to form the second offline model set.

[0068] Specifically, the offline model with small profit information is eliminated; the profit information of the offline model currently calculated is compared with the profit information of the offline model previously retained; and the offline model with large profit information is retained.

[0069] In one embodiment, assuming that the first offline model set includes offline models of 1batch, 2batch, 4batch, 6batch, 8batch, 10batch, 12batch, 14batch, and 16batch, the revenue information corresponding to the offline model of 1batch is first determined; then the revenue information of the offline model of 2batch is calculated, if the revenue information of the offline model of 2batch is better than the revenue information corresponding to the offline model of 1batch, the offline model of 2batch is retained, otherwise the offline model of 2batch is eliminated; further, the revenue information of the offline model of 4batch is calculated, if the revenue information of the offline model of 4batch is better than the revenue information corresponding to the previously saved offline model (if the offline model of 2batch is retained, the revenue of the offline model of 4batch is compared with that of the offline model of 2batch), the offline model of 4batch is retained, otherwise the offline model of 4batch is eliminated; until the revenue information of the offline model of 16batch is calculated and compared with the previously saved offline model.

[0070] Specifically, assuming that the weight of the performance benefit is 0.6 and the weight of the memory benefit is 0.4, assuming that the performance benefit corresponding to 1batch is 1 and the memory benefit corresponding to 1batch is 1, then the resources consumed by 1batch are 1×0.6+0.4×1=1, the performance benefit corresponding to 2batch is 0.2, and the memory benefit corresponding to 2batch is -0.2, then the benefit information of 2batch is (1+0.2)×0.6+0.4×(1-0.2)=1.04, that is, 2batch has an overall benefit relative to 1batch, so 2batch is retained.

[0071] It can be understood that the second offline model set includes at least 1 batch of offline models.

[0072] The processing module 43 is used to process the data to be processed using at least some of the offline models in the second offline model set.

[0073] Through the above method, the offline model with the highest benefit has been selected from the first offline model set, and the second offline model set has been obtained. The processing module 43 selects at least part of the offline models from the second offline model set to process the data to be processed.

[0074] In one embodiment, it is assumed that the second offline model set that is ultimately retained is 1batch, 2batch, 4batch, and 8batch; if the data to be processed input by the user is 10batch data, the 8batch+2batch offline model is first selected to process the data to be processed; if the data to be processed input by the user is 7batch data, the 4batch+2batch+1batch offline model is first selected to process the data to be processed.

[0075] It can be understood that if the data to be processed input by the user is 7 batches of data, then the largest batch not larger than 7 batches is selected from the second offline model set. According to the offline models of 1 batch, 2 batches, 4 batches, and 8 batches in the second offline model set, the largest batch is 4 batches. After being processed by the 4 batch offline model, the data to be processed becomes 3 batches. At this time, a larger batch not larger than 3 batches, that is, 2 batches, is further selected from the second offline model set. After being processed by the 2 batch offline model, the data to be processed becomes 1 batch. At this time, the 1 batch offline model is selected for processing. After being processed by the 1 batch offline model, the data to be processed becomes 0, which means that all data processing is completed. Therefore, the 7 batches of data to be processed can be segmented and processed using the 4 batch + 2 batch + 1 batch offline model to improve data processing efficiency.

[0076] The technical solution designed in this application can take advantage of large computing power, effectively improve the utilization of computing resources, and reduce the memory consumption of the neural network offline model. Using the method proposed in this case, more algorithm services can be run on the same edge device, improving the cost-effectiveness of the device.

[0077] See also Figure 5 , is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention, the electronic device includes a memory 202 and a processor 201 connected to each other.

[0078] The memory 202 is used to store program instructions for implementing any one of the above methods.

[0079] The processor 201 is used to execute program instructions stored in the memory 202 .

[0080] The processor 201 may also be referred to as a CPU (Central Processing Unit). The processor 201 may be an integrated circuit chip having signal processing capabilities. The processor 201 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0081] The memory 202 can be a memory stick, a TF card, etc., which can store all the information in the electronic device of the device, including the input raw data, computer programs, intermediate motion results and final motion results are all stored in the memory. It stores and retrieves information according to the location specified by the controller. Only with the memory can the electronic device have a memory function and ensure normal operation. The memory of the electronic device can be divided into main memory (internal memory) and auxiliary memory (external memory) according to its use, and there is also a classification method of dividing it into external memory and internal memory. External memory is usually a magnetic medium or an optical disk, etc., which can store information for a long time. Memory refers to the storage component on the motherboard, which is used to store the data and programs currently being executed, but it is only used to temporarily store programs and data. If the power is turned off or the power is cut off, the data will be lost.

[0082] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0083] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0084] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0085] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a system server, or a network device, etc.) or a processor to execute all or part of the steps of the various implementation methods of the present application.

[0086] See also Figure 6 , which is a schematic diagram of the structure of the computer-readable storage medium of the present invention. The storage medium of the present application stores a program file 203 that can implement all the above methods, wherein the program file 203 can be stored in the above storage medium in the form of a software product, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of each implementation method of the present application. The aforementioned storage device includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, etc., which can store program codes, or terminal devices such as computers, servers, mobile phones, and tablets.

[0087] The above are only implementation modes of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A data processing method, characterized in that: include: Acquire a first offline model set, where the first offline model set includes multiple fixed batch data batchsize models; Calculate the profit information of each offline model in the first offline model set, and select some of the offline models from the first offline model set to form a second offline model set based on the profit information, the profit information of each offline model is determined based on the performance profit and memory profit of each offline model, the performance profit of the offline model is determined based on the average performance time corresponding to a single batch processing process of the offline model and the preset performance time corresponding to a preset single batch processing process; the memory profit of the offline model is determined based on the average memory consumption corresponding to a single batch processing process of the offline model and the preset memory consumption corresponding to a preset single batch processing process; The data to be processed is processed using at least part of the offline models in the second offline model set.

2. The data processing method according to claim 1, characterized in that: The step of calculating the revenue information of each offline model in the first offline model set includes: Determine the performance benefit, memory benefit, performance weight, and memory weight of each offline model in the first offline model set; Determine scoring information of each offline model based on the performance benefit, the memory benefit, the performance weight, and the memory weight; The revenue information of each of the offline models is determined based on the scoring information.

3. The data processing method according to claim 2, characterized in that: The rating information is positively correlated with the revenue information.

4. The data processing method according to claim 2, characterized in that: The method for determining the performance benefit includes: Determine the average performance time corresponding to a single batch processing process of the offline model based on the batch processing quantity and the corresponding performance time of each offline model; The performance benefit of the offline model is determined based on the average performance time and a preset performance time corresponding to a preset single batch processing process.

5. The data processing method according to claim 2, characterized in that: The method for determining the memory benefit includes: Determine the average memory consumption corresponding to a single batch processing process of the offline model based on the batch processing quantity and the corresponding memory consumption of each offline model; The memory benefit of the offline model is determined based on the average memory consumption and a preset memory consumption corresponding to a preset single batch process.

6. The data processing method according to claim 1, characterized in that: The step of selecting part of the offline models from the first offline model set to form a second offline model set based on the revenue information includes: Calculating the revenue information of the offline models in the first offline model set one by one, and comparing the revenue information of the offline model currently calculated with the revenue information of the previous offline model; The offline models with large revenue information are retained to form the second offline model set; The second offline model set includes at least 1 batch of offline models.

7. The data processing method according to claim 6, characterized in that: The step of retaining the offline model with large revenue information to form the second offline model set comprises: Eliminate the offline model with small revenue information; Comparing the currently calculated revenue information of the offline model with the previously retained revenue information of the offline model; The offline model retains the large benefit information.

8. The data processing method according to claim 6, characterized in that: The step of processing the data to be processed by using at least part of the offline models in the second offline model set includes: At least one offline model is selected from the second offline model set to perform data processing on the data to be processed at least once.

9. A data processing device, characterized in that: include: An acquisition module, configured to acquire a first offline model set, wherein the first offline model set includes a plurality of fixed batch data batchsize models; A calculation module, used to calculate the benefit information of each offline model in the first offline model set, and select some of the offline models from the first offline model set to form a second offline model set based on the benefit information, wherein the benefit information of each offline model is determined based on the performance benefit and memory benefit of each offline model, and the performance benefit of the offline model is determined based on the average performance time corresponding to a single batch processing process of the offline model and the preset performance time corresponding to a preset single batch processing process; the memory benefit of the offline model is determined based on the average memory consumption corresponding to a single batch processing process of the offline model and the preset memory consumption corresponding to a preset single batch processing process; The processing module is used to process the data to be processed by using at least part of the offline models in the second offline model set.

10. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: A program file is stored, and the program file can be executed to implement the method according to any one of claims 1 to 8.