Embedded equipment-based upgrading method without redundant space
1. An upgrading method based on embedded equipment without redundant space is characterized in that: comprises the following steps;
step one, downloading an upgrade package;
step two, after the upgrade package passes the verification, the upgrade package and the md5 value to be verified are stored, for example, the upgrade package and the md5 value to be verified can be stored in/etc/up;
step three, after the upgrade package is stored, the equipment carries out program upgrade, if the upgrade is successful, the upgrade package stored before is deleted, when the upgrade is failed, the upgrade package is still kept, if the equipment upgrade is failed due to uncontrollable abnormity in the process, after the equipment is powered off and restarted, the upgrade package judgment condition is added into the startup script, and if the upgrade package exists and the upgrade package is complete, the equipment is upgraded again;
and step four, after the upgrade is completed, the equipment normally operates.
2. The upgrading method without redundant space based on embedded device according to claim 1, characterized in that: after downloading the upgrade package, judging whether the upgrade package data and the integrity pass; and checking whether the designated path has the upgrade package, upgrading the equipment again, successfully upgrading, and deleting the upgrade package.
3. The upgrading method without redundant space based on embedded device according to claim 2, characterized in that: after the upgrade package is downloaded and the data correctness and integrity are verified, the upgrade package and the verification information are stored, the equipment is upgraded, and if the upgrade is successful, the upgrade package and the corresponding verification information are deleted.
4. The upgrading method without redundant space based on embedded device according to claim 3, characterized in that: when the equipment is restarted, whether the upgrading packet exists or not is checked firstly, if the upgrading packet exists, the equipment is not upgraded successfully, and then the equipment is upgraded again to ensure that the equipment can be upgraded successfully.
Background
At present, in the field of internet of things, a large number of embedded devices are used, software upgrading maintenance becomes a normal state, the devices are multiple, areas are scattered, and single manual upgrading is not practical, so that remote online upgrading is required to be supported, the embedded devices are required to support online upgrading, steps of downloading an upgrading package, backing up the upgrading package, installing the upgrading package and the like are necessarily involved, in the process, upgrading failure risks may exist in many links, such as conditions of network interruption in the downloading process of the upgrading package, upgrading package data transmission abnormity, power interruption in the upgrading process and the like, if the upgrading package fails, equipment bricks cannot be used, a series of measures are required to be considered to reduce the probability of abnormity generated in upgrading, wherein a part of abnormal conditions can be avoided through data verification, algorithms such as CRC, MD5 and the like verify the correctness and integrity of data, but a part of conditions cannot be predicted, for example, the equipment is suddenly powered off in the upgrading process, and the equipment is likely to be changed into bricks.
Disclosure of Invention
The invention aims to provide an upgrading method based on embedded equipment without a redundant space, so as to solve the problem that the abnormal conditions such as power failure and the like which cannot be predicted can occur in the upgrading process in the background technology.
In order to achieve the purpose, the invention provides the following technical scheme: an upgrading method based on embedded equipment without redundant space comprises the following steps;
step one, downloading an upgrade package;
step two, after the upgrade package passes the verification, the upgrade package and the md5 value to be verified are stored, for example, the upgrade package and the md5 value to be verified can be stored in/etc/up;
step three, after the upgrade package is stored, the equipment carries out program upgrade, if the upgrade is successful, the upgrade package stored before is deleted, when the upgrade is failed, the upgrade package is still kept, if the equipment upgrade is failed due to uncontrollable abnormity in the process, after the equipment is powered off and restarted, the upgrade package judgment condition is added into the startup script, and if the upgrade package exists and the upgrade package is complete, the equipment is upgraded again;
and step four, after the upgrade is completed, the equipment normally operates.
Preferably, after downloading the upgrade package, judging whether the upgrade package data and the integrity pass; and checking whether the designated path has the upgrade package, upgrading the equipment again, successfully upgrading, and deleting the upgrade package.
Preferably, after the upgrade package is downloaded and the data correctness and integrity are verified, the upgrade package and the verification information are stored, the device is upgraded, and if the upgrade is successful, the upgrade package and the corresponding verification information are deleted.
Preferably, when the device is restarted, whether the upgrade package exists or not is checked, if the upgrade package exists, the device is not upgraded successfully, and then the device is upgraded again, so that the device can be upgraded successfully.
The upgrading method based on the embedded equipment without the redundant space has the advantages that: the invention adds the mechanism of maintaining the upgrade package and checking the upgrade package when starting, ensures that the equipment can be normally upgraded after restarting even if the equipment fails to be upgraded due to some uncontrollable abnormity, greatly reduces the risk of equipment changing bricks, improves the maintainability of the equipment, actually improves the stability and competitiveness of the equipment and improves the use experience of customers.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a schematic diagram of an upgrade scheme of the present invention;
FIG. 3 is a timing diagram of the upgrade of the embedded device according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1-3, the present invention provides a technical solution: an upgrading method based on embedded equipment without redundant space comprises the following steps;
step one, downloading an upgrade package;
step two, after the upgrade package passes the verification, the upgrade package and the md5 value to be verified are stored, for example, the upgrade package and the md5 value to be verified can be stored in/etc/up;
step three, after the upgrade package is stored, the equipment carries out program upgrade, if the upgrade is successful, the upgrade package stored before is deleted, when the upgrade is failed, the upgrade package is still kept, if the equipment upgrade is failed due to uncontrollable abnormity in the process, after the equipment is powered off and restarted, the upgrade package judgment condition is added into the startup script, and if the upgrade package exists and the upgrade package is complete, the equipment is upgraded again;
step four, after the upgrade is finished, the equipment normally operates;
the implementation scheme is that after the upgrade package is downloaded and the data correctness and integrity check is passed, the upgrade package and the check information are stored, then the equipment is upgraded, if the upgrade is successful, the upgrade package and the corresponding check information are deleted, when the equipment is restarted, whether the upgrade package exists or not is checked, if the upgrade package exists, the equipment is not upgraded successfully, and then the upgrade is carried out, so that the equipment can be upgraded successfully;
embedded device upgrade
1. The equipment supports remote upgrading, firstly, an upgrading packet needs to be deployed in an upgrading server, the server performs version comparison, and if a new version can be upgraded, the embedded equipment is informed to be upgraded;
2. the equipment terminal carries out upgrading according to the scheme;
3. after the upgrade is completed, the version information of the current equipment is reported to the server again, so that the server can conveniently perform version maintenance and subsequent upgrade.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:远程升级方法、装置、终端设备及存储介质