CN118301142A - Downloading method, upgrading method and system for new version software - Google Patents
Downloading method, upgrading method and system for new version software Download PDFInfo
- Publication number
- CN118301142A CN118301142A CN202410368897.7A CN202410368897A CN118301142A CN 118301142 A CN118301142 A CN 118301142A CN 202410368897 A CN202410368897 A CN 202410368897A CN 118301142 A CN118301142 A CN 118301142A
- Authority
- CN
- China
- Prior art keywords
- new version
- downloading
- state
- software
- upgrade
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 139
- 238000004891 communication Methods 0.000 claims abstract description 126
- 230000008569 process Effects 0.000 claims abstract description 47
- 230000002159 abnormal effect Effects 0.000 claims abstract description 44
- 238000012795 verification Methods 0.000 claims description 13
- 238000003860 storage Methods 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 11
- 230000008859 change Effects 0.000 claims description 3
- 230000008901 benefit Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000005856 abnormality Effects 0.000 description 3
- 238000009826 distribution Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000002360 explosive Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention relates to the field of communication, and discloses a downloading method, an upgrading method and a system of new version software. The downloading method applied to the remote communication device comprises the following steps: sequentially downloading a plurality of files in the new version software according to preset downloading times; reconnecting to the new version server under the condition that the one-time downloading is not completed and the abnormal downloading condition occurs; and continuing to download the new version software by taking the file size of the downloaded times as an offset under the condition that the download identifier is in the first state and the file size of the downloaded times is smaller than the file size of the new version software. When the downloading process is abnormal, the method can continuously download the new version software on line by taking the size of the downloaded file as the offset, and is not influenced by the abnormal condition; and when the upgrading process is abnormal, if the remote communication device is in an upgrading state and the upgrading times are not up to the preset upgrading times, recording new version software from the standby area, thereby effectively solving the abnormal condition in the software upgrading process.
Description
Technical Field
The invention relates to the field of communication, in particular to a method for downloading new version software, an upgrading method and a system thereof.
Background
The power terminal and the remote communication module can carry out data transmission through a UART serial communication interface or a USB interface. According to different communication modes of the power terminal and the remote communication module, the power terminal can be divided into two types, namely a built-in TCP/IP protocol stack and an external TCP/IP protocol stack. The protocol stack is internally provided with a concentrator or other power terminals for acquiring information such as IP addresses and the like in a PPP dialing mode, and data packets issued by the terminals are all sent to a wireless network through a remote communication module after PPP processing; the protocol stack is externally arranged, and the power terminal interacts with the remote communication module in an AT command mode. The PPP network packets and AT commands and result codes transmitted between the power terminal and the remote communication module are typically transmitted by a serial communication interface.
At present, the online remote upgrading of the software version of the power terminal is supported by a special national network specification protocol, but the software version upgrading of the remote communication module is not supported by a related protocol. The version of the remote communication module used in the power terminal is manually upgraded when leaving a factory, if the remote communication module needs to be upgraded online, the remote communication module is possibly restarted and powered down by the power terminal in the process of downloading the software version online or upgrading, so that the remote upgrade is failed or abnormal.
Disclosure of Invention
The invention aims to provide a downloading method, an upgrading method and a system of new version software, wherein when the downloading process is abnormal, a remote communication device can continuously download the new version software on line by taking the downloaded file size as an offset, and the new version software is not influenced by the abnormal condition; and when the upgrading process is abnormal, if the remote communication device is in an upgrading state and the upgrading times are not up to the preset upgrading times, recording new version software from the standby area, thereby effectively solving the abnormal condition in the software upgrading process.
In order to achieve the above object, a first aspect of the present invention provides a method for downloading new version software, applied to a remote communication device, the method comprising: successively downloading a plurality of files in the new version software according to preset downloading times; reconnecting to the new version server under the condition that the one-time downloading is not completed and the abnormal downloading condition occurs; and continuing to download the new version software with the downloaded file size as an offset when the download identifier is in a first state and the downloaded file size is smaller than the new version software, wherein the first state indicates that the remote communication device is in a download state.
Preferably, the downloading method further comprises: under the condition that each downloading is completed, checking the files downloaded each time; and storing the file of each download in a corresponding position in a spare area in a memory of the remote communication device and updating the file size of the downloaded times under the condition that the file of each download passes the verification.
Preferably, the downloading method further comprises: checking the file downloaded last time under the condition that the download identifier is in the first state and the file size of the downloaded times is equal to the file size of the new version software; and storing the last downloaded file in a corresponding position in the spare area and placing the download identifier in a second state under the condition that the last downloaded file passes the verification, wherein the second state indicates that the remote communication device is in a non-download state.
Preferably, before performing the step of successively downloading the plurality of files in the new version of software by the remote communication device, the downloading method further comprises: acquiring the file size of the new version software from the new version server under the condition of connecting to the new version server; and setting the download flag to the first state and setting the file size of the downloaded times to 0.
Preferably, the successively downloading the plurality of files in the new version software according to the preset downloading times includes: and successively downloading a plurality of files in the new version software in an HTTP mode or an FTP mode according to preset downloading times.
Preferably, the download is identified as a global variable and stored in the memory.
Through the technical scheme, the method and the device for downloading the files in the new version software creatively and successively download the files in the new version software according to the preset downloading times; then, in the case that the one-time downloading is not completed and an abnormal downloading condition occurs, reconnecting to the new version server; finally, under the condition that the download identifier is in a first state and the file size of the downloaded times is smaller than the file size of the new version software, continuing to download the new version software by taking the file size of the downloaded times as an offset, wherein the first state indicates that the remote communication device is in a downloading state. Therefore, when the downloading process is abnormal, the invention can continuously download the new version software on line by taking the size of the downloaded file as the offset, and is not influenced by the abnormal condition.
A second aspect of the present invention provides an upgrade method of new version software, applied to a remote communication device, the upgrade method comprising: s1: judging whether the upgrading identifier is in a first state, wherein the first state indicates that the remote communication device is in an upgrading state; s2: judging whether the upgrading times are smaller than preset upgrading times or not under the condition that the upgrading mark is in the first state; s3: loading new version software from a standby area in a memory of the remote communication device when the number of upgrades is smaller than the preset number of upgrades, wherein the new version software is downloaded according to the downloading method of the new version software according to any one of claims 1-6; s4: and under the condition that the abnormal loading condition occurs in the loading process of the new version software, updating the upgrading times, and executing S1, S2 and S3.
Preferably, the upgrade method further comprises: and under the condition that the loading process of the new version software is completed, replacing original edition software in a main area in the memory with the new version software, and deleting the new version software in the spare area.
Preferably, at the same time or after deleting the new version of software in the spare area, the upgrade method further includes: setting the upgrade flag to a second state, wherein the second state indicates that the remote communication device is in a non-upgraded state; and setting the number of upgrades to 0.
Preferably, the upgrade method further comprises: setting the upgrade flag to the second state when the number of upgrades is equal to the preset number of upgrades, wherein the second state indicates that the remote communication device is in a non-upgrade state; and setting the number of upgrades to 0.
Preferably, the upgrade method further comprises: after a restart, loading master software from a main area in the memory; and deleting the new version software in the spare area.
Preferably, the upgrade method further comprises: loading master software from a main area in the memory in the event that the upgrade identification is in a second state, wherein the second state indicates that the remote communication device is in a non-upgrade state.
Through the technical scheme, the method and the device for upgrading the remote communication device creatively judge whether the upgrading identifier is in the first state through S1, wherein the first state indicates that the remote communication device is in the upgrading state; s2, judging whether the upgrading times are smaller than preset upgrading times or not under the condition that the upgrading mark is in the first state; loading new version software from a standby area in a memory of the remote communication device when the upgrading times are smaller than the preset upgrading times through S3, wherein the new version software is downloaded according to the downloading method of the new version software; and under the condition that the abnormal loading condition occurs in the loading process of the new version software, updating the upgrading times and executing the steps S1, S2 and S3 through the step S4, so that when the upgrading process is abnormal, if the remote communication device is in an upgrading state and the upgrading times do not meet the preset upgrading times, the new version software is recorded from the standby area, and the abnormal condition occurring in the software upgrading process can be effectively solved.
A third aspect of the present invention provides a system for downloading a new version of software for use in a remote communication device, the system comprising: the first downloading device is used for successively downloading a plurality of files in the new version software according to preset downloading times; the connection device is used for reconnecting to the new version server under the condition that one-time downloading is incomplete and abnormal downloading occurs; and a second downloading device, configured to, when the download identifier is in a first state and the file size of the downloaded number of times is smaller than the file size of the new version software, continue downloading the new version software with the file size of the downloaded number of times as an offset, where the first state indicates that the remote communication device is in a downloading state.
Preferably, the downloading system further comprises: the first verification device is used for verifying the file downloaded each time under the condition that the downloading of each time is completed; and a storage means for storing the file of each download at a corresponding position in a spare area in a memory of the remote communication device and updating the file size of the downloaded times in case that the file of each download passes the verification.
Preferably, the downloading system further comprises: and the second checking device is used for checking the last downloaded file when the download identifier is in the first state and the file size of the downloaded times is equal to the file size of the new version software, and the storage device is also used for storing the last downloaded file in a corresponding position in the standby area and placing the download identifier in a second state when the last downloaded file passes the check, wherein the second state indicates that the remote communication device is in a non-download state.
Preferably, the downloading system further comprises: obtaining means for obtaining a file size of the new version software from the new version server in a case of being connected to the new version server; and a changing device for setting the download identifier to the first state and setting the file size of the downloaded times to 0.
Preferably, the first downloading device is configured to successively download the plurality of files in the new version software according to a preset download time, including: and successively downloading a plurality of files in the new version software in an HTTP mode or an FTP mode according to preset downloading times.
Preferably, the download is identified as a global variable and stored in the memory.
The specific details and benefits of the upgrade system for new version software provided in the embodiments of the present invention can be found in the above description of the upgrade method for new version software, and will not be repeated here.
A fourth aspect of the present invention provides an upgrade system for a new version of software, for use in a telecommunication device, the upgrade system comprising: first judgment means for executing S1: judging whether the upgrading identifier is in a first state, wherein the first state indicates that the remote communication device is in an upgrading state; second judgment means for executing S2: judging whether the upgrading times are smaller than preset upgrading times or not under the condition that the upgrading mark is in the first state; first loading means for executing S3: loading new version software from a standby area in a memory of the remote communication device when the upgrade times are smaller than the preset upgrade times, wherein the new version software is downloaded according to the downloading method of the new version software; and execution means for executing S4: and under the condition that the abnormal loading condition occurs in the loading process of the new version software, updating the upgrading times, executing S1 by the first judging device, S2 by the second judging device and S3 by the loading device.
Preferably, the upgrade system further comprises: and the replacing device is used for replacing original edition software in the main area in the memory with the new edition software and deleting the new edition software in the spare area under the condition that the loading process of the new edition software is completed.
Preferably, the upgrade system further comprises: change means for performing the following operations: setting the upgrade flag to a second state, wherein the second state indicates that the remote communication device is in a non-upgraded state; and setting the number of upgrades to 0.
Preferably, the changing means is further configured to perform the following operations: setting the upgrade flag to the second state when the number of upgrades is equal to the preset number of upgrades, wherein the second state indicates that the remote communication device is in a non-upgrade state; and setting the number of upgrades to 0.
Preferably, the upgrade system further comprises: second loading means for loading the original software from the main area in said memory after a restart; and the deleting device is used for deleting the new version software in the spare area.
Preferably, the upgrade system further comprises: and third loading means for loading the original software from the main area in the memory in case the upgrade identification is in a second state, wherein the second state indicates that the remote communication device is in a non-upgrade state.
The specific details and benefits of the upgrade system for new version software provided in the embodiments of the present invention can be found in the above description of the upgrade method for new version software, and will not be repeated here.
A fifth aspect of the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for downloading said new version of software and/or a method for upgrading said new version of software.
A sixth aspect of the present invention provides a chip for executing a computer program, which when executed by the chip implements the method for downloading the new version of software and/or the method for upgrading the new version of software.
Additional features and advantages of the invention will be set forth in the detailed description which follows.
Drawings
The accompanying drawings are included to provide a further understanding of embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain, without limitation, the embodiments of the invention. In the drawings:
FIG. 1 is a schematic diagram of a method for downloading new version software according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a process for downloading new version software according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an upgrade process for a new version of software according to an embodiment of the present invention.
Detailed Description
The following describes specific embodiments of the present invention in detail with reference to the drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the invention, are not intended to limit the invention.
Fig. 1 is a schematic diagram of a method for downloading new version software according to an embodiment of the present invention. The download method is applied to a remote communication device, and the download method can comprise the following steps: step S101, successively downloading a plurality of files in the new version software according to preset downloading times; step S102, reconnecting to a new version server under the condition that one-time downloading is not completed and abnormal downloading occurs; and step S103, when the download identifier is in the first state and the file size of the downloaded times is smaller than the file size of the new version software, continuing to download the new version software by taking the file size of the downloaded times as an offset.
The remote communication device in various embodiments of the present invention may be a 5G remote communication device, such as a 5G remote communication device of a power terminal. The software in The various embodiments of The present invention may be a Firmware Over-The-Air (FOTA) upgrade for a mobile terminal.
The details of the above steps S101 to S103 are explained and explained below.
Before performing the step of successively downloading the plurality of files in the new version of software by the remote communication device (i.e., step S101), the downloading method further includes: acquiring the file size of the new version software from the new version server under the condition of connecting to the new version server; and setting the download flag to the first state and setting the file size of the downloaded times to 0.
Wherein the download is identified as a global variable and stored in the memory (e.g., flash memory). For example, setting a global variable download flag (e.g., download flag) in a flash memory of a remote communication device, wherein the download flag (e.g., download flag) indicates that the remote communication device is in a download state when in a first state (e.g., download flag=1); when the download flag (e.g., download flag) is in the second state (e.g., download flag=0), it indicates that the remote communication device is in the non-download state. Specifically, a download flag of 0 indicates that the remote communication device is not downloading a file task at the current time, and 1 indicates that the remote communication device is downloading a software version at the current time.
If the remote communication device is connected to the new version server (e.g., master station), the remote communication module obtains the file size N of the new version software from the master station through an FTP command, and determines the file size of a single download (typically 512 or 1024) according to N and the preset number of downloads, at which time the download flag is set to 1 and the received file size (size) is set to 0.
Of course, in other embodiments, the file size of the new version of software may be obtained in other manners that exist.
Step S101, a plurality of files in the new version software are downloaded successively according to preset downloading times.
For step S101, the successively downloading the plurality of files in the new version software according to the preset number of downloads may include: and successively downloading a plurality of files in the new version software in an HTTP mode or an FTP mode according to preset downloading times.
The downloading method may further include: under the condition that each downloading is completed, checking the files downloaded each time; and storing the file of each download in a corresponding position in a spare area in a memory of the remote communication device and updating the file size of the downloaded times under the condition that the file of each download passes the verification.
Taking a single download file size 1024 as an example, the remote communication device downloads a new version of the file by FTP in 1024 units, stores the file of each download in a corresponding location in a spare area in a memory (e.g., flash memory) of the remote communication device after the CRC check of the file of each download is passed, and modifies the received file size (size) to size+1024. Thereafter, the file content is downloaded with 1024 as an offset, and the size is modified to size+1024 each time the downloaded file CRC check passes.
Step S102, in the case that one download is not completed and an abnormal download condition occurs, the new version server is reconnected.
The abnormal downloading condition is various conditions that the downloading process cannot be performed normally, for example, abnormal conditions such as power failure or network abnormality (for example, the network signal is lower than a threshold value) and the like are restarted.
Specifically, whether the current downloading process of the new version software is completed is judged, and if the remote communication device is powered off or other abnormal downloading conditions occur before the current downloading process of the new version software is completed, the remote communication device is restarted to be reconnected with the new version server (e.g. a master station).
Step S103, when the download identifier is in the first state and the file size of the downloaded times is smaller than the file size of the new version software, continuing to download the new version software by taking the file size of the downloaded times as an offset.
Wherein the first state (e.g., download flag of 1) indicates that the remote communication device is in a download state.
Specifically, whether the download flag is 1 is determined, if the download flag is still 1, the file size completely received in each download process is valid, whether the received file size is N is determined, and if the received file size is smaller than N, the new version software is continuously downloaded by taking the received file size as an offset. That is, when the remote communication device is powered on to start normal network access, the download flag and the full received file size are queried, and after the remote communication device is connected to a new version server (e.g. a master station), if the download flag is 1 and the received file size is smaller than N, the new version is continuously downloaded by taking the size stored in the flash as an offset, without downloading from the beginning. Thereafter, the exception may be handled in the same manner.
The downloading method may further include: checking the file downloaded last time under the condition that the download identifier is in the first state and the file size of the downloaded times is equal to the file size of the new version software; and storing the last downloaded file in a corresponding position in the spare area and placing the download identifier in a second state under the condition that the last downloaded file passes the verification.
Wherein the second state (e.g., download flag of 0) indicates that the remote communication device is in a non-download state.
Specifically, after the remote communication device is connected to a new version server (e.g., a master station), if the download flag is 1 and the size of the received file is equal to N, performing CRC check on the file downloaded last time, after the CRC check of the file downloaded last time passes, storing the file downloaded last time in a corresponding location in a spare area in a memory (e.g., a flash memory) of the remote communication device, and setting the download flag to 0, and at the same time, modifying the size (size) of the received file to N. The remote communication module software version downloading process is completed.
In particular, the downloading process of the new version software executed by the remote communication device will now be explained and explained by taking fig. 2 as an example.
As shown in fig. 2, the process of downloading the new version of software executed by the remote communication device may include steps S201-S210. In fig. 2, "Y" represents "yes" and "N" represents "no".
Step S201, register with network and judge whether register is successful, if yes, execute step S202; otherwise, the process continues to step S201.
The remote communication device connection registers with the network (e.g., private or public network), which is equivalent to a successful registration (attach).
Step S202, connecting the new version server and judging whether the connection is successful, if yes, executing step S203; otherwise, the step S202 is continued.
Step S203, the file size N of the new version software is obtained.
In step S204, the download flag is set to 1, the received file size is set to 0 and the single download file size is determined to be 1024.
Step S205, executing the current download and judging whether the current download is completed, if yes, executing step S206; otherwise, step S207 is performed.
In step S206, the files downloaded at the current time are sequentially stored in the corresponding positions in the flash and the size=size+1024 is updated.
Step S207, reconnecting to the new version server after the abnormal downloading condition.
For example, upon a special restart or a power outage.
Step S208, determining whether the download flag=1 is satisfied, if yes, executing step S209; otherwise, ending.
Step S209, determining whether the received file size=n is true, if yes, executing step 210; otherwise, step S205 is performed.
Step S210, determining that the downloading of the new version software is completed, setting the download flag to 0, setting the update flag to 1 and setting the update count to 0.
After power failure or abnormality occurs in the process of online downloading of the software version by the remote communication device, the online downloading function after re-powering can not be affected by the abnormality, and the online downloading is continued based on the files stored in the backup area in the flash until the successful downloading of the software version is completed
In summary, the method and the device creatively download a plurality of files in the new version software successively according to the preset download times; then, in the case that the one-time downloading is not completed and an abnormal downloading condition occurs, reconnecting to the new version server; finally, under the condition that the download identifier is in a first state and the file size of the downloaded times is smaller than the file size of the new version software, continuing to download the new version software by taking the file size of the downloaded times as an offset, wherein the first state indicates that the remote communication device is in a downloading state. Therefore, when the downloading process is abnormal, the invention can continuously download the new version software on line by taking the size of the downloaded file as the offset, and is not influenced by the abnormal condition.
An embodiment of the invention provides an upgrading method of new version software, which is applied to a remote communication device. The upgrading method comprises the following steps: s1: judging whether the upgrading identifier is in a first state, wherein the first state indicates that the remote communication device is in an upgrading state; s2: judging whether the upgrading times are smaller than preset upgrading times or not under the condition that the upgrading mark is in the first state; s3: loading new version software from a standby area in a memory of the remote communication device when the upgrade times are smaller than the preset upgrade times, wherein the new version software is downloaded according to the downloading method of the new version software; s4: and under the condition that the abnormal loading condition occurs in the loading process of the new version software, updating the upgrading times, and executing S1, S2 and S3.
Wherein the upgrade identification (e.g., update flag) and the number of upgrades (update count) are global variables and stored in the memory (e.g., flash memory). The two variables are initialized to 0, and the maximum value of the update count can be set according to actual needs (for example, the maximum value is 3), namely, the update is not updated after 3 times of update failure, and the downloaded new version is deleted. For example, setting a global variable upgrade flag (e.g., update flag) in a flash memory of a remote communication device, wherein when the upgrade flag (e.g., update flag) is in a first state (e.g., update flag=1), it indicates that the remote communication device is in an upgrade state; an upgrade flag (e.g., update flag) is in a second state (e.g., update flag=0), indicating that the remote communication device is in a non-upgraded state.
When the downloading of the new version software is completed, the update flag is set to be 1, which means that the remote communication device needs to upgrade the software version in the next restarting or power-off; and update flag=0 indicates that the remote communication device does not need to upgrade the software version at the next restart or power down. And, the update count (update count) is valid only when the update flag is 1.
The abnormal loading condition is various conditions that the loading process cannot normally be performed, for example, the abnormal condition such as power failure or loading environment (e.g. temperature) is restarted.
Specifically, first, it is judged whether update flag=1 is established or not by S1; then, in the case where update flag=1 is established, it is judged by S2 whether update count <3 is established; then, under the condition that update count <3 is met, loading the new version software from a standby area in a flash memory through S3; finally, under the condition that the abnormal loading condition occurs in the loading process of the new version software, updating the update count=update count+1 through S4, and executing S1, S2 and S3.
In an embodiment, the upgrade method may further include: and under the condition that the loading process of the new version software is completed, replacing original edition software in a main area in the memory with the new version software, and deleting the new version software in the spare area.
The upgrade method may further include, at the same time or after deleting the new version of software in the spare area: setting the upgrade flag to a second state, wherein the second state indicates that the remote communication device is in a non-upgraded state; and setting the number of upgrades to 0.
Specifically, if no abnormal loading condition occurs in the new version loading process (i.e. the new version is successfully loaded), deleting original edition software stored in a main area in the flash memory, storing the new edition software to a corresponding position of the main area, and then deleting a new edition file in a standby area. At the same time or later, update flag is set to 0, and also update count is set to 0.
In an embodiment, the upgrade method may further include: loading master software from a main area in the memory in the event that the upgrade identification is in a second state, wherein the second state indicates that the remote communication device is in a non-upgrade state.
That is, when it is determined that Update flag=0 through S1, it indicates that the remote communication device is in a non-upgrade state (i.e., no upgrade of software is required), at this time, the original edition of the software may be loaded from the main area in the flash memory.
In an embodiment, the upgrade method may further include: setting the upgrade flag to the second state when the number of upgrades is equal to the preset number of upgrades, wherein the second state indicates that the remote communication device is in a non-upgrade state; and setting the number of upgrades to 0.
The upgrade method may further include: after a restart, loading master software from a main area in the memory; and deleting the new version software in the spare area.
It is known from S4 that update count=update count+1 if the version upgrade is unsuccessful. Then, steps S1-S2 are performed, for example, if it is determined that update count=3 through S2, the upgrade is failed 3 times, the upgrade is terminated, and the update flag is set to 0. After the remote communication device is powered down and restarted, original edition software can be loaded from a main area in the flash memory, the original edition software stored in the main area is continuously used, and new edition software of the standby area is deleted.
The upgrading process of the new version software executed by the remote communication device will now be explained and explained by taking fig. 3 as an example.
As shown in fig. 3, the upgrade process of the new version software executed by the remote communication device may include steps S301-S311. In fig. 3, "Y" represents "yes" and "N" represents "no".
In step S301, the remote communication device is powered on.
Step S302, loading a BootLoader.
The loading and starting task of the whole system is completed by the BootLoader. For example, in most embedded systems, the system typically starts executing at address 0x00000000 at power-up or reset, and the BootLoader program of the system is typically arranged at this address. Briefly, bootLoader is a small piece of program that runs before the user program runs. Through the applet, the hardware device can be initialized, and the memory space can be initialized, so that the software and hardware environment of the system is brought into a proper state, and the correct environment is prepared for finally calling the kernel of the operating system.
Step S303, judging whether update flag=1 is satisfied, if yes, executing step S304; otherwise, step S305 is performed.
Step S304, judging whether the update count <3 is true, if yes, executing step S307; otherwise, steps S310-S311 are performed.
Step S305, the original version of the software of the main area is loaded.
Step S306, judging whether the new version of software of the loading standby area is successful, if yes, executing steps S307-S308; otherwise, step S309 is performed.
In step S307, both update flag and update count are set to 0.
Step S308, deleting original version software of the main area, copying new version software to the main area and deleting new version software of the standby area.
Step S309, execute update count++.
In step S310, update flag is set to 1 and update count is set to 0.
Step S311, the original version of the software of the main area is loaded and the new version of the software of the spare area is deleted.
The loading process of the software in the various embodiments of the present invention refers to the upgrading process of the software.
After the remote communication device successfully downloads the software version online, the software version can be updated when restarting next time, if the remote communication device is abnormal in the process, the software updating can not be stopped, and the process can be tried again until the updating is successful. If the upgrade fails due to other problems of the version, the remote communication device can return the original version, so that the normal operation of the module is ensured. The method and the device can improve the probability of downloading version software online, improve the probability of success of online upgrading of the 5G remote communication device, prevent the device from being abnormal during upgrading, and comprehensively realize the online upgrading function of the remote communication device.
With the continuous deep construction of the energy Internet, the intelligent level of the power grid is greatly improved, the power utilization service quality requirement is continuously improved, the production operation of the power grid of a company, the business management and the external customer service are undergoing historical transformation, and the data requirements of the power grid data acquisition and control at all levels, the user information interaction and the like are in explosive growth situations. The key technologies of 5G low-delay, high-bandwidth and large-connection characteristics, network slicing, edge computing and the like can meet the requirements of safety, reliability and flexibility of each link of the power service distribution network, and can realize fault judgment and accurate positioning of distribution network line sections or equipment and quickly isolate the fault sections or equipment. The 5G remote communication module is not only used in a public network system, but also suitable for a private network.
In summary, the present invention creatively determines, through S1, whether the upgrade identifier is in a first state, where the first state indicates that the remote communication device is in an upgrade state; s2, judging whether the upgrading times are smaller than preset upgrading times or not under the condition that the upgrading mark is in the first state; loading new version software from a standby area in a memory of the remote communication device when the upgrading times are smaller than the preset upgrading times through S3, wherein the new version software is downloaded according to the downloading method of the new version software; under the condition that the loading process of the new version software is abnormally loaded, updating the upgrading times through the S4, and executing the S1, the S2 and the S3, so that when the upgrading process is abnormal, if the remote communication device is in an upgrading state and the upgrading times are not up to the preset upgrading times, the new version software is recorded from the standby area, and the abnormal condition in the software upgrading process can be effectively solved.
An embodiment of the present invention provides a system for downloading new version software, applied to a remote communication device, the system comprising: the first downloading device is used for successively downloading a plurality of files in the new version software according to preset downloading times; the connection device is used for reconnecting to the new version server under the condition that one-time downloading is incomplete and abnormal downloading occurs; and a second downloading device, configured to, when the download identifier is in a first state and the file size of the downloaded number of times is smaller than the file size of the new version software, continue downloading the new version software with the file size of the downloaded number of times as an offset, where the first state indicates that the remote communication device is in a downloading state.
Preferably, the downloading system further comprises: the first verification device is used for verifying the file downloaded each time under the condition that the downloading of each time is completed; and a storage means for storing the file of each download at a corresponding position in a spare area in a memory of the remote communication device and updating the file size of the downloaded times in case that the file of each download passes the verification.
Preferably, the downloading system further comprises: and the second checking device is used for checking the last downloaded file when the download identifier is in the first state and the file size of the downloaded times is equal to the file size of the new version software, and the storage device is also used for storing the last downloaded file in a corresponding position in the standby area and placing the download identifier in a second state when the last downloaded file passes the check, wherein the second state indicates that the remote communication device is in a non-download state.
Preferably, the downloading system further comprises: obtaining means for obtaining a file size of the new version software from the new version server in a case of being connected to the new version server; and a changing device for setting the download identifier to the first state and setting the file size of the downloaded times to 0.
Preferably, the first downloading device is configured to successively download the plurality of files in the new version software according to a preset download time, including: and successively downloading a plurality of files in the new version software in an HTTP mode or an FTP mode according to preset downloading times.
Preferably, the download is identified as a global variable and stored in the memory.
The specific details and benefits of the upgrade system for new version software provided in the embodiments of the present invention can be found in the above description of the upgrade method for new version software, and will not be repeated here.
An embodiment of the present invention provides an upgrade system for new version software, applied to a remote communication device, the upgrade system comprising: first judgment means for executing S1: judging whether the upgrading identifier is in a first state, wherein the first state indicates that the remote communication device is in an upgrading state; second judgment means for executing S2: judging whether the upgrading times are smaller than preset upgrading times or not under the condition that the upgrading mark is in the first state; first loading means for executing S3: loading new version software from a standby area in a memory of the remote communication device when the upgrade times are smaller than the preset upgrade times, wherein the new version software is downloaded according to the downloading method of the new version software; and execution means for executing S4: and under the condition that the abnormal loading condition occurs in the loading process of the new version software, updating the upgrading times, executing S1 by the first judging device, S2 by the second judging device and S3 by the loading device.
Preferably, the upgrade system further comprises: and the replacing device is used for replacing original edition software in the main area in the memory with the new edition software and deleting the new edition software in the spare area under the condition that the loading process of the new edition software is completed.
Preferably, the upgrade system further comprises: change means for performing the following operations: setting the upgrade flag to a second state, wherein the second state indicates that the remote communication device is in a non-upgraded state; and setting the number of upgrades to 0.
Preferably, the changing means is further configured to perform the following operations: setting the upgrade flag to the second state when the number of upgrades is equal to the preset number of upgrades, wherein the second state indicates that the remote communication device is in a non-upgrade state; and setting the number of upgrades to 0.
Preferably, the upgrade system further comprises: second loading means for loading the original software from the main area in said memory after a restart; and the deleting device is used for deleting the new version software in the spare area.
Preferably, the upgrade system further comprises: and third loading means for loading the original software from the main area in the memory in case the upgrade identification is in a second state, wherein the second state indicates that the remote communication device is in a non-upgrade state.
The specific details and benefits of the upgrade system for new version software provided in the embodiments of the present invention can be found in the above description of the upgrade method for new version software, and will not be repeated here.
An embodiment of the present invention provides a computer readable storage medium, where a computer program is stored, and the computer program when executed by a processor implements the method for downloading the new version of software and/or the method for upgrading the new version of software.
An embodiment of the present invention provides a chip for executing a computer program, where the computer program when executed by the chip implements the method for downloading the new version of software and/or the method for upgrading the new version of software.
Specifically, the present embodiment provides a chip including: a processor; a memory for storing a computer program for execution by the processor; the processor is configured to read the computer program from the memory, and execute the computer program to implement a method for downloading new version software and/or a method for upgrading the new version software.
The preferred embodiments of the present invention have been described in detail above with reference to the accompanying drawings, but the present invention is not limited to the specific details of the above embodiments, and various simple modifications can be made to the technical solution of the present invention within the scope of the technical concept of the present invention, and all the simple modifications belong to the protection scope of the present invention.
In addition, the specific features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various possible combinations are not described further.
Those skilled in the art will appreciate that all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program stored in a storage medium, including instructions for causing a single-chip microcomputer, chip or processor (processor) to perform all or part of the steps of the methods of the embodiments described herein. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Moreover, any combination of the various embodiments of the invention can be made without departing from the spirit of the invention, which should also be considered as disclosed herein.
Claims (26)
1. A method for downloading new version software, applied to a remote communication device, characterized in that the method comprises the following steps:
successively downloading a plurality of files in the new version software according to preset downloading times;
reconnecting to the new version server under the condition that the one-time downloading is not completed and the abnormal downloading condition occurs; and
And continuing to download the new version software by taking the file size of the downloaded times as an offset under the condition that the download identifier is in a first state and the file size of the downloaded times is smaller than the file size of the new version software, wherein the first state indicates that the remote communication device is in a downloading state.
2. The downloading method as claimed in claim 1, wherein the downloading method further comprises:
under the condition that each downloading is completed, checking the files downloaded each time; and
And in the case that the file downloaded each time passes the verification, storing the file downloaded each time in a corresponding position in a standby area in a memory of the remote communication device, and updating the file size of the downloaded times.
3. The downloading method according to claim 1 or 2, wherein the downloading method further comprises:
Checking the file downloaded last time under the condition that the download identifier is in the first state and the file size of the downloaded times is equal to the file size of the new version software; and
And under the condition that the last downloaded file passes the verification, storing the last downloaded file in a corresponding position in the standby area, and placing the download identifier in a second state, wherein the second state indicates that the remote communication device is in a non-download state.
4. The download method as set forth in claim 1, wherein prior to the step of successively downloading the plurality of files in the new version of software by the remote communication device, the download method further comprises:
Acquiring the file size of the new version software from the new version server under the condition of connecting to the new version server; and
The download flag is set to the first state and the file size of the downloaded times is set to 0.
5. The downloading method as claimed in claim 1, wherein the successively downloading the plurality of files in the new version software according to the preset number of downloads includes:
and successively downloading a plurality of files in the new version software in an HTTP mode or an FTP mode according to preset downloading times.
6. The download method according to claim 1, wherein the download is identified as a global variable and stored in the memory.
7. An upgrade method of new version software applied to a remote communication device, characterized in that the upgrade method comprises:
s1: judging whether the upgrading identifier is in a first state, wherein the first state indicates that the remote communication device is in an upgrading state;
s2: judging whether the upgrading times are smaller than preset upgrading times or not under the condition that the upgrading mark is in the first state;
S3: loading new version software from a standby area in a memory of the remote communication device when the number of upgrades is smaller than the preset number of upgrades, wherein the new version software is downloaded according to the downloading method of the new version software according to any one of claims 1-6; and
S4: and under the condition that the abnormal loading condition occurs in the loading process of the new version software, updating the upgrading times, and executing S1, S2 and S3.
8. The upgrade method of claim 7, wherein the upgrade method further comprises:
And under the condition that the loading process of the new version software is completed, replacing original edition software in a main area in the memory with the new version software, and deleting the new version software in the spare area.
9. The upgrade method of claim 8, wherein the upgrade method further comprises, at the same time or after deleting the new version of software in the spare area:
setting the upgrade flag to a second state, wherein the second state indicates that the remote communication device is in a non-upgraded state; and
And setting the upgrade times to 0.
10. The upgrade method of claim 7, wherein the upgrade method further comprises:
Setting the upgrade flag to the second state when the number of upgrades is equal to the preset number of upgrades, wherein the second state indicates that the remote communication device is in a non-upgrade state; and
And setting the upgrade times to 0.
11. The upgrade method according to claim 10, wherein the upgrade method further comprises:
after a restart, loading master software from a main area in the memory; and
And deleting the new version software in the spare area.
12. The upgrade method of claim 7, wherein the upgrade method further comprises:
Loading master software from a main area in the memory in the event that the upgrade identification is in a second state, wherein the second state indicates that the remote communication device is in a non-upgrade state.
13. A download system for a new version of software for a telecommunications device, the download system comprising:
The first downloading device is used for successively downloading a plurality of files in the new version software according to preset downloading times;
The connection device is used for reconnecting to the new version server under the condition that one-time downloading is incomplete and abnormal downloading occurs; and
And the second downloading device is used for continuing to download the new version software by taking the file size of the downloaded times as an offset when the downloading identifier is in a first state and the file size of the downloaded times is smaller than the file size of the new version software, wherein the first state indicates that the remote communication device is in a downloading state.
14. The download system according to claim 13, wherein the download system further comprises:
The first verification device is used for verifying the file downloaded each time under the condition that the downloading of each time is completed; and
And the storage device is used for storing the files downloaded each time in the corresponding positions in the standby area in the memory of the remote communication device and updating the file size of the downloaded times under the condition that the files downloaded each time pass the verification.
15. The download system according to claim 13 or 14, wherein the download system further comprises: second checking means for checking a file downloaded last time in case that the download flag is in the first state and the file size of the downloaded times is equal to the file size of the new version software,
The storage device is further configured to store the last downloaded file in a corresponding location in the spare area and place the download identifier in a second state when the last downloaded file passes the verification, where the second state indicates that the remote communication device is in a non-download state.
16. The download system according to claim 13, wherein the download system further comprises:
obtaining means for obtaining a file size of the new version software from the new version server in a case of being connected to the new version server; and
And changing means for setting the download flag to the first state and setting the file size of the downloaded number to 0.
17. The downloading system as claimed in claim 13, wherein the first downloading means for successively downloading the plurality of files in the new version of software according to a preset number of downloads comprises:
and successively downloading a plurality of files in the new version software in an HTTP mode or an FTP mode according to preset downloading times.
18. The download system according to claim 13, wherein the download is identified as a global variable and stored in the memory.
19. An upgrade system for a new version of software for a telecommunications device, the upgrade system comprising:
First judgment means for executing S1: judging whether the upgrading identifier is in a first state, wherein the first state indicates that the remote communication device is in an upgrading state;
Second judgment means for executing S2: judging whether the upgrading times are smaller than preset upgrading times or not under the condition that the upgrading mark is in the first state;
First loading means for executing S3: loading new version software from a standby area in a memory of the remote communication device when the number of upgrades is smaller than the preset number of upgrades, wherein the new version software is downloaded according to the downloading method of the new version software according to any one of claims 1-6; and
Execution means for executing S4: and under the condition that the abnormal loading condition occurs in the loading process of the new version software, updating the upgrading times, executing S1 by the first judging device, S2 by the second judging device and S3 by the loading device.
20. The upgrade system of claim 19 wherein the upgrade system further comprises:
And the replacing device is used for replacing original edition software in the main area in the memory with the new edition software and deleting the new edition software in the spare area under the condition that the loading process of the new edition software is completed.
21. The upgrade system of claim 20 wherein the upgrade system further comprises:
Change means for performing the following operations:
setting the upgrade flag to a second state, wherein the second state indicates that the remote communication device is in a non-upgraded state; and
And setting the upgrade times to 0.
22. The upgrade system of claim 19 wherein the altering means is further for:
Setting the upgrade flag to the second state when the number of upgrades is equal to the preset number of upgrades, wherein the second state indicates that the remote communication device is in a non-upgrade state; and
And setting the upgrade times to 0.
23. The upgrade system of claim 22 wherein the upgrade system further comprises:
second loading means for loading the original software from the main area in said memory after a restart; and
And the deleting device is used for deleting the new version software in the spare area.
24. The upgrade system of claim 19 wherein the upgrade system further comprises:
And third loading means for loading the original software from the main area in the memory in case the upgrade identification is in a second state, wherein the second state indicates that the remote communication device is in a non-upgrade state.
25. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the method of downloading a new version of software according to any of claims 1-6 and/or the method of upgrading a new version of software according to any of claims 7-12.
26. Chip, characterized by being adapted to execute a computer program which, when executed by said chip, implements the method for downloading new version software according to any of claims 1-6 and/or the method for upgrading new version software according to any of claims 7-12.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410368897.7A CN118301142A (en) | 2024-03-28 | 2024-03-28 | Downloading method, upgrading method and system for new version software |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410368897.7A CN118301142A (en) | 2024-03-28 | 2024-03-28 | Downloading method, upgrading method and system for new version software |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118301142A true CN118301142A (en) | 2024-07-05 |
Family
ID=91679534
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410368897.7A Pending CN118301142A (en) | 2024-03-28 | 2024-03-28 | Downloading method, upgrading method and system for new version software |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118301142A (en) |
-
2024
- 2024-03-28 CN CN202410368897.7A patent/CN118301142A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7065347B1 (en) | System and method for over the air programming | |
CN101557583B (en) | Remote-updating and version-switching method of repeater equipment embedded software | |
EP2456257B1 (en) | Method and system for upgrading wireless data card | |
US20170206079A1 (en) | Method and Device for Upgrading Software | |
CN106610840A (en) | FOTA (Firmware Over-The-Air) upgrade method and system | |
CN111026581A (en) | Application program repairing method, device, system, storage medium and electronic device | |
CN114840242A (en) | System upgrading method and device of electronic equipment and readable storage medium | |
CN108322540A (en) | Customized data lead-in method, terminal and computer readable storage medium | |
CN112433739B (en) | Firmware upgrading method | |
CN110597545A (en) | Hot patch intelligent upgrading method and system based on OTA component | |
CN112181455B (en) | Online upgrading method of microcontroller, microcontroller and storage medium | |
CN108170456B (en) | Firmware upgrading method and device for electronic equipment | |
CN110597532A (en) | Data acquisition module, firmware upgrading method thereof and storage medium | |
CN114138296A (en) | Multi-system gateway upgrading method, equipment and storage medium | |
CN101854442B (en) | Network device and firmware updating method thereof | |
CN118301142A (en) | Downloading method, upgrading method and system for new version software | |
CN115437674B (en) | Firmware upgrading method, device, medium and electronic equipment | |
CN117971265A (en) | Radar software upgrading method, device, equipment and readable storage medium | |
CN112905218B (en) | Firmware upgrading method, device and equipment | |
CN112118280A (en) | Recovery method after OTA upgrade failure of WI-FI equipment | |
JP4483239B2 (en) | Differential rewriting system, method, portable terminal and program for portable terminal software | |
CN112667444A (en) | System upgrading method, storage medium and terminal equipment | |
CN114995845A (en) | OTA (over the air) upgrading method and device | |
CN112783535A (en) | Firmware upgrading method, embedded device and storage medium | |
US20080300019A1 (en) | Cellular phone |
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 |