Remote parameter upgrading method for control system with limited storage space

By using a block-based parameter storage system and a server index tree management method, the problem of high storage consumption and computational complexity in remote parameter upgrades for controllers with limited Flash storage space is solved, enabling upgrades with low storage consumption and low complexity suitable for small storage devices.

CN121349482APending Publication Date: 2026-01-16XCMG XUZHOU TRUCK MOUNTED CRANE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511158803.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2026-01-16

AI Technical Summary

Technical Problem

Existing OTA technology cannot meet the remote parameter upgrade requirements of controllers with limited Flash storage space, resulting in high storage space consumption and high computational complexity on the device side.

Method used

The method employs parameter storage partitioning, server index tree management, and step-by-step transmission verification. It establishes a connection between the controller and the server via HTTPS protocol, generates a Merkle index tree, downloads only the difference parameter blocks for upgrades, and the controller performs basic operations to reduce storage usage and computational complexity.

Benefits of technology

It enables remote parameter upgrades with low storage footprint and low device complexity, and is suitable for devices with limited storage space, especially PLCs and embedded controllers with less than 2MB of storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121349482A_ABST
    Figure CN121349482A_ABST
Patent Text Reader

Abstract

The invention discloses a remote parameter upgrading method for a control system with a limited storage space, and belongs to the technical field of calculation, reckoning or counting. According to the method, partitioning processing is carried out on a controller parameter storage area, functions such as difference analysis and residual space diagnosis based on an index tree are concentrated on a server, upgrading information containing difference parameter module information is transmitted to a controller end, the controller end only needs to execute basic operations such as information uploading, parameter block receiving and verification, and the upgrading efficiency is improved. Only one difference parameter block is downloaded each time, and the upgrading process only occupies a storage space as large as a single parameter block, so that the program complexity and the computing resource consumption are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to remote parameter optimization and upgrading technology of industrial automation control system, and particularly discloses a remote parameter upgrading method for control system with limited storage space, which is particularly suitable for PLC, embedded controller and other devices with limited Flash storage space, and belongs to the technical field of calculation, estimation or counting. BACKGROUND

[0002] The remote parameter upgrading of control system currently mainly adopts Over the Air (OTA) technology, which remotely updates device software or parameters through wireless communication networks such as cellular networks, Wi-Fi, Bluetooth, etc. In distributed devices such as new energy vehicles, industrial Internet of Things devices, mobile terminals and scenes that are difficult to physically contact, the OTA technology realizes safe, efficient and contactless parameter optimization and function iteration, and is the core means of control system parameter upgrading.

[0003] The existing OTA technology is divided into full upgrade and differential upgrade, and the OTA parameter upgrading process mainly includes the following links:

[0004] Parameter upgrade package generation: generate full upgrade package or differential upgrade package, the full upgrade package is a complete parameter set, and the differential upgrade package only contains the difference between the new and old versions;

[0005] Secure transmission: use encryption protocols such as HTTPS and digital signatures to prevent data tampering, support breakpoint resume and traffic compression to improve transmission efficiency;

[0006] Client verification and installation: the device end checks the digital signature to ensure data integrity and completes parameter replacement;

[0007] Seamless switching and rollback: save new and old parameters through A / B dual storage design, and automatically roll back to the old version when upgrading fails.

[0008] However, both the existing full upgrade and differential upgrade have defects. In the full upgrade process, even if only a small number of parameters need to be modified, the device still needs to download the complete parameter package and store it in the temporary storage area. For a device with a 2MB Flash storage space, due to the limited capacity of the temporary storage area, it can only support parameter package upgrading of no more than 1MB, which has very low flexibility. The differential upgrade process requires the pre-storage of the old version full parameters as a reference file on the device end, and then restores the new version parameters through the differential package, which not only occupies additional storage space but also increases the computational complexity of the device end, and is not suitable for scenarios with extremely limited storage space.

[0009] In summary, existing OTA technology cannot meet the remote parameter upgrade requirements of controllers with limited Flash storage space, and there is an urgent need for an upgrade method with low storage footprint and low device complexity. Summary of the Invention

[0010] The purpose of this invention is to overcome the shortcomings of high storage space occupation and high computational complexity on the device side when remotely upgrading the parameters of the control system in the prior art. It provides a method for remote parameter upgrading of control systems with limited storage space, realizes remote parameter upgrading of PLCs, embedded controllers and other devices with small Flash storage space, and solves the problem of parameter iteration of small storage devices.

[0011] To achieve the above-mentioned objectives, the present invention employs the following technical solution:

[0012] A method for remote parameter upgrades in a storage-constrained control system, comprising:

[0013] Step 1: Establish a connection between the controller and the server. The parameter storage area of ​​the controller includes at least one parameter block for storing control parameters in blocks. The server establishes a Merkle index tree corresponding to the current version of the controller parameters.

[0014] Step 2: Initialize device information. The controller uploads the device information to the server. The server generates the Merkle index tree of the next version of the controller parameters. When the controller is in the unupgraded state, the server compares the current version and the next version of the Merkle index tree of the control parameters, generates a list of difference parameter blocks, and sorts the parameter blocks in the list of difference parameter blocks according to the parameter block number.

[0015] Step 3: The server generates upgrade information according to the sorting order of the difference parameter blocks and sends it to the controller. The controller updates the difference parameter blocks step by step according to the received upgrade information.

[0016] As a further optimization of the remote parameter upgrade method for control systems with limited storage space, the device information includes device identifier, version and remaining storage information. The version information of the device information includes the main version of the device parameters and the status identifier information representing the updated difference parameter blocks.

[0017] As a further optimization of the remote parameter upgrade method for control systems with limited storage space, the upgrade information includes device identification, version and load data information. The version information of the upgrade information includes the main version of the parameters published by the server, the status identification information of the parameter blocks to be updated, and the load data. The load data includes the parameter block size, parameter block check value and parameter block content information.

[0018] As a further optimization of the remote parameter upgrade method for control systems with limited storage space, in step 2, when the device information omits the status identifier information representing the updated difference parameter block, the controller is in an un-upgraded state.

[0019] As a further optimization of the remote parameter upgrade method for control systems with limited storage space, step 3 specifically involves: the server generating upgrade information containing load data related to the first differential parameter block; sending the upgrade information to the controller when the remaining storage is greater than the upgrade information size; receiving device information fed back by the controller after updating the first differential parameter block; updating the differential parameter block list; generating upgrade information containing load data related to the remaining differential parameter blocks; sequentially completing the update of the remaining differential parameter blocks; and after all differential parameter blocks have been updated, sending upgrade information, omitting the status identifier information representing the differential parameter blocks to be updated and the load data, to the controller.

[0020] As a further optimization of the remote parameter upgrade method for storage-constrained control systems, the controller updates the first difference parameter, specifically:

[0021] When the status identifier of the first difference parameter block is non-negative, the parameter block corresponding to the status identifier of the first difference parameter block is verified. If the verification passes, the local parameter block corresponding to the status identifier of the first difference parameter block is updated according to the content of the first difference parameter block, and the device information is updated. If the verification fails, the device information is not updated. When the status identifier of the first difference parameter block is negative, fault handling is performed.

[0022] As a further optimization of the remote parameter upgrade method for control systems with limited storage space, in step 5, if the remaining storage is less than or equal to the size of the upgrade information, then fault handling is performed.

[0023] As a further optimization of the remote parameter upgrade method for control systems with limited storage space, a connection between the controller and the server is established via the HTTPS protocol.

[0024] Compared with the prior art, the present invention, by adopting the above technical solution, has the following beneficial effects:

[0025] 1. Reduced storage footprint: No need to pre-store all parameters or baseline files of the old version. Only one difference parameter block is downloaded each time. The upgrade process only occupies the storage space of a single parameter block. The storage space of the upgrade parameters can be compressed to 4KB-128B, solving the problem of small storage capacity limitation.

[0026] 2. Simplify device-side complexity: Functions such as index tree-based difference analysis and remaining space diagnosis are centralized on the server. The controller only needs to perform basic operations such as information uploading, parameter block reception, and verification, without having to run the differential restoration algorithm, which reduces program complexity and computational resource consumption.

[0027] 3. Strong compatibility: The parameter block size can be flexibly adjusted according to the storage space, making it suitable for devices with limited storage space, such as PLCs and embedded controllers with less than 2MB of storage. Attached Figure Description

[0028] Figure 1 This is a system architecture diagram of a client and server connected via the HTTPS protocol in one embodiment of the present invention.

[0029] Figure 2 This is a block structure diagram of controller parameter storage provided in one embodiment of the present invention.

[0030] Figure 3 This is a Merkle index tree structure diagram containing 4 parameter blocks provided in one embodiment of the present invention.

[0031] Figure 4 This is a schematic diagram of the device information structure provided in one embodiment of the present invention.

[0032] Figure 5 This is a schematic diagram of the upgrade information structure provided in one embodiment of the present invention.

[0033] Figure 6 This is a flowchart of a client-controlled remote parameter upgrade provided in one embodiment of the present invention.

[0034] Figure 7 This is a flowchart of server-side control for remote parameter upgrades provided in one embodiment of the present invention. Detailed Implementation

[0035] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only some, not all, of the embodiments of this invention.

[0036] To address the challenge of parameter iteration in small storage devices, this invention adopts a method of "parameter storage partitioning + server index tree management + step-by-step transmission verification" to centralize complex functions on the server, while the device executes basic functions, thereby achieving low storage consumption and low complexity upgrades on the device side.

[0037] In one embodiment of the present invention, a client / server architecture is used to remotely upgrade parameters of a storage-constrained control system. The controller, acting as a client, establishes an encrypted connection with the server via HTTPS protocol to ensure data transmission security. Figure 1 As shown.

[0038] In one embodiment of the present invention, the controller parameter storage area is divided into blocks, with the controller parameter storage area pf divided into several parameter blocks pb. The parameter block numbers pb_seq start from the integer 0 and increment sequentially, such as pb0, pb1, pb2... The size of each parameter block can be adjusted according to the actual storage space of the device, such as setting each parameter block to 128B, 512B, 1KB, 4KB. Each parameter block can store several parameters, such as p0, p1..., forming a three-level structure of "storage area pf - parameter block pb - parameter p". Figure 2 As shown.

[0039] In one embodiment of the present invention, the server establishes parameter block index trees for the parameters of the current version and the next version of the controller, respectively, using... Figure 3 The Merkle Tree structure shown is used to build a parameter block index tree. Leaf nodes are constructed by calculating the hash value of each parameter block using the SHA-256 algorithm; non-leaf nodes are constructed by concatenating the hash values ​​of two leaf nodes; the top-level hash value of the entire index tree obtained by concatenating the hash values ​​of the non-leaf nodes is assigned to the root node, which represents the overall parameter state of the corresponding version. By comparing the root and leaf nodes of different versions of the index tree, differing parameter blocks can be quickly located.

[0040] In one embodiment of the present invention, the status data uploaded by the controller to the server, namely device information device_info, includes: device identifier device_id, version, and remaining storage free_flash, such as... Figure 4 As shown. The device identifier (device_id) is a unique identifier for the controller, such as "PLC-001"; the version includes the main version (main_version) associated with the index tree version. The next version is 1 greater than the current version. Optionally, the version also includes the status flag (status_flag). A non-negative status_flag indicates the parameter block number that the controller has completed the upgrade. If omitted, it means that all parameter blocks have not been upgraded; the remaining storage (free_flash) indicates the remaining capacity of the controller's current parameter storage area, such as "1MB".

[0041] In one embodiment of the present invention, the upgrade instruction, i.e., the upgrade information update_info, sent by the server to the controller includes the device identifier device_id and the version. Optionally, the upgrade information update_info also includes payload data, such as... Figure 5 As shown. The device identifier device_id is consistent with the target controller's device_id; the version includes the main version main_version, which is the controller's current main version + 1. Optionally, the version also includes the status flag status_flag. A non-negative status_flag indicates the currently issued parameter block number. Omission indicates that the upgrade is complete / no upgrade is needed, and a negative number indicates a fault; the payload data includes the parameter block size size, the parameter block checksum rc, and the parameter block content pb.

[0042] The following example illustrates the implementation of the remote parameter upgrade method proposed in this invention, using a PLC controller with 2MB of Flash storage space as an example to perform a remote parameter upgrade with a total capacity of 1.5MB.

[0043] In one embodiment of the present invention, the process of remote parameter upgrade on the controller side is as follows: Figure 6 As shown, it includes steps 1 to 3.

[0044] Step 1: System Initialization

[0045] The controller, i.e., the client and server, establish a connection via HTTPS;

[0046] The controller divides the parameter storage area into 1500 1KB parameter blocks, numbered from pb0 to pb1499, with each parameter block storing the corresponding control parameters.

[0047] Step 2: Parameter upgrade triggered

[0048] The controller uploads device information device_info: device_id="PLC-001", version="V1.0" (main_version=1, status_flag omitted, i.e., upgrade not started), free_flash="0.1MB".

[0049] Step 3: Step-by-step upgrade process

[0050] The controller receives the upgrade information `update_info`. If the upgrade information contains `status_flag=100`, it indicates that parameter upgrades are being performed on pb100. After verifying the integrity of pb100 using the parameter block checksum CRC, the controller updates the local pb100 and updates `device_info: main_version = update_info: main_version`, `device_info: status_flag = update_info: status_flag`, with the first value of `device_info: status_flag` being the minimum value of the parameter block number to be upgraded. The content of the local parameter block with the parameter block number `status_flag` is updated, the remaining storage is updated, and the updated device information `device_info` is uploaded. If `status_flag` is omitted in the upgrade information, the entire parameter upgrade process ends. If `status_flag` in the upgrade information is negative, fault handling is performed. If the controller receives `update_info: status_flag` greater than or equal to 0 but CRC verification fails, it does not update `device_info` and uploads `device_info` to the server. For example, if the controller fails to verify the CRC after receiving pb103, it will not update device_info, that is, status_flag will remain 102. Instead, it will upload device_info to the server. After receiving device_info, the server will reprocess it and send update_info: status_flag=103.

[0051] In one embodiment of the present invention, the process of remote parameter upgrade on the server side is as follows: Figure 7 As shown, it includes steps I to III.

[0052] Step 1: System Initialization

[0053] The server and the controller (i.e., the client) establish a connection via HTTPS. The server builds a Merkle index tree for the current parameter version V1.0 of the controller, calculates the SHA-256 hash value of each parameter block as the leaf node, and generates non-leaf nodes and the root node layer by layer.

[0054] Step II: Parameter upgrade triggered

[0055] After receiving the device_info, the server confirms that it needs to be upgraded to V2.0 (main_version=2). The server generates a new parameter version V2.0 and builds a Merkle index tree for V2.0. When the device information device_info does not have a status identifier, it compares the index trees of V1.0 and V2.0 to locate the difference parameter blocks. Assuming that the difference parameter blocks are pb100 to pb105, a total of 6, they are sorted by pb_seq.

[0056] Step 3: Step-by-step upgrade process

[0057] Upgrade the first difference parameter block pb100, generate update_info: device_id="PLC-001", main_version=2, status_flag=100, payload=(size=1KB, crc=0x123456, pb=pb100 content), verify that free_flash (0.1MB) > update_info size (1KB), and send update_info to the controller;

[0058] The server receives the device information (device_info) returned by the controller after updating pb100. It compares the index tree of V2.0 and V1.0 to update the list of difference parameter blocks, sorts each parameter block in the list according to pb_seq, generates update_info (status_flag=101), verifies that free_flash (0.1MB) > update_info size (1KB), and sends the update_info for the next parameter block pb101. The transmission and update of pb102 to pb105 are completed in sequence. The controller finally uploads device_info (status_flag=105). The server confirms that all difference parameter blocks have been transmitted and sends update_info (status_flag and payload omitted), indicating that the upgrade is complete. If the remaining storage is insufficient, fault handling is performed.

[0059] The above specific embodiments are specific support for the "parameter storage partitioning + server index tree management + step-by-step transmission verification" scheme proposed in this invention, and should not be used to limit the scope of protection of this invention. Any equivalent changes or modifications made based on the technical concept of this invention shall still fall within the scope of protection of this invention.

Claims

1. A method for remote parameter upgrade of a control system with limited storage space, characterized in that, The application comprises the following steps: Step 1, establishing a connection between the controller and the server, the parameter storage area of the controller comprising at least one parameter block for storing control parameters in blocks, the server establishing a Merkle index tree corresponding to the current version of the controller parameters; Step 2, initializing device information, the controller uploading the device information to the server, the server generating a Merkle index tree of the next version of the controller parameters, when the controller is in an unstarted upgrading state, the server comparing the Merkle index trees of the current version and the next version of the control parameters to generate a list of difference parameter blocks, and sorting the parameter blocks in the list of difference parameter blocks according to the parameter block numbers; Step 3, the server generating upgrading information according to the sorting order of the difference parameter blocks and sending the upgrading information to the controller, the controller updating the difference parameter blocks step by step according to the received upgrading information.

2. The method for remote parameter upgrade of a control system with limited storage space according to claim 1, wherein, The device information comprises device identification, version and remaining storage information, and the version information of the device information comprises a main version of device parameters and state identification information representing updated difference parameter blocks.

3. The method for remote parameter upgrade of a control system with limited storage space according to claim 2, wherein, The upgrading information comprises device identification, version and load data information, and the version information of the upgrading information comprises a main version of server-published parameters, state identification information representing difference parameter blocks to be updated and load data, and the load data comprises parameter block size, parameter block check value and parameter block content information.

4. The method for remote parameter upgrade of a control system with limited storage space according to claim 3, wherein, In step 2, when the device information omits the state identification information representing updated difference parameter blocks, the controller is in an unstarted upgrading state.

5. The method for remote parameter upgrade of a control system with limited storage space according to claim 4, wherein, In step 3, the server generates upgrading information containing load data related to the first difference parameter block, sends the upgrading information to the controller when the remaining storage is greater than the size of the upgrading information, receives device information fed back by the controller after the first difference parameter block is updated, updates the list of difference parameter blocks, generates upgrading information containing load data related to the remaining difference parameter blocks, sequentially updates the remaining difference parameter blocks, and sends upgrading information omitting the state identification information representing difference parameter blocks to be updated and load data to the controller after all the difference parameter blocks are updated.

6. The method for remote parameter upgrade of a control system with limited storage space according to claim 5, wherein, The controller updates the first difference parameter, specifically as follows: When the state identification information of the first difference parameter block is non-negative, the parameter block corresponding to the state identification information of the first difference parameter block is checked, if the check is passed, the local parameter block corresponding to the state identification information of the first difference parameter block is updated according to the content of the first difference parameter block, the device information is updated, and if the check is failed, the device information is not updated; When the state identification information of the first difference parameter block is negative, fault processing is performed.

7. The method for remote parameter upgrade of a control system with limited storage space according to claim 5, wherein, In step 5, when the remaining storage is less than or equal to the size of the upgrading information, fault processing is performed.

8. The method for remote parameter upgrade of a control system with limited storage space according to any one of claims 1 to 7, characterized in that, The connection between the controller and the server is established through the HTTPS protocol.