Model training method, device and system and storage medium
通过在大模型训练中,利用云端服务器和边缘侧设备协同工作的方法,解决了边缘侧设备算力不足和数据泄露的问题,提高了模型训练效果和适配性,并保障了数据安全。
Patent Information
- Application Number
- CN202411304404.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-03
AI Technical Summary
During the training of large models, the computing resources of edge devices are limited and cannot support training. There is a risk of data leakage when transmitting data to cloud servers.
By working together between edge-side devices and cloud servers, iterative training is performed using the high-performance computing resources of cloud servers, obtaining model processing results and further training on edge-side devices, avoiding data uploads, and making full use of edge-side devices. Computing resources.
Improve the model training effect, avoid overfitting, enhance model adaptability, ensure data security, and realize full utilization of cloud and edge resources.
Smart Images

Figure CN119250229A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a model training method, device, system and storage medium. Background Art
[0002] With the good performance of large models in natural language processing, computer vision, recommendation systems, etc., the research on large models has become a hot topic.
[0003] The training process of large models usually requires the support of high-performance computing resources. In actual applications, the data required for the training of large models is usually distributed on edge devices, but the computing resources that edge devices can provide are limited and cannot support the training of large models. In some cases, enterprises will also transfer data to cloud servers to complete the training of large models on cloud servers. Since data needs to be transferred to cloud servers, this process will generate the risk of data leakage. Summary of the invention
[0004] The present application provides a model training method, device, system and storage medium, which can fully utilize the computing resources of cloud servers and edge devices, without uploading data to cloud servers, thus avoiding data leakage.
[0005] In order to achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, the present application provides a model training method, which is applied to an edge device, and the method includes:
[0007] The model processing result obtained by processing the business data sample of the edge side device by the first model is obtained; the first model is trained based on the cloud server; based on the business data sample, the model processing result and the label of the business data sample, the initial model is iteratively trained to obtain the second model, and the second model is used to process the business data of the edge side device.
[0008] In combination with the first aspect, in a possible implementation, based on the business data sample, the model processing result, and the label of the business data sample, the initial model is iteratively trained to obtain the second model, including:
[0009] In any iteration, the business data sample is input into the model obtained in the previous iteration to obtain the model training result of this iteration; based on the model training result, the model processing result and the label of the business data sample, the first gradient value is determined; the model parameters of the model are updated based on the first gradient value; in response to the end of the iterative training, the model obtained by the iterative training is obtained as the second model.
[0010] In combination with the first aspect above, in a possible implementation, the first model includes a first sub-model and a second sub-model, the first sub-model is deployed on an edge device; the second sub-model is deployed on a cloud server; and obtaining a model processing result obtained by processing a business data sample of the edge device by the first model includes:
[0011] The business data sample is processed based on the first sub-model to obtain a first processing result, and the first processing result is sent to the cloud server; and a model processing result is obtained by processing the first processing result by the second sub-model of the cloud server.
[0012] In combination with the first aspect, in a possible implementation, the first model includes a first sub-model and a second sub-model, and both the first sub-model and the second sub-model are deployed on an edge side device; obtaining a model processing result obtained by processing a business data sample of the edge side device by the first model includes:
[0013] The business data sample is processed based on the first sub-model to obtain a first processing result; the first processing result is processed based on the second sub-model to obtain a model processing result.
[0014] In combination with the first aspect above, in a possible implementation manner, the second sub-model is obtained by iterative training by the edge device and the cloud server based on the business data sample and the label of the business data sample; the method also includes:
[0015] In any iteration, the model training results are received from the cloud server; based on the model training results of this iteration and the labels of the business data samples, a second gradient value is determined; the second gradient value is sent to the cloud server, and the second gradient value is used to update the model parameters of the model obtained in the previous iteration.
[0016] In combination with the above first aspect, in a possible implementation manner, the order of magnitude of parameters of the second model is smaller than the order of magnitude of parameters of the first model.
[0017] Based on the above technical solution, the model training method provided by the present application, by using the high-performance computing resources of the cloud server, the training effect of the first model obtained by iterative training is good, the model processing result obtained after processing based on the first model can better characterize the characteristics of the business data sample, and the edge side device can increase the data reference amount for the training process of the second model by obtaining the model processing result, improve the model learning ability, and avoid the phenomenon of overfitting in the model training process. By training the second model on the edge side device, the computing resources of the edge side device can be fully utilized, and the computing resources of the cloud server and the computing resources of the edge side device are fully utilized; the second model obtained by training based on the business data sample, the model processing result and the label of the business data sample can adapt to the differences in data between different edge side devices, thereby improving the accuracy of the model. Through this model training method, there is no need to upload the business data sample to the cloud server, and data security can be guaranteed during the model training process to avoid data leakage.
[0018] In a second aspect, the present application provides a model training method, which is applied to a cloud server, and the method includes:
[0019] The first model is obtained based on cloud server training. The first model is used to process the business data samples of the edge side device to obtain the model processing result. The model processing result is used to iteratively train the initial model to obtain the second model. The second model is used to process the business data of the edge side device.
[0020] In combination with the above-mentioned second aspect, in a possible implementation manner, after obtaining the first model based on training on the cloud server, the method includes: sending the model processing result to the edge side device.
[0021] In combination with the above second aspect, in a possible implementation manner, the first model includes a first sub-model and a second sub-model, the first sub-model is deployed on an edge device; the second sub-model is deployed on a cloud server; after the first model is obtained through training on the cloud server, the method includes:
[0022] The second sub-model is sent to the edge side device. The second sub-model is used to process the first processing result to obtain a model processing result. The first processing result is obtained by the edge side device processing the business data sample based on the first sub-model.
[0023] In combination with the above second aspect, in a possible implementation, the first model includes a first sub-model and a second sub-model, the first sub-model is deployed on an edge device; the second sub-model is deployed on a cloud server; and the training process of the second sub-model includes:
[0024] Receive a first processing result obtained by an edge side device through processing a business data sample based on a first sub-model; iteratively train the initial sub-model based on the first processing result and the label of the business data sample; wherein, in any iteration, input the first processing result into the model obtained in the previous iteration to obtain the model training result of this iteration, and send the model training result to multiple edge side devices; receive multiple second gradient values determined by multiple edge side devices based on the model training results and the label of the business data sample; update the model parameters of the model based on the multiple second gradient values; in response to the end of the iterative training, obtain the model obtained by the iterative training as the second sub-model.
[0025] In combination with the second aspect, in a possible implementation manner, updating a model parameter of the model based on multiple second gradient values includes:
[0026] Aggregation processing is performed on the multiple second gradient values to obtain aggregated second gradient values; and model parameters of the model are updated based on the aggregated second gradient values.
[0027] Based on the above technical scheme, the model training method provided by the present application, by making use of the high-performance computing power resources of the cloud server, the first model obtained by iterative training has good training effect, can improve the accuracy of the model, and the model processing result obtained after processing based on the first model can better characterize the characteristics of the business data sample, and can increase the data reference amount for the subsequent training of the second model in the edge side device, thereby improving the accuracy of the model and realizing the full utilization of the computing power resources of the cloud server and the computing power resources of the edge side device.
[0028] In a third aspect, the present application provides a model training device, which is located on an edge device and includes:
[0029] An acquisition unit is used to acquire a model processing result obtained by processing a business data sample of an edge device by a first model; the first model is obtained based on training of a cloud server;
[0030] The first training unit is used to iteratively train the initial model based on the business data samples, the model processing results and the labels of the business data samples to obtain the second model, and the second model is used to process the business data of the edge side device.
[0031] In combination with the third aspect, in a possible implementation manner, the first training unit is used to:
[0032] In any iteration, the business data sample is input into the model obtained in the previous iteration to obtain the model training result of this iteration; based on the model training result, the model processing result and the label of the business data sample, the first gradient value is determined; the model parameters of the model are updated based on the first gradient value; in response to the end of the iterative training, the model obtained by the iterative training is obtained as the second model.
[0033] In combination with the third aspect, in a possible implementation, the first model includes a first sub-model and a second sub-model, the first sub-model is deployed on an edge device; the second sub-model is deployed on a cloud server; and the acquisition unit is used to:
[0034] The business data sample is processed based on the first sub-model to obtain a first processing result, and the first processing result is sent to the cloud server; and a model processing result is obtained by processing the first processing result by the second sub-model of the cloud server.
[0035] In combination with the third aspect, in a possible implementation manner, the first model includes a first sub-model and a second sub-model, and the first sub-model and the second sub-model are both deployed on an edge-side device; and the acquisition unit is used to:
[0036] The business data sample is processed based on the first sub-model to obtain a first processing result; the first processing result is processed based on the second sub-model to obtain a model processing result.
[0037] In combination with the third aspect, in a possible implementation, the second sub-model is obtained by iterative training by the edge device and the cloud server based on the business data sample and the label of the business data sample; the device also includes:
[0038] A receiving unit is used to receive the model training results from the cloud server in any iteration; a determining unit is used to determine the second gradient value based on the model training results of this iteration and the label of the business data sample; a first sending unit is used to send the second gradient value to the cloud server, and the second gradient value is used to update the model parameters of the model obtained in the previous iteration.
[0039] In combination with the third aspect above, in a possible implementation manner, the order of magnitude of parameters of the second model is smaller than the order of magnitude of parameters of the first model.
[0040] In a fourth aspect, the present application provides a model training device, which is located in a cloud server and includes:
[0041] The second training unit is used to obtain a first model based on cloud server training. The first model is used to process the business data samples of the edge side device to obtain a model processing result; the model processing result is used to iteratively train the initial model to obtain a second model, and the second model is used to process the business data of the edge side device.
[0042] In combination with the fourth aspect above, in a possible implementation, the apparatus further includes: a second sending unit, configured to send the model processing result to an edge side device.
[0043] In combination with the fourth aspect, in a possible implementation, the first model includes a first sub-model and a second sub-model, the first sub-model is deployed on an edge device; the second sub-model is deployed on a cloud server; the device further includes:
[0044] A processing unit is used to send the second sub-model to the edge side device, the second sub-model is used to process the first processing result to obtain a model processing result, and the first processing result is obtained by the edge side device processing the business data sample based on the first sub-model.
[0045] In combination with the fourth aspect, in a possible implementation, the first model includes a first sub-model and a second sub-model, the first sub-model is deployed on an edge device; the second sub-model is deployed on a cloud server; and the second training unit is used for:
[0046] Receive a first processing result obtained by an edge side device through processing a business data sample based on a first sub-model; iteratively train the initial sub-model based on the first processing result and the label of the business data sample; wherein, in any iteration, input the first processing result into the model obtained in the previous iteration to obtain the model training result of this iteration, and send the model training result to multiple edge side devices; receive multiple second gradient values determined by multiple edge side devices based on the model training results and the label of the business data sample; update the model parameters of the model based on the multiple second gradient values; in response to the end of the iterative training, obtain the model obtained by the iterative training as the second sub-model.
[0047] In combination with the fourth aspect, in a possible implementation manner, the second training unit is used to:
[0048] Aggregation processing is performed on the multiple second gradient values to obtain aggregated second gradient values; and model parameters of the model are updated based on the aggregated second gradient values.
[0049] In a fifth aspect, the present application provides a model training device, comprising: a processor and a communication interface; the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement the model training method as described in the first aspect and any possible implementation of the first aspect, or the model training method as described in the second aspect and any possible implementation of the second aspect.
[0050] In a sixth aspect, the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on an edge-side device, the edge-side device executes the model training method described in the first aspect and any possible implementation of the first aspect, or when the instructions are executed on a cloud server, the cloud server executes the model training method described in the second aspect and any possible implementation of the second aspect.
[0051] In the seventh aspect, the present application provides a computer program product comprising instructions, which, when the computer program product is running on an edge-side device, enables the edge-side device to execute the model training method described in the first aspect and any possible implementation of the first aspect, or when the computer program product is running on a cloud server, enables the cloud server to execute the model training method described in the second aspect and any possible implementation of the second aspect.
[0052] In an eighth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement the model training method described in the first aspect and any possible implementation of the first aspect, or to implement the model training method described in the second aspect and any possible implementation of the second aspect.
[0053] Specifically, the chip provided in the present application also includes a memory for storing computer programs or instructions.
[0054] It should be noted that the above computer instructions may be stored in whole or in part on a computer-readable storage medium, wherein the computer-readable storage medium may be packaged together with the processor of the device, or may be packaged separately from the processor of the device, which is not limited in this application.
[0055] In a ninth aspect, the present application provides a model training system, comprising: an edge side device and a cloud server, wherein the cloud server is used to obtain a first model based on cloud server training, and the first model is used to process the business data samples of the edge side device to obtain a model processing result; the edge side device is used to obtain the model processing result obtained by processing the business data samples of the edge side device by the first model; based on the business data samples, the model processing results and the labels of the business data samples, the initial model is iteratively trained to obtain a second model, and the second model is used to process the business data of the edge side device.
[0056] The descriptions of aspects 3 to 9 in the present application may refer to the detailed description of the first aspect, or refer to the detailed description of the second aspect; and the beneficial effects of the descriptions of aspects 3 to 9 may refer to the beneficial effect analysis of the first aspect, or refer to the beneficial effect analysis of the second aspect, which will not be repeated here.
[0057] In this application, the name of the above-mentioned model training device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of this application, they fall within the scope of the claims of this application and their equivalent technologies.
[0058] These and other aspects of the present application will become more apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A schematic diagram of the architecture of a model training method provided in an embodiment of the present application;
[0060] Figure 2 A schematic diagram of the hardware structure of a model training device provided in an embodiment of the present application;
[0061] Figure 3 A flowchart of a model training method provided in an embodiment of the present application;
[0062] Figure 4 A flowchart for obtaining model processing results provided in an embodiment of the present application;
[0063] Figure 5 Another flowchart for obtaining model processing results provided in an embodiment of the present application;
[0064] Figure 6 A flow chart of a first model training method provided in an embodiment of the present application;
[0065] Figure 7 A flow chart of another model training method provided in an embodiment of the present application;
[0066] Figure 8 A schematic diagram of the structure of a model training device provided in an embodiment of the present application;
[0067] Fig. 9 A schematic diagram of the structure of another model training device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0068] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 creative work are within the scope of protection of this application.
[0069] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0070] The terms "first" and "second" and the like in the specification and drawings of this application are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.
[0071] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0072] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0073] In the description of the present application, unless otherwise specified, “plurality” means two or more.
[0074] The emergence of big models has pushed artificial intelligence to a new stage of development, presenting a new development direction with basic big models as the technical foundation and industrial applications as the entry point. Big models perform well in natural language processing, computer vision, recommendation systems, etc. For example, they have demonstrated their application value in daily office work, content creation, customer service Q&A, etc., and are deeply integrated with real economy fields such as industrial manufacturing, medical health, energy, and transportation, empowering the transformation and upgrading of various industries.
[0075] The large model is obtained by training on a large-scale and broad data base, and the final model is a basic model that can adapt to a series of downstream tasks. Generally speaking, the training process of a large model generally includes two stages: stage one: pre-training stage, which is to train the basic large model on a large-scale unlabeled data set. This stage is used to learn general knowledge; stage two: fine-tuning stage, which is to further train the pre-trained basic large model on a data set of a specific task. This stage is used to adapt the large model to a specific task or field.
[0076] In the training process of large models, high-performance computing resources are usually required. In some scenarios, such as automatic inspection in the energy industry, visual inspection in the transportation field, and medical image analysis in the medical industry, scene data and computing resources are scattered in different areas, and scene data is often distributed on various edge devices. If the training process of the large model is completed at the edge device, the edge device needs to provide sufficient computing resources, but the computing resources that the edge device can provide are limited. Especially for some small and medium-sized enterprises, such as in the intelligent customer service scenario, the company's own information facilities are insufficient and it is difficult to provide sufficient computing resources to complete the training of the large model. In the actual application process, some companies will rent cloud servers to solve the problem of insufficient information facilities, and then transfer data to the cloud server. In the cloud server, the data is calculated based on the pre-trained large model to obtain the fine-tuned large model, and then the fine-tuned large model is sent to the edge device for application on the edge device. The large models trained by enterprises in this way are prone to overfitting due to their limited data size. Due to business differences among enterprises, they use different corpora, and the trained large models cannot match the differences in different corpora. In addition, there is a risk of data leakage when uploading data to cloud servers.
[0077] In order to solve the above technical problems, the embodiment of the present application provides a model training method. By using the high-performance computing resources of the cloud server, the first model obtained by iterative training has a good training effect. The model processing result obtained after processing based on the first model can better characterize the characteristics of the business data sample. The edge side device can increase the data reference amount for the training process of the second model by obtaining the model processing result, improve the model learning ability, and avoid overfitting in the model training process. By training the second model on the edge side device, the computing resources of the edge side device can be fully utilized, and the computing resources of the cloud server and the computing resources of the edge side device are fully utilized. The second model obtained by training based on the business data sample, the model processing result and the label of the business data sample can adapt to the differences in data between different edge side devices, thereby improving the accuracy of the model. Through this model training method, there is no need to upload the business data sample to the cloud server, and data security can be guaranteed during the model training process to avoid data leakage.
[0078] The implementation of the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.
[0079] Figure 1 The following is a schematic diagram of the architecture of a model training method provided in an embodiment of the present application. Figure 1 As shown, the architecture includes: an edge-side device 101 and a cloud server 102 .
[0080] The edge side device 101 can be at least one of a desktop computer, a laptop, a virtual reality terminal, an augmented reality terminal, a wireless terminal, a laptop portable computer, a small server, etc., and the embodiment of the present application is not limited to this.
[0081] In some embodiments, the edge-side device 101 may provide a storage function, such as storing business data samples, model processing results, and labels of business data samples.
[0082] In other embodiments, the edge-side device 101 may provide computing functions, such as iteratively training the initial model to obtain a second model.
[0083] In other embodiments, the edge device 101 may provide a communication function, such as a communication function between the edge device 101 and the cloud server 102 .
[0084] It should be noted that the architecture includes multiple edge devices 101, wherein each edge device 101 may include one or more devices, which is not limited in the embodiments of the present application.
[0085] The cloud server 102 may be an independent physical server, or a server cluster or distributed file system composed of multiple physical servers, or at least one of cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, and big data or artificial intelligence platforms, etc., which is not limited in the embodiments of the present application. Of course, the server 102 can also include other functions to provide more comprehensive and diversified services.
[0086] In the embodiment of the present application, the first model can be obtained based on training of the cloud server 102.
[0087] It should be noted that the cloud server 102 can provide higher-performance computing resources than the edge-side device 101, so as to provide the necessary computing power support for model training during the model training process.
[0088] In some embodiments, the process of model training may include: first, training a first model based on the cloud server 102, processing the business data sample of the edge device 101 based on the first model to obtain a model processing result. Then, the edge device 102 obtains the model processing result. Finally, the edge device 102 iteratively trains the initial model based on the business data sample, the model processing result, and the label of the business data sample to obtain a second model.
[0089] The edge device 101 and the cloud server 102 are connected via a communication link. The communication link can be a wired communication link or a wireless communication link, which is not limited in this application.
[0090] When implemented by hardware, the edge device 101 and the cloud server 102 can be integrated into Figure 2 The hardware structure of the model training device shown in FIG. Figure 2 As shown, the basic hardware structure of the model training device is introduced.
[0091] Figure 2 A schematic diagram of the hardware structure of a model training device provided in an embodiment of the present application. Figure 2 As shown, the model training device includes at least one processor 201, a communication line 202, and at least one communication interface 204, and may also include a memory 203. The processor 201, the memory 203 and the communication interface 204 may be connected via the communication line 202.
[0092] The processor 201 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application, such as one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA).
[0093] The communication line 202 is used to transmit information between the above components.
[0094] The communication interface 204 is used to communicate with other devices or communication networks, and can use any transceiver-like device, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.
[0095] The memory 203 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to include or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0096] In one possible design, the memory 203 can exist independently of the processor 201, that is, the memory 203 can be a memory outside the processor 201. In this case, the memory 203 can be connected to the processor 201 through the communication line 202 to store execution instructions or application code, and the processor 201 controls the execution to implement the model training method provided in the following embodiment of the present application. In another possible design, the memory 203 can also be integrated with the processor 201, that is, the memory 203 can be the internal memory of the processor 201. For example, the memory 203 is a cache that can be used to temporarily store some data and instruction information.
[0097] As a possible implementation, the processor 201 may include one or more CPUs, for example Figure 2 As another possible implementation, the model training device may include multiple processors, such as Figure 2 As another possible implementation, the model training apparatus may further include an output device 205 and an input device 206.
[0098] It should be pointed out that the various embodiments of the present application can learn from or refer to each other. For example, the same or similar steps, method embodiments, system embodiments and device embodiments can all refer to each other without limitation.
[0099] Figure 3 A flowchart of a model training method provided in an embodiment of the present application, which can be Figure 1 The cloud server shown in the figure cooperates with the edge device to complete the task. Figure 3 As shown, the method comprises the following steps:
[0100] S301, obtain a first model based on cloud server training.
[0101] Among them, the first model is used to process the business data samples of the edge side device to obtain the model processing results.
[0102] It should be noted that the first model includes a first sub-model and a second sub-model, wherein the first sub-model is deployed on the edge device, and the second sub-model is deployed on the cloud server at the end of the iterative training. After the second sub-model is trained, the second sub-model can be deployed on the cloud server, or the cloud server can send the second sub-model to the edge device, that is, the second sub-model can also be deployed on the edge device.
[0103] In a possible implementation, on a cloud server, the first model is divided into a first sub-model and a second sub-model according to the level. For example, if the first model has 50 layers, the first sub-model may be the first 20 layers of the first model, and the second sub-model may be the last 30 layers of the first model.
[0104] In this way, the computing power resources of the cloud server can be fully utilized. By leveraging the high-performance computing power resources of the cloud server, the training of the first model can be better completed, and the accuracy of the model can be improved.
[0105] S302: The edge side device obtains a model processing result obtained by processing a business data sample of the edge side device with a first model.
[0106] In this way, by obtaining the model processing results, the amount of data reference for the subsequent training of the second model can be increased, the model learning ability can be improved, and thus the accuracy of the model can be improved.
[0107] S303: The edge-side device iteratively trains the initial model based on the business data samples, the model processing results, and the labels of the business data samples to obtain a second model.
[0108] Among them, the second model is used to process the business data of the edge side device.
[0109] In a possible implementation, in the above step S303, the corresponding process in any iterative training may be:
[0110] Step 1: The edge device inputs the business data sample into the model obtained in the previous iteration to obtain the model training result of this iteration.
[0111] Step 2: The edge-side device determines a first gradient value based on the model training results, the model processing results, and the labels of the business data samples.
[0112] Step three: The edge-side device updates the model parameters of the model based on the first gradient value.
[0113] In a possible implementation, in the above step three, the process in which the edge side device updates the model parameters of the model based on the first gradient value may be to process the first gradient value based on a gradient descent algorithm, thereby updating the model parameters of the model.
[0114] It should be noted that when updating the model parameters of the model, all the model parameters of the model may be updated, or part of the model parameters may be updated, which is not limited in the embodiments of the present application.
[0115] Step 4: In response to the completion of the iterative training, the model obtained by the iterative training is obtained as the second model.
[0116] In a possible implementation, the condition for the end of iterative training may be: the number of iterative training is equal to a preset number of iterations, the error between the model prediction value and the true value is less than a preset error value, etc.
[0117] It should be noted that the order of magnitude of the parameters of the second model is smaller than that of the parameters of the first model.
[0118] In this way, the computing power resources of the edge side devices can be fully utilized. By deploying a second model with a smaller parameter magnitude on the edge side devices, it is more adaptable to the deployment requirements of hardware resources of the edge side devices in actual applications. The second model obtained by iterative training based on the business data samples of the edge side devices can adapt to the differences in data of each edge side device, and the accuracy of the model can be further improved through the iterative process.
[0119] The technical solution provided by the embodiment of the present application has good training effect of the first model obtained by iterative training by leveraging the high-performance computing resources of the cloud server. The model processing result obtained after processing based on the first model can better characterize the characteristics of the business data sample. The edge side device can increase the data reference amount for the training process of the second model by obtaining the model processing result, improve the model learning ability, and avoid overfitting in the model training process. By training the second model on the edge side device, the computing resources of the edge side device can be fully utilized, and the computing resources of the cloud server and the computing resources of the edge side device are fully utilized. The second model obtained by training based on the business data sample, the model processing result and the label of the business data sample can adapt to the differences in data between different edge side devices, thereby improving the accuracy of the model. Through this model training method, there is no need to upload the business data sample to the cloud server, and data security can be guaranteed during the model training process to avoid data leakage.
[0120] It should be noted that in the above S302, when the second sub-model is deployed on the edge side device, the edge side device obtains the model processing result based on the second sub-model. This process corresponds to Figure 4 The implementation process shown in FIG. 1 ; when the second sub-model is deployed on the cloud server, the cloud server obtains the model processing result based on the second sub-model, and the cloud server sends the model processing result to the edge device. This process corresponds to Figure 5 The implementation process shown.
[0121] As a possible embodiment of the present application, Figure 4 A flowchart of obtaining model processing results provided in an embodiment of the present application. Figure 4 As shown, the above S302 can also be implemented through the following S401 to S404.
[0122] S401. The cloud server sends the second sub-model to the edge device.
[0123] In this way, by deploying the second sub-model on the edge side device, the computing power resources of the edge side device can be fully utilized.
[0124] S402: The edge-side device receives the second sub-model.
[0125] S403: The edge-side device processes the business data sample based on the first sub-model to obtain a first processing result.
[0126] In this way, by processing business data samples, we can preliminarily reveal the patterns contained in the data samples, reduce the complexity of data calculation, and improve the accuracy of the model.
[0127] S404: The edge-side device processes the first processing result based on the second sub-model to obtain a model processing result.
[0128] In this way, by processing the first processing result, the regularities among the data can be captured more accurately, which helps to improve the accuracy of the model and improve the performance of the model.
[0129] Figure 5 Another flowchart for obtaining model processing results provided in an embodiment of the present application. Figure 5 As shown, the above S302 can also be implemented through the following S501 to S504.
[0130] S501. The edge-side device processes the business data sample based on the first sub-model to obtain a first processing result.
[0131] S502: The edge-side device sends the first processing result to the cloud server.
[0132] S503, the cloud server receives the first processing result, processes the first processing result based on the second sub-model, obtains a model processing result, and sends the model processing result to the edge side device.
[0133] S504: The edge-side device receives the second sub-model of the cloud server and processes the first processing result to obtain a model processing result.
[0134] In this way, by processing the first processing result, the regularities among the data can be captured more accurately, which helps to improve the accuracy of the model and improve the performance of the model.
[0135] like Figure 6 As shown, Figure 6 A flow chart of a first model training method provided in an embodiment of the present application.
[0136] S601. The edge-side device processes the business data sample based on the first sub-model to obtain a first processing result, and sends the first processing result to the cloud server.
[0137] In this way, by processing business data samples, it is possible to simplify the data, reduce the complexity of data calculation, and improve the accuracy of the model.
[0138] S602: The cloud server receives a first processing result obtained by the edge device through processing the business data sample based on the first sub-model.
[0139] It should be noted that what the cloud server receives are the first processing results of multiple edge-side devices.
[0140] In this way, the cloud server receives multiple first processing results, which increases the data scale for subsequent model training and can avoid overfitting.
[0141] S603: The cloud server iteratively trains the initial sub-model based on the first processing result and the labels of the business data samples.
[0142] Among them, in iterative training, the process of any iteration can be:
[0143] Step 1: The cloud server inputs the first processing result into the model obtained in the previous iteration, obtains the model training result of this iteration, and sends the model training result to multiple edge devices.
[0144] Step 2: Each edge device receives the model training results from the cloud server, and determines the second gradient value based on the model training results of this iteration and the labels of the business data samples.
[0145] Step 3: Each edge device sends the second gradient value to the cloud server.
[0146] Step 4: The cloud server receives multiple second gradient values determined by multiple edge devices based on the model training results and the labels of the business data samples.
[0147] Step 5: The cloud server updates the model parameters of the model based on the multiple second gradient values.
[0148] In a possible implementation, in the above step 5, the process in which the cloud server updates the model parameters of the model based on the multiple second gradient values may be:
[0149] 1) The cloud server aggregates the multiple second gradient values to obtain an aggregated second gradient value.
[0150] 2) The cloud server updates the model parameters of the model based on the second gradient value after aggregation processing.
[0151] In another possible implementation, when updating the model parameters of the model, low-rank decomposition methods such as low-rank adaptation (LoRA) and quantized low-rank adaptation (QLoRA) can be used to update the model parameters.
[0152] It should be noted that when the model parameters of the model are updated, all the model parameters may be updated, or part of the model parameters may be updated, which is not limited in the embodiments of the present application.
[0153] In this way, by performing iterative training through the cloud server, with the help of the high-performance computing resources of the cloud server, it is possible to complete calculations with higher complexity, so that the second sub-model after iterative training can have high performance and the effect of model training can be improved, thereby achieving full utilization of the computing resources of the cloud server.
[0154] S604: In response to the completion of the iterative training, the cloud server obtains the model obtained by the iterative training as the second sub-model.
[0155] In a possible implementation, the condition for the end of iterative training may be: the number of iterative training is equal to a preset number of iterations, the error between the model prediction value and the true value is less than a preset error value, etc.
[0156] It should be noted that the second sub-model is obtained through iterative training based on the cloud server, and combined with the first sub-model, it is equivalent to obtaining the first model based on the cloud server training.
[0157] In this way, by setting the end of iterative training, the model can be prevented from falling into an infinite loop, computing time can be saved, and waste of resources can be avoided. By interacting with business data samples of multiple edge devices, the training of the second sub-model can be completed, that is, the training of the first model is completed, which can improve the model accuracy.
[0158] like Figure 7 As shown, Figure 7 Another model training method flow chart provided in an embodiment of the present application, the method comprises the following steps:
[0159] S701. On the cloud server, divide the initial model of the first model into two parts according to the hierarchy, namely the first sub-model and the initial sub-model, and send the first sub-model to the edge side device.
[0160] Among them, the initial model of the first model can be an open source pre-trained large model, such as a large language model (LLaMA), a chat generative language model (ChatGLM), etc.; it can also be a self-designed or self-pretrained large model.
[0161] In a possible implementation, M α Represents the initial model of the first model, with M l Represents the first submodel, with M c Represents the initial submodel.
[0162] S702. The edge-side device processes the business data sample based on the first sub-model to obtain a first processing result, and sends the first processing result to the cloud server.
[0163] In one possible implementation, X i Represents a business data sample, Indicates the first processing result.
[0164] Here, i represents the i-th edge device, i∈[1,N], N is the number of edge devices, and it can be understood that N is a positive integer.
[0165] S703. The cloud server receives the first processing result, and in any iteration, inputs the first processing result into the model obtained in the previous iteration to obtain the model training result of this iteration, and sends the model training result to multiple edge-side devices.
[0166] In a possible implementation, Y i 1 Indicates the model training results obtained after iterative training on the cloud server.
[0167] It should be noted that, in the first iteration process, the first processing result is input into the initial sub-model.
[0168] S704. The edge-side device receives the model training results from the cloud server, determines a first loss value and a second gradient value based on the model training results and the labels of the business data samples, and sends the second gradient value to the cloud server.
[0169] Among them, the first loss value is used to evaluate the error between the model prediction value and the true value. When the first loss value of the edge side device is less than the first preset loss value, the iterative training ends.
[0170] In a possible implementation, a first loss value is obtained by calculation based on the model training result, the label of the business data sample and the following formula (1).
[0171]
[0172] In the formula, represents the first loss value, Y i 1 Represents the model training results, Y i represents the label of the business data sample, and L represents the loss function.
[0173] In a possible implementation, the loss function L used when calculating the first loss value is a cross entropy loss function.
[0174] S705: The cloud server receives multiple second gradient values from multiple edge devices, aggregates the multiple second gradient values to obtain aggregated second gradient values, and processes the aggregated second gradient values based on a gradient descent algorithm to update model parameters of the model.
[0175] In a possible implementation, aggregation processing is performed based on multiple second gradient values and the following formula (2) to obtain an aggregated second gradient value.
[0176]
[0177] In the formula, g 1 represents the second gradient value after aggregation processing, i represents the i-th edge device, N represents the number of edge devices, Represents the second gradient value.
[0178] In a possible implementation, the second gradient value after aggregation is processed based on a gradient descent algorithm and the following formula (3), thereby updating the model parameters of the model.
[0179]
[0180] in, represents the updated model, i.e., the second sub-model, M c represents the initial sub-model, and r1 represents the first learning rate.
[0181] S706. In response to the completion of the iterative training, the cloud server obtains the model obtained by the iterative training as the second sub-model.
[0182] S707: The cloud server sends the second sub-model to the edge device.
[0183] Optionally, the second sub-model can be deployed on a cloud server, and a model processing result can be obtained based on the second sub-model, and the model processing result can be sent to an edge device for subsequent processing; the cloud server can also send the second sub-model to the edge device, and the edge device can obtain the model processing result based on the second sub-model. The embodiment of the present application is described by taking the cloud server sending the second sub-model to the edge device as an example.
[0184] S708. The edge-side device processes the first processing result based on the second sub-model to obtain a model processing result.
[0185] In one possible implementation, Represents the model processing result.
[0186] S709. In any iteration, the edge-side device inputs the business data sample into the model obtained in the previous iteration to obtain the model training result of this iteration.
[0187] It should be noted that in the first iteration, the business data sample is input into the initial model.
[0188] The parameters of the initial model are smaller in magnitude than those of the initial model of the first model.
[0189] In one possible implementation, Indicates the model training result obtained after iterative training of edge devices. Represents the initial model.
[0190] S710. The edge side device determines the second loss value and the first gradient value based on the model training results, the model processing results, and the labels of the business data samples.
[0191] Among them, the second loss value is used to evaluate the error between the model prediction value and the true value. When the second loss value is less than the second preset loss value, the iterative training ends.
[0192] In a possible implementation, a second loss value is obtained by calculation based on the model training result, the model processing result, the label of the business data sample and the following formula (4).
[0193]
[0194] In the formula, represents the second loss value, Represents the model training results, Represents the model processing result, Y i represents the label of the business data sample, and L represents the loss function.
[0195] In one possible implementation, the loss function L for determining the second loss value may be a weighted mixed loss function based on the cross entropy between the model training result and the label of the business data sample, and the relative entropy (Kullback-Leibler divergence) between the model processing result and the model training result.
[0196] It should be noted that the model processing results can be roughly regarded as a label of a business data sample. In this way, the data reference volume can be enriched, the model learning ability can be improved, and thus the model accuracy can be improved.
[0197] S711. The edge-side device updates the model parameters of the model based on the first gradient value.
[0198] In a possible implementation, the first gradient value is processed based on a gradient descent algorithm and the following formula (5), thereby updating the model parameters of the model.
[0199]
[0200] In the formula, represents the updated model, i.e., the second model, represents the initial model, r2 is the second learning rate, Represents the first gradient value.
[0201] S712: In response to the completion of iterative training, the edge-side device obtains the model obtained by the iterative training as a second model.
[0202] During actual use, in each edge-side device, the actually generated business data is input into the second model for calculation to obtain the corresponding output result.
[0203] It should be noted that in order to further ensure the security of data, encryption technology can also be used to ensure the security of data transmission during data interaction between edge devices and cloud servers, such as differential privacy encryption for federated learning and secure multi-party computing.
[0204] The technical solution provided by the embodiment of the present application has good training effect of the first model obtained by iterative training by leveraging the high-performance computing resources of the cloud server. The model processing result obtained after processing based on the first model can better characterize the characteristics of the business data sample. The edge side device can increase the data reference amount for the training process of the second model by obtaining the model processing result, improve the model learning ability, and avoid overfitting in the model training process. By training the second model on the edge side device, the computing resources of the edge side device can be fully utilized, and the computing resources of the cloud server and the computing resources of the edge side device are fully utilized. The second model obtained by training based on the business data sample, the model processing result and the label of the business data sample can adapt to the differences in data between different edge side devices, thereby improving the accuracy of the model. Through this model training method, there is no need to upload the business data sample to the cloud server, and data security can be guaranteed during the model training process to avoid data leakage.
[0205] The above technical solution, through multiple processing of business data samples, can more accurately capture the rules contained in the data, which helps to improve the accuracy of the first model. The second sub-model can be deployed on the edge device or on the cloud server. In actual application, it can be personalized according to the actual application scenario. The second model can learn business data samples of multiple edge devices, and can also adapt to the business data samples of its own edge devices, which can improve the model learning ability and improve the accuracy and performance of the second model. By deploying a second model with a smaller order of magnitude of parameters than the first model on the edge device, it can better adapt to the deployment requirements of hardware resources of the edge device in actual applications.
[0206] The embodiment of the present application can divide the model training device into functional modules or functional units according to the above method example. For example, each functional module or functional unit can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules or functional units. Among them, the division of modules or units in the embodiment of the present application is schematic, which is only a logical function division, and there may be other division methods in actual implementation.
[0207] like Figure 8 , which is a schematic diagram of the structure of a model training device provided in an embodiment of the present application, the device is located on an edge device, and the model training device includes:
[0208] An acquisition unit 801 is used to acquire a model processing result obtained by processing a service data sample of an edge device by a first model; the first model is obtained based on training on a cloud server;
[0209] The first training unit 802 is used to iteratively train the initial model based on the business data samples, the model processing results and the labels of the business data samples to obtain the second model, and the second model is used to process the business data of the edge side device.
[0210] In a possible implementation, the first training unit 802 is used to:
[0211] In any iteration, the business data sample is input into the model obtained in the previous iteration to obtain the model training result of this iteration; based on the model training result, the model processing result and the label of the business data sample, the first gradient value is determined; the model parameters of the model are updated based on the first gradient value; in response to the end of the iterative training, the model obtained by the iterative training is obtained as the second model.
[0212] In a possible implementation, the first model includes a first sub-model and a second sub-model, the first sub-model is deployed on an edge device; the second sub-model is deployed on a cloud server; the acquisition unit 801 is used to:
[0213] The business data sample is processed based on the first sub-model to obtain a first processing result, and the first processing result is sent to the cloud server; and a model processing result is obtained by processing the first processing result by the second sub-model of the cloud server.
[0214] In a possible implementation, the first model includes a first sub-model and a second sub-model, and both the first sub-model and the second sub-model are deployed on an edge-side device; the acquisition unit 801 is used to:
[0215] The business data sample is processed based on the first sub-model to obtain a first processing result; the first processing result is processed based on the second sub-model to obtain a model processing result.
[0216] In a possible implementation, the second sub-model is obtained by iterative training by the edge device and the cloud server based on the business data sample and the label of the business data sample; the device also includes:
[0217] A receiving unit is used to receive the model training results from the cloud server in any iteration; a determining unit is used to determine the second gradient value based on the model training results of this iteration and the label of the business data sample; a first sending unit is used to send the second gradient value to the cloud server, and the second gradient value is used to update the model parameters of the model obtained in the previous iteration.
[0218] In a possible implementation, the order of magnitude of parameters of the second model is smaller than the order of magnitude of parameters of the first model.
[0219] like Fig. 9FIG. 1 is a schematic diagram of the structure of another model training device provided in an embodiment of the present application. The device is located in a cloud server and includes:
[0220] The second training unit 901 is used to obtain a first model based on cloud server training. The first model is used to process the business data samples of the edge side device to obtain a model processing result; the model processing result is used to iteratively train the initial model to obtain a second model, and the second model is used to process the business data of the edge side device.
[0221] In a possible implementation, the apparatus further includes: a second sending unit, configured to send the model processing result to an edge-side device.
[0222] In a possible implementation, the first model includes a first sub-model and a second sub-model, the first sub-model is deployed on an edge device; the second sub-model is deployed on a cloud server; the device also includes:
[0223] A processing unit is used to send the second sub-model to the edge side device, the second sub-model is used to process the first processing result to obtain a model processing result, and the first processing result is obtained by the edge side device processing the business data sample based on the first sub-model.
[0224] In a possible implementation, the first model includes a first sub-model and a second sub-model, the first sub-model is deployed on an edge device; the second sub-model is deployed on a cloud server; and the second training unit 901 is used to:
[0225] Receive a first processing result obtained by an edge side device through processing a business data sample based on a first sub-model; iteratively train the initial sub-model based on the first processing result and the label of the business data sample; wherein, in any iteration, input the first processing result into the model obtained in the previous iteration to obtain the model training result of this iteration, and send the model training result to multiple edge side devices; receive multiple second gradient values determined by multiple edge side devices based on the model training results and the label of the business data sample; update the model parameters of the model based on the multiple second gradient values; in response to the end of the iterative training, obtain the model obtained by the iterative training as the second sub-model.
[0226] In a possible implementation, the second training unit 901 is used to:
[0227] Aggregation processing is performed on the multiple second gradient values to obtain aggregated second gradient values; and model parameters of the model are updated based on the aggregated second gradient values.
[0228] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0229] An embodiment of the present application provides a computer program product comprising instructions. When the computer program product runs on an edge-side device, the edge-side device executes the model training method in the above method embodiment; or when the computer program product runs on a cloud server, the cloud server executes the model training method in the above method embodiment.
[0230] An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on an edge-side device, the edge-side device executes the model training method in the method flow shown in the above method embodiment, or when the instructions are executed on a cloud server, the cloud server executes the model training method in the method flow shown in the above method embodiment.
[0231] Among them, the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read only memory (EPROM), a register, a hard disk, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above, or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). In the embodiments of the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0232] Since the model training device, computer-readable storage medium, and computer program product in the embodiments of the present application can be applied to the above-mentioned method, the technical effects that can be obtained can also refer to the above-mentioned method embodiments, and the embodiments of the present application will not be repeated here.
[0233] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the 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.
[0234] 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 solution of this embodiment.
[0235] 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.
[0236] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A model training method, characterized in that: Applied to edge side equipment, the method includes: Obtaining a model processing result obtained by processing the business data sample of the edge device with a first model; the first model is obtained based on training on a cloud server; Based on the business data samples, the model processing results and the labels of the business data samples, the initial model is iteratively trained to obtain a second model, and the second model is used to process the business data of the edge-side device.
2. The method according to claim 1, characterized in that The iterative training of the initial model based on the business data sample, the model processing result and the label of the business data sample to obtain the second model includes: In any iteration, the business data sample is input into the model obtained in the previous iteration to obtain the model training result of this iteration; based on the model training result, the model processing result and the label of the business data sample, a first gradient value is determined; based on the first gradient value, the model parameters of the model are updated; In response to the completion of the iterative training, the model obtained by the iterative training is obtained as the second model.
3. The method according to claim 1, characterized in that The first model includes a first sub-model and a second sub-model, the first sub-model is deployed on the edge device; the second sub-model is deployed on the cloud server; The obtaining of the model processing result obtained by processing the business data sample of the edge side device by the first model includes: Processing the business data sample based on the first sub-model to obtain a first processing result, and sending the first processing result to the cloud server; The model processing result obtained by processing the first processing result by the second sub-model of the cloud server is received.
4. The method according to claim 1, characterized in that The first model includes a first sub-model and a second sub-model, and the first sub-model and the second sub-model are both deployed on the edge side device; The obtaining of the model processing result obtained by processing the business data sample of the edge side device by the first model includes: Processing the business data sample based on the first sub-model to obtain a first processing result; The first processing result is processed based on the second sub-model to obtain the model processing result.
5. The method according to claim 3 or 4, characterized in that: The second sub-model is obtained by iterative training by the edge device and the cloud server based on the business data sample and the label of the business data sample; The method further comprises: In any iteration, receiving the model training result from the cloud server; determining the second gradient value based on the model training result of this iteration and the label of the business data sample; The second gradient value is sent to the cloud server, and the second gradient value is used to update the model parameters of the model obtained in the previous iteration.
6. The method according to claim 1, characterized in that The order of magnitude of parameters of the second model is smaller than the order of magnitude of parameters of the first model.
7. A model training method, characterized in that: Applied to a cloud server, the method includes: A first model is obtained based on training on the cloud server, and the first model is used to process the business data samples of the edge side device to obtain a model processing result; the model processing result is used to iteratively train the initial model to obtain a second model, and the second model is used to process the business data of the edge side device.
8. The method according to claim 7, characterized in that After the first model is obtained through training based on the cloud server, the method includes: The model processing result is sent to the edge side device.
9. The method according to claim 7, characterized in that: The first model includes a first sub-model and a second sub-model, and the first sub-model is deployed on the edge side device; The second sub-model is deployed on the cloud server; After the first model is obtained through training based on the cloud server, the method includes: The second sub-model is sent to the edge side device, and the second sub-model is used to process the first processing result to obtain the model processing result. The first processing result is obtained by the edge side device processing the business data sample based on the first sub-model.
10. The method according to claim 7, characterized in that The first model includes a first sub-model and a second sub-model, and the first sub-model is deployed on the edge side device; The second sub-model is deployed on the cloud server; The training process of the second sub-model includes: Receiving a first processing result obtained by the edge side device processing the business data sample based on the first sub-model; Based on the first processing result and the label of the business data sample, the initial sub-model is iteratively trained; wherein, in any iteration, the first processing result is input into the model obtained in the previous iteration to obtain the model training result of this iteration, and the model training result is sent to multiple edge-side devices; multiple second gradient values determined by the multiple edge-side devices based on the model training result and the label of the business data sample are received; and the model parameters of the model are updated based on the multiple second gradient values; In response to the completion of the iterative training, the model obtained by the iterative training is obtained as the second sub-model.
11. The method according to claim 10, characterized in that The updating of the model parameters of the model based on the multiple second gradient values comprises: Performing aggregation processing on the multiple second gradient values to obtain an aggregated second gradient value; Based on the second gradient value after the aggregation process, the model parameters of the model are updated.
12. A model training device, characterized in that: The device is located at an edge side device, and the device includes: An acquisition unit is used to acquire a model processing result obtained by processing a business data sample of the edge device by a first model; the first model is obtained based on training of a cloud server; The first training unit is used to iteratively train the initial model based on the business data sample, the model processing result and the label of the business data sample to obtain a second model, and the second model is used to process the business data of the edge side device.
13. A model training device, characterized in that: The device is located in a cloud server and includes: The second training unit is used to obtain a first model based on the cloud server training, and the first model is used to process the business data sample of the edge side device to obtain a model processing result; the model processing result is used to iteratively train the initial model to obtain a second model, and the second model is used to process the business data of the edge side device.
14. A model training system, characterized in that: include: Edge devices and cloud servers; among them, The cloud server is used to obtain a first model based on training of the cloud server, and the first model is used to process the business data sample of the edge device to obtain a model processing result; The edge side device is used to obtain the model processing result obtained by the first model processing the business data sample of the edge side device; based on the business data sample, the model processing result and the label of the business data sample, the initial model is iteratively trained to obtain a second model, and the second model is used to process the business data of the edge side device.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions. When the edge-side device executes the instructions, the edge-side device executes the model training method as described in any one of claims 1 to 6, or when the cloud-side server executes the instructions, the cloud-side server executes the model training method as described in any one of claims 7 to 11.
16. A computer program product, characterized in that The computer program product includes computer instructions, which, when executed on an edge-side device, enable the edge-side device to execute the model training method described in any one of claims 1 to 6, or, when executed on a cloud server, enable the cloud server to execute the model training method described in any one of claims 7 to 11.
