A hierarchical neural network model deployment method and related device
By adopting a hierarchical architecture of training on a central cloud server and deploying on edge servers, the problems of high computational cost and untimely updates for fine-tuning models in various application scenarios are solved, achieving efficient adaptability and accurate deployment of models.
Patent Information
- Application Number
- CN202311160918.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-08
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-09-08
AI Technical Summary
Existing technologies suffer from unstable performance after model deployment in various application scenarios, and fine-tuning requires a large amount of computation and is difficult to update in a timely manner, thus failing to guarantee the accuracy of the model.
The initial scene model is trained and fine-tuned using a global training dataset and a real-time fine-tuning dataset on the cloud central server to generate an optimized scene model. After consistency verification by the edge server, it is deployed to the heterogeneous chip of the edge smart device.
This reduces the computational burden on edge devices, ensures timely model updates and accuracy, and adapts to the performance requirements of various application scenarios.
Smart Images

Figure CN117193797B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of neural network technology, and in particular to a hierarchical neural network model deployment method and related apparatus. Background Technology
[0002] In algorithm model applications, temporal and spatial differences in scenarios are common. Factors such as lighting, environment, and angle cause variations in the data characteristics collected by different smart devices, leading to unstable model performance when deployed in different regions. To better adapt the model to different scenarios, a common approach is to collect data specific to the deployment scenario and use it for optimization training. This allows the model to learn scenario-specific features, thereby improving its performance in that scenario. When, after deployment, it is found that the model performance on the edge smart device degrades and fails to meet the scenario's performance requirements, the model needs to be retrained and redeployed using data collected from that edge device.
[0003] When dealing with a wide variety of scenarios, the workload of fine-tuning each individual algorithm model becomes extremely heavy and consumes a significant amount of computing resources. Moreover, once the model is deployed, it cannot be updated in a timely manner, making it impossible to effectively maintain accuracy. Summary of the Invention
[0004] This application provides a hierarchical neural network model deployment method and related apparatus to solve the technical problem that existing optimization models have a large amount of computational burden for fine-tuning in various application scenarios, and are difficult to update in a timely manner after deployment, thus failing to ensure the accuracy of the model.
[0005] In view of this, the first aspect of this application provides a method for deploying a hierarchical neural network model, comprising:
[0006] On the cloud central server, a global training dataset and a real-time fine-tuning dataset are used to train and fine-tune different initial scene models to obtain a variety of optimized scene models;
[0007] After receiving the model request information from the edge server, a model file is generated based on the optimized scene model and distributed to the edge server. The model request information includes scene identifier and device information.
[0008] The edge server performs consistency verification on the applicable scenario model in the model file, and after the verification is passed, the applicable scenario model is deployed to the heterogeneous chip of the edge smart device according to the smart device information.
[0009] Preferably, the process of training and fine-tuning different initial scene models on a cloud-based central server using a global training dataset and a real-time fine-tuning dataset yields a variety of optimized scene models, including:
[0010] The initial scene model is trained on a global training dataset on a cloud central server to obtain a variety of general scene models.
[0011] The cloud-based central server collects different scene datasets from the edge smart devices to obtain real-time fine-tuning datasets;
[0012] The general scenario model is fine-tuned using the real-time fine-tuning dataset to obtain various optimized scenario models.
[0013] Preferably, after receiving the model request information from the edge server, a model file is generated based on the optimized scene model and distributed to the edge server. The model request information includes scene identifier and device information, including:
[0014] After receiving the model request information from the edge server, an applicable scenario model is selected for each edge server from a variety of optimized scenario models based on the model request information. The model request information includes scenario identifier and device information.
[0015] After generating model files from the applicable scenario model, the models are distributed to each of the edge servers. The model files include the size and format of the applicable scenario model.
[0016] Preferably, the step of performing consistency verification on the applicable scenario model in the model file through the edge server, and after passing the verification, deploying the applicable scenario model to the heterogeneous chip of the edge smart device according to the smart device information, includes:
[0017] The edge server obtains the smart device information of the edge smart device, which includes the device type, operating system, and chip type.
[0018] The applicable scenario model in the model file is subjected to consistency verification, and after the verification is passed, the applicable scenario model is deployed to the heterogeneous chip of the edge smart device according to the smart device information.
[0019] A second aspect of this application provides a hierarchical neural network model deployment apparatus, comprising:
[0020] The model training unit is used to train and fine-tune different initial scene models on the cloud central server using a global training dataset and a real-time fine-tuning dataset to obtain a variety of optimized scene models.
[0021] The model sending unit is used to receive the model request information from the edge server, generate a model file based on the optimized scene model, and distribute it to the edge server. The model request information includes scene identifier and device information.
[0022] The model deployment unit is used to perform consistency verification on the applicable scenario model in the model file through the edge server, and after the verification is passed, deploy the applicable scenario model to the heterogeneous chip of the edge smart device according to the smart device information.
[0023] Preferably, the model training unit is specifically used for:
[0024] The initial scene model is trained on a global training dataset on a cloud central server to obtain a variety of general scene models.
[0025] The cloud-based central server collects different scene datasets from the edge smart devices to obtain real-time fine-tuning datasets;
[0026] The general scenario model is fine-tuned using the real-time fine-tuning dataset to obtain various optimized scenario models.
[0027] Preferably, the model sending unit is specifically used for:
[0028] After receiving the model request information from the edge server, an applicable scenario model is selected for each edge server from a variety of optimized scenario models based on the model request information. The model request information includes scenario identifier and device information.
[0029] After generating model files from the applicable scenario model, the models are distributed to each of the edge servers. The model files include the size and format of the applicable scenario model.
[0030] Preferably, the model deployment unit is specifically used for:
[0031] The edge server obtains the smart device information of the edge smart device, which includes the device type, operating system, and chip type.
[0032] The applicable scenario model in the model file is subjected to consistency verification, and after the verification is passed, the applicable scenario model is deployed to the heterogeneous chip of the edge smart device according to the smart device information.
[0033] A third aspect of this application provides a hierarchical neural network model deployment device, the device including a processor and a memory;
[0034] The memory is used to store program code and transmit the program code to the processor;
[0035] The processor is used to execute the hierarchical neural network model deployment method described in the first aspect according to the instructions in the program code.
[0036] A fourth aspect of this application provides a computer-readable storage medium for storing program code for executing the hierarchical neural network model deployment method described in the first aspect.
[0037] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0038] This application provides a hierarchical neural network model deployment method, comprising: training and fine-tuning different initial scene models on a cloud central server using a global training dataset and a real-time fine-tuning dataset to obtain multiple optimized scene models; receiving model request information from an edge server, generating model files based on the optimized scene models and distributing them to the edge server, wherein the model request information includes scene identifiers and device information; performing consistency verification on the applicable scene models in the model files through the edge server, and after passing the verification, deploying the applicable scene models to heterogeneous chips on edge smart devices based on smart device information.
[0039] The hierarchical neural network model deployment method provided in this application trains, transmits, and deploys models for different scenarios through a hierarchical architecture. Model training and fine-tuning are performed on a cloud-based central server, avoiding the accumulation of large amounts of computation on edge devices and the resulting significant computational pressure. Furthermore, model transmission and deployment via edge servers ensures that models deployed to smart devices are up-to-date in a timely manner. This is because the cloud-based central server can acquire real-time augmented scenario data for model fine-tuning and then deploy the models to specific smart devices via edge servers. Therefore, this application solves the technical problems of existing optimized models having high computational demands for fine-tuning in various application scenarios and difficulty in timely updates after deployment, thus compromising model accuracy. Attached Figure Description
[0040] Figure 1 A flowchart illustrating a hierarchical neural network model deployment method provided in this application embodiment;
[0041] Figure 2 A schematic diagram of a hierarchical neural network model deployment device provided in an embodiment of this application;
[0042] Figure 3 This is a schematic diagram of the overall model deployment in the cloud-edge-device hierarchical architecture provided in the embodiments of this application. Detailed Implementation
[0043] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0044] For easier understanding, please refer to Figure 1 An embodiment of a hierarchical neural network model deployment method provided in this application includes:
[0045] Step 101: Train and fine-tune different initial scene models on the cloud central server using the global training dataset and the real-time fine-tuning dataset to obtain a variety of optimized scene models.
[0046] Further, step 101 includes:
[0047] The initial scene model is trained on a global training dataset on a cloud central server to obtain a variety of general scene models.
[0048] By collecting different scene datasets from edge smart devices through the cloud central server, a real-time fine-tuning dataset is obtained;
[0049] By using a real-time fine-tuning dataset, a general scenario model is fine-tuned to obtain a variety of optimized scenario models.
[0050] It should be noted that the cloud-based central server, as the core of the hierarchical architecture in this embodiment, not only trains and fine-tunes the model but also stores and manages global scene data and model-related data. The global training dataset can be used to pre-train the model, resulting in a relatively general scene model with high generalization ability. The scene data is data intermittently acquired by the cloud-based central server from edge-side intelligent devices. Fine-tuning the general scene model using this data makes the model more targeted; the resulting optimized scene model will not put computational pressure on the edge-side intelligent devices and can adapt to the model task requirements of the scene, thus ensuring the model's accuracy.
[0051] Understandably, acquiring real-time fine-tuning datasets allows for incremental model training, meaning constantly changing data is used for model fine-tuning, ensuring the model's suitability for the scenario and guaranteeing its timeliness. For example, a smart device transmits one currently collected image to an edge server every minute; edge servers in various scenarios aggregate the collected data to a central server; when the central server receives 2000 new data points, it uses this incremental data to fine-tune the algorithm model; the model can then be further optimized based on new scenario data, improving its performance in constantly changing scenarios.
[0052] Step 102: After receiving the model request information from the edge server, generate a model file based on the optimized scene model and distribute it to the edge server. The model request information includes scene identifier and device information.
[0053] Further, step 102 includes:
[0054] After receiving the model request information from the edge server, the appropriate scenario model is selected for each edge server from a variety of optimized scenario models based on the model request information. The model request information includes scenario identifier and device information.
[0055] After generating model files for applicable scenarios, the models are distributed to various edge servers. The model files include the size and format of the applicable scenario models.
[0056] It's important to note that edge servers are located at the edge of the scenario where smart devices operate; they are side-side servers used to connect the cloud and the device side, as well as for model deployment. They can quickly respond to scene data processing needs and coordinate communication between the central server and smart devices. Edge servers can send scene data and model request information from smart devices to the central server, and can also retrieve smart device information and scene data from smart devices. Edge servers connect to the central server on the cloud side via the internet or a local area network, and HTTPS or other secure communication protocols can be used to ensure the security of the transmission process.
[0057] The model request information sent by the edge server to the central server includes a scene identifier for scene identification and device information for device differentiation. In addition, it may include the chip type on the smart device, allowing the central server to select the optimal model based on the model request information for distribution, i.e., the applicable scene model; different edge servers can obtain different applicable scene models based on the model request information.
[0058] To ensure the integrity and traceability of the model, this embodiment requires transmitting the received applicable scenario model in the form of a model file. Specifically, the model parameters, architecture, and other configuration information are packaged into a transmittable file format, with the model file explicitly specifying the model's size and format.
[0059] Step 103: Perform consistency verification on the applicable scenario model in the model file through the edge server, and after the verification is passed, deploy the applicable scenario model to the heterogeneous chip of the edge smart device according to the smart device information.
[0060] Further, step 103 includes:
[0061] The edge server obtains the smart device information of the edge smart device, which includes the device type, operating system, and chip type.
[0062] The applicable scenario models in the model file are validated for consistency. After the validation is passed, the applicable scenario models are deployed to the heterogeneous chips of the edge smart devices based on the smart device information.
[0063] It should be noted that after the edge server receives the model from the central server, it needs to perform a consistency check on the model to ensure that no abnormalities occurred during the model transmission process, that it is consistent with the target transmission model in the central server, and that its integrity has not been compromised or tampered with.
[0064] Edge servers can select the most suitable deployment method and the most matching model version based on the smart device information of the edge smart device. Then, the selected applicable scenario model is deployed on the heterogeneous chips of the edge smart device. This allows the smart device to perform algorithm model inference based on local data and achieve data processing. Because smart devices are equipped with different types of heterogeneous chips, such as GPUs, CPUs, and FPGAs, the edge server will select the most efficient model version based on the device information.
[0065] The process of deploying applicable scenario models from edge servers to edge smart devices involves operations such as model parameter conversion, compilation, and optimization to ensure that the deployed models can run efficiently on the smart devices. Furthermore, to ensure error-free deployment, consistency verification can be performed on the deployed models on the smart devices, thereby guaranteeing the accuracy and completeness of model parameters. In addition, edge servers can be configured and optimized according to the characteristics of smart devices to maximize model performance.
[0066] Understandably, both the central server and the edge server can monitor the model inference and data processing of intelligent devices, and can adjust the model's status and operation mode in real time according to the monitoring status to ensure the reliability of the system.
[0067] Please see Figure 3 The model will be continuously optimized as scene data accumulates, and the heterogeneous chip cluster system of the entire cloud-edge-device collaborative architecture will continuously improve the performance and adaptability of intelligent scene processing to meet the growing demand for intelligent applications.
[0068] The hierarchical neural network model deployment method provided in this application uses a hierarchical architecture to train, transmit, and deploy models for different scenarios. Model training and fine-tuning are performed on a cloud-based central server, avoiding the accumulation of large amounts of computation on edge devices and the resulting significant computational pressure. Furthermore, using edge servers for model transmission and deployment ensures that models deployed to smart devices are up-to-date in a timely manner. This is because the cloud-based central server can acquire real-time augmented scenario data for model fine-tuning and then deploy the models to specific smart devices via edge servers. Therefore, this application's embodiments can solve the technical problems of existing optimized models having high computational demands for fine-tuning in various application scenarios, difficulty in timely updates after deployment, and inability to ensure model accuracy.
[0069] For easier understanding, please refer to Figure 2 This application provides an embodiment of a hierarchical neural network model deployment device, comprising:
[0070] The model training unit 201 is used to train and fine-tune different initial scene models on the cloud central server using a global training dataset and a real-time fine-tuning dataset to obtain a variety of optimized scene models.
[0071] The model sending unit 202 is used to receive the model request information from the edge server, generate a model file based on the optimized scene model, and distribute it to the edge server. The model request information includes scene identifier and device information.
[0072] The model deployment unit 203 is used to perform consistency verification on the applicable scenario model in the model file through the edge server, and after the verification is passed, deploy the applicable scenario model to the heterogeneous chip of the edge smart device according to the smart device information.
[0073] Furthermore, the model training unit is specifically used for:
[0074] The initial scene model is trained on a global training dataset on a cloud central server to obtain a variety of general scene models.
[0075] By collecting different scene datasets from edge smart devices through the cloud central server, a real-time fine-tuning dataset is obtained;
[0076] By using a real-time fine-tuning dataset, a general scenario model is fine-tuned to obtain a variety of optimized scenario models.
[0077] Furthermore, the model sending unit is specifically used for:
[0078] After receiving the model request information from the edge server, the appropriate scenario model is selected for each edge server from a variety of optimized scenario models based on the model request information. The model request information includes scenario identifier and device information.
[0079] After generating model files for applicable scenarios, the models are distributed to various edge servers. The model files include the size and format of the applicable scenario models.
[0080] Furthermore, the model deployment unit is specifically used for:
[0081] The edge server obtains the smart device information of the edge smart device, which includes the device type, operating system, and chip type.
[0082] The applicable scenario models in the model file are validated for consistency. After the validation is passed, the applicable scenario models are deployed to the heterogeneous chips of the edge smart devices based on the smart device information.
[0083] This application also provides a hierarchical neural network model deployment device, the device including a processor and a memory;
[0084] The memory is used to store program code and transfer the program code to the processor;
[0085] The processor is used to execute the hierarchical neural network model deployment method in the above method embodiments according to the instructions in the program code.
[0086] This application also provides a computer-readable storage medium for storing program code for executing the hierarchical neural network model deployment method in the above method embodiments.
[0087] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0088] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0089] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0090] If the integrated unit is implemented as 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 this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions for executing all or part of the steps of the methods described in the various embodiments of this application through a computer device (which may be a personal computer, server, or network device, etc.). The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0091] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for deploying a hierarchical neural network model, characterized in that, include: On the cloud central server, a global training dataset and a real-time fine-tuning dataset are used to train and fine-tune different initial scene models to obtain a variety of optimized scene models; After receiving the model request information from the edge server, a model file is generated based on the optimized scene model and distributed to the edge server. The model request information includes scene identifier and device information. The edge server performs consistency verification on the applicable scenario model in the model file, and after the verification is passed, the applicable scenario model is deployed to the heterogeneous chip of the edge smart device according to the smart device information. After receiving the model request information from the edge server, a model file is generated based on the optimized scene model and distributed to the edge server. The model request information includes scene identifier and device information, including: After receiving the model request information from the edge server, an applicable scenario model is selected for each edge server from a variety of optimized scenario models based on the model request information. The model request information includes scenario identifier and device information. After generating model files from the applicable scenario model, the models are distributed to each of the edge servers. The model files include the size and format of the applicable scenario model. The step of performing consistency verification on the applicable scenario model in the model file through the edge server, and deploying the applicable scenario model to the heterogeneous chip of the edge smart device according to the smart device information after the verification is passed, includes: The edge server obtains the smart device information of the edge smart device, which includes the device type, operating system, and chip type. The applicable scenario model in the model file is subjected to consistency verification, and after the verification is passed, the applicable scenario model is deployed to the heterogeneous chip of the edge smart device according to the smart device information.
2. The hierarchical neural network model deployment method of claim 1, wherein, The process involves training and fine-tuning different initial scene models on a cloud-based central server using a global training dataset and a real-time fine-tuning dataset, resulting in various optimized scene models, including: The initial scene model is trained on a global training dataset on a cloud central server to obtain a variety of general scene models. The cloud-based central server collects different scene datasets from the edge smart devices to obtain real-time fine-tuning datasets; The general scenario model is fine-tuned using the real-time fine-tuning dataset to obtain various optimized scenario models.
3. A hierarchical neural network model deployment apparatus characterized by comprising: include: The model training unit is used to train and fine-tune different initial scene models on the cloud central server using a global training dataset and a real-time fine-tuning dataset to obtain a variety of optimized scene models. The model sending unit is used to receive the model request information from the edge server, generate a model file based on the optimized scene model, and distribute it to the edge server. The model request information includes scene identifier and device information. The model deployment unit is used to perform consistency verification on the applicable scenario model in the model file through the edge server, and after the verification is passed, deploy the applicable scenario model to the heterogeneous chip of the edge smart device according to the smart device information; The model sending unit is specifically used for: After receiving the model request information from the edge server, an applicable scenario model is selected for each edge server from a variety of optimized scenario models based on the model request information. The model request information includes scenario identifier and device information. After generating model files from the applicable scenario model, the models are distributed to each of the edge servers. The model files include the size and format of the applicable scenario model. The model deployment unit is specifically used for: The edge server obtains the smart device information of the edge smart device, which includes the device type, operating system, and chip type. The applicable scenario model in the model file is subjected to consistency verification, and after the verification is passed, the applicable scenario model is deployed to the heterogeneous chip of the edge smart device according to the smart device information.
4. The hierarchical neural network model deployment apparatus according to claim 3, characterized by, The model training unit is specifically used for: The initial scene model is trained on a global training dataset on a cloud central server to obtain a variety of general scene models. The cloud-based central server collects different scene datasets from the edge smart devices to obtain real-time fine-tuning datasets; The general scenario model is fine-tuned using the real-time fine-tuning dataset to obtain various optimized scenario models.
5. A hierarchical neural network model deployment device, comprising: The device includes a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the hierarchical neural network model deployment method according to any one of claims 1-2 according to the instructions in the program code.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program code for executing the hierarchical neural network model deployment method according to any one of claims 1-2.
Citation Information
Patent Citations
Deep learning model training and reasoning architecture deployment method based on cloud edge-end cooperation
CN114422349A
Federal small sample learning method, system and equipment facing natural language model
CN116127018A
