Body intelligence edge device AI model remote updating method, device and medium

CN123145248APending Publication Date: 2026-11-20SHENZHEN ARATEK BIOMETRICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611152872.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing technologies struggle to balance transmission efficiency and security during remote model updates for embodied intelligent edge devices, especially in industrial environments with limited network bandwidth. This results in lengthy model updates, high bandwidth costs, and a lack of source authentication and integrity protection for differential packets, potentially leading to device malfunctions and security incidents.

Method used

By generating differential packets, cloud devices use the differences between the old and new versions of AI models to perform encryption and digital signatures, ensuring the security and integrity of transmission. At the edge devices, functional verification and atomic replacement operations are performed to ensure the security and reliability of model updates.

Benefits of technology

It effectively reduces the transmission overhead of model updates, ensures the confidentiality, integrity and source credibility of update packages, avoids device malfunctions, and ensures the safe and stable operation of embodied intelligent devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123145248A_ABST
    Figure CN123145248A_ABST
Patent Text Reader

Abstract

The application discloses a kind of body intelligence edge device AI model remote updating method, equipment and medium, it is related to body intelligence field, comprising: cloud end equipment is based on the difference of new and old version AI model Difference package is generated, is sent to target edge device after encryption and digital signature;Target edge device is verified and passes through integrity check, in memory based on difference package and the old version AI model currently running is constructed to be verified new version AI model and carries out function verification;After verification, execute atomic replacement operation, in the case where not interrupting inference service, switch to the new version AI model to be verified and keep old version AI model copy as rollback backup model;Afterwards, monitor inference service running index, when meeting abnormal condition, rollback to rollback backup model.The application reduces data volume by differential transmission, guarantees that update package is safe and reliable in combination with encryption signature, to realize uninterrupted service hot updating by atomic replacement, and guarantee update reliability by running monitoring and automatic rollback.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of embodied intelligence technology, and in particular to a method, device and medium for remotely updating AI models of embodied intelligent edge devices. Background Technology

[0002] Currently, with the rapid development of technologies such as embodied intelligence, a large number of intelligent robots and machine vision inspection equipment deployed in production lines, warehouses, inspection sites and other field environments need to frequently iterate their internal physical simulation models, machine vision models and other AI models to improve perception accuracy or adapt to new tasks.

[0003] Remote model updates for these edge devices have become a rigid operational requirement, but existing update processes face significant challenges. Regarding security, the industry typically encrypts the complete model file before full distribution. However, the physical and machine vision models carried by embodied intelligent devices are often massive, and full encrypted transmission is time-consuming and bandwidth-intensive under the limited network conditions of industrial sites. Furthermore, some solutions use differential methods to generate update packages to improve transmission efficiency, but in the pursuit of lightweight design, they often lack source authentication and integrity protection for differential packets, or only perform simple verification after the update, making it difficult to detect malicious tampering or data corruption during transmission. Moreover, once a tampered model is loaded and executed at the edge, it not only causes abnormal machine vision inference but may also lead to physical malfunctions in the embodied intelligent device, triggering operational safety incidents. Therefore, existing solutions struggle to balance security and transmission efficiency in remote model updates, posing a significant challenge to the secure management of model updates for massive numbers of edge devices. Summary of the Invention

[0004] This invention provides a method, device, and medium for remotely updating AI models of embodied intelligent edge devices. The technical problem it aims to solve is: how to provide a solution for remotely updating AI models of edge devices that can effectively reduce transmission overhead while ensuring the confidentiality, integrity, and trustworthiness of the update package.

[0005] In a first aspect, the present invention provides a method for remotely updating an AI model of an embodied intelligent edge device, comprising: The cloud device obtains the new version of the AI ​​model and the old version of the AI ​​model, and generates a difference package based on the differences between the new version of the AI ​​model and the old version of the AI ​​model; The cloud device encrypts and digitally signs the differential packet to obtain a secure differential packet; The cloud device sends the security differential packet to the target edge device; The target edge device performs signature verification and integrity verification on the received security differential packet, and obtains the verified differential packet after both signature verification and integrity verification are passed; The target edge device, in its memory, constructs a new version AI model to be verified based on the verified differential packet and the old version AI model currently running on the target edge device, and performs functional verification on the new version AI model to be verified. Once the function verification is successful, the target edge device performs an atomic replacement operation. Without interrupting the inference service on the target edge device, the inference service is switched from the old version AI model to the new version AI model to be verified, and a copy of the old version AI model is retained as a rollback backup model. After completing the atomic replacement operation, the target edge device monitors the operating metrics of the inference service. When the operating metrics meet abnormal conditions, the inference service is rolled back from the new version of the AI ​​model to be verified to the rollback backup model.

[0006] Optionally, the cloud device generates a differential package based on the differences between the new version of the AI ​​model and the old version of the AI ​​model, including: Obtain the first operator list, dependencies, version identifier, and model computation graph of the new version AI model, as well as the second operator list, dependencies, and version identifier of the old version AI model; By comparing the first list of operators with the second list of operators, operators that show differences are identified as change operators; Extract the binary code of the change operator from the new version of the AI ​​model, and determine the topological location information of the change operator based on the model computation graph; The binary code of the change operator, the topological location information, the version identifier of the new version AI model, and the version identifier of the old version AI model are packaged together to form an operator-level difference package, and the operator-level difference package is used as the difference package.

[0007] Optionally, the target edge device, in memory, constructs a new version of the AI ​​model to be verified based on the verified differential packet and the old version of the AI ​​model currently running on the target edge device, including: The target edge device loads a complete computation graph representation of the currently running older version of the AI ​​model into memory; Determine whether the version identifier of the old version AI model recorded in the operator level difference package matches the actual version identifier of the old version AI model currently running on the target edge device; In the case of a match, based on the topological location information in the operator level difference package, the node to be replaced is located in the complete computation graph representation, and the operator binary code of the located node is replaced with the binary code of the corresponding change operator in the operator level difference package, thus forming the new version AI model to be verified.

[0008] Optionally, the functional verification of the new version of the AI ​​model to be verified includes: Obtain the real business requests processed by the old version AI model within a preset historical time period as a replay sample set; The replay sample set is input into the old version AI model and the new version AI model to be verified, respectively, to obtain the first inference result set and the second inference result set; Calculate the distribution similarity between the first inference result set and the second inference result set; When the distribution similarity is higher than a preset compatibility threshold, the function verification is deemed successful.

[0009] Optionally, the target edge device performs an atomic replacement operation, including: The target edge device maintains a model service registry, which records currently active model instances; The target edge device loads the new version AI model to be verified into memory and marks the new version AI model to be verified as inactive in the model service registry; Through a single atomic write operation, the active flag of the old version AI model in the model service registry is exchanged with the inactive flag of the new version AI model to be verified; After the exchange is completed, the new inference request is routed to the new version of the AI ​​model to be verified that is marked as active in the model service registry.

[0010] Optionally, after completing the atomic replacement operation, the target edge device monitors the operational metrics of the inference service. When the operational metrics meet abnormal conditions, the inference service is rolled back to the rollback backup model, including: Collect the inference delay of the inference service after the atomic substitution operation is completed and the confidence distribution of the inference results output by the inference service; Calculate the upward trend of the inference delay within the sliding time window, and the offset trend of the confidence distribution within the sliding time window; When the upward trend exceeds the first threshold and the offset trend exceeds the second threshold, it is determined that the abnormal condition is met; Trigger the rollback process to switch the inference service from the new version AI model to be verified back to the rollback backup model.

[0011] Optionally, calculating the upward trend of the inference delay within the sliding time window includes: Obtain the request sequence of the inference service within the sliding time window; The inference delay collected at each sampling point within the sliding time window is normalized according to the request amount corresponding to the sampling point to obtain a normalized delay value sequence. The normalized delay value sequence is linearly fitted to obtain the normalized delay slope; When the normalized delay slope is greater than a preset slope threshold, it is determined that the inference delay exhibits an upward trend. Optionally, calculating the offset trend of the confidence distribution within the sliding time window includes: The confidence distribution of the inference service within the first time window after the atomic replacement operation is completed is determined as the initial baseline distribution. Within the sliding time window, the confidence distribution of the inference service is collected at preset sampling intervals to obtain a sampling distribution sequence; Calculate the bulldozer distance between each sampling distribution in the sampling distribution sequence and the initial reference distribution to obtain a distance sequence; Calculate the moving average of the distance sequence within the current sliding time window. If the bulldozer distance corresponding to the current sampling point is greater than a preset multiple of the moving average, then it is determined that the confidence distribution exhibits the shift trend.

[0012] Optionally, the cloud device sends the security differential packet to the target edge device, including: Obtain device grouping information and canary release ratio, wherein the device grouping information includes at least one of hardware architecture grouping, operating environment grouping, and business importance grouping; A candidate edge device set is determined based on the device grouping information; Based on the grayscale release ratio, a subset of edge devices are selected from the candidate edge device set as the target edge devices; The security differential packet is sent to the selected target edge device.

[0013] Secondly, the present invention also provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.

[0014] Thirdly, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.

[0015] This invention provides a method, device, and medium for remotely updating AI models on embodied intelligent edge devices. By generating differential packets based on the differences between the new and old versions of the AI ​​model via a cloud device, only the differences between the two versions are transmitted, rather than the complete model file. This reduces the total amount of data transmitted for model updates from the source, effectively lowering the transmission overhead for edge devices. Furthermore, after generating the differential packets, the cloud device encrypts and digitally signs them to obtain secure differential packets. Encryption ensures the confidentiality of the differential packets during transmission, while digital signing ensures their integrity and source credibility. Upon receiving the secure differential packets, the target edge device verifies their signature and integrity. Only after both verifications are successful does the target edge device receive the verified differential packets, ensuring that only differential packets with authentic sources, complete content, and no tampering can be used for subsequent model updates. Therefore, this solution effectively reduces the transmission overhead of model updates through a differential transmission mechanism while ensuring the confidentiality, integrity, and source credibility of the update packets, solving the technical problem of balancing security and transmission efficiency in remote AI model updates for edge devices. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 A flowchart illustrating a method for remotely updating an AI model of an embodied intelligent edge device, provided in an embodiment of the present invention; Figure 2 This is a schematic block diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0020] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0021] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0022] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0023] Please see Figure 1This invention provides a method for remotely updating the AI ​​model of an embodied intelligent edge device. This method is applied to a distributed system composed of cloud devices and embodied intelligent edge devices deployed in various field environments. Further, embodied intelligent edge devices refer to intelligent devices that possess physical entities, can perceive environmental states through sensors, and exert actions on the physical world through actuators. Typical forms include intelligent robotic arms on industrial production lines, autonomous navigation and handling robots in warehousing and logistics, quadrupedal robotic dogs or rotary-wing drones for outdoor inspections, etc. Further, these devices internally run AI models to perform core tasks such as machine vision reasoning, physical simulation calculations, motion planning, and control. Further, machine vision reasoning refers to the process of using deep learning models to analyze visual sensor data such as images or point clouds to complete perception functions such as target detection, semantic segmentation, and pose estimation. Further, physical simulation calculations refer to the process of using physical models to perform numerical simulation calculations on the device's own kinematics, dynamic characteristics, and interactions with the environment. Furthermore, the AI ​​model's inference service is a background daemon running on the edge device's operating system. It receives inference requests from upper-layer business applications, invokes the loaded AI model to perform forward computation, and returns the computation results as inference results. The real-time performance, accuracy, and reliability of the inference service directly determine the behavioral security and operational efficiency of the embodied intelligent device.

[0024] Furthermore, the deployment environment of edge devices typically features limited network bandwidth, limited storage space, unattended operation, and difficulty in on-site manual maintenance. Robots in warehouses may only connect via Wi-Fi, while outdoor inspection equipment may rely on 4G or narrowband IoT signals. The solid-state storage capacity of embedded computing platforms is often between 32GB and 256GB, leaving limited space for model files after operating systems and business programs. Under these conditions, transmitting the complete model file for each model update is not only time-consuming and costly in terms of data usage, but may also fail due to insufficient storage space. Furthermore, embodied intelligent devices typically require continuous 24 / 7 operation; downtime of production line robotic arms directly leads to production losses, and interruptions in inference services during flight of inspection drones may cause them to crash uncontrollably. Therefore, when updating models for such devices, it is essential to simultaneously address the three core challenges of transmission efficiency, service continuity, and fault self-healing while ensuring safety. The technical solution in this embodiment is a systematic solution proposed to address the aforementioned contradictions. Specifically, the method includes the following steps: S1, the cloud device obtains the new version AI model and the old version AI model, and generates a differential package based on the differences between the new version AI model and the old version AI model.

[0025] In practice, the cloud device first acquires both the new and old versions of the AI ​​model. This cloud device can be a cluster of model management servers deployed in a private data center or public cloud infrastructure, running a model version management system that uniformly stores and indexes model files and their version metadata for all edge devices within its jurisdiction. Further, based on update tasks submitted by operations personnel through the management platform, the cloud device extracts the corresponding two versions of the model files from the model repository. The old version of the AI ​​model is a complete file copy of the AI ​​model currently running and performing inference tasks on the target edge device, while the new version is a complete file of the upgraded version trained and optimized by the algorithm team and intended for deployment to the edge device. Furthermore, the differences between the two versions may manifest at multiple levels: at the parameter level, the weights of some convolutional kernels in the convolutional neural network are fine-tuned; at the structural level, a certain activation function operator in the model computation graph is replaced with another activation function operator, or a batch normalization layer is added at a specific location; at the precision level, the model's numerical precision is quantized from 32-bit floating-point numbers to 16-bit floating-point numbers to improve inference speed.

[0026] Furthermore, cloud devices generate differential packets based on the differences between the new and old versions of the AI ​​model. The basic principle of differential generation lies in the significant locality of reference in AI model iterations: algorithm improvements typically involve only the addition, deletion, or modification of a few nodes in the model's computational graph, while most network structures and parameters remain stable across multiple versions. Therefore, by accurately identifying and extracting the differences between the two versions and their location information in the model file or computational graph, rather than packaging the entire binary content of the new AI model, the generated differential packet size can be significantly smaller than the complete model file. Further, the specific operation of differential generation can be: comparing the two model files byte-by-byte to extract the differing byte segments and offset addresses; or performing a structured comparison of the operator lists of the two models to extract the code and data of the changed operators. Regardless of the granularity used, the essence is to minimize the amount of data transmitted by leveraging the sparsity of model updates.

[0027] For example, in some preferred embodiments, the cloud device generates a difference package based on the differences between the new version AI model and the old version AI model, including: obtaining a first operator list, dependencies, version identifier, and model computation graph of the new version AI model, and a second operator list, dependencies, and version identifier of the old version AI model; comparing the first operator list and the second operator list, and identifying operators with differences as changed operators; extracting the binary code of the changed operators from the new version AI model, and determining the topological location information of the changed operators according to the model computation graph; packaging the binary code of the changed operators, the topological location information, the version identifier of the new version AI model, and the version identifier of the old version AI model to form an operator-level difference package, and using the operator-level difference package as the difference package.

[0028] In practice, AI models running on embodied intelligent devices, such as the PointPillars model for 3D point cloud object detection or deep neural network models for pose estimation, typically have very large model files, ranging from hundreds of MB to several GB. However, these models exhibit significant locality of reference during iterative updates: a typical iterative improvement often involves changes to only a few operators in the computational graph, such as replacing a standard convolution operator with a depthwise separable convolution operator, adding an attention module after a feature extraction layer, or fine-tuning the weight parameters of a specific layer, while the vast majority of the computational graph's structure and parameters remain completely unchanged. If a traditional full update method is used, each update requires transmitting the entire hundreds of MB model file; even with a simple binary data block differencing method, because a small change in an operator parameter can cause a chain reaction in the offset addresses of all subsequent data blocks, the generated differencing packet still contains a large amount of redundant data that has not undergone substantial changes. To address this, this embodiment starts from the structured semantic level of the model computation graph. Through operator-level list comparison and topology positioning, it accurately identifies and extracts only the binary code of the change operator and the topological position information of the change operator in the computation graph, generating a very small operator-level differential packet. This fundamentally solves the redundant transmission problem caused by insufficient granularity in traditional differential schemes.

[0029] First, the cloud device acquires configuration data for both the new and old versions of the AI ​​model. The configuration data for the new version includes a list of first operators, dependencies, version identifiers, and the model's computation graph; the configuration data for the old version includes a list of second operators, dependencies, and version identifiers. Furthermore, an operator is a basic computational unit in the AI ​​model's computation graph, whose function is to receive one or more input tensors, perform specific mathematical operations or tensor transformations, and produce an output tensor. Common operator types include: convolution operators, used to extract local spatial features from the input feature map; pooling operators, used to downsample the feature map; fully connected operators, used to fully connect all input neurons to the output neurons; activation function operators, such as ReLU and Sigmoid operators, used to introduce nonlinear transformations; and normalization operators, such as batch normalization and layer normalization operators, used to accelerate training convergence and improve model stability. Each operator instance has specific hyperparameter configurations, such as the kernel size, stride, and padding method for convolution operators. The operator list is a structured list that records the indices of all operator instances in an AI model computation graph. Each index entry contains a unique identifier for the operator instance, an operator type enumeration value, and parameter configuration. Furthermore, dependencies are described in the form of an edge list, depicting the data flow between operator nodes in the computation graph. For example, the output tensor of operator A is the first input tensor of operator B; this dependency determines the execution order of operators during model inference. The model computation graph is a formal abstract representation of the logical structure of the AI ​​model. It fully depicts the entire computation process from input data to final output in the form of a directed acyclic graph. Each node in the graph corresponds to an operator, and each directed edge corresponds to a tensor's data dependency. Further, the version identifier is a globally unique string used to deterministically distinguish different model versions. It can be generated by calculating the SHA-256 hash value of the entire binary content of the model file and extracting the prefix, or by being assigned by the cloud platform according to an incrementing rule during model registration.

[0030] Furthermore, the cloud device compares the first operator list with the second operator list item by item. The comparison operation uses the unique identifier of the operator instance as the matching key to establish a correspondence between the old and new versions of the operator. For operator instances with the same identifier in both lists, the serialized binary data of the operator type enumeration value and parameter configuration are further compared to see if they are completely consistent. Further, based on the comparison results, operators with discrepancies are identified as modified operators. Differences are categorized into three types: newly added operators (existing in the first operator list but not in the second); deleted operators (existing in the second operator list but not in the first); and modified operators (with the same identifier in both lists but differences in type or parameters).

[0031] Furthermore, after determining the changing operator and its change type, the cloud device extracts the complete binary code of the changing operator from the model file of the new version of the AI ​​model. For new and modified operators, the extracted binary code includes the operator type encoding field, the hyperparameter configuration serialization field, and the weight tensor binary data field. The concatenation of these fields represents all the information required for the edge device to load the operator. Further, for deletion operators, there is no need to extract the binary code; only the deletion instruction and operator identifier need to be recorded in the differential packet. Simultaneously, the cloud device determines the topological location information of the changing operator based on the model computation graph of the new version of the AI ​​model. The topological location information precisely describes the spatial location and connectivity of the changing operator in the computation graph, including: node number, i.e., the unique index of the operator in the node sequence of the computation graph; level depth, i.e., the longest path length from the operator to the input node; a predecessor node identifier list, i.e., the source node identifiers corresponding to all edges with the operator as the output target; and a successor node identifier list, i.e., the target node identifiers corresponding to all edges with the operator as the input source. The complete record of topology location information ensures that when applying differential packages, the edge device side can accurately assemble each change operator into the correct topology location in the computation graph.

[0032] Furthermore, the cloud device packages the binary code of the change operator, the topology location information, the version identifier of the new version AI model, and the version identifier of the old version AI model according to a predefined structured format to form an operator-level difference package, and uses this operator-level difference package as the difference package described in Embodiment 1. The file header of the packaged format sequentially includes: the difference format version number, the version identifier of the new version AI model, the version identifier of the old version AI model, and the total number of change operators. The file body consists of a number of change operator data segments arranged sequentially, the same number as the total number of change operators. Each data segment includes an operator identifier, a change type enumeration value, a topology location information length, topology location information data, a binary code length, and binary code data.

[0033] This embodiment performs differential generation at the structured semantic level of the model computation graph, elevating the granularity of difference extraction from semantically insensitive binary byte blocks to the operator level with explicit computational semantics. For typical large machine vision models or physical simulation models on embedded intelligent devices, a single iteration update usually involves only changes to a few to dozens of operators. The operator-level differential packet only needs to carry the binary code and topological location information of these changed operators. The size of the differential packet can be reduced by more than two orders of magnitude compared to the full model file, for example, from 500MB to hundreds of KB. Under the conditions of frequent model iteration and narrowband IoT networks in industrial fields, this order of magnitude reduction in size means that the update transmission time is shortened from several hours to tens of seconds, significantly reducing bandwidth consumption and network occupation for normal device operation. Furthermore, the embedding of topological location information enables edge devices to accurately assemble nodes at the node level based on the structured information of the computation graph when applying differential packets. In principle, this avoids the inherent problem in traditional binary differential schemes where insertion or deletion operations cause subsequent address offsets, leading to positioning failures and assembly errors.

[0034] S2, the cloud device encrypts and digitally signs the differential packet to obtain a secure differential packet.

[0035] In practice, the cloud device encrypts and digitally signs the generated differential packet to obtain a secure differential packet. The encryption operation can employ a symmetric encryption algorithm. The specific process is as follows: The cloud device's encryption module first generates a one-time random symmetric key. This symmetric key is used to encrypt the plaintext data of the differential packet, generating ciphertext differential data. Simultaneously, a hash value is calculated on the plaintext of the differential packet, serving as the original integrity check value. This original integrity check value is used to verify whether the decrypted differential plaintext is consistent with the original plaintext data before encryption after decryption by the target edge device. Further, the symmetric key is encrypted using an asymmetric public key pre-bound to the target edge device, generating a key ciphertext. The digital signature operation uses the private key held by the cloud device to perform a hash calculation on the overall data packet composed of the ciphertext differential data, the key ciphertext, and the original integrity check value. The resulting hash value is then signed using the private key to generate a digital signature value. Finally, the ciphertext differential data, the key ciphertext, the original integrity check value, and the digital signature value are encapsulated according to a predefined security protocol data format to form a secure differential packet. Furthermore, the security protocol data format defines the length, order, and encoding / decoding method of each field to ensure consistent encapsulation and parsing by both the sender and receiver. Moreover, this security mechanism, combining digital envelopes with digital signatures, simultaneously achieves three security objectives from a cryptographic perspective: confidentiality is guaranteed by symmetric encryption, ensuring the differential packet is not eavesdropped on during network transmission; integrity is guaranteed by hash verification, ensuring the differential packet content is not tampered with; and source authentication and non-repudiation are guaranteed by digital signatures, ensuring the secure differential packet is indeed issued by a legitimate cloud device and preventing attackers from forging update instructions.

[0036] S3, the cloud device sends the security differential packet to the target edge device.

[0037] In practice, the cloud device sends the security differential packet to the target edge device. This sending operation can be based on standard application-layer network protocols. In scenarios with relatively ample bandwidth in local area networks or leased lines, a Hypertext Transfer Security Protocol (HTTP) based on the Transmission Control Protocol (TCP) can be used, leveraging its reliable connection management and breakpoint resumption capabilities to ensure the complete delivery of the security differential packet. Furthermore, in IoT scenarios with low bandwidth, high latency, or intermittent connectivity, a Message Queuing Telemetry Transport Protocol (MQTP) can be used, utilizing its publish / subscribe model and Quality of Service (QoS) level control to achieve asynchronous push of the security differential packet with extremely low overhead. Further, the cloud device, based on a pre-maintained device list, device grouping tags, and update policy configuration in its device management database, determines the target edge device requiring this model update and sends the security differential packet to the target device's network address via push.

[0038] In some preferred embodiments, the cloud device sends the security differential packet to the target edge device, including: obtaining device grouping information and canary release ratio, wherein the device grouping information includes at least one of hardware architecture grouping, operating environment grouping, and business importance grouping; determining a candidate edge device set based on the device grouping information; selecting a portion of edge devices from the candidate edge device set as the target edge device based on the canary release ratio; and sending the security differential packet to the selected target edge device.

[0039] In practice, for industrial IoT platforms managing hundreds, thousands, or even tens of thousands of intelligent edge devices, pushing a new AI model to all devices at once is a high-risk operation. Different edge devices may have different hardware versions, firmware versions, run on different operating system kernels, and have different network environments and workloads. If the new model has hidden defects that have not been tested or has compatibility issues with specific hardware versions of a specific batch of devices, a full push will cause a large number of devices to fail simultaneously within the same time window. For production lines, this means a complete shutdown, and for warehouse robot clusters, it means the paralysis of the entire warehouse operation. To address this, this embodiment obtains device grouping information and canary release ratios. The device grouping information includes at least one of hardware architecture grouping, operating environment grouping, and business importance grouping. Target edge devices are selected according to a phased, gradual push strategy of first conducting small-scale pilot verification and then gradually expanding the coverage. This strictly controls the risk impact of a single model update within a limited scope, while effectively identifying and isolating compatibility issues related to specific hardware or environments through the grouping mechanism.

[0040] First, the cloud-based device obtains device grouping information and the canary release ratio. This device grouping information includes at least one of hardware architecture grouping, operating environment grouping, and business importance grouping. Device grouping is a management strategy that organizes massive heterogeneous edge devices into different logical groups according to classification dimensions with operational significance. Grouping dimensions include, but are not limited to: hardware architecture dimension, such as device groups based on x86 processor platforms and device groups based on ARM processor platforms; the instruction sets and numerical precision of the two architectures may differ, and the inference behavior of the same model on the two platforms needs to be verified separately; operating environment dimension, such as temperature and humidity-controlled indoor fixed device groups and outdoor all-weather mobile device groups; the impact of ambient temperature, humidity, and vibration on sensor data and device heat dissipation differs; further, business importance dimension, such as critical device groups undertaking core production tasks that cannot be interrupted and non-critical device groups undertaking auxiliary handling tasks; the tolerable risk levels differ. The canary release ratio is a numerical parameter indicating the percentage of devices that should be covered in the first batch of this update. It is set by operations personnel on the update strategy configuration interface of the cloud management platform based on the magnitude of model changes, the sufficiency of historical testing, and the risk assessment level.

[0041] Furthermore, based on the device grouping information, the cloud-based device queries the device management database for all online edge devices whose device tags match the specified group tags. It then aggregates the unique device identifiers and network addresses of these devices into a candidate list, i.e., the candidate edge device set. Query conditions can combine multiple grouping dimensions for AND / OR logical filtering.

[0042] Furthermore, based on the canary release ratio, cloud devices select a portion of edge devices from the candidate edge device set as target edge devices. The selection strategy can adopt a stratified random sampling method, sampling proportionally according to the proportion of each subgroup in the candidate set; or it can adopt a priority ranking method, prioritizing devices with higher historical update success rates, current operating load below the threshold, or marked as low priority as the first batch of canary targets, in order to further reduce the potential risks in the canary phase.

[0043] Furthermore, after selecting target edge devices, the cloud device sends security differential packets one by one to the network addresses of the selected target edge devices. The remaining candidate edge devices not selected in the initial gray-scale release continue to run the old version of the AI ​​model and continue to report operational metrics to the cloud. During the observation period of the first batch of devices in the gray-scale release, the cloud device continuously monitors the operational status and abnormal rollback events reported by the target edge devices. If no abnormal rollback occurs within the preset observation period and the operational metrics remain stable, the operations and maintenance personnel can increase the gray-scale release ratio to the next tier on the management platform, for example, from 10% to 30%, and the cloud device will automatically push the security differential packets to the new batch of target devices. This process is gradually advanced until all devices are updated. If an abnormal rollback or deterioration of metrics is detected during the gray-scale observation period, the operations and maintenance personnel can immediately pause the release, roll back the affected devices, and investigate and repair the problems exposed during the gray-scale phase to prevent further expansion of the impact.

[0044] This embodiment transforms large-scale model updates from a high-risk, one-time full rollout into a phased, observable, pauseable, and rollback-capable gradual release process by introducing device grouping and canary release ratios. Furthermore, operations personnel can first push the new model to low-risk pilot devices (10% of the total number of devices). After sufficient observation and verification throughout a complete business cycle or stress cycle, confirming normal functionality and no performance degradation, the rollout ratio can be gradually increased until all devices are covered. This strategy further strictly limits the potential impact of a single model update to a small area corresponding to the canary release ratio. Even in the worst-case scenario where the new model has serious defects, only a small number of pilot devices will be affected, while the vast majority of the device cluster can continue to operate the old version model normally, ensuring the overall continuity of production or operations is not fatally impacted. Furthermore, the device grouping function supports executing independent canary verification pipelines for devices on different hardware platforms and operating environments. This effectively identifies and isolates compatibility issues related to specific hardware architectures or environmental conditions during the canary phase, preventing these hidden problems from erupting after a full rollout.

[0045] S4, the target edge device performs signature verification and integrity verification on the received security differential packet, and obtains the verified differential packet after both signature verification and integrity verification are passed.

[0046] In practice, after receiving the secure differential packet, the target edge device performs signature verification and integrity verification on the received secure differential packet. The signature verification operation is a cryptographic process to verify the authenticity of the source of the secure differential packet. The specific steps are as follows: The target edge device uses the cloud public key paired with the cloud private key to decrypt the digital signature value in the secure differential packet, obtaining the first hash value calculated by the cloud device when signing; at the same time, it performs hash calculation on the three parts of the secure differential packet: the ciphertext differential data, the key ciphertext, and the original integrity verification value, to obtain the second hash value; the first hash value and the second hash value are compared. If the two hash values ​​are completely consistent, the digital signature verification is successful, confirming that the secure differential packet was indeed issued by the cloud device holding the legitimate cloud private key, and that the content after signing has not been modified by any third party. Furthermore, integrity verification is the process of verifying that the content of the differential packet remains consistent before and after encryption. The specific steps are as follows: the target edge device uses its own private key, which is bound to the target edge device, to decrypt the ciphertext key to obtain the symmetric key; then, it uses the symmetric key to decrypt the ciphertext differential data to obtain the differential plaintext; the differential plaintext is hashed, and the result is compared with the original integrity verification value parsed from the secure differential packet. Further, only if both signature verification and integrity verification pass, the target edge device retains the decrypted differential plaintext as a verified differential packet and proceeds to the subsequent model building process. If signature verification fails, it indicates that the source of the secure differential packet is suspicious or that its content has been tampered with during transmission; the target edge device discards the secure differential packet and records a security alarm. Furthermore, if integrity verification fails, it indicates that the decrypted differential data is inconsistent with the original data, indicating an anomaly in the encryption or decryption process; similarly, it is discarded and an error is reported. This layered security verification mechanism ensures that the differential packets reaching the model building stage have undergone end-to-end trusted verification.

[0047] S5, the target edge device constructs a new version AI model to be verified in memory based on the verified differential packet and the old version AI model currently running on the target edge device, and performs functional verification on the new version AI model to be verified.

[0048] In practice, the target edge device constructs a new version of the AI ​​model to be verified in memory based on the verified differential packets and the old version of the AI ​​model currently running on the target edge device. All operations in the construction process are completed in memory, without any writing or modification to the old version of the AI ​​model file stored on disk. Specifically, the target edge device first loads the currently running old version of the AI ​​model into an independent construction region in memory, forming a memory image of the old version of the AI ​​model. Further, this independent construction region is allocated in heap memory by the operating system and is isolated from the runtime stack region of the inference service process through a virtual address space, ensuring that the construction operation does not interfere with the ongoing inference computation. Further, based on the difference data blocks recorded in the verified differential packets and the location information of the difference data blocks, the target edge device performs replacement, insertion, or deletion operations on the data content at the corresponding positions in the memory image, thereby gradually assembling a complete memory representation of the new version of the AI ​​model, i.e., the new version of the AI ​​model to be verified, in memory. Furthermore, this in-situ memory reconstruction method based on the old model has the core advantage of avoiding the need to store two complete model files simultaneously on the limited storage space of edge devices, and also significantly shortens the time spent on model assembly. On typical embedded platform fourth-generation double-rate synchronous dynamic random access memory (DDR4), data block replacement operations in memory can reach a throughput of several gigabytes per second, while the disk I / O rate is usually only a fraction of that of memory.

[0049] Furthermore, the target edge device performs functional verification on the new version of the AI ​​model to be verified. The purpose of functional verification is to ensure that the new model, after being built in memory, can perform inference normally and behaves as expected before being deployed to online services, thus avoiding replacing an older version of the AI ​​model already in service with a model that has structural damage, assembly errors, or functional abnormalities. Further, one implementation of functional verification is as follows: the target edge device extracts a set of real historical business requests from its locally stored historical request buffer as a verification sample set. Each request in the verification sample set is input into the new version of the AI ​​model to be verified, the inference output results are collected, and compared with the inference results of the old version of the AI ​​model for the same request. A consistency index of the output results is calculated, such as the consistency rate of category labels in a classification task or the mean cosine similarity of the confidence vector. Further, when the consistency index meets a preset passing condition, the functional verification is deemed successful. The functional verification process is executed in a runtime environment independent of the online inference service. It shares underlying computing resources with the online inference service, but resource access is ensured to be mutually independent through process isolation or containerization technology. The request processing latency and throughput of the online inference service are not affected by the parallel execution of functional verification.

[0050] In some preferred embodiments, the target edge device constructs a new version AI model to be verified in memory based on the verified differential packet and the old version AI model currently running on the target edge device. This includes: the target edge device loading the complete computation graph representation of the currently running old version AI model in memory; determining whether the version identifier of the old version AI model recorded in the operator-level differential packet matches the actual version identifier of the old version AI model currently running on the target edge device; if they match, locating the node to be replaced in the complete computation graph representation according to the topology location information in the operator-level differential packet, and replacing the operator binary code of the located node with the binary code of the corresponding changed operator in the operator-level differential packet, thereby forming the new version AI model to be verified.

[0051] In practice, after the operator-level difference package is verified as trustworthy and complete, the next crucial step is to apply this difference package to transform the old version of the AI ​​model into the new version to be verified in memory. Since the operator-level difference package carries operator-level change information rather than complete model data, the edge device must have the ability to accurately assemble the operator-level changes into the old model's computation graph. The core challenges of this assembly process are twofold: First, it must be confirmed that the version of the currently running old model is completely consistent with the version of the old model on which the difference package is based; otherwise, the topology location information will become invalid due to version mismatch. Second, the nodes that need to be replaced must be accurately located in the old model's computation graph, and the operator replacement must be completed without compromising the overall structural integrity of the computation graph. To address these challenges, this embodiment effectively utilizes a bidirectional matching verification of version identifiers and a node location and replacement mechanism based on topology location information.

[0052] First, the target edge device loads the complete computational graph representation of the currently running older version of the AI ​​model into memory. Model files stored on the edge device typically use a specific serialization format, such as the Open Neural Network Exchange Format (ONNX) or a framework-specific format based on Protocol Buffers (Protobuf). During loading, the model loader first parses the model file header, reading metadata such as the total number of nodes, edges, and input / output specifications of the computational graph. Then, it sequentially parses each operator node, creating a corresponding node object and filling it with pointers to operator type, parameters, and weight data. Finally, it parses all edge objects, establishing input / output reference relationships between nodes. The completed computational graph representation, a directed acyclic graph data structure with a root node as its entry point, resides in memory and serves as the object for subsequent operator replacement operations.

[0053] Furthermore, the target edge device reads the version identifier of the old version AI model recorded in the file header from the packet body data of the operator-level difference package. Simultaneously, the target edge device queries its local model version information file to obtain the actual version identifier of the currently running old version AI model. This model version information file is a metadata file written and synchronized by the cloud device during the model's initial deployment or each successful update. The target edge device compares the two version identifiers character by character to determine if they match. If the two version identifiers are completely identical, it is considered a match, proving that the operator-level difference package is the correct difference generated for the currently running model, possessing the basic prerequisites for application to the current model, and proceeding to the subsequent node replacement process. If the two version identifiers are inconsistent, it is considered a mismatch. Version mismatch means that the computation graph structure referenced by the topology location information in the difference package may be completely different from the actual computation graph structure; forcibly applying it will highly likely lead to damage to the computation graph structure. Furthermore, in this case, the target edge device aborts the update process, discards the operator-level differential packet, releases the memory buffer occupied by the differential packet, and reports an error status code of version mismatch and the local actual version identifier to the cloud device, so that cloud operation and maintenance personnel can investigate and recreate the differential packet of the correct version.

[0054] Further, after version matching is confirmed, the target edge device enters the node replacement process. The target edge device sequentially traverses each changed operator data segment in the operator-level differential package file body. For the current data segment, it reads the change type enumeration value. If the change type is "modified," the target edge device directly locates the node to be replaced in the complete computation graph representation using the node number index based on the topology location information (specifically, the node number) in the data segment. Further, after confirming that the node exists and that its current operator type and other attributes match the expected old operator information implicit in the differential package, the target edge device redirects the node's operator binary code pointer to a copy of the changed operator binary code carried in the differential package in memory, while simultaneously updating the parameter attribute set. Further, to ensure the stability of memory replacement, the changed operator's binary code has the same memory layout and input / output interface definition as the old operator, or the operator is replaced through a runtime dynamic link library loading mechanism. The replacement operation involves only pointer redirection and a small amount of memory copying, which can be completed at the microsecond level. If the change type is "Add", the target edge device creates a new node object in the complete computation graph representation, loads the change operator binary code into the new node, and then, based on the predecessor and successor node identifiers in the topology location information, locates the corresponding node in the computation graph and establishes a new directed edge connection, integrating the new node into the data flow path of the computation graph. If the change type is "Delete", the target edge device locates the node to be deleted based on the node number, records the predecessor and successor node identifiers of the node, then removes the node from the computation graph, and establishes direct edge connections between all predecessor and successor nodes, bypassing the deleted node to maintain smooth data flow in the computation graph. Furthermore, after processing all change operator data segments, the complete computation graph representation in memory has been completely transformed from the old version to the new version, which is the new version AI model to be verified.

[0055] This embodiment establishes a pre-check for version consistency before model reconstruction by performing bidirectional matching verification of version identifiers. This automatically detects and prevents version mismatch risks caused by incorrect version differential packages pushed from the cloud or abnormal local version records on edge devices, thus fundamentally avoiding model building errors and potential system crashes caused by version incompatibility. Furthermore, precise node-level replacement guided by topology location information based on a complete computation graph representation in memory fully utilizes the structured information of the computation graph. Each changed operator is precisely assembled to its correct topology position in the computation graph, ensuring that the constructed model computation graph is completely equivalent to the new version model in the cloud in terms of logical structure, operator connections, and data flow paths. Moreover, all construction operations are completed in memory without modifying the old version AI model files on the edge device's disk, achieving complete decoupling between the construction process and persistent storage. This design provides dual protection: memory operations during the build process are much faster than disk operations, and model assembly takes very little time; even if the build process is interrupted by an unexpected exception, the old model files on the disk and the old model inference service running in memory remain intact, and the exception will not spread to online business.

[0056] In some preferred embodiments, the functional verification of the new version AI model to be verified includes: obtaining real business requests processed by the old version AI model within a preset historical period as a replay sample set; inputting the replay sample set into the old version AI model and the new version AI model to be verified respectively to obtain a first inference result set and a second inference result set; calculating the distribution similarity between the first inference result set and the second inference result set; and determining that the functional verification is passed when the distribution similarity is higher than a preset compatibility threshold.

[0057] In practice, on edge devices, the new AI model to be verified is dynamically built in memory based on the old model and differential packets. The correctness of the inference results and the consistency of the behavior have not been verified in any actual way. If the functional verification step is skipped and the model to be verified is directly deployed online to replace it, any hidden errors in the model during the construction process (such as undetected bit flips in the weight data of individual operators in the differential packet during transmission or decryption, or incorrect writing positions due to positioning errors during operator replacement) will cause abnormal inference output, posing a serious security risk to the embodied intelligent device performing physical actions. For example, deviations in the inference results of the object detection model may lead to incorrect gripping positions of the robotic arm, causing damage to the workpiece or equipment collisions. Traditional model testing methods usually rely on a limited set of manually constructed test samples. The number and diversity of these samples are limited by the cost of manual collection, making it difficult to fully cover the various boundary conditions and complex data distributions that the device may encounter in the real operating environment. Therefore, passing offline testing does not equate to normal operation after deployment. Therefore, this embodiment uses historical real business requests as a replay sample set to compare the statistical similarity of the inference results distribution of the new and old models under the same input, providing a model function verification scheme that is closer to the distribution of real online data and has greater predictive power.

[0058] First, the target edge device acquires real business requests processed by the old version of the AI ​​model within a preset historical time period as a replay sample set. The preset historical time period can be flexibly set according to the storage capacity and business characteristics of the edge device, and is usually selected as a representative operating interval before the new model is downloaded, such as a complete cycle covering the business peak and off-peak periods in the past 24 hours. Real business requests are the raw inference request data actually received by the inference service from upstream sensors or business systems during normal operation, containing complete data of the input tensor. During the operation of the inference service, the target edge device continuously and asynchronously writes the request data processed by the inference service and its arrival timestamp to the local replay buffer through a request recording hook function embedded in the inference framework. The replay buffer is implemented in memory as a fixed-length circular queue. When the queue is full, it automatically overwrites the record with the earliest timestamp, ensuring that the buffer always retains a snapshot of requests within the most recent period.

[0059] Furthermore, the target edge device initiates the replay verification process in a memory space independent of the online inference service's runtime domain. Real business requests from the replay sample set are retrieved one by one in the order of their original arrival timestamps and input into the old version AI model and the new version AI model to be verified, respectively, to obtain a first inference result set and a second inference result set. For classification models, each inference result is a vector containing confidence scores for each class; for example, for a 1000-class classification task, each result is a 1000-dimensional probability vector with all dimensions summed to 1. For regression models, each inference result is a continuous numerical value or a numerical vector. The replay verification process is executed in an independent memory runtime domain, running in a different process address space or container instance than the online inference service. The processor core and memory limits for the verification process are configured through the operating system's cgroup mechanism or the container's resource quota mechanism to ensure that the replay verification process does not preempt critical computing resources of the online service or cause a significant increase in online inference latency.

[0060] Furthermore, after obtaining two sets of inference result sets, the target edge device calculates the distribution similarity between the first and second inference result sets. Distribution similarity measures the overall behavioral consistency of the two sets of inference results from a statistical distribution perspective, rather than comparing the differences of individual results one by one. One-by-one comparisons may produce a large number of spurious differences when dealing with models with numerical randomness. The calculation method is as follows: First, the calculation method of the distribution metric is determined according to the data type of the inference task: For classification tasks where the output is category confidence, histogram statistics are performed on the highest confidence of each inference result in both the first and second inference result sets. The confidence value range is divided into several intervals from 0 to 1, and the number of samples falling into each interval is counted and normalized to obtain the first probability distribution P and the second probability distribution Q; For regression tasks where the output is a continuous vector, the values ​​of each dimension in the output vectors of the two inference result sets are extracted, and bucketing and normalization statistics are performed according to a preset value range to similarly obtain the first probability distribution P and the second probability distribution Q.

[0061] Furthermore, the Jason-Shannon divergence is used as a measure of the distributional distance between the two probability distributions mentioned above. The Jason-Shannon divergence is an improvement upon the KL divergence. Its core logic is as follows: first, construct the average distributions of the two probability distributions; then, calculate the dispersion between each original distribution and the average distribution; finally, average the dispersions of the two distributions to obtain the final distributional distance value. This calculation process ensures that the Jason-Shannon divergence possesses symmetry, meaning that the distance between distribution P and Q is equal to the distance between distribution Q and P. Simultaneously, this distance value is fixed and bounded, with its value stable between 0 and 1, where 0 indicates that the two distributions are completely consistent, and 1 indicates that the two distributions are completely divergent. Therefore, this divergence value can stably and accurately reflect the statistical deviation of the new version model from the old version model in overall inference behavior.

[0062] Furthermore, the Jason-Shannon divergence value is subtracted from 1 to obtain the distribution similarity between the first and second inference result sets. When this distribution similarity is greater than a preset compatibility threshold (e.g., 0.9), the functional verification is deemed successful.

[0063] Furthermore, when the calculated distribution similarity is higher than a preset compatibility threshold, the target edge device determines that the function verification has passed, indicating that the new model's output behavior is highly consistent with the old model when processing requests with the same distribution as the online model, thus meeting the prerequisite for replacement and deployment. The compatibility threshold can be set according to the business scenario's requirements for model behavior consistency. When the distribution similarity is lower than or equal to the compatibility threshold, the function verification fails, indicating that the new model has significant differences in inference behavior compared to the old model. At this time, the target edge device discards the new version AI model to be verified in memory, releases the memory resources it occupies, and reports the details of the function verification failure to the cloud device.

[0064] This embodiment uses business requests collected from a real production environment as the verification sample set. The statistical distribution of the replay samples is naturally consistent with the distribution of real online data. The verification results can more accurately predict the actual performance of the new model after its launch than a limited test set constructed manually, effectively solving the problem of a significant gap between offline verification pass rate and online operation failure rate. Furthermore, the verification method based on distribution similarity rather than comparing results one by one has a natural tolerance for reasonable fluctuations in individual samples caused by differences in floating-point operation order or random operators between the old and new models, effectively avoiding false judgments of verification failure due to non-substantial differences. The entire verification process is carried out in an independent operating domain, forming process-level or container-level isolation from the online inference service, ensuring zero intrusion and zero interference of the verification operation to online business. The embodied intelligent device can still perform its work tasks normally while performing model function verification, without affecting the production line cycle time or inspection progress.

[0065] S6. After the function verification is passed, the target edge device performs an atomic replacement operation. Without interrupting the inference service on the target edge device, the inference service is switched from the old version AI model to the new version AI model to be verified, and a copy of the old version AI model is retained as a rollback backup model.

[0066] In practice, after functional verification is passed, the target edge device performs an atomic replacement operation. The core characteristic of the atomic replacement operation lies in its indivisibility: the entire model switching action appears to an external observer as a single, instantaneous, and uninterrupted state change. At any given moment, observing the service entry point of the inference service will point to either the old version of the AI ​​model or the new version of the AI ​​model to be verified; there will be no intermediate transition state where two models simultaneously partially process requests. Furthermore, without interrupting the inference service on the target edge device, the atomic replacement operation switches the inference service from the old version of the AI ​​model to the new version of the AI ​​model to be verified, while retaining a copy of the old version of the AI ​​model as a rollback backup. A typical way to implement atomic replacement is as follows: the target edge device maintains a model service registry stored in a shared memory area, which records the memory entry addresses of currently active model instances. The atomic replacement operation utilizes the compare-and-swap instructions provided by the processor to indivisibly replace the entry address of the active model instance in the registry from the address of the old version of the AI ​​model to the address of the new version of the AI ​​model to be verified in a single operation. Furthermore, after the replacement is complete, the inference service's request scheduler obtains the new entry address upon the next registry read, and all newly arriving inference requests are routed to the new version of the AI ​​model to be verified for processing. After the replacement operation, the old version of the AI ​​model continues to reside in a spare area of ​​memory, retaining all its model parameters, runtime state, and request context as a rollback backup model. Moreover, the existence of the rollback backup model enables the system to quickly recover to a known stable state when the new model malfunctions, forming the basis for the subsequent automatic rollback mechanism.

[0067] In some preferred embodiments, the target edge device performs an atomic replacement operation, including: the target edge device maintaining a model service registry, which records currently active model instances; the target edge device loading the new version AI model to be verified into memory and marking the new version AI model to be verified as inactive in the model service registry; exchanging the active marker of the old version AI model in the model service registry with the inactive marker of the new version AI model to be verified through a single atomic write operation; after the exchange is completed, new inference requests are routed to the new version AI model to be verified that is marked as active in the model service registry.

[0068] In practical implementation, during the continuous operation of an embodied intelligent device, the inference service may be processing continuous sensor data streams, such as continuous frame image sequences in visual simultaneous localization and mapping (SLAM) or real-time joint status feedback data in robotic arm motion planning. If there is a service interruption or request loss during model replacement, the temporal continuity of data processing will be disrupted, potentially causing the device to lose tracking of its own pose or environmental state for a short period, thereby executing incorrect control commands and possibly causing safety accidents in industrial environments. Traditional service interruption replacement schemes require terminating the inference service process, overwriting the old file with the new model file, and then restarting the service. This process inevitably creates a service interruption window lasting from seconds to minutes, during which all inference requests cannot be responded to. To address this, this embodiment centrally manages the active state of model instances through a model service registry and utilizes a single atomic write operation of the processor to simultaneously flip the active flags of the old and new models, achieving seamless switching of inference service request routing and zero-loss retention of the old model, completely eliminating the service interruption window.

[0069] The target edge device maintains a model service registry within its inference service framework. This model service registry is a data structure allocated in the operating system's shared memory region. Shared memory allows multiple processes to achieve zero-copy shared access to data by mapping the same physical memory page. The request scheduling component and model management component of the inference service each access the same registry data through memory mapping within their respective process spaces. Furthermore, each record in the model service registry represents a model instance loaded into memory. Its core fields include: a model identifier field, storing the model's unique name or number as a string; a model instance memory entry address field, storing a pointer to the virtual address of the model's inference entry function; and an activity flag field, a Boolean variable with a value of logical true or logical false. The semantic definition of the activity flag is: when the value is logical true, the model instance is the currently active inference service provider, and the request scheduler should route newly arriving inference requests to this instance for processing; when the value is logical false, the model instance is loaded but in a standby or decommissioning state, and the request scheduler does not distribute new requests to it. Furthermore, the dispatcher's distribution logic is as follows: each time an inference request is received, it iterates through all records in the model service registry, filters out records marked as active as true, and puts the request into the request queue of that model instance.

[0070] Furthermore, after the new version of the AI ​​model to be verified completes functional verification and passes confirmation, the target edge device inserts the memory entry address and model identifier of the new version of the AI ​​model as a new record into the model service registry, and initializes the activity flag field of the new record to logical false, marking it as inactive. At this time, the new version of the AI ​​model to be verified is resident in memory and is in a standby state that can be activated at any time, but because the activity flag is false, the request scheduler will not distribute any inference requests to it. The activity flag of the old version of the AI ​​model record is still logical true at this time, and it continues to receive all inference requests.

[0071] Furthermore, the target edge device invokes an atomic replacement function to switch between the old and new models. The core of this atomic replacement function utilizes the processor's compare-and-swap instruction or the atomic variable interface provided by the operating system kernel. Within an indivisible bus cycle, it atomically overwrites the content of the active flag storage location corresponding to the old version AI model record in the model service registry from logical true to logical false, while simultaneously atomically overwriting the content of the active flag storage location corresponding to the new version AI model record to be verified from logical false to logical true. Further, the atomic instruction locks the relevant cache lines through the processor's cache coherence protocol, ensuring that no other processor core or thread can observe the two active flags being in an inconsistent intermediate state before the entire atomic operation is completed. Furthermore, the request scheduler reads the registry before the atomic operation, seeing the old model active and the new model inactive; after the atomic operation, it reads the registry, seeing the old model inactive and the new model active; there is no point in time where a scheduler can simultaneously see both models as either active or both as inactive. The instantaneity and consistency of state transitions are the key technical foundation for ensuring uninterrupted service and no request loss.

[0072] Furthermore, after the atomic swap of the active flag is completed, the request scheduler will only dispatch new requests to the new version of the AI ​​model that is still valid when dispatching requests. Inference requests that have already been dispatched to the old version of the AI ​​model and are currently being processed will continue to be executed by the old version of the AI ​​model until the inference result is output and returned to the caller, unaffected by the active flag switch, because the request processing context, model state, and intermediate computation results are all stored in the runtime stack of the old version of the AI ​​model. Furthermore, after processing all accepted ongoing requests, the old version of the AI ​​model, whose active flag is now false, will no longer receive new requests and enters a silent standby state. Its complete image in memory is preserved as a rollback backup model.

[0073] This embodiment transforms the essence of model replacement from file-level replacement and process restart in traditional solutions to the atomic state flipping of active markers in the model service registry. Through synchronous exchange of active markers implemented by processor atomic operation instructions, the switching process can be completed at the nanosecond level, completely eliminating the second- to minute-level service interruption window of traditional off-line update solutions. This provides truly uninterrupted hot update capabilities for embodied intelligent devices with extremely high real-time and continuity requirements. Furthermore, the request routing mechanism based on active markers naturally guarantees the complete processing lifecycle of requests already accepted on the old model. The entire switching process will not lose any currently processed requests and their computational context, ensuring the inter-frame continuity and state integrity of machine vision or physical simulation operations. Furthermore, the old model is fully retained in memory in a hot-standby form after the switch, forming a dual-model coexistence architecture with the new model. If the new model malfunctions, a reverse rollback can be completed within the same nanosecond timeframe through another atomic exchange of active markers. Switching in both forward and reverse directions is lossless and imperceptible to business operations, constituting a two-way security guarantee for the entire lifecycle operation and maintenance of the model.

[0074] S7. After completing the atomic replacement operation, the target edge device monitors the operating metrics of the inference service. When the operating metrics meet the abnormal conditions, the inference service is rolled back from the new version AI model to be verified to the rollback backup model.

[0075] In practice, after the target edge device completes the atomic replacement operation, it initiates a performance metric monitoring mechanism to continuously monitor the performance metrics of the inference service. These performance metrics are collected from two dimensions: the first dimension consists of fundamental performance metrics reflecting model computational performance, including inference latency and throughput. Inference latency refers to the time interval from when a request arrives at the inference service interface to when the inference result is returned, and throughput refers to the number of requests completed by the inference service per unit time. The second dimension consists of business semantic metrics reflecting the quality of the model output, including the confidence distribution and classification accuracy of the inference results. The confidence distribution refers to the statistical distribution of confidence scores for each category in the inference results. Furthermore, metric collection is achieved through metric collection hook functions embedded within the inference service framework. After each inference request is processed, the corresponding metric value is automatically recorded and aggregated in the time-series metric buffer.

[0076] Furthermore, when operational metrics meet preset abnormal conditions, the target edge device automatically triggers a rollback operation. Abnormal conditions can be defined as follows: within multiple consecutive monitoring periods, the moving average of inference latency consistently exceeds a preset multiple of the baseline value, or the mean of the confidence distribution is lower than a preset quality threshold. After triggering the rollback operation, the target edge device performs a model switching action that is the reverse of the forward atomic replacement operation, switching the active model instance of the inference service from the new version AI model to be verified back to the rollback backup model, thereby restoring the service to its stable state before the update in a very short time. The rollback operation is also implemented by atomically modifying the model service registry, without interrupting the inference service itself.

[0077] This embodiment encrypts and digitally signs the differential packets, shifting security protection from the edge device loading stage to the generation and transmission of the update packets. This constructs an end-to-end trusted update channel from the cloud to the edge, eliminating the security risks of model update packets being eavesdropped on, tampered with, or replaced in untrusted network transmission links. This meets the mandatory requirements of enterprise-level applications for model distribution security. The method of building a new model in memory based on the old model image and the differential packets eliminates the need to store two complete model files simultaneously on the limited embedded storage space of the edge device, significantly reducing storage resource requirements. Simultaneously, the high-speed random access of memory greatly shortens the model assembly time. Furthermore, the functional verification step performs pre-testing of the new model in a memory space independent of the online service. Only models that pass verification are switched online, effectively avoiding the risk of business failures caused by directly replacing defective models. Atomic replacement operations are completed through a single entry address change in the model service registry, reducing the model switching time window from seconds to minutes in traditional downtime schemes to the processor instruction execution level. This ensures service continuity for critical businesses such as machine vision inference or physics simulation calculations that require 24 / 7 continuous operation. Furthermore, the retention of copies of old models and the automatic anomaly rollback mechanism enable edge devices to autonomously restore to previously stable versions that have been validated over a long period of operation without human intervention when performance degradation or output anomalies occur after the new model is launched. For massive embodied intelligent devices deployed in remote, unattended environments, this significantly reduces maintenance manpower costs and mean time to recovery, improving the operational reliability and long-term availability of the entire device cluster.

[0078] In some preferred embodiments, after the target edge device completes the atomic replacement operation, it monitors the operational metrics of the inference service. When the operational metrics meet abnormal conditions, the inference service is rolled back to the rollback backup model. This includes: collecting the inference latency of the inference service after the atomic replacement operation is completed and the confidence distribution of the inference results output by the inference service; calculating the upward trend of the inference latency within a sliding time window and the offset trend of the confidence distribution within the sliding time window; determining that the abnormal conditions are met when the upward trend exceeds a first threshold and the offset trend exceeds a second threshold; and triggering the rollback process to switch the inference service from the new version AI model to be verified back to the rollback backup model.

[0079] In practice, the initial operational phase after a new model goes live is the most problematic window. Some model defects may not be triggered during the functional verification phase because the replay sample set does not cover specific data distributions. However, they will gradually emerge when facing long-tail data, rare scenarios, or memory fragmentation effects after long-term continuous operation in a real production environment, manifesting as a continuous increase in inference latency or a gradual decline in the quality of inference results. If only a single operational indicator is relied upon for anomaly judgment, such as monitoring only inference latency, it is easy to misjudge normal queuing latency caused by a surge in request volume during peak business periods as model anomalies, triggering unnecessary rollbacks and affecting normal business operations. To address this, this embodiment collects two different operational indicators—inference latency and inference result confidence distribution—simultaneously, calculates their changing trends within a sliding time window, and uses the simultaneous deterioration of both trends as an anomaly judgment condition, significantly improving the accuracy and anti-interference capability of anomaly monitoring.

[0080] First, after the atomic replacement operation is completed, the target edge device starts a metrics collection thread. This thread runs at a fixed sampling period, aggregating performance and quality data from all inference requests processed within each period. For each inference request, two key metrics are recorded: inference latency, obtained by recording the difference between the request arrival timestamp and the result return timestamp; and confidence distribution, i.e., the confidence component in the inference result vector, which, for classification models, is the confidence value corresponding to the category with the highest confidence. The sampling period can be configured according to the business's sensitivity requirements for anomaly detection, for example, set to 1 second.

[0081] Furthermore, the target edge device performs time-series analysis on the collected inference latency data to calculate the upward trend of the inference latency within a sliding time window. The sliding time window is a data window of fixed length, for example, 300 sampling periods (5 minutes). As time progresses, the window slides forward on the time axis, always maintaining latency data from the most recent N sampling periods within the window. The upward trend is calculated as follows: the average of the N inference latency periods within the window is taken as the mean latency of the current window; using the start time of the window as the independent variable and the mean latency of each sampling period as the dependent variable, a least-squares linear regression is performed on the latency time series within the window to obtain the slope of the regression line. A positive slope indicates an upward trend in latency within the window, with a larger positive value indicating a more pronounced increase; a slope close to zero indicates stable latency.

[0082] Furthermore, the target edge device simultaneously performs time-series tracking on the collected confidence data, calculating the offset trend of the confidence distribution within the sliding time window. The offset trend is calculated as follows: in each sampling period, the mean confidence value of all inference results within that period is calculated, forming a time series of the mean confidence value; this mean confidence value series is also fitted with linear regression according to the sliding time window to obtain the slope of the regression line. A negative slope value indicates that the mean confidence value is decreasing within the window, suggesting a decline in the model's certainty regarding its inference results, which may be a sign of model performance degradation.

[0083] Furthermore, when both conditions are met simultaneously—the upward trend of inference latency exceeding the first threshold and the shift in confidence distribution falling below the second threshold—the target edge device is deemed to meet the abnormal conditions. This dual-confirmation logic, which simultaneously sends abnormal signals from two dimensions, can effectively distinguish between performance degradation of the model itself and fluctuations in indicators caused by external environmental factors: if only latency increases while confidence remains stable, it is likely due to background resource contention or increased request volume, and not attributed to model abnormality; if only confidence decreases slightly while latency remains stable, it may reflect a slow conceptual shift in the input data distribution, which is a normal adaptive behavior of the model in a dynamic environment. Only when the model's inference performance has indeed deteriorated will both latency and confidence show adverse trends simultaneously.

[0084] Furthermore, after determining that the abnormal conditions are met, the target edge device triggers a rollback process, which switches the active model instance of the inference service from the new version of the AI ​​model to be verified back to the rollback backup model by performing an active tag atomic swap again.

[0085] This embodiment constructs a redundant and complementary anomaly detection system using operational metrics across two dimensions: inference latency and confidence distribution. Rollback is triggered only when both dimensions simultaneously emit anomaly signals, logically eliminating the possibility of false alarms caused by momentary fluctuations in a single-dimensional metric due to external factors, significantly reducing the frequency of unnecessary rollback operations. Furthermore, the introduction of a sliding time window allows trend judgment to be based on continuous historical time-series statistical characteristics, rather than relying on instantaneous spikes at a single sampling point. This provides excellent smoothing and filtering effects against short-term fluctuations such as network jitter and sensor transient noise, further enhancing the stability and reliability of anomaly detection. Moreover, the entire process from anomaly monitoring and judgment to rollback triggering is autonomously executed locally by the edge device in a closed loop, without any interaction with the cloud or waiting for cloud commands. The end-to-end latency from anomaly detection to rollback completion depends only on the sliding window length and sampling period, enabling service recovery to a stable state within seconds to tens of seconds. This significantly shortens fault recovery time and ensures business continuity and system self-healing capabilities in remote, unattended scenarios.

[0086] In some preferred embodiments, calculating the upward trend of the inference latency within a sliding time window includes: obtaining a sequence of request volumes for the inference service within the sliding time window; normalizing the inference latency collected at each sampling point within the sliding time window based on the request volume corresponding to the sampling point to obtain a normalized latency value sequence; performing linear fitting on the normalized latency value sequence to obtain a normalized latency slope; and determining that the inference latency exhibits the upward trend when the normalized latency slope is greater than a preset slope threshold.

[0087] In practice, the request arrival rate for inference services is not constant in the actual operating environment of embodied intelligent devices, typically exhibiting significant peak-and-valley variations as business scenarios shift. For example, during peak periods of goods inbound, warehouse robots require high-frequency barcode recognition and pallet inspection, with request rates potentially several times higher than during off-peak times; similarly, when inspection robots enter complex terrain areas, the frame processing request density for visual SLAM is much higher than in open, straight areas. Assuming the model's inference performance remains constant, a sudden increase in request volume itself leads to an increase in the queuing time for inference requests in the service queue. According to the basic principles of queuing theory, the average queuing time increases non-linearly as the load approaches system capacity. Therefore, an increase in inference latency can be caused by two distinct reasons: first, increased queuing latency due to increased request volume; and second, increased processing latency due to increased computational time of the model itself. If these two reasons are not distinguished, the increased latency caused by increased request volume during peak business periods is highly likely to be misjudged as abnormal model performance, leading to erroneous model rollbacks during the busiest and most critical times for stable operation. To address this, this embodiment introduces request volume normalization preprocessing before delay trend calculation, standardizing the inference delay according to the corresponding request arrival rate. This allows the calculated delay increase trend to more purely reflect the changes in the model's own inference computing performance, thus solving the signal aliasing problem between load changes and model performance degradation.

[0088] The target edge device acquires the request volume sequence for the inference service within a sliding time window. In the metric collection thread, in addition to the average inference latency for each sampling period, the total number of new requests arriving at the inference service within that period is also recorded, i.e., the request volume. The request volumes for each sampling period within the sliding time window are arranged chronologically to obtain the request volume sequence.

[0089] Furthermore, the target edge device normalizes the average inference latency collected for each sampling period within the sliding time window based on the request volume value corresponding to that sampling period, resulting in a normalized latency value sequence. The normalization can be calculated by dividing the average inference latency for each sampling period by the logarithm of the request volume value for that period, or by the smoothed value of the request volume value. The theoretical basis for this normalization is that, under ideal conditions where the model's inference performance remains constant, the pure computation time of a single inference request is an inherent hardware attribute independent of the system's concurrent load and is unrelated to the number of requests queued simultaneously. Normalizing the average latency according to the arrival rate can, to some extent, isolate the additional latency component caused by queuing, resulting in a measure closer to the pure inference time of the model. Furthermore, if the model's computational performance remains stable, the normalized latency value sequence should randomly fluctuate around a stable mean during long-term operation; conversely, if the normalized latency value sequence shows a continuously monotonically increasing trend over time, it indicates that even after excluding the factor of request volume variation, the time taken by the model to process each request is still increasing, which can be attributed to a substantial deterioration in the model's computational performance.

[0090] Furthermore, the target edge device performs a linear fitting operation on the obtained normalized delay value sequence, calculates the linear regression slope of the sequence on the time axis, and obtains the normalized delay slope. When the normalized delay slope is greater than a preset slope threshold, it is determined that the inference delay has an upward trend caused by the degradation of the model's own performance.

[0091] This embodiment effectively separates the impact of request volume changes on inference latency from the latency trend signal through a request volume normalization preprocessing step. This allows latency rise trend detection to focus on changes in the model's own inference computing performance, rather than natural fluctuations in request volume. Furthermore, this processing solves the technical challenge of distinguishing between normal queuing latency during peak request periods and abnormal latency increases caused by model performance degradation on the original latency curve in real-world production scenarios with significant peak-valley variations in business load. This significantly reduces the probability of erroneous rollbacks triggered by increased request volume during peak business periods. Moreover, the normalized latency slope, as a load-decoupled measure of model performance degradation, has a clear and explicit physical meaning. Its rise can be reliably interpreted as a degradation in model computing performance, providing a more scientific quantitative basis for the automatic evaluation of the operational quality after model updates.

[0092] In some preferred embodiments, calculating the offset trend of the confidence distribution within the sliding time window includes: determining the confidence distribution of the inference service within the first time window after the atomic replacement operation is completed as the initial baseline distribution; collecting the confidence distribution of the inference service at a preset sampling interval within the sliding time window to obtain a sampling distribution sequence; calculating the bulldozer distance between each sampling distribution in the sampling distribution sequence and the initial baseline distribution to obtain a distance sequence; calculating the moving average of the distance sequence within the current sliding time window; if the bulldozer distance corresponding to the current sampling point is greater than a preset multiple of the moving average, then it is determined that the confidence distribution has the offset trend.

[0093] In practice, during the long-term operation of model inference services, the statistical distribution of input data may undergo slow and continuous natural drift due to factors such as seasonal changes in ambient lighting, gradual wear and tear on the appearance of the detected object, slow aging of sensor performance, or adjustments to the operational process. This drift is defined as concept drift in the field of machine learning. Concept drift leads to a gradual and continuous trend in the confidence distribution of the model output. For example, in object classification tasks, the mean confidence score of the model for each category gradually shifts. This is an inherent response behavior of the model when facing non-stationary dynamic environments and should not be confused with a sudden drop or severe fluctuation in confidence score caused by functional abnormalities after model updates. Furthermore, the baseline shape and normal fluctuation range of confidence distribution vary significantly under different model architectures and different business scenarios. A reasonable confidence distribution shift in an image classification model may already be a serious anomaly for an object detection model. Using a uniform, fixed static threshold to determine the anomaly of confidence shift for all models in all scenarios is clearly neither reasonable nor feasible. To address this, this embodiment selects the confidence distribution during the initial stable period of the new model after atomic replacement as a fixed initial baseline distribution, uses bulldozer distance as a robust measure of distribution differences, and constructs a personalized dynamic adaptive judgment threshold using the moving average of historical distance sequences. This effectively solves the problem of distinguishing between concept drift and abnormal shift, as well as the problem of the universality of fixed thresholds.

[0094] First, the target edge device determines the initial baseline distribution as the confidence distribution of the inference service within the first stable time window after the atomic replacement operation. The selection of the first stable time window should ensure that the new model has completed the necessary runtime warm-up, such as just-in-time compilation and sufficient memory cache warm-up. Typically, confidence data from the 2nd to 3rd minute after the switch is completed is used. The initial baseline distribution is stored in memory in the form of a histogram. The horizontal axis of the histogram divides the confidence value range into several intervals, and the vertical axis records the frequency of inference results falling into each interval. The frequency, after normalization, becomes the empirical probability quality function. Once the initial baseline distribution is determined, it remains unchanged throughout the entire monitoring lifecycle of this model update, serving as a fixed reference anchor point for measuring whether the behavior of the new model deviates from its normal state at the time of its initial launch.

[0095] Furthermore, during the subsequent continuous monitoring process, the target edge device collects the confidence distribution of the inference service at a preset sampling interval. Each sampling is statistically analyzed using a histogram binning method that is exactly the same as the initial baseline distribution to obtain the sampling distribution sequence.

[0096] Furthermore, the target edge device calculates the bulldozer distance between each sampling distribution in the sampling distribution sequence and the initial baseline distribution, obtaining a distance sequence. Bulldozer distance is a distance metric used to quantify the difference between two probability distributions. Its intuitive physical meaning is the minimum total work required to reshape the probability mass of one distribution into the shape of another distribution using the least effort-intensive transport scheme. The work is calculated as the transported mass multiplied by the transport distance. Compared to traditional information-theoretic metrics such as KL divergence, bulldozer distance has three key advantages: symmetry—the distance from distribution A to distribution B is equal to the distance from distribution B to distribution A, conforming to the intuitive definition of distance; it satisfies the triangle inequality, allowing it to be used to construct a metric space for distance comparison; and it still provides a valid finite distance value even when the support sets of the distributions have no intersection, whereas KL divergence diverges to infinity in this case, losing its metric meaning. These properties make bulldozer distance particularly suitable for handling scenarios where the support sets may expand or displace during changes in the shape of the confidence distribution.

[0097] Further, after obtaining the distance sequence, the target edge device calculates the moving average of the distance sequence within the current sliding time window. The moving average is calculated by taking the arithmetic mean of the K most recent bulldozer distance samples in the distance sequence, where K can be set according to the desired smoothness. The moving average reflects the average degree to which the recent confidence distribution deviates from the initial baseline distribution, and can adaptively capture the gradual shift caused by concept drift, absorbing it as background noise. For the newly calculated bulldozer distance value at the current sampling point in the distance sequence, the target edge device compares it with the moving average. If the current bulldozer distance is greater than a preset multiple of the moving average, it is determined that the confidence distribution has an abnormal shift trend, that is, the current confidence distribution shift significantly exceeds the normal fluctuation range of recent smooth drift, which is highly likely caused by model malfunction.

[0098] This embodiment uses bulldozer distance as a measure of confidence distribution difference. Leveraging its excellent mathematical properties such as symmetry, the validity of the triangle inequality, and support set independence, it exhibits good robustness and numerical stability when dealing with complex distribution changes in actual inference service output. It can still provide reasonable and bounded difference quantification results even when the distribution support set dynamically expands or shifts. Furthermore, using the distribution of the first stable window after atomic replacement as a fixed initial benchmark distribution, a static reference system is constructed that refers to the initial normal operating state of the new model. This avoids the benchmark drift problem in moving benchmark schemes, where the benchmark itself gradually deviates with concept drift, leading to severe abnormal offsets being masked by the synchronous movement of the benchmark. Furthermore, a dynamic adaptive threshold determination mechanism based on the moving average of historical distance sequences enables each model to automatically generate customized abnormal offset judgment criteria according to its own historical behavioral characteristics in each business scenario. Slow and gradual offsets caused by concept drift are gradually absorbed into the baseline of the moving average over time. Only sudden and drastic offsets exceeding the baseline by several times will trigger anomaly judgment, thus achieving a reliable distinction between normal concept drift and abnormal model offsets from a mechanistic perspective.

[0099] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0100] Please see Figure 2 , Figure 2 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be a terminal or a server, wherein the server can be a standalone server or a server cluster composed of multiple servers.

[0101] The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.

[0102] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, it enables the processor 502 to perform a method for remotely updating an AI model for an embodied intelligent edge device.

[0103] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.

[0104] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a method for remotely updating an AI model of an embodied intelligent edge device.

[0105] The network interface 505 is used for network communication with other devices. Those skilled in the art will understand that the above structure is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. A specific computer device 500 may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements.

[0106] The processor 502 is used to run a computer program 5032 stored in a memory to implement the steps of a remote update method for an embodied intelligent edge device AI model provided in any of the above method embodiments.

[0107] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0108] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0109] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform the steps of a method for remotely updating an AI model for an embodied intelligent edge device provided in any of the above-described method embodiments.

[0110] The storage medium is a physical, non-transient storage medium, such as a USB flash drive, external hard drive, read-only memory (ROM), magnetic disk, or optical disk, or any other physical storage medium capable of storing program code. The computer-readable storage medium can be non-volatile or volatile.

[0111] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0112] In the several embodiments provided by this invention, 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 example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0113] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention 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.

[0114] 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 storage medium. Based on this understanding, the technical solution of the present invention, 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 to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0115] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0116] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, this invention is also intended to include these modifications and variations as long as they fall within the scope of the claims of this invention and their equivalents.

[0117] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for remotely updating an AI model of an embodied intelligent edge device, characterized in that, include: The cloud device obtains the new version of the AI ​​model and the old version of the AI ​​model, and generates a difference package based on the differences between the new version of the AI ​​model and the old version of the AI ​​model; The cloud device encrypts and digitally signs the differential packet to obtain a secure differential packet; The cloud device sends the security differential packet to the target edge device; The target edge device performs signature verification and integrity verification on the received security differential packet, and obtains the verified differential packet after both signature verification and integrity verification are passed; The target edge device, in its memory, constructs a new version AI model to be verified based on the verified differential packet and the old version AI model currently running on the target edge device, and performs functional verification on the new version AI model to be verified. Once the function verification is successful, the target edge device performs an atomic replacement operation. Without interrupting the inference service on the target edge device, the inference service is switched from the old version AI model to the new version AI model to be verified, and a copy of the old version AI model is retained as a rollback backup model. After completing the atomic replacement operation, the target edge device monitors the operating metrics of the inference service. When the operating metrics meet abnormal conditions, the inference service is rolled back from the new version of the AI ​​model to be verified to the rollback backup model.

2. The method for remotely updating the AI ​​model of an embodied intelligent edge device according to claim 1, characterized in that, The cloud device generates a differential package based on the differences between the new version of the AI ​​model and the old version of the AI ​​model, including: Obtain the first operator list, dependencies, version identifier, and model computation graph of the new version AI model, as well as the second operator list, dependencies, and version identifier of the old version AI model; By comparing the first list of operators with the second list of operators, operators that show differences are identified as change operators; Extract the binary code of the change operator from the new version of the AI ​​model, and determine the topological location information of the change operator based on the model computation graph; The binary code of the change operator, the topological location information, the version identifier of the new version AI model, and the version identifier of the old version AI model are packaged together to form an operator-level difference package, and the operator-level difference package is used as the difference package.

3. The method for remotely updating the AI ​​model of an embodied intelligent edge device according to claim 2, characterized in that, The target edge device, in memory, constructs a new version of the AI ​​model to be verified based on the verified differential packet and the old version of the AI ​​model currently running on the target edge device, including: The target edge device loads a complete computation graph representation of the currently running older version of the AI ​​model into memory; Determine whether the version identifier of the old version AI model recorded in the operator level difference package matches the actual version identifier of the old version AI model currently running on the target edge device; In the case of a match, based on the topological location information in the operator level difference package, the node to be replaced is located in the complete computation graph representation, and the operator binary code of the located node is replaced with the binary code of the corresponding change operator in the operator level difference package, thus forming the new version AI model to be verified.

4. The method for remotely updating the AI ​​model of an embodied intelligent edge device according to claim 1, characterized in that, The functional verification of the new version of the AI ​​model to be verified includes: Obtain the real business requests processed by the old version AI model within a preset historical time period as a replay sample set; The replay sample set is input into the old version AI model and the new version AI model to be verified, respectively, to obtain the first inference result set and the second inference result set; Calculate the distribution similarity between the first inference result set and the second inference result set; When the distribution similarity is higher than a preset compatibility threshold, the function verification is deemed successful.

5. The method for remotely updating the AI ​​model of an embodied intelligent edge device according to claim 1, characterized in that, The target edge device performs an atomic replacement operation, including: The target edge device maintains a model service registry, which records currently active model instances; The target edge device loads the new version AI model to be verified into memory and marks the new version AI model to be verified as inactive in the model service registry; Through a single atomic write operation, the active flag of the old version AI model in the model service registry is exchanged with the inactive flag of the new version AI model to be verified; After the exchange is completed, the new inference request is routed to the new version of the AI ​​model to be verified that is marked as active in the model service registry.

6. The method for remotely updating the AI ​​model of an embodied intelligent edge device according to claim 1, characterized in that, After completing the atomic replacement operation, the target edge device monitors the operational metrics of the inference service. When the operational metrics meet abnormal conditions, the inference service is rolled back to the rollback backup model, including: Collect the inference delay of the inference service after the atomic substitution operation is completed and the confidence distribution of the inference results output by the inference service; Calculate the upward trend of the inference delay within the sliding time window, and the offset trend of the confidence distribution within the sliding time window; When the upward trend exceeds the first threshold and the offset trend exceeds the second threshold, it is determined that the abnormal condition is met; Trigger the rollback process to switch the inference service from the new version AI model to be verified back to the rollback backup model.

7. The method for remotely updating the AI ​​model of an embodied intelligent edge device according to claim 6, characterized in that, The calculation of the upward trend of the inference delay within the sliding time window includes: Obtain the request sequence of the inference service within the sliding time window; The inference delay collected at each sampling point within the sliding time window is normalized according to the request amount corresponding to the sampling point to obtain a normalized delay value sequence. The normalized delay value sequence is linearly fitted to obtain the normalized delay slope; When the normalized delay slope is greater than a preset slope threshold, it is determined that the inference delay exhibits an upward trend. And / or, calculating the offset trend of the confidence distribution within the sliding time window, including: The confidence distribution of the inference service within the first time window after the atomic replacement operation is completed is determined as the initial baseline distribution. Within the sliding time window, the confidence distribution of the inference service is collected at preset sampling intervals to obtain a sampling distribution sequence; Calculate the bulldozer distance between each sampling distribution in the sampling distribution sequence and the initial reference distribution to obtain a distance sequence; Calculate the moving average of the distance sequence within the current sliding time window. If the bulldozer distance corresponding to the current sampling point is greater than a preset multiple of the moving average, then it is determined that the confidence distribution exhibits the shift trend.

8. The method for remotely updating the AI ​​model of an embodied intelligent edge device according to claim 1, characterized in that, The cloud device sends the security differential packet to the target edge device, including: Obtain device grouping information and grayscale release ratio; A candidate edge device set is determined based on the device grouping information; Based on the grayscale release ratio, a subset of edge devices are selected from the candidate edge device set as the target edge devices; The security differential packet is sent to the selected target edge device.

9. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the method as described in any one of claims 1-8.