CN106250192B - Software upgrading method and system of upper computer - Google Patents

Software upgrading method and system of upper computer Download PDF

Info

Publication number
CN106250192B
CN106250192B CN201610633338.XA CN201610633338A CN106250192B CN 106250192 B CN106250192 B CN 106250192B CN 201610633338 A CN201610633338 A CN 201610633338A CN 106250192 B CN106250192 B CN 106250192B
Authority
CN
China
Prior art keywords
check value
unit
wireless module
software
upper computer
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.)
Active
Application number
CN201610633338.XA
Other languages
Chinese (zh)
Other versions
CN106250192A (en
Inventor
百志强
鹿勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xintong Wireless Technology Shanghai Co Ltd
Original Assignee
Xintong Wireless Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xintong Wireless Technology Shanghai Co Ltd filed Critical Xintong Wireless Technology Shanghai Co Ltd
Priority to CN201610633338.XA priority Critical patent/CN106250192B/en
Publication of CN106250192A publication Critical patent/CN106250192A/en
Application granted granted Critical
Publication of CN106250192B publication Critical patent/CN106250192B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a software upgrading method and a system of an upper computer, wherein the software upgrading method comprises the following steps: s1 logging in the server by the wireless module every other time period; s2 the wireless module detects whether the software upgrade package is updated, if yes, the step S3 is executed; s3, the wireless module downloads the updated software upgrading package from the server; s4, sending an upgrading instruction to the upper computer by the wireless module; s5, setting an upgrading flag bit by the upper computer; s6, the upper computer judges whether an upgrade flag bit is detected in the process of restarting, if so, the step S7 is executed; and S7, the upper computer reads the data of the software upgrading package from the wireless module in a segmentation mode, and writes the read data into a program storage area until all the data are written. Compared with the prior art, the invention can realize software upgrading under the condition of limited storage space by reading and writing the data of the software upgrading package from the wireless module in a segmented manner, thereby saving the cost.

Description

software upgrading method and system of upper computer
Technical Field
The invention relates to the field of software upgrading, in particular to a software upgrading method and system of an upper computer.
Background
At present, in wireless devices designed and operated in the fields of M2M (Machine to Machine, communication between machines) and internet of things, a framework combining an upper computer and a wireless module is basically adopted, wherein the wireless module provides a wireless link, and the upper computer realizes application logic. Since the operating environment of the wireless device is usually various and complex, when a problem is found or a change is required during the use process, it is difficult to upgrade the software of the device at this time, and high capital cost and labor cost are required.
for The wireless module, remote upgrade can be performed in a FOTA (Firmware Over-The-Air, Over-The-Air software upgrade of a mobile terminal) mode and The like. However, in some cases, the upper computer software also needs to be updated, and for some larger upper computer software, such as operating a Linux operating system, because the storage space and the operating space of the software are sufficient, the update package can be directly downloaded to the storage space of the upper computer through the wireless module, and then the software is updated.
however, for some smaller upper computers, because the storage space of the upper computers is limited, the software of the upper computers cannot be updated and upgraded by directly downloading the upgrade package, if the upgrade requirement exists, the upgrade package needs to be sent back to a manufacturer or sent to a field for upgrading, and the cost of time, labor, capital and the like is consumed. If the storage space of the upper computer is expanded, the cost of the product is increased, and therefore the market competitiveness and profit of the product are reduced.
disclosure of Invention
The invention aims to overcome the defect that cost is increased due to the fact that a manufacturer needs to be sent back or a person needs to be sent to a field for upgrading or storage space needs to be expanded when the software of an upper computer with limited storage space in the prior art is upgraded, and provides a software upgrading method and a software upgrading system of the upper computer with low cost and high reliability.
the invention solves the technical problems through the following technical scheme:
a software upgrading method of an upper computer is characterized by comprising the following steps:
S1, logging in a server by the wireless module every other time period, wherein a software upgrading package of the upper computer is stored in the server;
S2, the wireless module detects whether the software upgrade package is updated, if yes, the step S3 is executed, and if not, the step S1 is returned;
S3, the wireless module downloads the updated software upgrading package from the server;
S4, the wireless module sends an upgrading instruction to the upper computer;
S5, setting an upgrading flag bit when the upper computer receives the upgrading instruction, and restarting;
S6, judging whether the upgrading flag bit is detected or not in the restarting process of the upper computer, if so, executing a step S7, and if not, ending the process;
and S7, the upper computer reads the updated data of the software upgrading package from the wireless module in a segmented manner, and writes the read data into a program storage area until all the data of the software upgrading package are written.
According to the scheme, the server is logged in through the wireless module, the updated software upgrading package is downloaded, the upper computer reads and writes data of the software upgrading package from the wireless module in a segmented mode until all the data are written into the program storage area, the updating of the whole software upgrading package is completed, and the software upgrading is achieved.
In step S1, the interval between the wireless module logging in to the server may be fixed or random. The specific setting can be according to the demand, and can also be according to the bearing capacity of server. For example, a random time period can be generated by adding a fixed time period and a random time period each time, and the random time period is used as the interval time for logging in the server, so that the time for logging in the server can be prevented from being concentrated, and the pressure of the server can be reduced.
in step S2, the algorithm for the wireless module to detect whether the software upgrade package is updated is the prior art, for example, the software version may be obtained by looking up the name of the software upgrade package in the server, and compared with the software version stored in the wireless module, and whether the software upgrade package in the server is updated is detected according to the comparison result.
in step S3, the wireless module downloads the updated software upgrade package to its own storage space.
in step S5, the upper computer stores the set upgrade flag bit in a storage space such as flash (flash memory) where data is not lost when power is off.
in step S7, the upper computer reads the data of the software upgrade package from the wireless module in segments, and writes the read data into the program storage area after each reading, wherein the data read later covers the data read last time, so that a large storage space is not required for storing the data of the software upgrade package. In addition, the upper computer can set the data position (i.e. offset) and data length of each reading according to the storage space of the upper computer. For example, if the storage space of the memory is small, the length of data read each time can be set to be short; if the storage space of the memory is large, the length of data read each time can be set to be long.
compared with the prior art, the scheme has the advantages that the upper computer reads and writes the data of the software upgrading package from the wireless module in a segmented manner, so that the upper computer can realize software upgrading under the condition of limited storage space, a manufacturer does not need to send the data back or send a person to a field for upgrading, the storage space of the upper computer does not need to be expanded, and the cost is saved.
preferably, step S7 is followed by the following steps: and S8, the upper computer clears the upgrading flag bit and restarts the upgrading flag bit. In step S8, the upgrade flag is cleared after the software of the upper computer is successfully upgraded, so as to prevent the software from being upgraded by mistake when the upper computer is restarted next time.
Preferably, the server further stores an upgrade package information file, wherein the upgrade package information file includes information of a software upgrade package of the upper computer;
If the detection result in step S2 is yes, the following steps are performed:
s23, the wireless module downloads the upgrade package information file from the server, analyzes the downloaded upgrade package information file to obtain a first check value, and executes the step S3;
Step S3 includes the following steps:
S31, the wireless module downloads the updated software upgrading package from the server and calculates a second check value of the downloaded software upgrading package;
S32, the wireless module determines whether the first check value is the same as the second check value, if yes, executes step S4, otherwise, returns to step S1.
in the scheme, the upgrade package information file and the software upgrade package are positioned in the same path in the server. The algorithm for the wireless module to calculate the second check value of the software upgrade package in step S31 is the prior art and will not be described again.
in addition, the communication between the wireless module and the server may be abnormal, which may cause errors in the data downloaded by the wireless module, and therefore, the software upgrade package downloaded by the wireless module needs to be checked, that is, whether the second check value is the same as the first check value is determined, so as to ensure that the data of the software upgrade package downloaded by the wireless module is completely consistent with the data of the software upgrade package in the server.
Preferably, step S1 further includes the following steps: the wireless module sets a first downloading frequency;
step S23 includes the following steps:
s231, the wireless module downloads the upgrade package information file from the server and adds one to the first downloading frequency;
S232, the wireless module judges whether the upgrade package information file is downloaded successfully, if so, step S234 is executed, and if not, step 233 is executed;
S233, the wireless module judges whether the first download times are larger than or equal to a first preset download times, if so, the step S1 is returned, and if not, the step S231 is returned;
s234, the wireless module analyzes the downloaded upgrade package information file to obtain a first check value.
In step S232 of this solution, an algorithm for the wireless module to determine whether the upgrade package information file is successfully downloaded is the prior art, where successful downloading means that the wireless module completes downloading the upgrade package information file. When the downloading fails, the wireless module can download the upgrade package information file from the server for multiple times. The maximum number of downloads is a first preset number of downloads, and the specific value may be set according to the actual situation, for example, may be set to 2 times.
Preferably, step S1 further includes the following steps: the wireless module sets a second downloading frequency;
Step S31 includes the following steps:
s311, the wireless module downloads the updated software upgrading package from the server and adds one to the second downloading frequency;
S312, the wireless module judges whether the software upgrading package is downloaded successfully, if so, the step S314 is executed, and if not, the step 313 is executed;
S313, the wireless module judges whether the second download times are larger than or equal to a second preset download times, if so, the step S1 is returned, and if not, the step S311 is returned;
And S314, the wireless module calculates a second check value of the downloaded software upgrading package.
In step S312 of the present solution, an algorithm for the wireless module to determine whether the software upgrade package is successfully downloaded is also the prior art, where successful downloading means that the wireless module completes downloading the software upgrade package, but does not mean that data of the downloaded software upgrade package is completely consistent with data of the software upgrade package in the server. When the downloading fails, the wireless module can download the software upgrading package from the server for multiple times. The maximum number of downloads is a second preset number of downloads, and the specific value may be set according to the actual situation, for example, may be set to 3 times.
preferably, in step S32, the wireless module determines that the first check value is different from the second check value, and then executes step S313.
In the scheme, when the first check value is different from the second check value, the data of the software upgrading package downloaded by the wireless module is inconsistent with the data of the software upgrading package in the server, and if the downloading times of the software upgrading package, namely the second downloading times, do not reach a second preset downloading time, the software upgrading package is downloaded from the server again; and if the downloading times of the software upgrading package, namely the second downloading times, reach the second preset downloading times, waiting for the next upgrading, namely updating the software upgrading package in the server again.
preferably, when the determination result in step S6 is yes, the following steps are executed: the upper computer reads the first check value from the wireless module and executes the step S7;
the steps between the steps S7 and S8 further include the following steps:
s781, the upper computer calculates a third check value of the data written into the software upgrading packet in the program storage area;
and S782, the upper computer judges whether the first check value is the same as the third check value, if so, the step S8 is executed, and if not, the step S7 is returned.
in the scheme, the communication between the wireless module and the upper computer is possibly abnormal, so that the data read by the upper computer is wrong, and therefore, the verification is required after the software of the upper computer is upgraded, and the upgraded software data is completely consistent with the data of the software upgrading package downloaded in the wireless module.
Preferably, step S1 is preceded by the following steps: storing an IP address (Internet protocol address) and a port number of a server to the wireless module;
Step S1 includes the following steps: and the wireless module logs in the server according to the IP address and the port number.
In the scheme, the wireless module can successfully log in the server storing the software upgrading packet and the upgrading packet information file according to the IP address and the port number. Wherein, the IP address and the port number correspond to a unique server together. In addition, some servers may need to enter a username and password to log in, and therefore, the username and password of the server also need to be stored in the wireless module. Some servers may store more files, so that the path for storing the software upgrade package and the upgrade package information file needs to be stored in the wireless module.
preferably, the server is an FTP (file transfer protocol) server or an Http (hypertext transfer protocol) server.
Preferably, the first check value, the second check value and the third check value each include: CRC (cyclic redundancy check) 32 checksum value or MD (message digest algorithm) 5 checksum value.
preferably, the first check value, the second check value and the third check value further include a size of the software upgrade package. In the scheme, the checked object also comprises the size of the software upgrading packet, so that the reliability and the accuracy of the software upgrading of the upper computer are effectively improved.
The invention also provides a software upgrading system of the upper computer, which is characterized by comprising the upper computer, a wireless module and a server, wherein the wireless module comprises a login unit, a detection unit, an upgrading packet downloading unit and an instruction sending unit;
the login unit is used for logging in the server at intervals;
The detection unit is used for detecting whether the software upgrading package is updated or not, calling the upgrading package downloading unit if the software upgrading package is updated, and calling the login unit if the software upgrading package is not updated;
the upgrade package downloading unit is used for downloading the updated software upgrade package from the server and calling the instruction sending unit;
the instruction sending unit is used for sending an upgrading instruction to the upper computer;
The flag bit setting unit is used for setting an upgrading flag bit when the upgrading instruction is received and restarting the upper computer;
the flag bit judging unit is used for judging whether the upgrading flag bit is detected or not in the process of restarting the upper computer and calling the reading and writing unit if the upgrading flag bit is detected;
the read-write unit is used for reading the updated data of the software upgrading package from the wireless module in a segmented manner and writing the read data into a program storage area;
preferably, the software upgrading system further includes a flag bit clearing unit, configured to clear the upgrade flag bit when all data of the software upgrading packet is written in, and restart the upper computer.
preferably, the server further stores an upgrade package information file, the upgrade package information file includes information of a software upgrade package of the upper computer, and the wireless module further includes an information file downloading unit and a first judging unit;
The detection unit is used for calling the information file downloading unit when the software upgrading package is detected to be updated;
The information file downloading unit is used for downloading the upgrade package information file from the server, analyzing the downloaded upgrade package information file to obtain a first check value, and calling the upgrade package downloading unit;
the upgrade package downloading unit is also used for calculating a second check value of the downloaded software upgrade package;
The first judging unit is used for judging whether the first check value is the same as the second check value, and calling the sending unit if the first check value is the same as the second check value, and calling the login unit if the first check value is not the same as the second check value.
preferably, the login unit is further configured to set a first download time;
the information file downloading unit comprises a first downloading subunit, a first judging subunit, a second judging subunit and an analyzing subunit;
The first downloading subunit is used for downloading the upgrade package information file from the server and adding one to the first downloading times;
The first judging subunit is used for judging whether the upgrade package information file is downloaded successfully, calling the analysis subunit if the upgrade package information file is downloaded successfully, and calling the second judging subunit if the upgrade package information file is not downloaded successfully;
The second judging subunit is configured to judge whether the first download number is greater than or equal to a first preset download number, and if so, invoke the login unit, and if not, invoke the first download subunit;
And the analysis subunit is used for analyzing the downloaded upgrade package information file to obtain a first check value.
preferably, the login unit is further configured to set a second download time;
the upgrade package downloading unit comprises a second downloading subunit, a third judging subunit, a fourth judging subunit and a calculating subunit;
The second downloading subunit is used for downloading the updated software upgrading package from the server and adding one to the second downloading times;
The third judging subunit is used for judging whether the software upgrading package is downloaded successfully, calling the calculating subunit if the software upgrading package is downloaded successfully, and calling the fourth judging subunit if the software upgrading package is not downloaded successfully;
the fourth judging subunit is configured to judge whether the second download time is greater than or equal to a second preset download time, and if so, invoke the login unit, and if not, invoke the second download subunit;
And the computing subunit is used for computing a second check value of the downloaded software upgrading package.
preferably, the first determining unit is configured to invoke the fourth determining subunit when determining that the first check value is different from the second check value.
Preferably, the upper computer further comprises a reading unit, a calculating unit and a second judging unit;
The reading unit is used for reading the first check value from the wireless module;
The calculation unit is used for calculating a third check value of the data written into the software upgrading packet in the program storage area;
the second judging unit is used for judging whether the first check value is the same as the third check value, and if so, the zone bit clearing unit is called, and if not, the reading and writing unit is called.
preferably, the wireless module stores an IP address and a port number of the server;
the login unit is used for logging in the server according to the IP address and the port number.
preferably, the server is an FTP server or an Http server.
Preferably, the first check value, the second check value and the third check value each include: a CRC32 checksum value or a MD5 checksum value.
Preferably, the first check value, the second check value and the third check value further include a size of the software upgrade package.
On the basis of the common knowledge in the field, the above preferred conditions can be combined randomly to obtain the preferred embodiments of the invention.
the positive progress effects of the invention are as follows: compared with the prior art, the software upgrading method and the software upgrading device have the advantages that the upper computer reads and writes the data of the software upgrading package from the wireless module in a segmented manner, so that the software upgrading can be realized under the condition that the storage space is limited, the software upgrading can be realized without sending back to a manufacturer or sending a person to a field for upgrading, the storage space of the upper computer is not required to be expanded, and the cost is saved. In addition, the reliability and the accuracy of software upgrading are ensured through multiple checks.
Drawings
fig. 1 is a flowchart of a software upgrading method for a host computer according to an embodiment of the present invention.
fig. 2 is a block diagram of a software upgrading system of an upper computer according to an embodiment of the present invention.
Fig. 3 is a block diagram of a wireless module according to an embodiment of the present invention.
Fig. 4 is a block diagram of the upper computer according to the embodiment of the present invention.
Detailed Description
the invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
the embodiment provides a software upgrading method for an upper computer, as shown in fig. 1, including the following steps:
Step 101, storing an IP address and a port number of an FTP server to a wireless module;
The FTP server stores a software upgrading package of an upper computer and an upgrading package information file, wherein the upgrading package information file comprises information of the software upgrading package of the upper computer;
102, the wireless module logs in the FTP server every 3 days according to the IP address and the port number, and sets a first download frequency and a second download frequency;
in this embodiment, the initial values of the first download times and the second download times are both 0.
Step 103, the wireless module detects whether the software upgrading package is updated, if yes, step 104 is executed, and if not, step 102 is returned;
104, the wireless module downloads the upgrade package information file from the FTP server and adds one to the first downloading times;
step 105, the wireless module judges whether the upgrade package information file is downloaded successfully, if so, step 107 is executed, and if not, step 106 is executed;
step 106, the wireless module judges whether the first downloading frequency is greater than or equal to a first preset downloading frequency, if so, the step 102 is returned, and if not, the step 104 is returned;
step 107, the wireless module analyzes the downloaded upgrade package information file to obtain a first check value;
step 108, the wireless module downloads the updated software upgrading package from the FTP server and adds one to the second downloading frequency;
Step 109, the wireless module judges whether the software upgrading package is downloaded successfully, if so, step 111 is executed, and if not, step 110 is executed;
Step 110, the wireless module judges whether the second download times are greater than or equal to a second preset download times, if so, the step 102 is returned, and if not, the step 108 is returned;
Step 111, the wireless module calculates a second check value of the downloaded software upgrading package;
Step 112, the wireless module determines whether the first check value and the second check value are the same, if yes, step 113 is executed, and if not, step 110 is returned to;
step 113, the wireless module sends an upgrading instruction to the upper computer;
step 114, setting an upgrading flag bit when the upper computer receives the upgrading instruction, and restarting;
step 115, the upper computer judges whether the upgrading flag bit is detected or not in the restarting process, if so, step 116 is executed, and if not, the process is ended;
step 116, the upper computer reads the first check value from the wireless module;
Step 117, the upper computer reads the updated data of the software upgrading package from the wireless module in a segmented manner, and writes the read data into a program storage area until all the data of the software upgrading package are written;
Step 118, the upper computer calculates a third check value of the data written into the software upgrading packet in the program storage area;
Step 119, the upper computer judges whether the first check value and the third check value are the same, if so, step 120 is executed, and if not, the step 117 is returned to;
And 120, clearing the upgrading flag bit by the upper computer.
the upper computer in this embodiment is a PIC (programmable terminal controller) small-sized single chip microcomputer with a limited storage space, and the first preset download number is 2 and the second preset download number is 3. The first check value, the second check value and the third check value are all CRC32 checksum values and the size of the software upgrade package, wherein the size of the software upgrade package is 10 MB.
The embodiment also provides a software upgrading system 10 of an upper computer, which is capable of implementing the software upgrading method, as shown in fig. 2, and includes an FTP server 11, a wireless module 12, and an upper computer 13.
the FTP server 11 stores a software upgrade package of the upper computer and an upgrade package information file, where the upgrade package information file includes information of the software upgrade package of the upper computer. In this embodiment, the upgrade package information file includes a size of the software upgrade package and a CRC32 checksum value of the software upgrade package.
the wireless module 12 includes a login unit 21, a detection unit 22, an information file downloading unit 23, an upgrade package downloading unit 24, an instruction sending unit 25, and a first judgment unit 26, where the information file downloading unit 23 includes a first downloading subunit 231, a first judgment subunit 232, a second judgment subunit 233, and an analysis subunit 234, the upgrade package downloading unit 24 includes a second downloading subunit 241, a third judgment subunit 242, a fourth judgment subunit 243, and a calculation subunit 244, and an IP address and a port number of the FTP server are stored in the wireless module.
the upper computer 13 includes a flag setting unit 31, a flag judging unit 32, a reading unit 33, a reading and writing unit 34, a calculating unit 35, a second judging unit 36, and a flag clearing unit 37.
In this embodiment, data transmission between the wireless module and the upper computer is realized through a serial port.
The following briefly describes the functions of the software upgrading system of the upper computer in this embodiment.
and the login unit is used for logging in the FTP server every 3 days according to the IP address and the port number and setting a first download time and a second download time. In this embodiment, the initial values of the first download times and the second download times are both 0.
the detection unit is used for detecting whether the software upgrading package is updated or not, and calling the information file downloading unit if the software upgrading package is updated, and calling the login unit if the software upgrading package is not updated.
the first downloading subunit is configured to download the upgrade package information file from the server, and add one to the first downloading number.
the first judging subunit is used for judging whether the upgrade package information file is downloaded successfully, calling the analysis subunit if the upgrade package information file is downloaded successfully, and calling the second judging subunit if the upgrade package information file is not downloaded successfully.
the second judging subunit is configured to judge whether the first download number is greater than or equal to a first preset download number, invoke the login unit if the first download number is greater than or equal to the first preset download number, and invoke the first download subunit if the first download number is not greater than the first preset download number. In this embodiment, the first preset number of downloads is 2.
the analysis subunit is configured to analyze the downloaded upgrade package information file to obtain a first check value, and invoke the upgrade package downloading unit.
and the second downloading subunit is used for downloading the updated software upgrading package from the server and adding one to the second downloading times.
The third judging subunit is used for judging whether the software upgrading package is downloaded successfully, calling the calculating subunit if the software upgrading package is downloaded successfully, and calling the fourth judging subunit if the software upgrading package is not downloaded successfully;
the fourth judging subunit is configured to judge whether the second download time is greater than or equal to a second preset download time, and if so, invoke the login unit, and if not, invoke the second download subunit. In this embodiment, the second preset number of downloads is 3.
and the computing subunit is used for computing a second check value of the downloaded software upgrading package.
the first judging unit is used for judging whether the first check value is the same as the second check value, and calling the instruction sending unit if the first check value is the same as the second check value, and calling the fourth judging subunit if the first check value is not the same as the second check value.
the instruction sending unit is used for sending an upgrading instruction to the upper computer.
the zone bit setting unit is used for setting an upgrading zone bit when the upgrading instruction is received and restarting the upper computer.
The zone bit judging unit is used for judging whether the upgrading zone bit is detected or not in the process of restarting the upper computer and calling the reading and writing unit if the upgrading zone bit is detected.
The reading unit is used for reading the first check value from the wireless module. In this embodiment, when the instruction sending unit is called, it is described that the first check value and the second check value are the same, and therefore, the reading unit may read the second check value in addition to the first check value from the wireless module.
the read-write unit is used for reading the updated data of the software upgrading package from the wireless module in a segmented mode and writing the read data into a program storage area.
the calculation unit is used for calculating a third check value of the data written into the software upgrading packet in the program storage area.
The second judging unit is used for judging whether the first check value is the same as the third check value, and if so, the zone bit clearing unit is called, and if not, the reading and writing unit is called.
The flag bit clearing unit is used for clearing the upgrading flag bit when all data of the software upgrading packet are written.
compared with the prior art, the embodiment reads and writes the data of the software upgrading package into the wireless module in a segmented manner through the upper computer, so that the upper computer can successfully realize software upgrading under the condition of limited storage space, does not need to send back a manufacturer or send a person to a field for upgrading, does not need to expand the storage space of the upper computer, and saves the cost. In addition, the embodiment ensures the reliability and the accuracy of software upgrading through multiple checks, and has wide application value.
while specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that these are by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.

Claims (22)

1. a software upgrading method of an upper computer is characterized by comprising the following steps:
S1, logging in a server by the wireless module every other time period, wherein a software upgrading package of the upper computer is stored in the server;
s2, the wireless module detects whether the software upgrade package is updated, if yes, the step S3 is executed, and if not, the step S1 is returned;
s3, the wireless module downloads the updated software upgrading package from the server;
S4, the wireless module sends an upgrading instruction to the upper computer;
s5, setting an upgrading flag bit when the upper computer receives the upgrading instruction, and restarting;
s6, judging whether the upgrading flag bit is detected or not in the restarting process of the upper computer, if so, executing a step S7, and if not, ending the process;
S7, the upper computer reads the updated data of the software upgrading package from the wireless module in a segmented manner, and writes the read data into a program storage area until all the data of the software upgrading package are written;
in step S7, the upper computer sets the data position and data length to be read each time according to its own storage space.
2. the software upgrading method according to claim 1, further comprising, after step S7, the steps of: and S8, the upper computer clears the upgrading flag bit and restarts the upgrading flag bit.
3. the software upgrading method according to claim 2, wherein an upgrade package information file is further stored in the server, and the upgrade package information file includes information of a software upgrade package of the upper computer;
If the detection result in step S2 is yes, the following steps are performed:
s23, the wireless module downloads the upgrade package information file from the server, analyzes the downloaded upgrade package information file to obtain a first check value, and executes the step S3;
step S3 includes the following steps:
s31, the wireless module downloads the updated software upgrading package from the server and calculates a second check value of the downloaded software upgrading package;
s32, the wireless module determines whether the first check value is the same as the second check value, if yes, executes step S4, otherwise, returns to step S1.
4. the software upgrading method of claim 3,
the step S1 further includes the steps of: the wireless module sets a first downloading frequency;
Step S23 includes the following steps:
s231, the wireless module downloads the upgrade package information file from the server and adds one to the first downloading frequency;
S232, the wireless module judges whether the upgrade package information file is downloaded successfully, if so, step S234 is executed, and if not, step 233 is executed;
S233, the wireless module judges whether the first download times are larger than or equal to a first preset download times, if so, the step S1 is returned, and if not, the step S231 is returned;
S234, the wireless module analyzes the downloaded upgrade package information file to obtain a first check value.
5. the software upgrading method of claim 3,
the step S1 further includes the steps of: the wireless module sets a second downloading frequency;
step S31 includes the following steps:
s311, the wireless module downloads the updated software upgrading package from the server and adds one to the second downloading frequency;
S312, the wireless module judges whether the software upgrading package is downloaded successfully, if so, the step S314 is executed, and if not, the step 313 is executed;
s313, the wireless module judges whether the second download times are larger than or equal to a second preset download times, if so, the step S1 is returned, and if not, the step S311 is returned;
And S314, the wireless module calculates a second check value of the downloaded software upgrading package.
6. The software upgrading method of claim 5,
in step S32, the wireless module determines that the first check value is different from the second check value, and then performs step S313.
7. the software upgrading method of claim 3,
if the determination result in step S6 is yes, the following steps are performed: the upper computer reads the first check value from the wireless module and executes the step S7;
the steps between the steps S7 and S8 further include the following steps:
S781, the upper computer calculates a third check value of the data written into the software upgrading packet in the program storage area;
and S782, the upper computer judges whether the first check value is the same as the third check value, if so, the step S8 is executed, and if not, the step S7 is returned.
8. The software upgrading method of any one of claims 1-7, further comprising, before step S1, the steps of: storing the IP address and the port number of a server to the wireless module;
step S1 includes the following steps: and the wireless module logs in the server according to the IP address and the port number.
9. the software upgrading method of claim 8, wherein the server is an FTP server or an Http server.
10. the software upgrade method according to claim 7, wherein the first check value, the second check value, and the third check value each comprise: a CRC32 checksum value or a MD5 checksum value.
11. The software upgrading method of claim 10, wherein the first check value, the second check value, and the third check value further include a size of a software upgrade package.
12. A software upgrading system of an upper computer is characterized by comprising the upper computer, a wireless module and a server, wherein the wireless module comprises a login unit, a detection unit, an upgrading packet downloading unit and an instruction sending unit, the upper computer comprises a flag bit setting unit, a flag bit judging unit and a reading and writing unit, and a software upgrading packet of the upper computer is stored in the server;
the login unit is used for logging in the server at intervals;
The detection unit is used for detecting whether the software upgrading package is updated or not, calling the upgrading package downloading unit if the software upgrading package is updated, and calling the login unit if the software upgrading package is not updated;
the upgrade package downloading unit is used for downloading the updated software upgrade package from the server and calling the instruction sending unit;
the instruction sending unit is used for sending an upgrading instruction to the upper computer;
the flag bit setting unit is used for setting an upgrading flag bit when the upgrading instruction is received and restarting the upper computer;
The flag bit judging unit is used for judging whether the upgrading flag bit is detected or not in the process of restarting the upper computer and calling the reading and writing unit if the upgrading flag bit is detected;
the read-write unit is used for reading the updated data of the software upgrading package from the wireless module in a segmented manner and writing the read data into a program storage area;
The upper computer sets the data position and the data length of each reading according to the storage space of the upper computer.
13. The software upgrading system according to claim 12, further comprising a flag bit clearing unit for clearing the upgrade flag bit and restarting the upper computer when all data of the software upgrade package is written.
14. The software upgrading system according to claim 13, wherein the server further stores an upgrade package information file, the upgrade package information file includes information of a software upgrade package of the upper computer, and the wireless module further includes an information file downloading unit and a first judging unit;
the detection unit is used for calling the information file downloading unit when the software upgrading package is detected to be updated;
the information file downloading unit is used for downloading the upgrade package information file from the server, analyzing the downloaded upgrade package information file to obtain a first check value, and calling the upgrade package downloading unit;
the upgrade package downloading unit is also used for calculating a second check value of the downloaded software upgrade package;
the first judging unit is used for judging whether the first check value is the same as the second check value, and calling the instruction sending unit if the first check value is the same as the second check value, and calling the login unit if the first check value is not the same as the second check value.
15. The software upgrade system according to claim 14,
The login unit is also used for setting a first downloading frequency;
the information file downloading unit comprises a first downloading subunit, a first judging subunit, a second judging subunit and an analyzing subunit;
the first downloading subunit is used for downloading the upgrade package information file from the server and adding one to the first downloading times;
the first judging subunit is used for judging whether the upgrade package information file is downloaded successfully, calling the analysis subunit if the upgrade package information file is downloaded successfully, and calling the second judging subunit if the upgrade package information file is not downloaded successfully;
the second judging subunit is configured to judge whether the first download number is greater than or equal to a first preset download number, and if so, invoke the login unit, and if not, invoke the first download subunit;
and the analysis subunit is used for analyzing the downloaded upgrade package information file to obtain a first check value.
16. the software upgrade system according to claim 14,
the login unit is also used for setting a second downloading frequency;
the upgrade package downloading unit comprises a second downloading subunit, a third judging subunit, a fourth judging subunit and a calculating subunit;
the second downloading subunit is used for downloading the updated software upgrading package from the server and adding one to the second downloading times;
The third judging subunit is used for judging whether the software upgrading package is downloaded successfully, calling the calculating subunit if the software upgrading package is downloaded successfully, and calling the fourth judging subunit if the software upgrading package is not downloaded successfully;
The fourth judging subunit is configured to judge whether the second download time is greater than or equal to a second preset download time, and if so, invoke the login unit, and if not, invoke the second download subunit;
And the computing subunit is used for computing a second check value of the downloaded software upgrading package.
17. The software upgrade system according to claim 16,
the first judging unit is used for calling the fourth judging subunit when judging that the first check value is different from the second check value.
18. The software upgrade system according to claim 14,
the upper computer further comprises a reading unit, a calculating unit and a second judging unit;
the reading unit is used for reading the first check value from the wireless module;
The calculation unit is used for calculating a third check value of the data written into the software upgrading packet in the program storage area;
the second judging unit is used for judging whether the first check value is the same as the third check value, and if so, the zone bit clearing unit is called, and if not, the reading and writing unit is called.
19. The software upgrade system according to any one of claims 12-18, wherein said wireless module has stored therein an IP address and a port number of said server;
the login unit is used for logging in the server according to the IP address and the port number.
20. The software upgrade system according to claim 19, wherein said server is an FTP server or an Http server.
21. The software upgrade system according to claim 18 wherein the first check value, the second check value and the third check value each comprise: a CRC32 checksum value or a MD5 checksum value.
22. the software upgrade system according to claim 21 wherein the first check value, the second check value and the third check value further comprise a size of a software upgrade package.
CN201610633338.XA 2016-08-04 2016-08-04 Software upgrading method and system of upper computer Active CN106250192B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610633338.XA CN106250192B (en) 2016-08-04 2016-08-04 Software upgrading method and system of upper computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610633338.XA CN106250192B (en) 2016-08-04 2016-08-04 Software upgrading method and system of upper computer

Publications (2)

Publication Number Publication Date
CN106250192A CN106250192A (en) 2016-12-21
CN106250192B true CN106250192B (en) 2019-12-17

Family

ID=58077694

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610633338.XA Active CN106250192B (en) 2016-08-04 2016-08-04 Software upgrading method and system of upper computer

Country Status (1)

Country Link
CN (1) CN106250192B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032615A (en) * 2018-06-06 2018-12-18 咕咚网络(北京)有限公司 A kind of on-line software updating method for Wireless Networking door lock

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107179928A (en) * 2017-05-12 2017-09-19 深圳市四海众联网络科技有限公司 A kind of method that communication equipment is upgraded automatically
CN107395666B (en) * 2017-05-23 2020-09-18 武汉华中数控股份有限公司 Method and device for operating upgrading data packet of numerical control machine tool
CN109002305B (en) * 2017-06-05 2022-09-09 深圳市海洋王照明工程有限公司 Method and system for updating equipment program
CN107332932B (en) * 2017-08-09 2020-04-17 南京阿凡达机器人科技有限公司 Robot system remote upgrading method based on FOTA
CN107832074A (en) * 2017-11-28 2018-03-23 福州瑞芯微电子股份有限公司 A kind of intelligent sound box data updating method and device
CN107861746B (en) * 2017-12-06 2020-11-27 北京经纬恒润科技有限公司 Vehicle electronic control unit refreshing method and system
CN110502256A (en) * 2018-05-18 2019-11-26 佛山市顺德区美的电热电器制造有限公司 A kind of method for upgrading software, terminal and storage medium
CN109408090B (en) * 2018-10-09 2021-05-28 广东美的制冷设备有限公司 Upgrading method of equipment software, data converter and readable storage medium
CN109639666B (en) * 2018-12-07 2020-12-25 国能日新科技股份有限公司 Meteorological data file transmission method and device
CN111913728A (en) * 2019-05-08 2020-11-10 杰克缝纫机股份有限公司 Program upgrading method for sewing equipment
CN112068857A (en) * 2019-06-10 2020-12-11 海信视像科技股份有限公司 OTA (over the air) upgrading method and system based on dual systems
CN110716727B (en) * 2019-09-02 2023-07-21 领翌技术(横琴)有限公司 Software upgrading method and system
CN112068864A (en) * 2020-09-02 2020-12-11 深圳创维-Rgb电子有限公司 Terminal equipment camera software updating method and device and terminal equipment
CN116107612B (en) * 2023-04-11 2023-07-04 北京集度科技有限公司 Firmware air upgrading device, charging pile, device, method and program product

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8230415B1 (en) * 2007-03-13 2012-07-24 Juniper Networks, Inc. On-demand advertising of software packages
CN101425018B (en) * 2008-12-05 2011-11-23 深圳创维数字技术股份有限公司 Embedded firmware upgrading method and device based on sectional form
CN103686685A (en) * 2012-09-20 2014-03-26 芯讯通无线科技(上海)有限公司 Wireless communication module over-the-air upgrading method
CN105760194A (en) * 2016-02-15 2016-07-13 清华大学 DSP control system software update method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032615A (en) * 2018-06-06 2018-12-18 咕咚网络(北京)有限公司 A kind of on-line software updating method for Wireless Networking door lock

Also Published As

Publication number Publication date
CN106250192A (en) 2016-12-21

Similar Documents

Publication Publication Date Title
CN106250192B (en) Software upgrading method and system of upper computer
WO2019076037A1 (en) Firmware updating method and device
CN106325929B (en) Firmware upgrading method, firmware upgrading device, refrigerator and server
CN108121559B (en) Configuration file pushing method, server and storage medium
CN102945176B (en) Terminal unit start, upgrade method and equipment
CN110597542A (en) Automatic OTA (over the air) software upgrading method and device and electronic equipment
CN107066300B (en) Firmware upgrading method of storage device and storage device
CN107908417B (en) Firmware upgrading method and electronic equipment
CN110633092A (en) Server for OTA (over the air) upgrading and embedded equipment upgrading method and device
US20170068585A1 (en) Method and Apparatus for Recovering System Software of Intelligent Terminal
CN111813428A (en) Method and device for upgrading terminal firmware, electronic equipment and storage medium
US11886886B2 (en) System and method for runtime synchronization and authentication of pre-boot device drivers for a rescue operating system
CN111273924B (en) Software updating method and device
WO2017016282A1 (en) Software upgrading method and apparatus, and computer storage medium
WO2019080840A1 (en) Method and device for repairing firmware
CN106843947B (en) Method and device for processing code defects
CN109416629A (en) Firmware upgrade method, electronic equipment, camera system and unmanned vehicle
CN114020526A (en) Firmware upgrading method and device and computer storage medium
CN114911500A (en) Terminal upgrading method, terminal and system
CN111459524A (en) Software upgrading method, device and system
CN117391099A (en) Data downloading and checking method and system for smart card and storage medium
CN114780122A (en) Embedded equipment firmware updating method and embedded equipment
WO2018010600A1 (en) Exception handling method and device, and computer storage media
CN114328080A (en) Firmware state detection method and device and electronic equipment
CN112328288A (en) Method, system, equipment and storage medium for updating server component

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant