Method, device, equipment, medium and cloud for updating data in storage module
By partitioning and isolating system data and model data in the storage module, and using active and inactive partitions to switch the model loading path, the problems of resource waste and system restart during OTA upgrades are solved, and hot switching and efficient updates of models are achieved.
Patent Information
- Application Number
- CN202611148482.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-11-24
AI Technical Summary
In existing technologies, due to the strong correlation between the system and the model, OTA upgrades require downloading or switching the entire system image, resulting in resource waste, and the system needs to be restarted when the model data is updated.
By partitioning and isolating system data and model data in the storage module, and updating the model by switching the model loading path between active and inactive partitions, adjustments to system data are avoided, thus achieving hot switching of the model.
It decouples model upgrades from the system, avoids system restarts, improves resource utilization efficiency, and supports hot model switching.
Smart Images

Figure CN123157128A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of data updating, specifically relating to a method, apparatus, device, medium, and cloud for updating data in a storage module. Background Technology
[0002] In related technologies, due to the strong correlation between systems and models, a specific system can only be paired with a specific model. To avoid mismatch issues, system data and model data are packaged in the same image.
[0003] Therefore, traditional OTA (Over-The-Air) upgrade solutions require re-downloading or switching the entire system image when updating the model, which causes unnecessary waste of resources; and since model data and system data are together, the system needs to be restarted when switching model data. Summary of the Invention
[0004] In view of the above problems, a method, apparatus, device, medium, and cloud for updating data in a storage module are proposed to overcome or at least partially solve the above problems, including: A method for updating data in a storage module, characterized in that the storage module is applied to a smart device, and the storage module includes a system data storage partition and a model data storage partition; the system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition, the first partition being used to store a first version of model data, and the second partition being used to store a second version of model data; the method includes: From the first partition and the second partition, determine the active model data storage partition pointed to by the model loading path, and the inactive model data storage partition not pointed to by the model loading path; Upon receiving a model update request, in response to the model update request, the model data in the active model data storage partition is read and the model data is updated. The updated model data is stored in the inactive model data storage partition, and the model loading path is pointed to the inactive model data storage partition.
[0005] In some embodiments, the method further includes: Upon receiving a system update request, in response to the system update request, the system data in the system data storage partition is read and the system data is updated. The updated system data is stored in the system data storage partition, and the system of the smart device is restarted.
[0006] In some embodiments, the system data storage partition includes a third partition and a fourth partition, wherein the third partition is used to store a third version of system data, and the fourth partition is used to store a fourth version of system data. The method further includes: From the third partition and the fourth partition, determine the active system model data storage partition pointed to by the system loading path, and the inactive system data storage partition not pointed to by the system loading path; Upon receiving a system update request, in response to the system update request, the system data in the active system data storage partition is read and the system data is updated. The updated system data is stored in the inactive system data storage partition, and the system loading path is pointed to the inactive system data storage partition.
[0007] In some embodiments, the method further includes: The system service node uploads the current system version information of the system data in the system data storage partition to the data service node; the data service node generates the system update request based on the current system version information and sends the system update request to the smart device; the system update request includes a system upgrade package, and the system upgrade package includes multiple system network packets; Updating the system data includes: Upon receiving any system network packet, the system data is updated based on the system network packet.
[0008] In some embodiments, the method further includes: The data service node uploads the current model version information of the model data in the active model data storage partition to the data service node; the data service node generates the model update request based on the current model version information and sends the model update request to the smart device; the model update request includes a model upgrade package, and the model upgrade package includes multiple model network packets; The step of responding to the model update request by reading model data from the active model data storage partition and updating the model data includes: In response to the model update request, read the model data from the active model data storage partition; Upon receiving any model network packet, the model network packet is verified. When the model network packet verification passes, the model data is updated according to the model network packet. If the verification of the model network packet fails, a request is made to retransmit the model network packet.
[0009] In some embodiments, after updating the model data according to all model network packets, the method further includes: Validate the updated model data; After the updated model data passes the verification, if the smart device to which the storage module belongs is in a non-sensitive operation state, the step of pointing the model loading path to the inactive model data storage partition is executed.
[0010] This application embodiment also provides a method for updating data in a storage module, applied in the cloud, wherein the storage module is applied in a smart device, the cloud is communicatively connected to the smart device, and the storage module includes a system data storage partition and a model data storage partition; the system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition, wherein the first partition is used to store a first version of model data, and the second partition is used to store a second version of model data; the method includes: Receive the current model version information of the model data in the model data storage partition uploaded by the smart device; Based on the current model version information, a model update request is generated and sent to the smart device. The model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition. In response to the model update request, the model data in the active model data storage partition is read and the model data is updated. The updated model data is stored in the inactive model data storage partition, and the model loading path is pointed to the inactive model data storage partition.
[0011] In some embodiments, the method further includes: Receive the current system version information of the system data in the system data storage partition uploaded by the smart device; Based on the current system version information, a system update request is generated and sent to the smart device; the system update request is used to trigger an update of the system data in the system data storage partition.
[0012] In some embodiments, generating a model update request based on the current model version information includes: If, based on the current model version information, it is determined that the smart device needs to upgrade its model, a model change data block is identified for the model data in the active model data storage partition; The model change data block is compressed to generate a model difference packet, and the model difference packet is split to obtain multiple model network packets; The model update request is generated based on the multiple model network packets.
[0013] In some embodiments, the method further includes: Determine the transmission-related status information of the smart device; Based on the transmission-related status information, the transmission time and transmission rate for sending the model network packets to the smart device are determined.
[0014] In some embodiments, the method further includes: Determine the upgrade-related status information of the smart device; Based on the upgrade-related status information, the packet size, transmission time, and transmission rate of the model network are adjusted.
[0015] This application embodiment also provides a method for updating data in a storage module, applied to an edge gateway. The storage module is applied to a smart device, and the edge gateway is communicatively connected to the cloud and the smart device. The storage module includes a system data storage partition and a model data storage partition. The system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition. The first partition is used to store a first version of model data, and the second partition is used to store a second version of model data. The method includes: Receive the current model version information of the model data in the model data storage partition uploaded by the smart device, and upload the current model version information to the cloud; The system receives a model update request from the cloud and sends the model update request to the smart device. The model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition. In response to the model update request, the system reads the model data in the active model data storage partition and updates the model data. The updated model data is stored in the inactive model data storage partition, and the model loading path is set to the inactive model data storage partition.
[0016] This application embodiment also provides a cloud platform, which is communicatively connected to a smart device. The smart device includes a storage module, which includes a system data storage partition and a model data storage partition. The system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition. The first partition is used to store a first version of model data, and the second partition is used to store a second version of model data. The cloud platform includes: Version repository, used to maintain system data and model data for different versions; The differential engine is used to receive the current model version information of the model data in the model data storage partition uploaded by the smart device; and to generate a model update request based on the current model version information. A distribution scheduler is configured to determine the transmission-related status information of the smart device; based on the transmission-related status information, determine the transmission time and transmission rate for sending the model update request to the smart device, and send the model update request to the smart device according to the transmission time and transmission rate; the model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path, and the inactive model data storage partition not pointed to by the model loading path; in response to the model update request, read the model data in the active model data storage partition and update the model data; store the updated model data in the inactive model data storage partition, and point the model loading path to the inactive model data storage partition; the model update request includes multiple model network packets; The device profiling module is used to determine the upgrade-related status information of the smart device; and to adjust the packet size, transmission time, and transmission rate of the model network packets based on the upgrade-related status information.
[0017] This application embodiment also provides a data updating device in a storage module, the storage module being applied to a smart device, the storage module including a system data storage partition and a model data storage partition; the system data storage partition is used to store system data, the model data storage partition includes a first partition and a second partition, the first partition is used to store a first version of model data, and the second partition is used to store a second version of model data; the device includes: The partition determination module is used to determine, from the first partition and the second partition, the active model data storage partition pointed to by the model loading path, and the inactive model data storage partition not pointed to by the model loading path; The data update module is used to, upon receiving a model update request, read the model data in the active model data storage partition and update the model data in response to the model update request. The partition adjustment module is used to store the updated model data in the inactive model data storage partition and point the model loading path to the inactive model data storage partition.
[0018] This application embodiment also provides a data updating device in a storage module, applied in the cloud. The storage module is applied to a smart device, and the cloud is communicatively connected to the smart device. The storage module includes a system data storage partition and a model data storage partition. The system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition. The first partition is used to store a first version of model data, and the second partition is used to store a second version of model data. The device includes: The first receiving module is used to receive the current model version information of the model data in the model data storage partition uploaded by the smart device; The first sending module is configured to generate a model update request based on the current model version information and send the model update request to the smart device; the model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition; in response to the model update request, the module reads the model data in the active model data storage partition and updates the model data; the module stores the updated model data in the inactive model data storage partition and points the model loading path to the inactive model data storage partition.
[0019] This application embodiment also provides a data updating device in a storage module, applied to an edge gateway. The storage module is applied to a smart device, and the edge gateway is communicatively connected to the cloud and the smart device. The storage module includes a system data storage partition and a model data storage partition. The system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition. The first partition is used to store a first version of model data, and the second partition is used to store a second version of model data. The device includes: The second receiving module is used to receive the current model version information of the model data in the model data storage partition uploaded by the smart device, and upload the current model version information to the cloud. The second sending module is used to receive the model update request sent from the cloud and send the model update request to the smart device; the model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition; in response to the model update request, the module reads the model data in the active model data storage partition and updates the model data; the module stores the updated model data in the inactive model data storage partition and points the model loading path to the inactive model data storage partition.
[0020] This application also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the above-described method for updating data in the storage module.
[0021] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described method for updating data in the storage module.
[0022] The embodiments of this application have the following advantages: In this embodiment, the storage module can be divided into different areas, such as a system data storage partition and a model data storage partition. The system data storage partition can be used to store system data of the system running on the smart device. The model data storage partition can be used to store model data of the models deployed in the smart device's system, such as model parameter files. The model data storage partition can include multiple partitions for storing different versions of model data. Based on this design, when updating the model, only the data in one partition of the model data storage partition needs to be modified, without modifying the data in the system data storage partition, thus decoupling the model upgrade from the system upgrade. Since no adjustments to system-related data or the partitions are required when upgrading the model, a system restart is not necessary. Furthermore, when upgrading the model, the system switches by changing the model loading path, eliminating the need to restart the system or the model, enabling hot-swapping of the model. Attached Figure Description
[0023] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a flowchart illustrating the steps of a data update method in a storage module according to an embodiment of this application; Figure 2This is a flowchart illustrating the steps of another data update method in a storage module according to an embodiment of this application; Figure 3 This is a flowchart illustrating the steps of another data update method in a storage module according to an embodiment of this application; Figure 4 This is a schematic diagram of a cloud-based structure according to an embodiment of this application; Figure 5 This is a schematic diagram of a cloud-device architecture according to an embodiment of this application; Figure 6 This is a flowchart illustrating the steps of an air conditioning AI module OTA upgrade process according to an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a data updating device in a storage module according to an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a data updating device in another storage module according to an embodiment of this application; Figure 9 This is a schematic diagram of the structure of a data updating device in a storage module according to another embodiment of this application. Detailed Implementation
[0024] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0025] In the embodiments of this application, the storage module can be a module with data storage capability, such as flash memory in a smart device; for example: external NAND (Negative AND) Flash, DDR (Double Data Rate) / SDRAM (Synchronous Dynamic Random Access Memory), etc.
[0026] In some embodiments, the storage module includes a system data storage partition and a model data storage partition. The system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition. The first partition is used to store a first version of model data, and the second partition is used to store a second version of model data.
[0027] For example, the storage module can be divided into different areas, such as a system data storage partition and a model data storage partition. The system data storage partition can be used to store system data of the system running on the smart device. The model data storage partition can be used to store model data of the models deployed in the system of the smart device, such as model parameter files.
[0028] In this embodiment, the model data storage partition may include multiple partitions for storing different versions of model data. For example, it may include a first partition for storing a first version of model data and a second partition for storing a second version of model data. The first and second versions are used only to distinguish the model data in different partitions.
[0029] In some embodiments, the storage module may further include a user data partition and a partition status table partition; wherein, the user data partition can be used to store user data; the partition status table partition can be used to record the current status of each partition, and based on the status, it can be determined which partition's system data and which partition's model data the device is currently running, thereby ensuring that there is a traceable path during upgrade switching and abnormal rollover.
[0030] Based on the above design, and referring to Figure 1 The diagram illustrates a flowchart of a method for updating data in a storage module according to an embodiment of this application, which may include the following steps: Step 101: From the first partition and the second partition, determine the active model data storage partition pointed to by the model loading path, and the inactive model data storage partition not pointed to by the model loading path.
[0031] In this embodiment, during the operation of the smart device (e.g., a smart air conditioner) to which the storage module belongs, its control chip can determine the partition where the model data of the model currently running by the control chip is located from the first partition and the second partition in the storage module. For example, based on the status of each partition recorded in the partition status table, the active model data storage partition pointed to by the model loading path can be determined from the first partition and the second partition. The active model data storage partition can refer to the model data storage partition where the model data of the model currently running by the control chip depends is located.
[0032] Correspondingly, the other partition in the first and second partitions is the inactive model data storage partition, which is not pointed to by the model loading path. The inactive model data storage partition can refer to the model data storage partition on which the model currently running by the control chip depends is not located.
[0033] After determining the active model data storage partition, the control chip can upload the version information of the model data in the active model data storage partition to the data service node. The data service node can refer to the cloud or edge gateway, which has the ability to analyze whether the data in the storage module needs to be upgraded, and the ability to send upgrade packages to smart devices.
[0034] When a data service node determines that a model in a smart device needs to be updated, it can generate a model update request based on the upgrade package and return it to the smart device.
[0035] Step 102: Upon receiving a model update request, in response to the model update request, read the model data in the active model data storage partition and update the model data.
[0036] After receiving a model update request, the smart device can read the model data of the model currently running by the control chip from the active model data storage partition.
[0037] On the other hand, the control chip can respond to the model update request by updating the model data read from the active model data storage partition, thereby obtaining the updated model data, that is, the model data corresponding to the new model.
[0038] In some embodiments, since model data and system data are stored in different partitions, it is not necessary to adjust the system data in the system data storage partition when updating the model data.
[0039] Step 103: Store the updated model data in the inactive model data storage partition, and point the model loading path to the inactive model data storage partition.
[0040] In some embodiments, since the active model data storage partition is in a state of being read and used and cannot be modified, while the inactive model data storage partition is currently unused and can be modified; therefore, in order to avoid affecting the use of the model, after updating the model data, the control chip can store the updated model data in the inactive model data storage partition, that is, the model data storage partition on which the model currently running by the control chip depends is not located.
[0041] Next, the control chip can point the model loading path to the inactive model data storage partition; thus, the model run by the control chip will depend on the partition that was previously the inactive model data storage partition. At this point, the control chip can adjust the state of each partition in the partition status table.
[0042] For example: First, determine that the first partition is the active model data storage partition and the second partition is the inactive model data storage partition; in response to a model update request, read the model data in the first partition and update the model data according to the model update request. After the update, write the updated model data to the second partition and point the model loading path to the second partition.
[0043] After the model loading path is directed to the second partition, the control chip can adjust the status of each partition in the partition status table so that the first partition becomes an inactive model data storage partition and the second partition becomes an active model data storage partition.
[0044] When operations such as adjusting the model data storage partition are performed, the system data storage partition in this application is not affected; therefore, the system data storage partition does not need to be restarted and hot switching of models can be achieved.
[0045] In this embodiment, the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path can be determined first from the first and second partitions. Then, upon receiving a model update request, the model data in the active model data storage partition is read and updated in response to the request. Afterward, the updated model data can be stored in the inactive model data storage partition, and the model loading path is set to point to the inactive model data storage partition. Through this embodiment, the upgrades of the system and the model can be decoupled, so that when upgrading the model, there is no need to restart the system, thus achieving hot switching of the model.
[0046] In some embodiments of this application, the above method may further include a step of updating system data: Upon receiving a system update request, the system responds by reading system data from the system data storage partition and updating the system data; it then stores the updated system data in the system data storage partition and restarts the smart device's system.
[0047] In some embodiments, in addition to updating the model, the system can also be updated; for example, the control chip can periodically upload the current version information of the system data in the system data storage partition to the data service node.
[0048] After receiving the current version information of the system data, the data service node can compare it with the system data of various versions maintained in the version repository to determine whether the system data in the storage module needs to be upgraded.
[0049] If it is determined that no upgrade is needed, the next version information can be received; if it is determined that an upgrade is needed, the data service node can generate a system update request based on the differences in system data in different version information and send it to the smart device. The system update request can be used to trigger the update of system data in the storage module, and the system update request can include the system data to be updated.
[0050] After receiving a system update request, the control chip of the smart device can respond to the system update request and trigger the update of system data in the storage module.
[0051] For example, the control chip can first read the system data corresponding to the version of the system that the control chip is currently running from the system data storage partition.
[0052] Then, the control chip can update the system data in the system data storage partition based on the system data to be updated in the system update request, thereby obtaining the updated system data.
[0053] After obtaining the updated system data, the updated system data can be stored in the system data storage partition, and the smart device's system can be restarted; in some embodiments, the system needs to be shut down and then restarted in order to achieve a complete system update.
[0054] In some embodiments of this application, the system data storage partition includes a third partition and a fourth partition, wherein the third partition is used to store a third version of the system data, and the fourth partition is used to store a fourth version of the system data; based on this, the above method may further include the following steps for updating the system data: From the third and fourth partitions, determine the active system model data storage partition pointed to by the system loading path, and the inactive system data storage partition not pointed to by the system loading path; upon receiving a system update request, respond to the system update request by reading the system data in the active system data storage partition and updating the system data; store the updated system data in the inactive system data storage partition, and point the system loading path to the inactive system data storage partition.
[0055] In some embodiments, the system data storage partition may include partitions for storing different versions of system data, such as a third partition for storing a third version of system data and a fourth partition for storing a fourth version of system data. The third and fourth versions are used only to distinguish the system data in different partitions.
[0056] In this embodiment, during the operation of the smart device to which the storage module belongs, its control chip can determine the partition where the system data of the system currently running by the control chip is located from the third and fourth partitions in the storage module. For example, based on the status of each partition recorded in the partition status table, the active system data storage partition pointed to by the system loading path can be determined from the third and fourth partitions. The active system data storage partition can refer to the system data storage partition where the system data on which the system currently running by the control chip depends is located.
[0057] Correspondingly, the other partition in the third and fourth partitions is the inactive system data storage partition, which is not pointed to by the system loading path. The inactive system data storage partition can refer to the system data storage partition on which the system data currently running by the control chip depends is not located.
[0058] After determining the active system data storage partition, the control chip can upload the current version information of the system data in that active system data storage partition to the data service node.
[0059] When a data service node determines that the system in a smart device needs an update, it can generate a system update request based on the upgrade package and return it to the smart device.
[0060] After receiving a system update request, a smart device can read the system data of the system currently running on the control chip from the active system data storage partition.
[0061] On the other hand, the control chip can respond to the system update request and update the system data read from the active system data storage partition to obtain the updated system data, that is, the model data corresponding to the new model.
[0062] In some embodiments, since the active system data storage partition is in a state of being read and used and cannot be modified, while the inactive system data storage partition is currently unused and can be modified; therefore, in order to avoid affecting the use of the system, after the system data is updated, the control chip can store the updated system data in the inactive system data storage partition, that is, the system data storage partition on which the system currently running by the control chip depends is not located.
[0063] Next, the control chip can point the system load path to the inactive system data storage partition; thus, the system running on the control chip will depend on the partition that was previously the inactive system data storage partition. At this point, the control chip can adjust the state of each partition in the partition status table.
[0064] For example: First, determine that the third partition is the active system data storage partition and the fourth partition is the inactive system data storage partition; in response to a system update request, read the system data in the third partition and update the system data according to the system update request. After the update, write the updated system data to the fourth partition and point the system load path to the fourth partition.
[0065] After the system loading path is pointed to the fourth partition, the control chip can adjust the status of each partition in the partition status table so that the third partition becomes an inactive system data storage partition and the fourth partition becomes an active system data storage partition. On the other hand, the control chip can restart the system to complete the system update.
[0066] In some embodiments of this application, the above method may further include the following steps before updating the system data: The system uploads the current system version information of the system data in the system data storage partition to the data service node; the data service node generates a system update request based on the current system version information and sends the system update request to the smart device; the system update request includes a system upgrade package, which includes multiple system network sub-packets.
[0067] In some embodiments, the control chip can periodically or periodically upload the current system version information of the system data in the system data storage partition to the data service node.
[0068] After receiving the current version information of the system data, the data service node can compare it with the system data of various versions maintained in the version repository to determine whether the system data in the storage module needs to be upgraded.
[0069] If it is determined that no upgrade is needed, the next version information can be received. If it is determined that an upgrade is needed, the data service node can generate a system update request based on the differences in system data in different version information and send it to the smart device. The system update request can be used to trigger the update of system data in the storage module. The system update request can include the system data to be updated, i.e., the system upgrade package. The system upgrade package can include multiple system network packets, which can be packets obtained by dividing the system data to be updated.
[0070] Based on multiple system network packets, updating system data can be achieved using the following methods: Upon receiving any system network packet, the system data is updated based on the system network packet.
[0071] In some embodiments, when updating system data based on multiple system network packets, an update operation can be performed based on each system network packet received, without having to wait until all system network packets are received before updating. Through the embodiments of this application, tasks such as downloading, reconstructing, and writing can be overlapped in time to form a pipeline. Compared with the method of receiving all system network packets before updating, the memory usage of this application is strictly controlled.
[0072] In some embodiments of this application, before reading model data from the active model data storage partition and updating the model data in response to a model update request, the above method may further include the following steps: The current model version information of the model data in the active model data storage partition is uploaded to the data service node; the data service node is used to generate a model update request based on the current model version information and send the model update request to the smart device; the model update request includes a model upgrade package, which includes multiple model network sub-packets.
[0073] In some embodiments, before reading the model data in the active model data storage partition and updating the model data in response to a model update request, the control chip in this application may first upload the current model version information of the model data in the active model data storage partition to the data service node.
[0074] After receiving the current model version information, the data service node can determine whether the model data in the active model data storage partition needs to be updated based on this information. For example, this can be done by comparing version numbers or similar methods.
[0075] When it is determined that the model data in the active model data storage partition does not need to be updated, new model version information can continue to be received.
[0076] Conversely, when it is determined that the model data in the active model data storage partition needs to be updated, the data service node can generate a model upgrade package based on the model data corresponding to the old and new versions, and then generate a model update request to trigger the update of the model data based on the model upgrade package; the model upgrade package may include multiple model network packets. Multiple model network packets can be generated based on the differences between the old and new versions of the model data, or they can be generated based on the model data corresponding to the new version, and this application embodiment does not limit this.
[0077] After obtaining multiple model network packets, step 102, when updating the model data, can be achieved through the following sub-steps: Sub-step 11: In response to the model update request, read the model data from the active model data storage partition.
[0078] Upon receiving a model update request, the control chip can respond to the request by triggering an update of the model data in the storage module; specifically, the control chip can first read the model data in the active model data storage partition.
[0079] Sub-step 12: When any model network packet is received, the model network packet is verified.
[0080] Then, after receiving each model network packet, the control chip can first verify it; for example, it can first use RS error correction code to try to correct bit errors that may occur during transmission (common in high temperature and high interference environments of outdoor units).
[0081] If the error correction is successful, the HMAC-SHA256 is calculated based on the model network packet and compared with the signature attached to the model network packet, thereby realizing the verification of the model network packet.
[0082] Sub-step 13: When the model network packet verification passes, update the model data according to the model network packet.
[0083] When the verification passes, the model network packet can be placed into a circular buffer, and the model data can be updated based on the model network packet to limit memory usage.
[0084] Sub-step 14: If the verification of the model network packet fails, request a retransmission of the model network packet.
[0085] In some embodiments, if the verification fails, the control chip can immediately request the retransmission of the model network packet from the data service node.
[0086] In some embodiments of this application, after updating the model data according to all model network packets, the above method may further include the following steps: The updated model data is validated. After the updated model data passes the validation, if the smart device to which the storage module belongs is in a non-sensitive operation state, the step of pointing the model loading path to the inactive model data storage partition is executed.
[0087] In some embodiments, once all model network packets have been received and the model data has been updated based on these model network packets, the entire updated model data can be verified.
[0088] For example, a whole-area SHA-256 hash calculation can be performed on the entire updated model data and compared with the target hash value issued by the data service node. If they match, the verification passes, indicating that the model data update was successful; if they do not match, the verification fails, indicating that the model data update failed and was not updated to the target version.
[0089] If the verification passes, it can be determined whether the smart device to which the storage module belongs is in a non-sensitive operation state. A non-sensitive operation state can refer to a state in which the smart device is unaffected by switching model versions. For example, if the smart device does not have compressor start / stop switching operations within the next 500ms, it can be determined that the smart device is in a non-sensitive operation state.
[0090] If it is determined that the smart device is not in a non-sensitive operation state, the model can be run based on the old model data first; conversely, if it is determined that the smart device is in a non-sensitive operation state, the step of pointing the model loading path to the inactive model data storage partition can be executed, thereby realizing the version update of the running model.
[0091] The above description primarily focuses on the smart device side; next, the method for updating data in the storage module mentioned in this application will be explained from the cloud perspective: Reference Figure 2 This illustration shows a flowchart of another method for updating data in a storage module according to an embodiment of this application. This method can be applied to the cloud, where communication between the cloud and smart devices is possible. Figure 2 As shown, the method may include the following steps: Step 201: Receive the current model version information of the model data in the model data storage partition uploaded by the smart device.
[0092] In some embodiments, the cloud can act as a data service node to provide OTA services to the smart devices to which the storage module belongs.
[0093] For smart devices, their control chips can send the current model version information of the model data in the model data storage partition to the cloud; specifically, the control chip can send the current model version information of the model data in the active model data storage partition to the cloud.
[0094] Step 202: Based on the current model version information, generate a model update request and send the model update request to the smart device; the model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path from the first partition and the second partition, as well as the inactive model data storage partition not pointed to by the model loading path; in response to the model update request, read the model data in the active model data storage partition and update the model data; store the updated model data in the inactive model data storage partition, and point the model loading path to the inactive model data storage partition.
[0095] After receiving the current model version information, the cloud can determine whether the model data in the active model data storage partition needs to be updated based on this information.
[0096] When it is determined that the model data in the active model data storage partition does not need to be updated, the cloud can continue to receive new model version information.
[0097] Conversely, when it is determined that the model data in the active model data storage partition needs to be updated, the cloud can generate a model upgrade package based on the model data corresponding to the old and new versions, and then generate a model update request to trigger the update of the model data based on the model upgrade package.
[0098] After generating a model update request, the cloud can send the model update request to the smart device. After receiving the model update request, the smart device can respond to the model update request and trigger the update of the model data in the storage module. Specifically, the control chip can read the model data of the model currently running from the active model data storage partition.
[0099] On the other hand, the control chip can respond to the model update request by updating the model data read from the active model data storage partition, thereby obtaining the updated model data, that is, the model data corresponding to the new model.
[0100] To avoid affecting the use of the model, after updating the model data, the control chip can store the updated model data in the inactive model data storage partition.
[0101] Next, the control chip can point the model loading path to the inactive model data storage partition; thus, the model run by the control chip will depend on the partition that was previously the inactive model data storage partition. At this point, the control chip can adjust the state of each partition in the partition status table.
[0102] In some embodiments of this application, step 202 may generate a model update request through the following sub-steps: Sub-step 21: If it is determined that the smart device needs to upgrade the model based on the current model version information, determine the model change data block for the model data in the active model data storage partition.
[0103] In some embodiments, after obtaining the current model version information, the cloud can first determine whether the model data in the storage module needs to be updated based on the current model version information; for example, it can determine whether the model data in the storage module needs to be updated by comparing the version numbers.
[0104] If it is determined that the model data in the storage module does not need to be updated, then new current model version information can continue to be received.
[0105] Conversely, if it is determined that the model data in the storage module needs to be updated, the differences between the model data corresponding to the current model version information and the model data of the version to be updated can be identified first. Then, the model change data block for the model data in the active model data storage partition can be determined. The change data block can refer to the model data corresponding to the current model version information that differs from the model data of the version to be updated.
[0106] Sub-step 22: Compress the model change data block to generate a model difference packet, and then split the model difference packet to obtain multiple model network packets.
[0107] After determining the model change data block, it can be compressed to generate a model difference packet; next, the model difference packet can be split to obtain multiple model network packets; in this embodiment, when the model data in the storage module needs to be updated, the cloud can transmit multiple model network packets to the smart device in sequence.
[0108] Sub-step 23: Generate model update requests based on multiple model network packets.
[0109] After obtaining multiple model network packets, the cloud can generate a model update request to trigger the updating of model data based on the multiple model network packets.
[0110] In some embodiments of this application, the method applied to the cloud described above may further include the following steps: Receive the current system version information of the system data in the system data storage partition uploaded by the smart device; generate a system update request based on the current system version information and send the system update request to the smart device; the system update request is used to trigger the update of the system data in the system data storage partition.
[0111] In some embodiments, the cloud can also trigger updates to system data in the storage module; for example, the control chip can periodically upload the current system version information of system data in the system data storage partition to the cloud.
[0112] Taking the third and fourth partitions as examples, the control chip can periodically upload the current system version information of the system data in the active system data storage partition to the cloud.
[0113] After receiving the current system version information, the cloud can generate a system update request based on the system data corresponding to the current system version information and the system data of the version to be updated.
[0114] For example, an upgrade package can be generated based on the differences between the system data corresponding to the current system version information and the system data of the version to be updated, and a system update request can be generated based on the upgrade package.
[0115] For example, an upgrade package can be generated directly based on the system data of the version to be updated, and a system update request can be generated based on the upgrade package. This application embodiment does not limit this.
[0116] After generating a system update request, the cloud can send the system update request to the smart device; in response to the system update request, the control chip in the smart device can update the system data in the system data storage partition.
[0117] For example, taking the third and fourth partitions as examples, the control chip can respond to the system update request by reading system data from the active system model data storage partition and updating the system data according to the upgrade package in the system update request.
[0118] After the update, the control chip can write the updated system data to the inactive system data storage partition; then, the control chip can point the system loading path to the inactive system data storage partition, thereby completing the system update.
[0119] In some embodiments of this application, the method applied to the cloud described above may further include the following steps: Determine the transmission-related status information of the smart device; based on the transmission-related status information, determine the transmission time and transmission rate for sending model network packets to the smart device.
[0120] In some embodiments, for the cloud, the transmission time and transmission rate can also be determined based on transmission-related status information such as device geographical location, network quality, and operating status (cooling / heating / standby).
[0121] For example, from the cloud perspective, the network quality between the cloud and the smart device can be determined, as well as the operating status of the smart device to which the storage module belongs. Network quality can include network volatility, latency, etc., while operating status can include the current operating status of each module within the smart device, such as the operating status of a compressor.
[0122] After determining the relevant transmission status information, the cloud can determine the transmission time and transmission rate for sending model network packets to smart devices based on the relevant transmission status information.
[0123] For example, when network latency is high, model network packets can be transmitted at a lower transmission rate; or, when a smart device is in a sensitive operating state, the transmission of model network packets can be delayed.
[0124] In some embodiments of this application, the method applied to the cloud described above may further include the following steps: Determine the upgrade-related status information of the smart device; based on the upgrade-related status information, adjust the packet size, transmission time, and transmission rate of the model network packets.
[0125] In some embodiments, the cloud can also record upgrade-related status information for use in adjusting packet size, transmission strategies, etc.
[0126] For example, upgrade-related status information may include information related to the upgrade process, which may affect the success rate of data transmission during the upgrade process, as well as the success rate of the upgrade itself.
[0127] For example, information such as device model, hardware version, Flash / RAM capacity, current system version, current model version, active partition combination, network quality, historical upgrade success rate, reasons for failure, operating status, communication status, and model performance can be obtained. After determining the relevant upgrade status information, the cloud can adjust the packet size, transmission time, and transmission rate of the model network packets based on this information.
[0128] For example, when network conditions are poor, the transmission rate can be reduced and the transmission time delayed. As another example, when a smart device is in a sensitive operating state, the transmission time can be postponed. Furthermore, when Flash / RAM capacity is small, the packet size can be set smaller; however, this application does not impose any limitations on this.
[0129] This application also provides a method for updating data in a storage module of an edge gateway, which can communicate with the cloud and smart devices; such as Figure 3 The diagram illustrates a flowchart of another method for updating data in a storage module according to an embodiment of this application, which may include the following steps: Step 301: Receive the current model version information of the model data in the model data storage partition uploaded by the smart device, and upload the current model version information to the cloud.
[0130] In some embodiments, the data update method in the storage module described above can also be applied to the edge gateway; the edge gateway can connect multiple smart devices through a MESH network and send upgrade packages to the smart devices via broadcast or multicast distribution. This solution reduces the cloud egress traffic from N smart devices * the size of the upgrade package to a single cloud download, and significantly reduces network congestion caused by multiple smart devices simultaneously pulling data from a weak network, making it particularly suitable for large-scale air conditioning group control scenarios in commercial buildings.
[0131] For example, an edge gateway can receive the current model version information of the model data in the model data storage partition uploaded by a smart device; then, the edge gateway can upload the current model version information to the cloud.
[0132] After receiving the current model version information, the cloud can determine whether the model data in the active model data storage partition needs to be updated based on this information. For example, this can be done by comparing version numbers or similar methods.
[0133] When it is determined that the model data in the active model data storage partition does not need to be updated, new model version information can continue to be received.
[0134] Conversely, when it is determined that the model data in the active model data storage partition needs to be updated, the cloud can generate a model upgrade package based on the model data corresponding to the old and new versions, and then generate a model update request to trigger the update of the model data based on the model upgrade package.
[0135] Step 302: Receive the model update request sent from the cloud and send the model update request to the smart device; the model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition; in response to the model update request, read the model data in the active model data storage partition and update the model data; store the updated model data in the inactive model data storage partition and point the model loading path to the inactive model data storage partition.
[0136] After generating a model update request, the cloud can send it to the edge gateway; after receiving the model update request, the edge gateway can distribute it to various smart devices, thereby enabling the model update of each smart device.
[0137] After receiving a model update request, the smart device can read the model data of the model currently running by the control chip from the active model data storage partition.
[0138] On the other hand, the control chip can respond to the model update request by updating the model data read from the active model data storage partition, thereby obtaining the updated model data, that is, the model data corresponding to the new model.
[0139] In some embodiments, since model data and system data are stored in different partitions, it is not necessary to adjust the system data in the system data storage partition when updating the model data.
[0140] After updating the model data, the control chip can store the updated model data in an inactive model data storage partition, which is the model data storage partition on which the model currently being run by the control chip depends is not located.
[0141] Next, the control chip can point the model loading path to the inactive model data storage partition; thus, the model run by the control chip will depend on the partition that was previously the inactive model data storage partition. At this point, the control chip can adjust the state of each partition in the partition status table.
[0142] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.
[0143] Reference Figure 4 This diagram illustrates a cloud-based structure according to an embodiment of this application. The cloud is communicatively connected to a smart device, which includes a storage module. The storage module includes a system data storage partition and a model data storage partition. The system data storage partition stores system data, and the model data storage partition includes a first partition and a second partition. The first partition stores a first version of model data, and the second partition stores a second version of model data. Figure 4 As shown, the cloud 40 may include: Version repository 401 is used to maintain system data and model data for different versions; Differential Engine 402 is used to store the current model version information of the model data in the model data storage partition uploaded by smart devices; and generates a model update request based on the current model version information. The dispatch scheduler 403 is used to determine the transmission-related status information of the smart device; based on the transmission-related status information, it determines the transmission time and transmission rate for sending a model update request to the smart device, and sends the model update request to the smart device according to the transmission time and transmission rate; the model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition; in response to the model update request, it reads the model data in the active model data storage partition and updates the model data; it stores the updated model data in the inactive model data storage partition and points the model loading path to the inactive model data storage partition; the model update request includes multiple model network packets; The device profiling module 404 is used to determine the upgrade-related status information of the smart device; based on the upgrade-related status information, the packet size, transmission time, and transmission rate of the model network packets are adjusted.
[0144] In this embodiment, the cloud 40 may include a version repository 401, a differential engine 402, a distribution scheduler 403, and a device profiling module 404.
[0145] The version repository 401 can be used to maintain and store different versions of system data and different versions of model data, and can provide the latest version of system data and the latest version of model data for use in smart device updates.
[0146] The differential engine 402 can generate a corresponding upgrade package based on the model or system version in the smart device for upgrading the device. For example, after receiving the current model version information of the model data in the model data storage partition uploaded by the smart device, the cloud 40 can generate an upgrade package based on the model data corresponding to the current model version information and the latest version model data in the version repository 401, and generate a model update request to trigger the model update of the smart device based on the upgrade package.
[0147] After generating the model update request, the dispatcher 403 can determine the transmission time and transmission rate based on transmission-related status information such as device geographical location, network quality, and operating status (cooling / heating / standby).
[0148] For example, the cloud 40 can first determine the network quality between itself and the smart device, as well as the operating status of the smart device to which the storage module belongs; based on this transmission-related status information, the distribution scheduler 403 can determine the transmission time and transmission rate for sending model network packets to the smart device.
[0149] In some embodiments, a correspondence between different transmission-related status information and corresponding transmission time and transmission rate can be established in advance; after determining the current transmission-related status information, the corresponding transmission time and transmission rate can be determined.
[0150] In other embodiments, corresponding weights can be set for different transmission-related state information; based on weighted calculation, the corresponding transmission rate and offset time can be determined; based on the offset time and the current time, the transmission time for the upgrade package can be determined.
[0151] The device profiling module 404 can be used to record the profiling features of each smart device and generate strategies for triggering the differential engine 402 and the distribution scheduler 403 to adjust packet size, transmission time, and transmission rate.
[0152] For example, the device profiling module 404 can first determine the upgrade-related status information of the smart device, such as: device model, hardware version, Flash / RAM capacity, current system version, current model version, active partition combination, network quality, historical upgrade success rate, failure reason, compressor operating status, communication status between indoor and outdoor units, and model operating performance, etc.
[0153] Next, the device profiling module 404 can generate a device upgrade risk level and policy label based on the upgrade-related status information, and provide them to the differential engine 402 and the distribution scheduler 403 to trigger the differential engine 402 to adjust the packet size and the distribution scheduler 403 to adjust the generation transmission time and transmission rate strategies. The policy label can include strategies for adjusting the packet size and strategies for adjusting the generation transmission time and transmission rate.
[0154] In some embodiments, after receiving an upgrade risk level, the device profiling module 404 can adjust the transmission time and transmission rate generation strategy based on the level of risk; for example, when the risk level is high, the transmission time can be delayed and the transmission rate reduced. After receiving a policy tag, the device profiling module 404 can also adjust the transmission time and transmission rate based on the policy tag.
[0155] Reference Figure 5 This illustration shows a schematic diagram of a cloud-based 40-device terminal according to an embodiment of this application; refer to Figure 6 The diagram illustrates a flowchart of the OTA upgrade process for an air conditioning AI module according to an embodiment of this application.
[0156] like Figure 5 , 6As shown, taking an air conditioner as an example, the control chip in the air conditioner is equipped with an AI module, and the OTA Agent can be the core execution unit. The cloud 40 is equipped with a cloud 40 deployment version repository 401, a differential engine 402, a distribution scheduler 403, and a device profiling module 404.
[0157] Version repository 401 maintains the full version tree of system data such as system firmware and AI model data; The differential engine 402 adopts a Rabin fingerprint block division + bsdiff / zstd dual-layer differential strategy to dynamically generate the minimum differential package for the current version information reported by each smart device. The differential engine 402 is used to generate differential upgrade packages for system data and model data respectively based on the current system version information, current model version information and target upgrade version information (i.e. the information of the version to be upgraded) reported by the air conditioning AI module.
[0158] For example, the differential engine 402 first retrieves the data corresponding to the current version information and the data corresponding to the target version information from the version repository 401; it identifies identical data blocks and changed data blocks based on the Rabin fingerprinting algorithm; for model data, it can further identify differences based on the model layer structure, parameter segments, or weight matrices, generating differential data only for model parameters that have changed (taking model data as an example, differential data can refer to model change data blocks). After compression, the differential data generates a differential package, and simultaneously generates a package index, block-level hash, target mirror hash, and version compatibility table.
[0159] The distribution scheduler 403 determines the transmission time and transmission rate based on the device's geographical location, network quality, and operating status (cooling / heating / standby); the distribution scheduler 403 is used to determine the upgrade push strategy based on the device's operating status, network quality, regional load, historical upgrade success rate, and the air conditioner's current operating mode.
[0160] After the target version is released, the distribution scheduler 403 first groups and performs canary screening of smart devices, and then sends upgrade notifications to eligible smart devices via MQTT or HTTPS channels. After the device confirms that it is in an upgradeable state, the distribution scheduler 403 sends differential packets according to the preset transmission rate and packet size. If network jitter, increased retransmission count, or the device enters a compressor start-up / shutdown sensitive phase are detected during the upgrade process, the transmission rate is dynamically adjusted, the packet size is reduced, the upgrade is paused, or it is postponed to the next scheduling window.
[0161] The device profiling module 404 records the historical upgrade success rate and network jitter characteristics of each air conditioner AI module for personalized packet size and retransmission strategy optimization. The device profiling module 404 records and updates upgrade-related status information for each air conditioner AI module, including device model, hardware version, Flash / RAM capacity, current system version, current model version, active partition combination, network quality, historical upgrade success rate, failure reasons, compressor operating status, indoor / outdoor unit communication status, and model performance. Based on the above information, the device profiling module 404 generates a device upgrade risk level and strategy label, and provides them to the differential engine 402 and the distribution scheduler 403 to generate differential packets adapted to the device's resource conditions and select appropriate transmission time, packet size, error correction redundancy, and retransmission strategies.
[0162] The control chip (such as ARM Cortex-M33 or RISC-V) is connected to external NAND Flash (capacity ≥32MB) and RAM such as DDR / SDRAM (capacity ≥1MB). The physical partition layout of the Flash is as follows (from low address to high address): Bootloader area (fixed, single copy, read-only); Partition State Table (PST): Dual copies, each 4KB, used for atomic writes; the partition state table can be used to record which system partition is currently running and which model partition is loaded, ensuring a reliable basis for upgrade switching and abnormal rollback; System partition A (Sys-A, approximately 8MB), also known as the third partition; System partition B (Sys-B, approximately 8MB), also known as the fourth partition; Model A partition (Model-A, approximately 8MB), i.e., the first partition; Model-B partition (approximately 8MB), also known as the second partition; User data area (approximately 2MB); The OTA Agent, acting as middleware between the Bootloader and the main application, resides in RAM and is responsible for download management, differential reconstruction, verification calculation, and partition switching scheduling.
[0163] Taking the mid-season rollout of the new AI comfort model (Model-v2.1) to a large number of online air conditioners as an example, while keeping the system firmware (Sys-v1.5) unchanged, the process is as follows: Step 1: Upgrade decision and differential package generation; The AI module periodically reports heartbeat packets to the cloud 40 via MQTT / HTTPS. These packets include the currently active system version number (Sys-v1.5) (i.e., the current system version information), the model version number (Model-v2.0) (i.e., the current model version information), the partition combination status code (e.g., 0x01 indicates that Sys-A+Model-A is active), and the device operating status (cooling / compressor running). Among these, the code is used to encode the combination relationship between the active system partition and the active model partition in the current air conditioner AI module. This allows the cloud 40 and the device (i.e., smart devices and air conditioners) to accurately identify the current operating base version, determine the differential packet generation object, select the inactive target partition, and support subsequent compatibility checks, partition switching, and anomaly rollback.
[0164] After determining that the smart device needs a model upgrade, the cloud-based 401 engine calls the differential engine 402 to first perform Rabin fingerprint segmentation on Model-v2.0 and Model-v2.1 to identify the model change data blocks. Then, it further analyzes the internal structure of these change data blocks to determine which small segment of data, which type of parameter, or which part of the content has changed. It then uses zstd compression to generate a differential packet (Delta-Model-v2.0-to-v2.1), which may only be 8% to 15% the size of the original model. The differential packet is further divided into several model network packets, each with a 16-byte RS error correction code and a 32-byte HMAC-SHA256 signature.
[0165] Among them, fingerprint segmentation belongs to the content-defined segmentation method, which means that while scanning the file, the content fingerprint of the current data segment is calculated; when the fingerprint meets the segmentation conditions, it is considered that it can be broken from here to form a data block.
[0166] Segmentation and Recognition Process: First, the difference engine 402 scans the old model data. It reads the binary content in a sliding window of a certain length and continuously calculates the Rabin fingerprint value. When the fingerprint value meets the preset segmentation conditions or the length reaches the upper limit, a data block is generated. Then, the difference engine 402 scans the new model data in the same way, generating a new version of the data block list. After this process, the original complete large model file is split into multiple comparable, referable, and verifiable data blocks.
[0167] Identify changed data blocks, which means matching and comparing each data block of the new model with the data blocks of the old model.
[0168] Step 2: Background download and block-level incremental verification; The cloud-based 40 sends an upgrade notification via MQTT. After confirming that the compressor is running smoothly and the network signal is good, the OTA Agent responds and agrees to the upgrade, and selects an inactive Model-B partition as the target.
[0169] The download process uses HTTP / 1.1 Range requests or MQTT binary stream channels for segmented retrieval. Upon receiving each model network packet, the OTA Agent first attempts to correct any bit errors that may have occurred during transmission using RS error correction codes (common in high-temperature, high-interference environments). If the error correction is successful, the HMAC-SHA256 is calculated and compared with the signature attached to the packet. Successfully verified model network packets are immediately placed in a ring buffer (64KB~256KB in size); if verification fails, the OTA Agent immediately requests the model network packet to be retransmitted from the cloud.
[0170] Step 3: Pipeline differential reconstruction and Flash writing; Data in the circular buffer is written by a separate thread. This thread uses the zstd streaming decompressor to decompress the model network into raw binary patches, and calls the bsdiff streaming reconstruction interface to merge the patches with the old data blocks (i.e., the old model data) in the current Model-A partition in real time, generating a complete Model-v2.1 image fragment. The generated fragment is then directly written to the corresponding offset address of the Model-B partition via DMA.
[0171] In this process, the four subtasks of downloading, decompressing, reconstructing, and writing overlap in time, forming a pipeline. Since the reconstruction results are directly written to partitions, the AI module does not need to cache the complete 8MB model image in RAM, and the peak RAM usage is strictly controlled to the sum of the circular buffer and the decompression working area (usually <300KB).
[0172] Step 4: Overall verification and activation tagging; Once all model network packets have been received and written, the OTA Agent performs a full-area SHA-256 hash calculation on the Model-B partition and compares it with the target hash value sent from the cloud. If they match, it means that Model-v2.1 has been completely and correctly written to Model-B.
[0173] Subsequently, the OTA Agent enters the safety-critical task check window: continuously monitors the compressor control status and the communication status between the indoor and outdoor units to confirm that there are no sensitive operations such as compressor start-stop switching within the next 500ms.
[0174] Once the conditions are met, the OTA Agent updates the Partition State Table (PST) atomically, switching the active model partition from Model-A to Model-B. Because the PST employs a dual-copy alternating write design with CRC self-checking, even if a power outage occurs during the switch, the Bootloader can restore the correct active partition flag using the PST replica upon the next power-on.
[0175] Step 5: Cross-hot switching and abnormal rollback; After the PST update, the control chip does not need to be reset. The OTA Agent immediately points the AI model's loading path to Model-B via memory mapping table redirection or file system mount point switching. This switching process is completed in milliseconds, and the Sys-A partition where the compressor control algorithm is located remains unaffected.
[0176] After the new model starts running, the OTA Agent enters a 24-hour observation period, continuously monitoring model inference latency, the rationality of compressor control commands, and user comfort feedback. If an anomaly is detected (such as inference timeout or control commands exceeding safety thresholds), the OTA Agent automatically rolls back the active model partition in the PST to Model-A, achieving a rollback without a restart. If no anomalies are detected, normal operation continues.
[0177] Reference Figure 7 This diagram illustrates a structural schematic of an optical module performance prediction device according to an embodiment of this application. The storage module is applied to a smart device and includes a system data storage partition and a model data storage partition. The system data storage partition stores system data, and the model data storage partition includes a first partition and a second partition. The first partition stores a first version of model data, and the second partition stores a second version of model data. The device may include the following modules: The partition determination module 701 is used to determine the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition. The data update module 702 is used to read the model data in the active model data storage partition and update the model data in response to the model update request received. The partition adjustment module 703 is used to store the updated model data in the inactive model data storage partition and point the model loading path to the inactive model data storage partition.
[0178] In some embodiments, the apparatus further includes: The restart module is used to respond to a system update request by reading system data from the system data storage partition, updating the system data, storing the updated system data in the system data storage partition, and restarting the smart device's system.
[0179] In some embodiments, the system data storage partition includes a third partition and a fourth partition, wherein the third partition is used to store a third version of system data and the fourth partition is used to store a fourth version of system data; the apparatus further includes: The restart module is used to determine the active system model data storage partition pointed to by the system loading path and the inactive system data storage partition not pointed to by the system loading path from the third and fourth partitions; when a system update request is received, it responds to the system update request by retrieving system data from the active system data storage partition and updating the system data; The updated system data is stored in the inactive system data storage partition, and the system load path is set to the inactive system data storage partition.
[0180] In some embodiments, the apparatus further includes: The first upload module is used to upload the current system version information of the system data in the system data storage partition to the data service node; the data service node is used to generate a system update request based on the current system version information and send the system update request to the smart device; the system update request includes a system upgrade package, which includes multiple system network packets; The restart module is used to update system data based on any system network packet received.
[0181] In some embodiments, the apparatus further includes: The second upload module uploads the current model version information of the model data in the active model data storage partition to the data service node; the data service node generates a model update request based on the current model version information and sends the model update request to the smart device; the model update request includes a model upgrade package, which includes multiple model network packets; The data update module 702 is used to respond to model update requests by reading model data from the active model data storage partition; upon receiving any model network packet, it verifies the model network packet; if the verification of the model network packet passes, it updates the model data according to the model network packet; if the verification of the model network packet fails, it requests a retransmission of the model network packet.
[0182] In some embodiments, the apparatus further includes: The verification module is used to verify the updated model data after updating the model data according to all model network packets. After the updated model data passes the verification, if the smart device to which the storage module belongs is in a non-sensitive operation state, the step of pointing the model loading path to the inactive model data storage partition is executed.
[0183] Reference Figure 8 This diagram illustrates a structural schematic of another optical module performance prediction device according to an embodiment of this application. It is applied in the cloud, and a storage module is applied in a smart device. The cloud and the smart device are communicatively connected. The storage module includes a system data storage partition and a model data storage partition. The system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition. The first partition is used to store a first version of model data, and the second partition is used to store a second version of model data. The device may include the following modules: The first receiving module 801 is used to receive the current model version information of the model data in the model data storage partition uploaded by the smart device; The first sending module 802 is used to generate a model update request based on the current model version information and send the model update request to the smart device. The model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition. In response to the model update request, the module reads the model data in the active model data storage partition and updates the model data. The module stores the updated model data in the inactive model data storage partition and points the model loading path to the inactive model data storage partition.
[0184] In some embodiments, the apparatus further includes: The generation module is used to receive the current system version information of the system data in the system data storage partition uploaded by the smart device; generate a system update request based on the current system version information, and send the system update request to the smart device; the system update request is used to trigger the update of the system data in the system data storage partition.
[0185] In some embodiments, the first sending module 802 is configured to, when determining that the smart device needs to upgrade its model based on the current model version information, determine a model change data block for the model data in the active model data storage partition; compress the model change data block to generate a model differential packet; and split the model differential packet to obtain multiple model network packets; and generate a model update request based on the multiple model network packets.
[0186] In some embodiments, the apparatus further includes: The transmission information determination module is used to determine the transmission-related status information of the smart device; based on the transmission-related status information, it determines the transmission time and transmission rate for sending model network packets to the smart device.
[0187] In some embodiments, the apparatus further includes: The transmission adjustment module is used to determine the upgrade-related status information of the smart device; based on the upgrade-related status information, it adjusts the packet size, transmission time, and transmission rate of the model network packets.
[0188] Reference Figure 9 This diagram illustrates a structural schematic of another optical module performance prediction device according to an embodiment of this application. It is applied to an edge gateway, and a storage module is applied to a smart device. The edge gateway is communicatively connected to the cloud and the smart device. The storage module includes a system data storage partition and a model data storage partition. The system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition. The first partition is used to store a first version of model data, and the second partition is used to store a second version of model data. The device may include the following modules: The second receiving module 901 is used to receive the current model version information of the model data in the model data storage partition uploaded by the smart device, and upload the current model version information to the cloud. The second sending module 902 is used to receive the model update request sent from the cloud and send the model update request to the smart device. The model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition. In response to the model update request, the module reads the model data in the active model data storage partition and updates the model data. The updated model data is stored in the inactive model data storage partition, and the model loading path is pointed to the inactive model data storage partition.
[0189] This application also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the above-described method for updating data in the storage module.
[0190] This application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it implements the above-described method for updating data in the storage module.
[0191] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0192] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0193] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0194] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0195] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0196] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0197] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0198] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0199] The above provides a detailed description of the data updating method, apparatus, device, medium, and cloud in a storage module. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for updating data in a storage module, characterized in that, The storage module is applied to a smart device, and includes a system data storage partition and a model data storage partition; the system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition, the first partition being used to store a first version of model data, and the second partition being used to store a second version of model data; the method includes: From the first partition and the second partition, determine the active model data storage partition pointed to by the model loading path, and the inactive model data storage partition not pointed to by the model loading path; Upon receiving a model update request, in response to the model update request, the model data in the active model data storage partition is read and the model data is updated. The updated model data is stored in the inactive model data storage partition, and the model loading path is pointed to the inactive model data storage partition.
2. The method according to claim 1, characterized in that, The method further includes: Upon receiving a system update request, in response to the system update request, the system data in the system data storage partition is read and the system data is updated. The updated system data is stored in the system data storage partition, and the system of the smart device is restarted.
3. The method according to claim 1, characterized in that, The system data storage partition includes a third partition and a fourth partition. The third partition is used to store system data for the third version, and the fourth partition is used to store system data for the fourth version. The method further includes: From the third partition and the fourth partition, determine the active system data storage partition pointed to by the system loading path, and the inactive system data storage partition not pointed to by the system loading path; Upon receiving a system update request, in response to the system update request, the system data in the active system data storage partition is read and the system data is updated. The updated system data is stored in the inactive system data storage partition, and the system loading path is pointed to the inactive system data storage partition.
4. The method according to any one of claims 2-3, characterized in that, The method further includes: The system service node uploads the current system version information of the system data in the system data storage partition to the data service node; the data service node generates the system update request based on the current system version information and sends the system update request to the smart device; the system update request includes a system upgrade package, and the system upgrade package includes multiple system network packets; Updating the system data includes: Upon receiving any system network packet, the system data is updated based on the system network packet.
5. The method according to claim 1, characterized in that, The method further includes: The data service node uploads the current model version information of the model data in the active model data storage partition to the data service node; the data service node generates the model update request based on the current model version information and sends the model update request to the smart device; the model update request includes a model upgrade package, and the model upgrade package includes multiple model network packets; The step of responding to the model update request by reading model data from the active model data storage partition and updating the model data includes: In response to the model update request, read the model data from the active model data storage partition; Upon receiving any model network packet, the model network packet is verified. When the model network packet verification passes, the model data is updated according to the model network packet. If the verification of the model network packet fails, a request is made to retransmit the model network packet.
6. The method according to claim 5, characterized in that, After updating the model data according to all model network packets, the method further includes: Validate the updated model data; After the updated model data passes verification, if the smart device to which the storage module belongs is in a non-sensitive operation state, the step of pointing the model loading path to the inactive model data storage partition is executed.
7. A method for updating data in a storage module, characterized in that, The storage module is applied to a smart device in the cloud, and the cloud is communicatively connected to the smart device. The storage module includes a system data storage partition and a model data storage partition. The system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition. The first partition is used to store the first version of model data, and the second partition is used to store the second version of model data. The method includes: Receive the current model version information of the model data in the model data storage partition uploaded by the smart device; Based on the current model version information, a model update request is generated and sent to the smart device. The model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition. In response to the model update request, the model data in the active model data storage partition is read and the model data is updated. The updated model data is stored in the inactive model data storage partition, and the model loading path is pointed to the inactive model data storage partition.
8. The method according to claim 7, characterized in that, The method further includes: Receive the current system version information of the system data in the system data storage partition uploaded by the smart device; Based on the current system version information, a system update request is generated and sent to the smart device; the system update request is used to trigger an update of the system data in the system data storage partition.
9. The method according to claim 7, characterized in that, The step of generating a model update request based on the current model version information includes: If, based on the current model version information, it is determined that the smart device needs to upgrade its model, a model change data block is identified for the model data in the active model data storage partition; The model change data block is compressed to generate a model difference packet, and the model difference packet is split to obtain multiple model network packets; The model update request is generated based on the multiple model network packets.
10. The method according to claim 9, characterized in that, The method further includes: Determine the transmission-related status information of the smart device; Based on the transmission-related status information, the transmission time and transmission rate for sending the model network packets to the smart device are determined.
11. The method according to claim 10, characterized in that, The method further includes: Determine the upgrade-related status information of the smart device; Based on the upgrade-related status information, the packet size, transmission time, and transmission rate of the model network are adjusted.
12. A method for updating data in a storage module, characterized in that, The storage module is used in an edge gateway and is applied to a smart device. The edge gateway is communicatively connected to the cloud and the smart device. The storage module includes a system data storage partition and a model data storage partition. The system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition. The first partition is used to store the first version of model data, and the second partition is used to store the second version of model data. The method includes: Receive the current model version information of the model data in the model data storage partition uploaded by the smart device, and upload the current model version information to the cloud; The system receives a model update request from the cloud and sends the model update request to the smart device. The model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition. In response to the model update request, the system reads the model data in the active model data storage partition and updates the model data. The updated model data is stored in the inactive model data storage partition, and the model loading path is set to the inactive model data storage partition.
13. A cloud platform, characterized in that, The cloud is communicatively connected to the smart device, which includes a storage module comprising a system data storage partition and a model data storage partition. The system data storage partition stores system data, and the model data storage partition includes a first partition and a second partition. The first partition stores a first version of model data, and the second partition stores a second version of model data. The cloud includes: Version repository, used to maintain system data and model data for different versions; The differential engine is used to receive the current model version information of the model data in the model data storage partition uploaded by the smart device; and to generate a model update request based on the current model version information. A distribution scheduler is configured to determine the transmission-related status information of the smart device; based on the transmission-related status information, determine the transmission time and transmission rate for sending the model update request to the smart device, and send the model update request to the smart device according to the transmission time and transmission rate; the model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path, and the inactive model data storage partition not pointed to by the model loading path; in response to the model update request, read the model data in the active model data storage partition and update the model data; store the updated model data in the inactive model data storage partition, and point the model loading path to the inactive model data storage partition; the model update request includes multiple model network packets; The device profiling module is used to determine the upgrade-related status information of the smart device; and to adjust the packet size, transmission time, and transmission rate of the model network packets based on the upgrade-related status information.
14. A data updating device in a storage module, characterized in that, The storage module is applied to a smart device, and includes a system data storage partition and a model data storage partition; the system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition, the first partition being used to store a first version of model data, and the second partition being used to store a second version of model data; the device includes: The partition determination module is used to determine, from the first partition and the second partition, the active model data storage partition pointed to by the model loading path, and the inactive model data storage partition not pointed to by the model loading path; The data update module is used to, upon receiving a model update request, read the model data in the active model data storage partition and update the model data in response to the model update request. The partition adjustment module is used to store the updated model data in the inactive model data storage partition and point the model loading path to the inactive model data storage partition.
15. A data updating device in a storage module, characterized in that, The storage module is applied to a smart device in the cloud, and the cloud is communicatively connected to the smart device. The storage module includes a system data storage partition and a model data storage partition. The system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition. The first partition is used to store model data of a first version, and the second partition is used to store model data of a second version. The device includes: The first receiving module is used to receive the current model version information of the model data in the model data storage partition uploaded by the smart device; The first sending module is configured to generate a model update request based on the current model version information and send the model update request to the smart device; the model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition; in response to the model update request, the module reads the model data in the active model data storage partition and updates the model data; the module stores the updated model data in the inactive model data storage partition and points the model loading path to the inactive model data storage partition.
16. A data updating device in a storage module, characterized in that, The storage module is used in an edge gateway and is applied to a smart device. The edge gateway is communicatively connected to the cloud and the smart device. The storage module includes a system data storage partition and a model data storage partition. The system data storage partition is used to store system data, and the model data storage partition includes a first partition and a second partition. The first partition is used to store model data of a first version, and the second partition is used to store model data of a second version. The device includes: The second receiving module is used to receive the current model version information of the model data in the model data storage partition uploaded by the smart device, and upload the current model version information to the cloud. The second sending module is used to receive the model update request sent from the cloud and send the model update request to the smart device; the model update request is used to trigger the determination of the active model data storage partition pointed to by the model loading path and the inactive model data storage partition not pointed to by the model loading path from the first partition and the second partition; in response to the model update request, the module reads the model data in the active model data storage partition and updates the model data; the module stores the updated model data in the inactive model data storage partition and points the model loading path to the inactive model data storage partition.
17. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when executed by the processor, the computer program implements a method for updating data in the storage module as claimed in any one of claims 1 to 12.
18. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements a method for updating data in the storage module as described in any one of claims 1 to 12.
