CN117472415A - Remote upgrading method, system, storage medium and terminal - Google Patents

Remote upgrading method, system, storage medium and terminal Download PDF

Info

Publication number
CN117472415A
CN117472415A CN202311386081.9A CN202311386081A CN117472415A CN 117472415 A CN117472415 A CN 117472415A CN 202311386081 A CN202311386081 A CN 202311386081A CN 117472415 A CN117472415 A CN 117472415A
Authority
CN
China
Prior art keywords
terminal
upgrading
differential
upgrade
configuration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311386081.9A
Other languages
Chinese (zh)
Inventor
杨茂林
贾苹
桑楠
陈泽玮
高久强
王若宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN202311386081.9A priority Critical patent/CN117472415A/en
Publication of CN117472415A publication Critical patent/CN117472415A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Abstract

The invention discloses a remote upgrading method, a remote upgrading system, a storage medium and a remote upgrading terminal, which belong to the field of embedded software and intelligent weight of railway contact networks and are used for an intelligent weight system based on the embedded railway contact networks; for the update related to the terminal task scheduling configuration, an online configuration update and upgrade strategy is used; and for the upgrading requirement of the terminal system functional components, adopting a differential upgrading strategy. By the online configuration updating and remote differential upgrading method, configuration errors and vulnerabilities are repaired in time, and the system is upgraded to adapt to new requirements, so that the stability and reliability of the system can be improved, and the requirements of intelligent application flexible configuration, real-time updating and light-weight upgrading are met.

Description

Remote upgrading method, system, storage medium and terminal
Technical Field
The invention relates to the field of embedded software and intelligent weight of railway contact networks, in particular to a remote upgrading method, a remote upgrading system, a storage medium and a terminal.
Background
The intelligent balance weight of the overhead line system is key core equipment of a monitoring and detecting system of a power supply facility of the railway overhead line system, and along with the deep advancement of intelligent construction of a railway, the functions and performances of an intelligent balance weight terminal are required to be continuously updated and upgraded. Especially in the application of high-cold, high-altitude and unmanned areas such as the Sichuan railway, real-time and efficient remote updating and upgrading of intelligent weight terminal software of the contact net for deployment and application are more needed. However, the existing railway contact net weight is usually developed based on a singlechip polling system, has strong software and hardware function coupling, fixed monitoring sampling period and weak expandability, and rarely considers remote configuration updating and system function and performance upgrading schemes. When upgrading and reforming, all firmware needs to be updated and restarted, even the deployment is redeveloped, and the problems of difficult updating and upgrading, complex flow, low efficiency and the like exist. Therefore, how to realize the configuration update and upgrade of the intelligent balance weight terminal system of the railway contact net and meet the requirements of flexible configuration, real-time update and lightweight upgrade of intelligent application is a problem to be solved urgently.
Disclosure of Invention
The invention aims to solve the problems and provide a remote upgrading method, a system, a storage medium and a terminal, so as to meet the requirements of low cost, low power consumption and flexible updating.
The aim of the invention is realized by the following technical scheme:
in a first aspect, a remote upgrading method is provided, which is used for an intelligent weight system based on an embedded railway contact net, wherein the system comprises a terminal, a central node and a back-end system, and the method comprises the following steps:
different upgrading strategies are adopted according to different upgrading requirements of the terminal; for the update related to the terminal task scheduling configuration, an online configuration update and upgrade strategy is used; and for the upgrading requirement of the terminal system functional components, adopting a differential upgrading strategy.
In a second aspect, a remote upgrading method is provided, which is used for an intelligent weight system based on an embedded railway contact net, wherein the system comprises a terminal, a central node and a back-end system, and the method comprises the following steps:
s1, packaging a configuration update data packet and/or generating a differential upgrade file by a back-end system;
s2, the back-end system sends a configuration update data packet and/or a differential upgrade file to the terminal;
s3, the back-end system receives the configuration update completion signal or the upgrade completion signal uploaded by the terminal.
In a third aspect, a remote upgrading method is provided, which is used for an intelligent weight system based on an embedded railway contact net, wherein the system comprises a terminal, a central node and a back-end system, and the method comprises the following steps:
S1, a terminal receives a configuration update data packet and/or a differential upgrade file sent by a back-end system;
s2, the terminal completes the update related to task scheduling configuration according to the configuration update data packet, and the terminal completes the upgrade of the functional component according to the differential upgrade file;
and S3, the terminal sends a configuration update completion signal or an upgrade completion signal to the back-end system.
Preferably, the generating the differential upgrade file includes:
and carrying out differential compression processing on the application program to be upgraded by using an HPatchLite+TinyUz algorithm through a create_lite_diff interface on a back-end system file server.
Preferably, the back-end system sends a differential upgrade file to a terminal, including:
the differential upgrading file is subjected to sub-packaging processing, the differential compressed file is divided into a plurality of data packets with byte-level capacity, and metadata with certain bytes are added for each data packet; and sending the data packets to the terminal according to a certain sequence.
Preferably, the terminal receives a differential upgrade file sent by a back-end system, including:
the terminal receives the differential upgrade file through the communication module;
calling a differential upgrading interface to preprocess the differential upgrading file, wherein the preprocessing comprises reorganization and integration;
Decompressing the preprocessed differential upgrade file by using a TinyUz decompression algorithm;
and performing solution difference on the decompressed difference upgrade file by using an HPatchLite solution difference algorithm, and finally forming a system program to be upgraded.
Preferably, the terminal completes the upgrade of the functional component according to the differential upgrade file, including:
and storing the system program to be upgraded in a corresponding APP area by using a ping-pong upgrade mode, guiding the system program to jump to a designated position by using a Bootloader program, and running the system program to be upgraded.
In a fourth aspect, a remote upgrading system, that is, an intelligent weight system based on an embedded operating system, is provided, and the intelligent weight system comprises a terminal, a central node and a back-end system, so that seamless integration of data transmission, monitoring and cooperation of the terminal, the central station and the back-end system is ensured, and efficiency, safety and reliability of the weight system are improved. The back-end system is used for making different upgrading strategies according to different upgrading requirements of the terminal; the central node is used for communication between the terminal and the back-end system; the back-end system updates the update related to the terminal task scheduling configuration by using an online configuration update strategy; and for the upgrading requirement of the terminal system functional components, adopting a differential upgrading strategy.
In a fifth aspect, a computer storage medium having stored thereon computer instructions which, when executed, perform the steps associated with any of the remote upgrade methods of the present invention.
In a sixth aspect, a terminal is provided, including a memory and a processor, the memory having stored thereon computer instructions executable on the processor, the processor executing any one of the steps associated with a remote upgrade method as described herein.
It should be further noted that the technical features corresponding to the above options may be combined with each other or replaced to form a new technical scheme without collision.
Compared with the prior art, the invention has the beneficial effects that:
(1) The invention can repair the errors and loopholes of configuration in time and upgrade the system to adapt to new requirements by the online configuration updating and remote differential upgrading method, thereby improving the stability and reliability of the system. Even if the configuration is updated and upgraded during the operation of the intelligent balance weight system, the continuous operation of the system can be maintained, and the system downtime is reduced. The requirements of flexible configuration, real-time updating and lightweight upgrading of intelligent application are met. Meanwhile, a system administrator can remotely manage and update the configuration of the device. Therefore, the inspection, maintenance and upgrading costs of maintenance personnel can be reduced, the working efficiency is improved, and the human resource cost of system management is reduced.
(2) In the application of high-cold, high-altitude and unmanned areas such as the Sichuan-Tibetan railways, the network is unstable, and the conditions of packet drop and disconnection easily occur during network transmission, so that the upgrading is interrupted. In this regard, in one example, with ping-pong upgrade techniques, the system may continue to run the original application even if the upgrade is interrupted; and a breakpoint continuous transmission mechanism is adopted, so that even if the upgrading is interrupted, the next transmission can be continued from the disconnection position, all data packets do not need to be retransmitted, and the network resource waste is reduced.
(3) The system power consumption is reduced: battery power is adopted for the balance weight system terminal and the central station, and the maintenance of low power consumption is a basic measure for prolonging the service life. When the system is remotely upgraded, the data volume is huge, the power consumption is further increased due to the limited speed of air data transmission, and the transmission data volume is reduced by adopting a differential upgrading algorithm, so that the power consumption of the system is reduced.
(4) Optimizing bandwidth and storage resources: in the actual operation of the system, the number of the deployed weight terminal equipment is huge, the adopted development boards such as RAM, FLASH and the like have limited storage resources, and the condition that the system is crashed due to insufficient RAM resources is very easy to occur when the terminal system is decompressed and differentiated. The system update is realized by two methods, namely configuration update and remote differential update, wherein the configuration update only needs to transmit a configuration update command data packet; the remote differential upgrade only transmits the increment part of the upgrade file, but not the full upgrade, thereby saving network bandwidth and storage resources.
(5) The safety is improved: when the differential upgrade package is transmitted, only the difference part of the application program to be upgraded and the original application program is transmitted, but not the complete program, so that the upgrade safety is improved.
Drawings
FIG. 1 is a schematic diagram of a system architecture according to an embodiment of the present invention;
FIG. 2 is a data transfer diagram illustrating an embodiment of the present invention;
FIG. 3 is a diagram of a terminal system framework according to an embodiment of the present invention;
fig. 4 is a memory area division diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made apparent and fully understood from the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In addition, the technical features of the different embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
Example 1
In an exemplary embodiment, a remote upgrading method is provided for an intelligent weight system based on an embedded railway contact network, the system including a terminal, a central node and a back-end system, the method including:
Different upgrading strategies are adopted according to different upgrading requirements of the terminal; for the update related to the terminal task scheduling configuration, an online configuration update and upgrade strategy is used; and for the upgrading requirement of the terminal system functional components, adopting a differential upgrading strategy.
Specifically, according to different intelligent weight upgrading requirements of the railway contact net, different upgrading strategies are adopted in the method: for the update related to task scheduling configuration, an operating system kernel online programming interface is designed, a configuration update data packet sent by an analysis console is received, an operating system thread management strategy is updated online under the condition of not interrupting the system operation, and new configuration parameters are dynamically loaded and applied, so that the update and upgrade of the weight terminal monitoring data sampling frequency and the like are realized; for the upgrade requirement of the functional components of the system, a lightweight differential upgrade algorithm is introduced for the intelligent balance weight terminal with limited hardware resources, the algorithm occupies a small amount of Flash space, RAM space can be saved when patch is executed, patch size and patch speed are close to those of a conventional differential algorithm, the balance weight terminal system is guaranteed to realize system update rapidly and efficiently, and the time for stopping running of the system is reduced as much as possible.
Further, the two methods are used for completing the upgrading operation of the system together, so that the time consumed by updating the weight system is reduced, and the instantaneity of the system is improved. The online configuration update and upgrade strategy allows configuration update during the operation of the weight system and can dynamically load and apply new configuration without affecting the normal operation of the system, and comprises the following steps:
s1, packaging a configuration update data packet: when the back-end system needs to update the system configuration parameters, the configuration update data packet is packaged according to the configuration specification.
S2, sending a configuration update data packet: and the back-end system server transmits the configuration updating data packet to the corresponding center node, and the configuration updating data packet is forwarded to the corresponding weight terminal node by the center node.
S3, configuration updating: and the weight terminal calls a configuration updating interface, and modifies a corresponding module according to the content of the configuration updating data packet, so as to complete the configuration updating and upgrading of the whole system.
The differential upgrade strategy comprises two parts of a differential upgrade algorithm and an IAP-based OTA upgrade technology, and is specifically as follows:
differential upgrade algorithm: aiming at an intelligent balance weight terminal with limited hardware resources, selecting a differential upgrading algorithm most suitable for a small-capacity balance weight terminal: RAM space can be saved when the patch is executed on the small embedded device, and meanwhile, the patch algorithm is smaller, so that a small amount of Flash space is occupied. In addition, the space is saved, the patch speed is considered, the decompression speed of the upgrade package can be influenced when the input buffer area is smaller, and the decompression efficiency can be influenced when the compression algorithm is too complex. And designing the most proper differential algorithm, compression algorithm and configuration related parameters by combining the condition of limited hardware resources of the weight terminal, so that the overall optimization of time and space when the weight terminal is upgraded is achieved.
IAP-based OTA upgrade technique: aiming at the conditions that the weight terminal is scattered in installation geographical position, is difficult to upgrade on site, is sometimes in a region with severe environment and unstable network condition, is extremely easy to fall off and disconnect, and is upgraded by using an IAP-OTA technology: upgrading is carried out in an aerial, contactless and remote mode. Differential upgrading is designed to be used in IAP-OTA upgrading, so that the transmission data volume is reduced, and the upgrading success rate is improved; adding a breakpoint continuous transmission mechanism in the IAP-OTA, and when abnormal conditions such as power failure, network disconnection and the like occur, timely storing received data information to realize that a terminal continuously acquires data from a place with broken lines; the IAP-OTA is optimized to use a ping-pong upgrading mode, so that a main program area is alternately updated, a data packet is directly stored in the updating area, the updating copy time of Flash outside a BootLoader is removed, a BootLoader guide program jump function is designed, and the downtime of a weight terminal system is reduced, so that the real-time performance of the system is ensured.
The differential upgrade strategy comprises the following steps:
s1, generating a differential compression file: when the back-end system needs to differentially upgrade the intelligent balance weight terminal, firstly, differential compression processing is carried out on an application program to be upgraded according to a specific algorithm to generate a differential compression file.
S2, transmitting a differential data packet: after the differential compression file is generated, the whole file is also required to be subjected to packetization processing, and the differential compression file is divided into smaller data packets so as to be more efficiently transmitted and processed in network transmission. And sequentially issuing all differential data packets to corresponding central nodes by a rear-end system server, and issuing the differential data packets to corresponding weight terminals by the central nodes through communication modules.
S3, differential upgrading: and the balance weight terminal calls a differential upgrading interface, performs a series of processes such as merging, decompressing and the like on the differential data packet according to a specific algorithm, and finally forms a system program to be upgraded to replace the original system program to run.
Example 2
In another exemplary embodiment, in order to implement the method, an intelligent weight system based on an embedded operating system is designed, and the intelligent weight system comprises a terminal, a central node and a back-end system, and is mainly responsible for providing data support and a hardware access interface for the back-end system, so that seamless integration of data transmission, monitoring and cooperation of the terminal, the central node (also called a central station) and the back-end system is ensured, and efficiency, safety and reliability of the weight system are improved. The back-end system is used for making different upgrading strategies according to different upgrading requirements of the terminal; the central node is used for communication between the terminal and the back-end system; the back-end system updates the update related to the terminal task scheduling configuration by using an online configuration update strategy; and for the upgrading requirement of the terminal system functional components, adopting a differential upgrading strategy.
Specifically, the intelligent weight terminal periodically collects environmental data such as ground clearance, environmental temperature, acceleration and the like, and sends the environmental data to the central station through the communication module, and then the environmental data is forwarded to the back-end system through the communication module by the central station. And the user carries out remote configuration updating and system upgrading on the embedded equipment through the back-end system.
In order to realize the functions, the intelligent weight system is unfolded and designed from a hardware layer, a kernel layer, a driving layer, an interface layer and an application layer respectively. The hardware layer includes the selection of development boards, the selection and layout of sensors, the selection of communication devices, power management, and the like. The kernel layer is a core part of the intelligent weight system, is cut according to weight requirements, provides services such as interrupt management, thread management, time management, exception handling and the like, coordinates execution sequences and priorities among different tasks, and ensures real-time performance and stability of system operation. The driving layer comprises a standard device driving module such as I2C, SPI and a weight application device driving module such as an ultrasonic sensor and LoRa. The interface layer comprises a communication interface, an online configuration updating interface and a remote upgrading interface. The existing application of the application layer is contact net weight monitoring, and the follow-up operation can be carried out according to the system requirement.
Further, the function of the intelligent balance weight terminal is realized by adopting a modularized thought design, and a configuration updating module, a differential upgrading module, a communication module and an equipment control module are designed and configured on the basis of a hardware platform and a real-time operating system so as to support remote upgrading of the balance weight terminal. The specific functions of each module are as follows:
1. and (3) a configuration updating module: the configuration updating module of the weight terminal is responsible for managing and processing the configuration information of the system, storing the current system configuration, receiving new configuration, completing configuration updating and other operations. The module enables the weight terminal to load and apply new configuration when the system is running, and ensures consistency and durability of the configuration.
2. Differential upgrading module: the upgrade processing module is a key part in the balance weight terminal and is responsible for processing upgrade requests and executing corresponding upgrade operations. The module receives and processes the differential upgrade file forwarded by the central node through communication with the central node and the back-end system, combines the differential upgrade file with the original system program to generate a system program to be upgraded, and stores the system program in a corresponding position. The upgrade processing module relates to functions of differential upgrade file processing, data analysis, upgrade algorithm and the like, and ensures that the weight terminal can effectively realize system upgrade.
3. And a communication module: the weight terminal is communicated with the central node through the communication module, and is responsible for receiving a configuration update data packet and a differential update file from the central node and providing corresponding data for the configuration update module and the update processing module. The communication interface module also transmits the system log records to the central node, including operation log, state change, event record, etc., for fault analysis, system optimization and subsequent operation and maintenance work.
4. And the equipment control module is used for: the weight terminal also comprises other modules related to equipment hardware, and the equipment control module is responsible for managing and controlling external equipment or interfaces connected with the weight terminal. It is responsible for processing the acquisition of sensor data, controlling the action of the actuator, etc. And the equipment control module cooperates with other modules of the balance weight terminal to realize real-time control and operation of the balance weight system.
In summary, the intelligent balance weight remote upgrading method is realized based on an intelligent balance weight system based on an embedded operating system, and needs to have hardware platform support, run RTOS, and realize functions of online configuration updating and differential updating through the cooperation of a configuration updating module, a differential updating module, a communication interface and a device control module.
Example 3
In another exemplary embodiment, the communication process of the intelligent weight system based on the embedded operating system of embodiment 2 is given.
Specifically, as shown in fig. 1, the information of each node in the communication module is transferred, the weight terminals are embedded terminal devices (corresponding to different branch nodes in fig. 1) distributed at different geographic positions, and the functions of a part of the system, such as periodically collecting weight environment data, reporting system logs at fixed time and the like, are executed; the central node is responsible for data transmission and command transmission; the back-end system is responsible for overall control of the system, such as online configuration update upgrade, remote differential upgrade, and the like. The back-end system comprises a server, the server and a plurality of central nodes are mutually communicated through a 4G module, each central node manages a plurality of weight terminals, and the server and the plurality of central nodes are mutually communicated through a LoRa module.
Further, as shown in fig. 2, the data transfer flow specifically includes:
1) Uploading environment data: the weight terminal is provided with a plurality of periodic threads according to a specific contact net intelligent weight system, specific operations such as data acquisition and the like are completed through equipment control modules by utilizing specified hardware, the acquired data are sent to a central node through a LoRa communication module, the central node cleans and normalizes the data and then sends the data to a server through a 4G communication module, and then a back-end system stores and analyzes the data. In addition, the weight terminal is also provided with a timing task, and the timing task is used for sending the system log record to the central node, so that the subsequent control decision making of the back-end system is facilitated.
2) Issuing an upgrade command: the back-end system uses a specific algorithm to carry out differential, compression, sub-packaging and the like on a system program to be upgraded, a differential data packet is generated, the differential data packet is sent to each central node through a 4G communication module by a server, after the central node checks that the error is avoided, the differential data packet is sent to a managed weight terminal, the upgrade result of the weight terminal is monitored, and the result is timely reported to the back-end system.
3) Issuing a configuration update data packet: the analysis early warning module of the back-end system analyzes the received data, makes corresponding configuration according to the situation, packages the configuration update data packet according to the specification of the configuration command, sends the configuration update data packet to the central node, and sends the configuration update data packet to the managed balance weight terminal after the central node checks that the configuration update data packet is correct, and the configuration update module of the balance weight terminal makes corresponding change according to the command.
The system architecture of the whole branch node is shown in fig. 3, and the bottom MCU is developed by using an STM32F103RCT6 development board. The kernel layer selects a lightweight aCoral embedded real-time operating system, and the kernel provides various services such as interrupt service, thread management and the like, so that the development of an upper layer is simpler and more convenient. On the basis of basic services provided by the inner core layer, an equipment driving layer is constructed and is specially used for driving equipment used by the intelligent weight system of the railway contact net, and meanwhile, standard equipment driving is also provided, and an equipment control module is used for realizing management and control of all peripheral equipment through the equipment driving layer. The interface layer provides a configuration updating interface, a differential upgrading interface and a communication interface, and the corresponding configuration updating module, differential upgrading module and communication module are called through the interfaces, so that the control and monitoring of the weight terminal by the upper computer are facilitated. The application of the application layer can be expanded according to the system requirement, a new functional module or subsystem is introduced, and the application layer is integrated with the existing component, so that the interconnection and the intercommunication of a plurality of applications and the common development are realized.
The invention adopts an IAP-based OTA design thought to receive differential upgrade firmware through an OTA wireless communication means, then uses an IAP technology to carry out firmware moving, checksum program jumping, and combines differential upgrade and ping-pong upgrade methods to jointly complete upgrade operation so as to ensure real-time performance and stability of the upgrade of the weight terminal.
And downloading the Bootloader program and the application program to a Flash corresponding area of the terminal in an ISP mode or an ICP mode in advance to serve as an initial program, grounding a BOOT0 pin and a BOOT1 pin of the development board, and starting configuration from a Flash main memory. The Bootloader program is stored at the Flash starting address 0x08000000, other program storage positions are shown in fig. 4, and each area is separated by a reserved space, so that the address is prevented from being changed frequently during program upgrading. After an upgrade command is issued by a system server at the rear end of the weight system, the weight terminal sequentially receives the differential upgrade package through the communication module, restores the user application program to be upgraded through decompression and differential decompression algorithms, writes the user application program into an application program storage area to be upgraded, and completes the system upgrade operation through a BootLoader bootstrap program after reset.
Further, when the weight terminal processes the upgrade command of the back-end system, the specific flow of the mutual cooperation of the modules is as follows:
1) After the system is initialized, the BootLoader judges the upgrade zone bit and guides the original system application program of the weight terminal to run.
2) In the original program, the system operates normally, a LoRa module in a communication module of the weight terminal waits for receiving a data packet forwarded by the central station, if the data packet is received, the step 3) is entered, and if the data packet is not received, the step continues waiting.
3) Judging whether the received data is a differential data packet in the communication module, if so, executing the steps 4-7), otherwise, executing the step 8).
4) Checking whether all the received differential data packets are accurate or not in the communication module, if the balance weight terminal calculates that the checksum of all the differential data packets is consistent with the checksum of the upgrading command data packet, executing the next step, and upgrading the system through the differential upgrading module; otherwise, the original system program continues to be executed.
5) In the differential upgrading module, the data packets which are successfully verified are recombined and integrated in sequence to generate an original differential compression file.
6) The flag location 1 will be upgraded.
7) And resetting the system, and executing a Bootloader program to finish system upgrading.
8) In the configuration updating module, whether the received data is a configuration updating command is judged according to the configuration command specification, and if not, the original user program is still continuously executed; if the configuration updating command is the configuration updating command, corresponding operation is executed according to the configuration updating data item. For example: when receiving the command for updating the acquisition period, modifying the TCB of the corresponding acquisition thread in aCoral by configuring an updating module, and re-mounting the acquisition thread on a period delay queue to wait for re-operation; and when a command for controlling the equipment to stop working is received, the equipment control module controls and calls a closing interface of the corresponding equipment according to the configuration updating parameters to finish online configuration updating.
Further, the reset program is started from the Flash storage area 0x08000000, and the Bootloader program is executed, and the Bootloader workflow is as follows:
1) Firstly, peripheral initialization work is carried out, and all peripheral devices needed for system initial starting are initialized.
2) Then checking whether an upgrade flag is set to 1, if so, directly jumping to an original user application program storage area taking origin_addr as a starting position to execute an original system program; if 1, the following steps are performed.
3) And decompressing the received differential upgrade file by using a TinyUz algorithm.
4) The original system program is read.
5) And calling the hpatch_lite_patch interface, and merging the original system program with the differential upgrade file to form a new system program.
6) Writing 0xFFFF, clearing original data in a system memory area to be upgraded taking Upgrade_addr as a starting position, and covering a newly generated system program to the area.
7) The upgrade flag is cleared.
8) And jumping to a system program storage area to be upgraded, and executing a new system program after exchanging the values of the origin_addr and the upgrade_addr.
Example 4
In another exemplary embodiment, based on the method and the system, a remote upgrading method is provided, the online configuration updating and upgrading of the weight terminal is realized, the method meets the real-time requirement that the normal operation of the system is not influenced when the online configuration updating and upgrading is carried out, and the method comprises the following steps:
s1, packaging a configuration update data packet: when the back-end system needs to perform configuration updating on the weight terminal, the back-end system encapsulates the configuration updating data packet according to the configuration specification, wherein the configuration updating parameters comprise:
the specific description information is shown in table 1.
Table 1 parameter specification table
After the data package is completed, configuration verification and compliance check are needed, including verification of correctness of configuration formats, validity of parameter ranges, dependency of configuration items and the like, so that consistency and validity of configuration information are ensured. After checking for error, step S2 is entered, otherwise step S1 is re-executed.
S2, sending a configuration update data packet: the server of the back-end system establishes communication connection with the corresponding central node through a 4G module according to the central_node_id parameter item in the configuration update data packet, after the connection is successful, the configuration update data packet is sent to the central node, the central node calculates a checksum value according to an MD5 algorithm, and compared with the value in the configuration update data packet, if the value is the same, the data packet is sent to the corresponding weight terminal according to the device_id parameter item in the configuration update data packet, otherwise, the step S2 is re-executed until the sending is successful or the maximum retransmission times are exceeded, and the whole update process is reported to the server and exited. After receiving the data packet, the weight terminal checks according to the MD5 algorithm, if the check values are the same, returns a receiving success message to the server through the central node, and executes the step S3, otherwise, re-executes the step S2 until the data packet is successfully transmitted or the maximum retransmission times are exceeded, reports to the server, and exits the whole updating process.
S3, configuration updating: and the balance weight terminal calls a configuration updating interface, analyzes the configuration updating data packet, and performs corresponding operation according to the value of the configuration command type (command_type). For example, when the value of the instruction type is add, it is determined whether the configuration item already exists according to the identifier (config_item_id) of the configuration item, that is, whether a Task Control Block (TCB) corresponding to the configuration item exists is queried. If so, updating the value of the existing task control block configuration item; if the configuration item does not exist, a new task control block is created by calling an active_create_thread () interface, a new configuration item identifier (config_item_id) and a value (config_value) are added into the task control block, after the addition of the configuration item is completed, the configuration is ensured to be effective at a designated time according to configuration effective time (effective_time), that is, the configuration is firstly mounted on a delay queue according to the configuration effective time after the task control block is created, the configuration is not removed from the delay queue linked list until the designated time reaches the task control block, the configuration is added to a ready queue linked list, and the CPU scheduling is waited for completing the updating operation. Similarly, when the value of the instruction type is update, delete, the corresponding TCB is subjected to addition, deletion and modification operations, and after the configuration update is completed, the weight terminal sends a configuration completion message to the server through the central node, so that the program is ended.
Example 5
In another exemplary embodiment, based on the method and the system, a remote upgrading method is provided, and online differential upgrading of the weight terminal application program is specifically achieved. Aiming at the problems that on equipment with limited hardware resources and severe running environments, such as an intelligent balance weight terminal, differential upgrading cannot be effectively applied, the HPatchLite is applied to the intelligent balance weight terminal, and a lossless compression algorithm TinyUz designed for the ultra-small embedded equipment is added. Test results show that by using the HPatchLite+TinyUz algorithm, the code only occupies about 1KB of memory after compiling, the RAM size is about 1KB when running, and the total time of incremental upgrade of the equipment is reduced to 1/10 of the total update.
The HPatchLite is a simplified version of the HDiffPatch, is specially optimized for executing the patch function on the microminiature embedded equipment, and compiled patch codes are very small and occupy only a small amount of Flash; at the same time, the memory is very small during patch. The basic principle of HPatchLite is consistent with that of HDiffPatch, and the HPatchLite is designed into a plurality of specific formats for the ultra-small embedded equipment, and a simpler format is used when patches are output, so that patch codes of the intelligent balance weight system terminal are easier to realize simply, and resource consumption during patch is reduced.
The specific implementation steps of this embodiment are as follows:
s1, generating a differential compression file: and the difference between the binary file of the system application program to be upgraded and the binary file of the original system application program is compared by utilizing the hdiffi algorithm in the HPatchLite through the create_lite_diff interface on the back-end system file server, so that a differential upgrading file with smaller volume is generated, and meanwhile, the differential upgrading file is subjected to quick and efficient lossless compression by using a TinyUz compression algorithm.
The hdiffi algorithm differential flow:
1) Establishing a suffix array OldStr of an original system program OldData: the OldData is divided into different blocks, which are then ordered to construct OldStr, and then the suffix array is ordered.
2) Traversing a system program NewData to be upgraded: the NewData is traversed using iterators it while finding the insertion position of each iterator it in olstr.
3) Searching for the longest match: for each iterator it a matching position itfound is found, and then the longest identical prefix is found further, ensuring that the length of this identical prefix is larger than a constant.
4) Processing the matched data segments: if a match is found that satisfies the condition, the matched NewData segment is replaced with the corresponding oltdata segment.
5) Processing the coverage line set L: for all coverage lines found, the following is done:
a) The line segment that is completely covered by the other line segments is deleted.
b) The line segments which can be optimized are combined, namely the line segments which are on the same straight line and are separated by small intervals are connected into a straight line segment.
c) The individual shorter segments thereof are deleted.
6) Generating an optimal path: among the remaining coverage lines, an optimal path is found through them. In particular by calculating the size penalty (weighted path search) for various combinations.
7) Generating patch data PatchData: and constructing patch data PatchData according to the best path and the remaining uncovered NewData data. The specific flow is as follows:
a) The path straight segment data is saved into PatchData.
b) NewData that is not covered by a straight line segment is copied into PatchData.
8) The differential upgrade file is the generated PatchData.
Furthermore, in order to save the storage space occupied by decompression programs, differential upgrade packages and the like on the weight terminal equipment, a compression algorithm TinyUz is adopted, and the algorithm balances the occupied decompression memory, the compression rate, the decompression code rate and the decompression code speed, so that each item meets the requirements of an intelligent weight system, the algorithm supports the rapid operation on equipment in a 1KB RAM, and the method is very friendly to the intelligent weight terminal with limited resources.
TinyUz is a lightweight library of compression algorithms that implement data compression based on variants of LZ77 compression algorithms, the compression flow of which is as follows:
1) Initializing: initializing the compressor includes setting compression parameters and allocating memory for storing the compressed data.
2) Reading input data: and reading the data blocks from the differential upgrade file.
3) Searching for a match: the repeated substring is found in the current data block, at which point the algorithm maintains a sliding window for finding matches in the previous data.
4) Generating a compression mark: when a match is found, a compression flag is generated indicating how the compressor reconstructed the data. This marker comprises two parts: matching length and distance.
5) Outputting compressed data: the compressed marks are written to the output stream.
6) Updating the sliding window: the sliding window is moved forward to contain the new data.
7) Repeating steps 2) through 6) until all the data blocks are processed.
8) And (3) ending compression: and releasing the allocated memory to complete the compression process.
And when the differential compression file is generated, the step S2 is operated.
S2, transmitting a differential data packet: after the differential compression file is generated, the whole file is also required to be subjected to sub-packaging treatment, the differential compression file is divided into data packets with the capacity of 240 bytes according to factors such as the network environment where the weight terminal is located, the equipment capacity and the like, the last data packet is divided according to the actual residual size, and meanwhile, 16 bytes of metadata are added for each data packet: including the information of sequence number, checksum, data length, time stamp, etc., so that the actual data plus the metadata is exactly 256 bytes, i.e. each data packet is exactly 256 bytes in size except for the last data packet. The back-end system server transmits the data packet sequence to the corresponding central node through the 4G network, and the central node needs to check the integrity and checksum of each data packet so as to ensure that the data packet is not damaged or tampered in the transmission process. After a data packet is checked and confirmed to be correct, the data packet is sequentially sent to the corresponding weight terminal through the LoRa module; and when the data packet is not received or the check is wrong, sending a request to retransmit the corresponding data packet message to the server. And (3) after the weight terminal receives the data packets, checking the checksum of the data packets, and after the data packets are received completely and without errors, operating the step (S3), otherwise, sending a request for retransmitting the corresponding data packet message to the server, if the retransmission times exceed the maximum set value, sending a transmission failure message to the server, deleting all the received data packets, and exiting the whole upgrading process.
S3, differential upgrading: the balance weight terminal calls the differential upgrading interface, and firstly, the data packets which are successfully verified are recombined and integrated according to the sequence to generate an original differential compression file. Decompressing the differentially compressed file: when decompressing, the original data can be restored only by reverse operation according to a corresponding decompressing algorithm, and the TinyUz decompressing flow is as follows:
1) Initializing: initializing a decompressor, setting decompression parameters, and distributing memory for storing decompressed data.
2) Reading the compressed data: and reading the compression mark from the compressed differential upgrade file.
3) Resolving the compression mark: the compressed tag is parsed to obtain a matching length and distance.
4) Reconstructing data: and using the matching length and distance information to find a matching item in the sliding window, and adding the matching item to the decompressed data.
5) Updating the sliding window: the sliding window is moved forward to contain the newly decompressed data.
6) Repeating steps 2) through 5 until all the compressed data is decompressed.
7) And (5) ending decompression: and releasing the distributed memory, and completing the decompression process to obtain the PatchData.
After decompression is completed, reading the OldData in the original user program storage area, copying data in the OldData into a newData data area according to the linear segment description in the PatchData, and copying the difference part in the PatchData into the newData to complete the difference decompression, thereby obtaining the system program to be upgraded. And storing the system program to be upgraded in a corresponding APP area, guiding the Bootloader program to jump to a designated position, running the system program to be upgraded, and finishing the system upgrading.
Example 6
In another exemplary embodiment, the invention provides a computer storage medium having stored thereon computer instructions that when executed perform the steps associated with the remote upgrade method.
Based on such understanding, the technical solution of the present embodiment may be essentially or a part contributing to the prior art or a part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Example 7
In another exemplary embodiment, the invention provides a terminal comprising a memory and a processor, the memory having stored thereon computer instructions executable on the processor, the processor executing the steps associated with the remote upgrade method.
The processor may be a single or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the invention.
Embodiments of the subject matter and the functional operations described in this specification can be implemented in: tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and structural equivalents thereof, or a combination of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by, or to control the operation of, data processing apparatus. Alternatively or additionally, the program instructions may be encoded on a manually-generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode and transmit information to suitable receiver apparatus for execution by data processing apparatus.
The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
Processors suitable for the execution of a computer program include, by way of example, general and/or special purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read only memory and/or a random access memory. The essential elements of a computer include a central processing unit for carrying out or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks, etc. However, a computer does not have to have such a device. Furthermore, the computer may be embedded in another device, such as a mobile phone, a Personal Digital Assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device such as a Universal Serial Bus (USB) flash drive, to name a few.
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features of specific embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. On the other hand, the various features described in the individual embodiments may also be implemented separately in the various embodiments or in any suitable subcombination. Furthermore, although features may be acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, although operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
The foregoing detailed description of the invention is provided for illustration, and it is not to be construed that the detailed description of the invention is limited to only those illustration, but that several simple deductions and substitutions can be made by those skilled in the art without departing from the spirit of the invention, and are to be considered as falling within the scope of the invention.

Claims (10)

1. The utility model provides a remote upgrade method for based on embedded railway contact net intelligence is weighed down a mound system, the system includes terminal station, central node and rear end system, its characterized in that, the method includes:
Different upgrading strategies are adopted according to different upgrading requirements of the terminal; for the update related to the terminal task scheduling configuration, an online configuration update and upgrade strategy is used; and for the upgrading requirement of the terminal system functional components, adopting a differential upgrading strategy.
2. The remote upgrading method is used for an intelligent weight system based on an embedded railway contact net, and the system comprises a terminal, a central node and a rear end system and is characterized by comprising the following steps:
s1, packaging a configuration update data packet and/or generating a differential upgrade file by a back-end system;
s2, the back-end system sends a configuration update data packet and/or a differential upgrade file to the terminal;
s3, the back-end system receives the configuration update completion signal or the upgrade completion signal uploaded by the terminal.
3. The remote upgrading method is used for an intelligent weight system based on an embedded railway contact net, and the system comprises a terminal, a central node and a rear end system and is characterized by comprising the following steps:
s1, a terminal receives a configuration update data packet and/or a differential upgrade file sent by a back-end system;
s2, the terminal completes the update related to task scheduling configuration according to the configuration update data packet, and the terminal completes the upgrade of the functional component according to the differential upgrade file;
And S3, the terminal sends a configuration update completion signal or an upgrade completion signal to the back-end system.
4. The method of claim 2, wherein generating the differential upgrade file comprises:
and carrying out differential compression processing on the application program to be upgraded by using an HPatchLite+TinyUz algorithm through a create_lite_diff interface on a back-end system file server.
5. The method of claim 2, wherein the backend system sends the differential upgrade file to the terminal, comprising:
the differential upgrading file is subjected to sub-packaging processing, the differential compressed file is divided into a plurality of data packets with byte-level capacity, and metadata with certain bytes are added for each data packet; and sending the data packets to the terminal according to a certain sequence.
6. The remote upgrade method according to claim 3, wherein the terminal receives a differential upgrade file transmitted by a back-end system, comprising:
the terminal receives the differential upgrade file through the communication module;
calling a differential upgrading interface to preprocess the differential upgrading file, wherein the preprocessing comprises reorganization and integration;
decompressing the preprocessed differential upgrade file by using a TinyUz decompression algorithm;
And performing solution difference on the decompressed difference upgrade file by using an HPatchLite solution difference algorithm, and finally forming a system program to be upgraded.
7. A remote upgrade method according to claim 3, wherein the terminal completes the upgrade of the functional components according to the differential upgrade file, comprising:
and storing the system program to be upgraded in a corresponding APP area by using a ping-pong upgrade mode, guiding the system program to jump to a designated position by using a Bootloader program, and running the system program to be upgraded.
8. The remote upgrading system is characterized by comprising a terminal, a central node and a back-end system, wherein the back-end system is used for formulating different upgrading strategies according to different upgrading requirements of the terminal; the central node is used for communication between the terminal and the back-end system; the back-end system updates the update related to the terminal task scheduling configuration by using an online configuration update strategy; and for the upgrading requirement of the terminal system functional components, adopting a differential upgrading strategy.
9. A computer storage medium having stored thereon computer instructions which, when executed, perform the steps associated with a remote upgrade method according to any of claims 1-7.
10. A terminal comprising a memory and a processor, the memory having stored thereon computer instructions executable on the processor, wherein the processor, when executing the computer instructions, performs the steps associated with a remote upgrade method according to any of claims 1-7.
CN202311386081.9A 2023-10-23 2023-10-23 Remote upgrading method, system, storage medium and terminal Pending CN117472415A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311386081.9A CN117472415A (en) 2023-10-23 2023-10-23 Remote upgrading method, system, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311386081.9A CN117472415A (en) 2023-10-23 2023-10-23 Remote upgrading method, system, storage medium and terminal

Publications (1)

Publication Number Publication Date
CN117472415A true CN117472415A (en) 2024-01-30

Family

ID=89638944

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311386081.9A Pending CN117472415A (en) 2023-10-23 2023-10-23 Remote upgrading method, system, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN117472415A (en)

Similar Documents

Publication Publication Date Title
US9128880B2 (en) Synchronizing and controlling software downloads, such as for utility meter-reading data collection and processing
CN109117168A (en) Unmanned plane firmware update, device, unmanned plane and storage medium
US7950006B2 (en) Electronic device with an update agent that employs preprocessing techniques for update
CN101930387A (en) Improved fault tolerance method and device used for updating compressed read-only file system
CN103530146A (en) Low-power-consumption embedded device remote wireless updating method
CN101815988A (en) Firmware image update and management
US20050210458A1 (en) Communication terminal software updating method, communication terminal, and software updating method
CN111212121A (en) Aerial firmware upgrading method and system for Internet of things equipment
CN106411619A (en) Wireless equipment upgrading method based on low-power-consumption wide area network
CN101904105A (en) Mobile handset employing efficient backup and recovery of blocks during update
CN111111214B (en) Game archiving processing method, device and system
US20130104119A1 (en) Streaming packetized binary patching system and method
CN111083214A (en) Method, device, client, server and system for updating application software
CN102915249A (en) Method and device for remotely realizing firmware updating
CN111309363A (en) Contiki operating system-based online upgrading method and device
JP3864337B2 (en) How to upgrade
CN113641413A (en) Target model loading and updating method and device, readable medium and electronic equipment
CN109871269A (en) A kind of Remote Sensing Data Processing method, system, electronic equipment and medium
CN111435288B (en) Data processing method and device
CN117472415A (en) Remote upgrading method, system, storage medium and terminal
CN112286565B (en) Embedded system differential upgrading method based on storage container
CN113168314A (en) Update management device, update management system, and update management method
US20230199064A1 (en) Data transmission method and system, apparatus, device, and medium
CN115883360A (en) Remote upgrading method based on multi-layer grading of Internet of things
CN115454627A (en) Calculation method of neural network model, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination