A collaborative update method and system for AI models based on edge computing
By adopting an AI model collaborative update method based on edge computing in park management, it solves problems such as complex device protocols, resource waste, and information islands, and achieves efficient AI services and model training.
Patent Information
- Application Number
- CN202411523336.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-10-30
AI Technical Summary
The existing technology has problems such as complex equipment protocols, serious resource waste, and serious information island effects in park management. The training and deployment of AI models are complex and the communication delay is large, making it difficult to achieve efficient AI services.
The AI model collaborative update method based on edge computing is used to calculate local update parameters through data collection and annotation of terminal devices, and realize global gradient calculation and model update through the scheduling framework and bandwidth resource allocation mechanism.
It improves system resource utilization, reduces the complexity of actual deployment, realizes the integration of federated learning and edge learning, and improves the training efficiency and model performance of AI models.
Smart Images

Figure CN119052295B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of Internet of Things, and specifically relates to an AI model collaborative updating method and system based on edge computing. Background Art
[0002] With the acceleration of urbanization, traditional parks are facing problems such as low management efficiency and serious waste of resources. The equipment and facilities involved in the park are huge in size and complex in structure. When conducting real-time monitoring and operation and maintenance management, the deployment is difficult to achieve due to the complexity of the equipment protocol. Server stacking wastes resources and the system has poor robustness. The online data management of the park management system is difficult to maintain. The existing enterprise information management system cannot effectively support the operation and management of the park, and there is a serious information island effect.
[0003] With the development of artificial intelligence, park terminal devices perform complex tasks and provide intelligent services through built-in AI algorithms and hardware support, pushing the training and reasoning capabilities of artificial intelligence models to the edge of the network, thereby providing ultra-low latency and high-reliability artificial intelligence services. These terminal devices usually use edge computing technology to transfer data processing from the cloud to local terminals to reduce network latency and bandwidth consumption; AI technology covers personnel management, vehicle management, energy management, security management and other aspects. By deploying front-end cameras to connect edge computing boxes, the park uses AI video analysis technology to monitor and manage personnel behavior, environment, etc. in real time. By combining with the Internet of Things (IoT), it realizes the interconnection of various devices and systems in the park, thereby improving data integration and modeling capabilities, and driving the intelligence, visualization and real-time control of business processes. However, in terms of data collection, terminal devices are usually randomly distributed in the wireless edge network, and the data they generate or collect is highly correlated with the environment in which they are located. Therefore, data across terminals often obey non-independent and identically distributed distributions. Different terminal devices will have different numbers of data samples, and the data categories and data characteristics across terminals will also vary greatly. The computing and storage resources of terminal devices and edge servers are limited, so they can only complete the processing and analysis of local and short-cycle services, which greatly increases the complexity of AI algorithms in problem modeling, theoretical analysis, and actual deployment, and has a great impact on model performance. The training process of the AI model and the communication overhead between the terminal device and the edge server are huge, and the communication delay of the entire system increases with the number of terminals. Therefore, terminal device management needs to be redesigned in the face of heterogeneous management and communication efficiency issues. Summary of the invention
[0004] In order to solve the above problems existing in the prior art, the present invention provides an AI model collaborative update method and system based on edge computing. The purpose of the present invention can be achieved through the following technical solutions:
[0005] S1: The IoT data and video stream data are collected through the data collection subsystem of the terminal device in the park, and the IoT data and video stream data are annotated through the label information library to form a local data set; the edge node broadcasts the corresponding AI model to the terminal device according to the received park application service;
[0006] S2: The terminal device calculates the local update parameters of the AI model loss function based on the local data set, calculates the weight index corresponding to the terminal device through the scheduling framework and the local update parameters, and uploads it to the edge node;
[0007] S3: The edge node constructs a resource matching terminal sequence according to the weight index and channel status of the terminal device, the edge node allocates bandwidth resources according to the resource matching terminal sequence, and sends a gradient upload instruction to the terminal device corresponding to the resource matching terminal sequence through a control channel;
[0008] S4: If the terminal device receives the gradient upload instruction, it uploads the local update parameters to the edge node through the multi-access channel; the edge node calculates the global gradient according to the received local update parameters, and updates the AI model according to the global gradient.
[0009] Specifically, the local data set of the terminal device is independently counted, and the local update parameter is the gradient obtained by the periodic low-interaction local calculation and global aggregation between the terminal device and the edge node, and the calculation formula is:
[0010] ,
[0011] in, g k is the local update parameter, B k For the k The terminal device randomly selects data from the local data set. s k for B k The number of training samples included, l is the local loss function, w For the jointly trained AI model, ( x , y ) are sample features and labels, ∇ is the gradient operator;
[0012] The weight index is the difference between the mathematical expectation of the local update parameter uploaded by the edge node of the scheduling framework under the optimal scheduling strategy in a single round of communication and the local loss function of the corresponding terminal device; the resource matching terminal sequence is the time slot resource allocated to the terminal device according to the channel transmission rate, computing power and weight index of the terminal device:
[0013] ,
[0014] in, u k Allocate resources to the terminal device for the edge node, R k is the channel transmission rate, q The number of quantization bits for the gradient elements of the local update parameters, N is the number of elements of the local update parameter, m is the ratio of the communication capacity of all edge computing nodes and backhaul links, s is the training sample batch size between edge nodes and terminal devices in a single round of communication, C is the weight index, s new is the optimal training sample batch size under the scheduling framework, V k is the sample training rate, T is the end-to-end delay of a single round of communication;
[0015] The global gradient is a balance parameter generated by the edge node after receiving all local update parameters within a preset communication cycle, and the calculation formula is:
[0016] ,
[0017] in, g is the global gradient, g k is the local update parameter, s k is the number of training samples, K is the total number of terminal devices, k Count terminal devices;
[0018] The edge node and the terminal device jointly train and update the AI model, and the local loss function of the AI model trained by the terminal device according to the local data set is:
[0019] ,
[0020] Among them, w is the jointly trained AI model, Loss k ( w) indicates that the AI model is k Local loss on a terminal device, n k is the number of samples in the local dataset involved in training, i is the training sample count, For the i The characteristics of the samples, For the i The sample labels of samples.
[0021] Specifically, the terminal device adopts orthogonal frequency division multiple access technology to share the system bandwidth, and the edge node occupies the entire system bandwidth to broadcast the AI model.
[0022] Specifically, the scheduling framework executes the optimal scheduling strategy through the channel state and gradient divergence of the terminal device, and the objective function of the optimal scheduling strategy is:
[0023] ,
[0024] Where E represents the mathematical expectation, r is the balance weight factor, For the selected terminal device X t The gradient divergence of For the selected terminal device X t The communication delay, K is the total number of terminal devices, k Counting terminal devices, For scheduling k The communication delay of each terminal device is Select the first k The optimal probability of a terminal device uploading a local gradient, is the norm of the deviation between the local gradient of the kth terminal device and the global gradient of the edge node.
[0025] Specifically, the communication delay of the terminal device is composed of the calculation delay of the local update parameters, the transmission delay and the model broadcast delay. The calculation delay is obtained by the ratio of the number of floating-point operations required for the local data set to execute a back-propagation algorithm and the number of floating-point operations that can be executed by the terminal device per second. The transmission delay is the single scheduling transmission delay of the quantization bit number of the local update parameters corresponding to the selected terminal device; the model broadcast delay is calculated by the number of model parameters and the channel transmission rate of the edge node.
[0026] Specifically, the bandwidth resource allocation method is: allocating the bandwidth resource by minimizing the transmission delay as the target optimization direction according to the channel state of the terminal device:
[0027] ,
[0028] in, is the number assigned to the first The bandwidth of the terminal device B is the total system bandwidth, For the The uplink channel transmission rate of each terminal device per unit bandwidth, m is the scheduling terminal sequence count, M is the number of scheduling terminals.
[0029] Specifically, the edge node scales the local update parameter of the terminal device when calculating the global gradient based on the gradient divergence of the global model.
[0030] An AI model collaborative update system based on edge computing, comprising: a global broadcast module, a local computing module, a terminal scheduling module, and a model update module;
[0031] The global broadcast module is used to collect IoT data and video stream data through the data collection subsystem of the terminal equipment in the park, annotate the IoT data and video stream data through the label information library and form a local data set; the edge node broadcasts the corresponding AI model to the terminal equipment according to the received park application service;
[0032] The local calculation module calculates the local update parameters of the AI model loss function based on the local data set, calculates the weight index corresponding to the terminal device through the scheduling framework and the local update parameters, and uploads it to the edge node;
[0033] The terminal scheduling module constructs a resource matching terminal sequence according to the weight index and channel status of the terminal device, the edge node allocates bandwidth resources according to the resource matching terminal sequence, and sends a gradient upload instruction to the terminal device corresponding to the resource matching terminal sequence through the control channel;
[0034] The model update module uploads the local update parameters to the edge node through a multiple access channel; the edge node calculates a global gradient according to the received local update parameters, and updates the AI model according to the global gradient.
[0035] As a preferred technical solution of the present invention,
[0036] The beneficial effects of the present invention are:
[0037] By analyzing and comparing the channel transmission rate, computing power, weight index and end-to-end delay of the services calculated on the terminal devices and edge nodes, the joint computing resources of the edge nodes and terminal devices are allocated to maximize the utilization of system resources. The model parameters and communication resources are integrated into a unified framework for joint optimization, and dynamically adjusted according to the quality of the wireless channel, which greatly reduces the complexity of the actual deployment. By analyzing the data imbalance, local gradient norm, and wireless channel status, the integration of federated learning and edge learning is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.
[0039] Figure 1 This is a flow chart of an AI model collaborative update method based on edge computing of the present invention. DETAILED DESCRIPTION
[0040] The example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein: on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art. In addition, the described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to give a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid blurring various aspects of the present disclosure. The blocks shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices. The flowcharts shown in the accompanying drawings are only exemplary illustrations and do not necessarily include all the content and operations / steps, nor do they necessarily have to be executed in the order described. For example, some operations / steps may be decomposed, while some operations / steps may be combined or partially combined, so the actual execution order may change according to the actual situation.
[0041] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation method, structure, characteristics and effects of the present invention are described in detail below in combination with the accompanying drawings and preferred embodiments.
[0042] See also Figure 1 , a collaborative update method of AI model based on edge computing:
[0043] S1: The IoT data and video stream data are collected through the data collection subsystem of the terminal device in the park, and the IoT data and video stream data are annotated through the label information library to form a local data set; the edge node broadcasts the corresponding AI model to the terminal device according to the received park application service;
[0044] S2: The terminal device calculates the local update parameters of the AI model loss function based on the local data set, calculates the weight index corresponding to the terminal device through the scheduling framework and the local update parameters, and uploads it to the edge node;
[0045] S3: The edge node constructs a resource matching terminal sequence according to the weight index and channel status of the terminal device, the edge node allocates bandwidth resources according to the resource matching terminal sequence, and sends a gradient upload instruction to the terminal device corresponding to the resource matching terminal sequence through a control channel;
[0046] S4: If the terminal device receives the gradient upload instruction, it uploads the local update parameters to the edge node through the multi-access channel; the edge node calculates the global gradient according to the received local update parameters, and updates the AI model according to the global gradient.
[0047] In this embodiment, the terminal device uploads the entire service to the edge node connected to it through a wireless channel. The edge node divides each service into two parts, one of which is handled by the edge server and the other is unloaded to the cloud server through the backhaul link. The edge server allocates computing resources and processes the services left on the edge node in parallel. The cloud server receives services from the edge node and allocates computing resources for parallel processing. The edge node downloads the calculation results of the cloud server, integrates them with the calculation results of the edge server, and then feeds them back to the terminal device through the wireless channel.
[0048] Specifically, the local data set of the terminal device is independently counted, and the local update parameter is the gradient obtained by the periodic low-interaction local calculation and global aggregation between the terminal device and the edge node, and the calculation formula is:
[0049] ,
[0050] in, g k is the local update parameter, B k For the k The terminal device randomly selects data from the local data set.s k for B k The number of training samples included, l is the local loss function, w For the jointly trained AI model, ( x , y ) are sample features and labels, ∇ is the gradient operator;
[0051] The weight index is the difference between the mathematical expectation of the local update parameter uploaded by the edge node of the scheduling framework under the optimal scheduling strategy in a single round of communication and the local loss function of the corresponding terminal device; the resource matching terminal sequence is the time slot resource allocated to the terminal device according to the channel transmission rate, computing power and weight index of the terminal device:
[0052] ,
[0053] in, u k Allocate resources to the terminal device for the edge node, R k is the channel transmission rate, q The number of quantization bits for the gradient elements of the local update parameters, N is the number of elements of the local update parameter, m is the ratio of the communication capacity of all edge computing nodes and backhaul links, s is the training sample batch size between edge nodes and terminal devices in a single round of communication, C is the weight index, s new is the optimal training sample batch size under the scheduling framework, V k is the sample training rate, T is the end-to-end delay of a single round of communication;
[0054] The global gradient is a balance parameter generated by the edge node after receiving all local update parameters within a preset communication cycle, and the calculation formula is:
[0055] ,
[0056] in, g is the global gradient, g k is the local update parameter, s k is the number of training samples, K is the total number of terminal devices, k Count terminal devices;
[0057] The edge node and the terminal device jointly train and update the AI model, and the local loss function of the AI model trained by the terminal device according to the local data set is:
[0058] ,
[0059] Among them, w is the jointly trained AI model, Loss k ( w ) indicates that the AI model is k Local loss on a terminal device, n k is the number of samples in the local dataset involved in training, i is the training sample count, For the i The characteristics of the samples, For the i The sample labels of samples.
[0060] Specifically, the terminal device adopts orthogonal frequency division multiple access technology to share the system bandwidth, and the edge node occupies the entire system bandwidth to broadcast the AI model.
[0061] Specifically, the scheduling framework executes the optimal scheduling strategy through the channel state and gradient divergence of the terminal device, and the objective function of the optimal scheduling strategy is:
[0062] ,
[0063] Where E represents the mathematical expectation, r is the balance weight factor, For the selected terminal device X t The gradient divergence of For the selected terminal device X t The communication delay, K is the total number of terminal devices, k Counting terminal devices, For scheduling k The communication delay of each terminal device is Select the first k The optimal probability of a terminal device uploading a local gradient, is the norm of the deviation between the local gradient of the kth terminal device and the global gradient of the edge node.
[0064] Specifically, the communication delay of the terminal device is composed of the calculation delay of the local update parameters, the transmission delay and the model broadcast delay. The calculation delay is obtained by the ratio of the number of floating-point operations required for the local data set to execute a back-propagation algorithm and the number of floating-point operations that can be executed by the terminal device per second. The transmission delay is the single scheduling transmission delay of the quantization bit number of the local update parameters corresponding to the selected terminal device; the model broadcast delay is calculated by the number of model parameters and the channel transmission rate of the edge node.
[0065] Specifically, the bandwidth resource allocation method is: allocating the bandwidth resource by minimizing the transmission delay as the target optimization direction according to the channel state of the terminal device:
[0066] ,
[0067] in, is the number assigned to the first The bandwidth of the terminal device B is the total system bandwidth, For the The uplink channel transmission rate of each terminal device per unit bandwidth, m is the scheduling terminal sequence count, M Specifically, the edge node scales the local update parameter when calculating the global gradient according to the local update parameter of the terminal device and the gradient divergence of the global model.
[0068] In this embodiment, the global model is maintained by the cloud server, and the model is distributed to the edge server and mobile devices. The update information from the edge server is synchronously summarized using a joint averaging algorithm. In each federated learning cycle, the edge server selects a subset of its terminal device data. If the data set of the mobile device associated with the edge server is selected to participate in the model training, the orthogonal frequency division multiple access (OFDMA) technology is used. The edge server can divide the bandwidth it provides into multiple sub-channels, and then allocate the sub-channels to the mobile device for uploading local model updates; when the local gradient is transmitted, the scheduling probability will decrease with the increase of the local gradient transmission delay. The edge node will schedule the terminal device with a larger gradient norm with a greater probability, so the terminal device needs to set the compensation variable to represent the gap between the local model parameters and the global model parameters, which is used to compensate for the gap between the local model parameters and the global model parameters. In each round of training, the learned compensation variables can be used to fine-tune the local model parameters, so that the local parameters of the local model and the edge model tend to be consistent, and the negative impact of the local imbalanced model is reduced.
[0069] An AI model collaborative update system based on edge computing, comprising: a global broadcast module, a local computing module, a terminal scheduling module, and a model update module;
[0070] The global broadcast module is used to collect IoT data and video stream data through the data collection subsystem of the terminal equipment in the park, annotate the IoT data and video stream data through the label information library and form a local data set; the edge node broadcasts the corresponding AI model to the terminal equipment according to the received park application service;
[0071] The local calculation module calculates the local update parameters of the AI model loss function based on the local data set, calculates the weight index corresponding to the terminal device through the scheduling framework and the local update parameters, and uploads it to the edge node;
[0072] The terminal scheduling module constructs a resource matching terminal sequence according to the weight index and channel status of the terminal device, the edge node allocates bandwidth resources according to the resource matching terminal sequence, and sends a gradient upload instruction to the terminal device corresponding to the resource matching terminal sequence through the control channel;
[0073] The model update module uploads the local update parameters to the edge node through a multiple access channel; the edge node calculates a global gradient according to the received local update parameters, and updates the AI model according to the global gradient.
[0074] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may 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 (non-exhaustive list) of computer-readable storage media 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 or flash memory), 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. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
[0075] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0076] The program code included on the computer readable medium can be transmitted with any appropriate medium, including but not limited to wireless, electric wire, optical cable, RF, etc., or any suitable combination of the above. The computer program code for performing the operation of the present invention can be written in one or more programming languages or their combinations, and the programming language includes object-oriented programming languages-such as Java, Smalltalk, C++, and also includes conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0077] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A collaborative update method for AI models based on edge computing, characterized in that: include: S1: The IoT data and video stream data are collected through the data collection subsystem of the terminal device in the park, and the IoT data and video stream data are annotated through the label information library to form a local data set; the edge node broadcasts the corresponding AI model to the terminal device according to the received park application service; S2: The terminal device calculates the local update parameters of the AI model loss function based on the local data set, calculates the weight index corresponding to the terminal device through the scheduling framework and the local update parameters, and uploads it to the edge node; S3: The edge node constructs a resource matching terminal sequence according to the weight index and channel status of the terminal device, the edge node allocates bandwidth resources according to the resource matching terminal sequence, and sends a gradient upload instruction to the terminal device corresponding to the resource matching terminal sequence through a control channel; S4: If the terminal device receives the gradient upload instruction, it uploads the local update parameter to the edge node through a multiple access channel; The edge node calculates a global gradient according to the received local update parameters, and updates the AI model according to the global gradient.
2. The method according to claim 1, characterized in that The local data set of the terminal device is counted independently, and the edge node and the terminal device jointly train and update the AI model.
3. The method according to claim 1, characterized in that The terminal device adopts orthogonal frequency division multiple access technology to share the system bandwidth, and the edge node occupies the entire system bandwidth to broadcast the AI model.
4. The method according to claim 1, characterized in that: The scheduling framework executes an optimal scheduling strategy through the channel status and gradient divergence of the terminal device.
5. The method according to claim 4, characterized in that The communication delay of the terminal device is composed of the calculation delay of the local update parameters, the transmission delay and the model broadcast delay.
6. The method according to claim 5, characterized in that The edge node scales the local update parameter when calculating the global gradient based on the gradient divergence of the local update parameter of the terminal device to the global model.
7. An AI model collaborative update system based on edge computing, used to execute the method as described in any one of claims 1-6, characterized in that: include: Global broadcast module, local calculation module, terminal scheduling module, model update module; The global broadcast module is used to collect IoT data and video stream data through the data collection subsystem of the terminal equipment in the park, annotate the IoT data and video stream data through the label information library and form a local data set; the edge node broadcasts the corresponding AI model to the terminal equipment according to the received park application service; The local calculation module calculates the local update parameters of the AI model loss function based on the local data set, calculates the weight index corresponding to the terminal device through the scheduling framework and the local update parameters, and uploads it to the edge node; The terminal scheduling module constructs a resource matching terminal sequence according to the weight index and channel status of the terminal device, the edge node allocates bandwidth resources according to the resource matching terminal sequence, and sends a gradient upload instruction to the terminal device corresponding to the resource matching terminal sequence through the control channel; The model updating module uploads the local update parameters to the edge node via a multiple access channel; The edge node calculates a global gradient according to the received local update parameters, and updates the AI model according to the global gradient.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the edge computing-based AI model collaborative update method as described in any one of claims 1-6 is implemented.
9. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions, when executed by a computer processor, are used to execute the edge computing-based AI model collaborative update method as described in any one of claims 1-6.
Citation Information
Patent Citations
Resource allocation method and device, terminal, network side equipment and terminal equipment
CN118233304A
Methods and apparatuses for federated learning
US20210365841A1