Remote upgrading method and corresponding equipment, storage medium and product

文档序号:1963492 发布日期:2021-12-14 浏览:24次 中文

阅读说明:本技术 一种远程升级方法及相应的设备、存储介质和产品 (Remote upgrading method and corresponding equipment, storage medium and product ) 是由 崔俊涛 于 2021-09-13 设计创作,主要内容包括:本发明公开了一种远程升级方法及相应的设备、存储介质和产品,包括以下步骤:接收升级文件;若升级文件为升级程序的新版本文件,则生成当前升级程序的备份文件;若升级文件为主程序的新版本文件,则生成当前主程序的备份文件;根据升级文件,对升级程序或者主程序进行升级;生成升级结果,包括成功或者失败。与现有技术相比,本发明提高了终端电子设备的程序在远程升级时的稳定性,降低了升级操作影响主程序可靠运行的频率。(The invention discloses a remote upgrading method, corresponding equipment, a storage medium and a product, which comprise the following steps: receiving an upgrade file; if the upgrade file is a new version file of the upgrade program, generating a backup file of the current upgrade program; if the upgrade file is a new version file of the main program, generating a backup file of the current main program; upgrading the upgrading program or the main program according to the upgrading file; an upgrade result is generated, including success or failure. Compared with the prior art, the method and the device improve the stability of the program of the terminal electronic equipment during remote upgrading, and reduce the frequency of the upgrading operation influencing the reliable running of the main program.)

1. A remote upgrading method is characterized by comprising the following steps:

receiving an upgrade file;

if the upgrade file is a new version file of the upgrade program, generating a backup file of the current upgrade program; if the upgrade file is a new version file of the main program, generating a backup file of the current main program;

upgrading the upgrading program or the main program according to the upgrading file;

an upgrade result is generated, including success or failure.

2. The remote upgrade method according to claim 1, wherein if an upgrade fails, a rollback is performed according to the corresponding backup file.

3. The remote upgrade method according to claim 1, wherein the upgrade result further includes an upgrade program that completes the upgrade or version information of the main program, and the upgrade result is sent to a server for archiving.

4. The remote upgrade method according to claim 1, further comprising, before receiving the upgrade file, the steps of:

sending a request to a server according to the planned task;

receiving a response of the server;

if the response comprises no new version information, the updating is not carried out; if the response comprises the new version information, downloading the upgrade file; wherein:

the requested information comprises the version information of the current upgrading program or the main program and the identity information of the electronic equipment running the upgrading program or the main program.

5. The remote upgrade method according to claim 4, wherein the server compares version information of its own stored program file with version information in the request,

if the version information is consistent or the blacklist corresponding to the new version program contains the identity information of the terminal electronic equipment, the response contains no new version information;

and if the server stores the program file of the new version and the blacklist corresponding to the new version does not contain the identity information of the terminal electronic equipment, the response contains the new version information.

6. The remote upgrade method according to claim 1, wherein the upgrade file is segmented into a plurality of file segments for segmented transmission, and all the file segments are connected into a complete upgrade file after being received.

7. The remote upgrade method according to claim 1, wherein if the upgrade file is a program file of the upgrade program, the upgrade file is stored in a storage space of the upgrade program; and if the upgrade file is the program file of the main program, storing the upgrade file into the storage space of the main program.

8. A terminal electronic device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the steps of the remote upgrade method according to any one of claims 1 to 7.

9. A computer-readable storage medium, having stored thereon a computer program/instructions, characterized in that the computer program/instructions, when executed by a processor, implement the steps of the remote upgrade method according to any one of claims 1-7.

10. A computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the steps of the remote upgrade method of any one of claims 1-7.

Technical Field

The invention belongs to the field of equipment program upgrading, particularly relates to a remote upgrading method and corresponding equipment, storage media and products, and aims at Internet of things equipment.

Background

The lithium batteries of the existing electric motorcycles and bicycles are usually matched with a battery management system for monitoring information such as battery service conditions, battery voltages, battery lives, battery temperatures and the like.

For the battery management system, the corresponding hardware devices, including operations, storage, etc., have limited hardware resources. The existing conventional remote upgrading method has the defects, such as: 1) when the fault is upgraded, only the network points can be removed for maintenance; 2) when a new management system itself fails, a failure may be caused.

Therefore, in some specific working scenarios, the existing remote upgrading method has the disadvantage that the key and core function program is easy to malfunction during upgrading, so that the core function program cannot work normally, and even the equipment is damaged.

Disclosure of Invention

In order to improve reliability and security of upgrade operations, the present invention provides a remote upgrade method, a terminal electronic device, a computer-readable storage medium, and a computer program product.

The technical scheme adopted by the invention is as follows:

in one aspect, a remote upgrade method is provided, which includes the following steps:

receiving an upgrade file;

if the upgrade file is a new version file of the upgrade program, generating a backup file of the current upgrade program; if the upgrade file is a new version file of the main program, generating a backup file of the current main program;

upgrading the upgrading program or the main program according to the upgrading file;

an upgrade result is generated, including success or failure.

Further, if the upgrade fails, rollback is executed according to the corresponding backup file.

In another aspect, a terminal electronic device is provided, comprising a memory, a processor and a computer program stored on the memory, the processor executing the computer program to implement the steps of the remote upgrade method.

In another aspect, a computer readable storage medium is provided, having stored thereon a computer program/instructions which, when executed by a processor, implement the steps of the above-described remote upgrade method.

In another aspect, a computer program product is provided, comprising computer programs/instructions which, when executed by a processor, implement the steps of the above described remote upgrade method.

Compared with the prior art, the invention has the beneficial effects that: the upgrading program is distinguished from the upgrading file of the main program and is upgraded and backed up respectively, so that the technical problem of stability of the program, particularly the core program such as the main program, during remote upgrading is solved. Other advantages can also be seen in the contents of the examples. In addition, even if the upgrading fails or a problem exists after the upgrading, the rollback can be executed, and the stable operation of the main program is ensured. In addition to the above advantages, other advantages of the present invention can be seen in the details of the examples.

Drawings

Fig. 1 is a schematic diagram of a server and a terminal electronic device in communication connection in an embodiment.

Fig. 2 is a flowchart illustrating a remote upgrade method according to an embodiment.

Fig. 3 is a schematic device structure diagram of the terminal electronic device according to the embodiment.

Description of the figure numbers:

1. terminal electronic equipment, 2, server, 21, inquiry server, 22, file server.

Detailed Description

The invention is further described below with reference to the accompanying drawings and specific embodiments.

In the present invention, a server is a computer or device that provides and manages network resources on a network; the terminal electronic device may refer to various electronic devices, such as an embedded device, an internet of things device, and the like. Referring to fig. 1, the terminal electronic device 1 is communicably connected to the server 2, and the server 2 shown by a dotted box in the figure indicates that the file server 22 and the query server 21 are not distinguished, that is, the server 2 may be replaced with the file server 22 and the query server 21.

The terminal electronic equipment is provided with an upgrading program and a main program, and the two modules are respectively distributed and stored in corresponding storage spaces.

Example 1

Referring to fig. 2, the remote upgrade method of the present embodiment includes the following steps:

and S10, receiving the upgrade file.

When the terminal electronic equipment normally operates, the main program of the terminal electronic equipment normally operates, and the terminal electronic equipment communicates with the server according to the planned task to search and obtain the upgrade file. The planning task is set as required, and is usually performed regularly in a certain period, for example, 24: 00 establish a communication connection with the server. Specifically, a request is sent to the server, and the requested information includes the current upgrade program, the version information of the main program, and the identity information of the terminal electronic device.

The identity information of the terminal electronic device may generally directly adopt IMEI (international mobile equipment identity), and may be replaced with other feature information or custom information capable of identifying the terminal electronic device if necessary.

The version information of the upgrade program and the main program is usually represented by a version number, and is distinguished according to the version information, for example, the version number corresponding to the current upgrade program is A202108010001, wherein a character "A" represents a file corresponding to the upgrade program; the version number of the corresponding main program is B202108010001, wherein the character "B" indicates the file of the corresponding main program.

And after receiving the request information, the server compares version information of the program file stored in the server with the version information in the request information, and if the version information is consistent, a response containing no new version information is returned to the upgrading program. If the server stores the program file of the new version, whether the blacklist corresponding to the program of the new version contains the identity information of the terminal electronic equipment is further checked, so that the phenomenon that the equipment works and is even damaged due to wrong upgrading is avoided.

If the blacklist contains the identity information of the terminal electronic equipment, the current new version program is not suitable for the terminal electronic equipment, and at the moment, a response containing no new version information is still returned to the upgrading program without upgrading; and if the blacklist does not contain the identity information of the terminal electronic equipment, the current new version program is applicable to the terminal electronic equipment, and an upgradable response is returned to the upgrading program.

There may be different ways when the server returns a response that is scalable. One way is that the server sends the new version of the program file directly to the upgrade program. Another way is to define the aforementioned server as a query server, and configure another file server capable of being connected with the query server in communication besides the query server, where: the query server is used only to store the relevant information of the program files and not to store the program files themselves, which are stored in the file server.

If the current new version program is suitable for the terminal electronic equipment, the following steps are carried out:

the response returned by the query server to the upgrade program contains the relevant information of the program file of the new version, which at least comprises version information, such as A202109010001, corresponding to the program file of the new version;

and the upgrading program sends a request for downloading the corresponding program file to a file server according to the version information in the response.

Preferably, the server segments the program file into a plurality of smaller file segments, the upgrade program performs segmented transmission when downloading the program file, and the upgrade program connects all the file segments into a complete upgrade file after receiving the file segments. In the invention, the upgrading file and the program file of the new version are corresponding concepts, and can be understood as the same pointed object. The size of the file segment is configured according to the type of the communication network and different network environments, and particularly, the size of the file segment is further preferably 1-10 KB for the Internet of things.

S20, if the upgrade file is the program file of the upgrade program, generating a backup file of the current upgrade program; and if the upgrade file is the program file of the main program, generating a backup file of the current main program.

The upgrade program and the backup file of the main program can be stored locally or sent and stored on a server. Preferably, the backup file is stored on the file server.

Preferably, if the upgrade file is a program file of the upgrade program, the upgrade file is stored in a storage space of the upgrade program; and if the upgrade file is the program file of the main program, storing the upgrade file into the storage space of the main program. Therefore, the upgrading efficiency is improved, and the adverse effect of upgrading operation on other files in the same storage space is avoided, such as error, accidental deletion and coverage of a certain file.

And S30, upgrading the upgrading program or the main program according to the upgrading file. The specific upgrading steps are conventional in the art and are not described in detail. The programs of the two modules are independently upgraded, so that the probability of faults caused by upgrading failure is reduced. Especially, the upgrading operation of the upgrading program does not influence the normal operation of the main program of the old version.

And S40, generating an upgrading result, including success or failure.

In addition, the upgrade result may further include related information of the upgrade, such as version information.

Further, if the upgrade fails, rollback is executed according to the corresponding backup file. And restoring the backup file before upgrading to the storage space of the corresponding upgrading program or the main program, and ensuring that the corresponding program can normally run in the old version.

Further, the upgrade result is sent to a server, or in a scheme of distinguishing a query server from a file server, the upgrade result is sent to the query server for archiving.

Further preferably, the main program is a battery management system, so as to improve stability and reliability of the battery management system.

Example 2

Referring to fig. 3, the terminal electronic device of this embodiment includes a memory, a processor, and a computer program stored in the memory, where the processor and the memory are connected through a system bus, and the processor executes the computer program to implement the steps of the remote upgrade method of embodiment 1.

Example 3

The computer-readable storage medium of this embodiment has stored thereon a computer program/instructions which, when executed by a processor, implement the steps of the remote upgrade method of embodiment 1.

Example 4

The computer program product of this embodiment includes a computer program/instructions, which when executed by a processor, implement the steps of the remote upgrade method of embodiment 1.

Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.

The embodiments of the present invention are merely illustrative, and not restrictive, of the scope of the claims, and other substantially equivalent alternatives may occur to those skilled in the art and are within the scope of the present invention.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:多路仪器并行升级的方法、装置、计算机设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!