CN112882743A - Software upgrading method - Google Patents
Software upgrading method Download PDFInfo
- Publication number
- CN112882743A CN112882743A CN202110181887.9A CN202110181887A CN112882743A CN 112882743 A CN112882743 A CN 112882743A CN 202110181887 A CN202110181887 A CN 202110181887A CN 112882743 A CN112882743 A CN 112882743A
- Authority
- CN
- China
- Prior art keywords
- software
- upgrading
- target
- area
- 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 48
- 230000006835 compression Effects 0.000 claims abstract description 60
- 238000007906 compression Methods 0.000 claims abstract description 60
- 230000008569 process Effects 0.000 claims abstract description 10
- 238000013524 data verification Methods 0.000 claims description 13
- 230000006837 decompression Effects 0.000 claims description 8
- 238000012795 verification Methods 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 5
- 230000004044 response Effects 0.000 claims description 4
- 238000012360 testing method Methods 0.000 claims description 3
- 238000000638 solvent extraction Methods 0.000 abstract 1
- 230000006870 function Effects 0.000 description 8
- 230000003287 optical effect Effects 0.000 description 6
- 230000009286 beneficial effect Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- 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
- G06F8/656—Updates while running
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)
- Stored Programmes (AREA)
Abstract
The embodiment of the invention discloses a method for upgrading software. Wherein, the method comprises the following steps: determining target software to be upgraded according to a received software upgrading request, and judging whether to upgrade the target software; if so, receiving a software upgrading compression package, and storing the software upgrading compression package to an operation area for storing firmware; decompressing the software upgrading compression packet to an upgrading area of the storage firmware to obtain software upgrading data, and upgrading the target software according to the software upgrading data; and if the target software is upgraded, taking the upgrading area as a new operation area, and operating the target software in the new operation area. The software is upgraded by partitioning the storage firmware, so that data loss in the software upgrading operation process is avoided, and the software upgrading efficiency is improved.
Description
Technical Field
The embodiment of the invention relates to a computer technology, in particular to a software upgrading method.
Background
With the intelligent development of the automobile industry, the software updating speed of the vehicle-mounted platform is faster, so that the requirement on all software online upgrading services operated by the platform is higher and higher.
In the prior art, when software of a vehicle-mounted platform is upgraded online, function improvement is performed by taking advantage of an Over-the-Air Technology (OTA Technology) Technology base of a mobile phone, and the whole storage firmware can only be in one state of upgrading or running during upgrading or running, which easily causes data loss and affects upgrading efficiency of the software.
Disclosure of Invention
The embodiment of the invention provides a software upgrading method, which aims to improve the efficiency of software upgrading.
In a first aspect, an embodiment of the present invention provides a software upgrading method, where the method includes:
determining target software to be upgraded according to a received software upgrading request, and judging whether to upgrade the target software;
if so, receiving a software upgrading compression package, and storing the software upgrading compression package to an operation area for storing firmware;
decompressing the software upgrading compression packet to an upgrading area of the storage firmware to obtain software upgrading data, and upgrading the target software according to the software upgrading data;
and if the target software is upgraded, taking the upgrading area as a new operation area, and operating the target software in the new operation area.
In a second aspect, an embodiment of the present invention further provides a software upgrading apparatus, where the apparatus includes:
the upgrading judgment module is used for determining target software to be upgraded according to the received software upgrading request and judging whether to upgrade the target software;
the compression package storage module is used for receiving the software upgrading compression package and storing the software upgrading compression package to an operation area for storing firmware if the software upgrading compression package is received;
the software upgrading module is used for decompressing the software upgrading compression packet to an upgrading area of the storage firmware to obtain software upgrading data and upgrading the target software according to the software upgrading data;
and the software running module is used for taking the upgrading area as a new running area and running the target software in the new running area if the target software is upgraded.
In a third aspect, an embodiment of the present invention further provides a software upgrading apparatus, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements a software upgrading method according to any embodiment of the present invention when executing the program.
In a fourth aspect, embodiments of the present invention further provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform the software upgrading method according to any of the embodiments of the present invention.
The embodiment of the invention divides the storage firmware into the operation area and the upgrading area, the operation area stores the software upgrading compression package, the upgrading area is upgraded according to the software upgrading compression package, after the upgrading is finished, the roles of the upgrading area and the operation area are exchanged, the upgrading area is used as a new operation area to operate the software, and the original operation area is used as a new upgrading area to wait for the next upgrading. The problem that the whole storage firmware can only be in one state of upgrading or running during upgrading or running in the prior art is solved, the upgrading area and the running area cannot be in the running state at the same time, and data loss during running is avoided. By dividing different areas, the division of the function of the storage firmware is realized, and the efficiency of software upgrading is effectively improved.
Drawings
Fig. 1 is a schematic flow chart of a software upgrading method according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating a software upgrading method according to a second embodiment of the present invention;
fig. 3 is a block diagram of a software upgrading apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a software upgrading device in the fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It is to be further noted that, for the convenience of description, only a part of the structure relating to the present invention is shown in the drawings, not the whole structure.
Example one
Fig. 1 is a schematic flow chart of a software upgrading method according to an embodiment of the present invention, where the method is applicable to upgrading software of a vehicle-mounted platform, and the method may be executed by a software upgrading apparatus. As shown in fig. 1, the method specifically includes the following steps:
The third party can send a software upgrading request to a vehicle-mounted system at any time according to the setting of a worker, the third party can be an upper computer or a computer and other equipment, the vehicle-mounted system can be a VxWorks (WickWa) system, the VxWorks is a real-time operating system, and the VxWorks system is installed on a server and can be used for executing the upgrading process of software. The third party can send a software upgrading request to the server at regular time according to the requirement, and the software upgrading request can include information such as a name and a version identification of software to be upgraded. The server receives a software upgrading request, specifically, the VxWorks system receives the software upgrading request, determines target software to be upgraded according to information in the software upgrading request, and judges whether the target software needs to be upgraded.
In this embodiment, optionally, determining the target software to be upgraded according to the received software upgrading request, and determining whether to upgrade the target software, including: determining target software and a target version to be upgraded according to a received software upgrading request of a third party; acquiring a current version of target software, and comparing the current version with the target version; and if the current version is inconsistent with the target version, determining to upgrade the target software.
Specifically, the software upgrading request is sent to the server of the vehicle-mounted platform by the third party, for example, the software upgrading request may be sent every 24 hours. After the VxWorks system in the server receives the software upgrading request, the information contained in the software upgrading request is obtained, and the target software to be upgraded and the target version to be upgraded are determined. For example, the software upgrade request may include information such as a request transmission time, a version identification, and a software name. After the target software is determined, the current version of the target software is checked, and the current version and the target version are compared. And determining whether the current version is the target version, and if not, determining that the target software needs to be upgraded. The beneficial effect of setting like this lies in, can confirm whether need to upgrade to target software fast, avoid the repeated upgrading, practice thrift the upgrade time, effectively improve upgrading efficiency.
In this embodiment, optionally, after determining target software to be upgraded according to the received software upgrade request and determining whether to perform software upgrade on the target software, the method further includes: if the target software is determined to be upgraded, sending a feedback message agreeing to the upgrade to the third party, so that the third party receives the feedback message agreeing to the upgrade and sends a software upgrading compressed packet; if the target software is determined not to be upgraded, sending a feedback message for stopping upgrading to the third party, and ending the upgrading process of the target software.
Specifically, if the current version is determined to be inconsistent with the target version, it is determined that software upgrading needs to be performed on the target software, and a feedback message agreeing to the upgrading is sent to the third party by the server, specifically, the feedback message agreeing to the upgrading is sent to the third party by the VxWorks system. And after receiving the feedback message agreeing to upgrade, the third party sends a software upgrading compression packet to the VxWorks system for the system to upgrade the software. And if the current version is consistent with the target version, determining that software upgrading is not required to be carried out on the target software, sending a feedback message for stopping upgrading to a third party by the VxWorks system, and ending the upgrading process of the target software. The VxWorks system can not send the feedback message to the third party, or the third party fails to receive the feedback message, and still sends the software upgrading compressed packet under the condition that the current version is consistent with the target version, and the VxWorks system can reject the message and end the upgrading process of the target software. The beneficial effect of setting like this is, through to the third party feedback, realize with the data interaction of third party, avoid the third party to send the compression package under the condition that does not need the upgrading, reduce the work load of third party, improve the efficiency of software upgrading.
And 120, if so, receiving the software upgrading compression package, and storing the software upgrading compression package to an operation area for storing the firmware.
The storage firmware is divided into an operating area and an upgrading area, the operating area is used for operating software, the upgrading area is used for upgrading the software, for example, the storage firmware is 10G, the operating area is divided into 5G, and the upgrading area is divided into 5G. If the target software is determined to be subjected to software upgrading, the software upgrading compression package is received from a third party, and the target software is not yet upgraded, so that the software upgrading compression package needs to be stored in the operation area.
And step 130, decompressing the software upgrading compression packet to an upgrading area for storing the firmware to obtain software upgrading data, and upgrading the target software according to the software upgrading data.
The software upgrading compression package is compressed by a third party according to a preset compression algorithm, after the VxWorks system receives the software upgrading compression package, the software upgrading compression package is decompressed into an upgrading area according to a corresponding decompression algorithm, and decompressed data are software upgrading data. And the VxWorks system updates the target software in the updating area according to the software upgrading data.
In this embodiment, optionally, decompressing the software upgrade compressed packet to an upgrade area storing the firmware to obtain software upgrade data, and upgrading the target software according to the software upgrade data, including: according to a preset decompression algorithm, releasing the software upgrading compression packet in the operation area into an upgrading area for storing firmware to obtain software upgrading data; verifying the directory file of the software upgrading data according to a preset data verification algorithm; and if the verification is successful, upgrading the target software according to the software upgrading data.
Specifically, a decompression algorithm corresponding to the third-party compression algorithm is stored in the VxWorks system in advance, and the software upgrading compression packet can be decompressed. After the software upgrading compression package is obtained, the software upgrading compression package is decompressed according to a preset decompression algorithm, the software upgrading compression package is released from the operation area to the upgrading area, and decompressed software upgrading data are stored in the upgrading area. After the software upgrading data are obtained, the software upgrading data are verified according to a preset data verification algorithm, and a directory file of the software upgrading data can be verified. For example, the format of the directory file and other information may be checked, and a standard format may be set in the preset data checking algorithm. And determining whether the software upgrading data has the problems of non-standard format or abnormal data and the like according to a data verification algorithm, if not, determining that the software upgrading data is verified successfully, and upgrading the target software according to the software upgrading data. If the verification is unsuccessful, determining that errors exist in the software upgrading data, namely errors exist in the software upgrading compressed packet, sending a data error message to a third party through a network, and prompting the third party to resend the software upgrading compressed packet, wherein the target software is failed to be upgraded. The beneficial effect that sets up like this lies in, will compress the package and release to the upgrading region, make the operation region distinguish with the upgrading region, and in the prior art, the storage firmware is in the operation state or is in the upgrading state either, and when software upgrading, can't carry out the operation of software, and causes data loss easily in the upgrading process. By dividing different areas, the software can be normally operated in the operation area while being upgraded, the data is prevented from being lost during upgrading, the probability of upgrading failure is reduced, and the software upgrading efficiency is improved.
And 140, if the target software is upgraded, taking the upgrading area as a new operation area, and operating the target software in the new operation area.
The upgrading region is upgraded according to the software upgrading data, after upgrading is finished, the roles of the upgrading region and the running region are exchanged, the upgrading region serves as a new running region to run upgraded software, and the running region serves as a new upgrading region to wait for next upgrading. The running area is used as a new upgrading area, and the software upgrading compression package in the running area can also be used as a backup.
In this embodiment, optionally, if the target software is upgraded, taking the upgrade area as a new operation area, and operating the target software in the new operation area, includes: if the target software is upgraded, triggering a preset self-starting request, and carrying out self-starting within preset time; checking whether the target software meets the preset software self-checking requirement; if yes, determining that the target software is successfully upgraded, writing an upgrade success identifier into the operation area, and feeding back an upgrade success message to a third party; and in response to a system restart instruction, taking the upgrading area as a new operation area, taking the operation area as a new upgrading area, and operating the target software in the new operation area.
Specifically, if the upgrading process in the upgrading area is finished, a preset self-starting request is triggered. The triggering condition of the self-starting request is that the upgrading is finished, and the self-starting refers to self-starting of the VxWorks system. The self-starting may be performed within a preset time after the target software upgrade is finished, for example, in response to a successful target software upgrade, the self-starting may be performed after one minute of the upgrade completion. After the self-starting is finished, the VxWorks system checks the target software according to the preset software self-checking requirement, and judges whether the target software meets the preset software self-checking requirement or not. For example, the software self-test requirements may include requirements for network functions and requirements for communication of the target software, and the like. And if the target software meets the preset software self-checking requirement, determining that the upgrading operation of the upgrading region is successful, writing the successfully upgraded mark into the operation region, and feeding back a successfully upgraded message to a third party. After the third party receives the message of successful upgrade, a worker can send a VxWorks system restart instruction to the server. And after a restart instruction is received, restarting the VxWorks system, taking the upgrading area as a new operation area and taking the operation area as a new upgrading area after restarting, and enabling the target software to operate in the operation area. After the software is restarted, a U-Boot (Universal Boot Loader) in the server reads an upgrading mark in the running area, if the upgrading mark is an upgrading success mark, the target software is finally determined to be upgraded, and the upgrading area is used as a new running area to start the target software. The self-checking method has the advantages that the self-checking is carried out on the target software after the self-starting, the target software is guaranteed to be free of problems in upgrading, and the software upgrading accuracy is improved. After the system is restarted, the identities of the operating area and the upgrading area are exchanged, so that the flexibility of dividing each area in the stored firmware is realized, the upgrading area can be directly used as the operating area to operate the target software after being upgraded, the loss phenomenon generated in data transmission is reduced, and the reliability and the efficiency of software upgrading are improved.
In this embodiment, optionally, after checking whether the target software meets the preset software self-test requirement, the method further includes: and if the target software does not meet the preset software self-checking requirement, determining that the target software fails to be upgraded, writing an upgrade failure identifier into the operation area, and feeding back an upgrade failure message to a third party.
Specifically, if the target software does not meet the preset software self-checking requirement, it is determined that the target software is failed to be upgraded, and an upgrade failure identifier is written into the operation area. The running area can be pre-stored with an upgrading failure identifier, and if the target software is upgraded successfully, the upgrading failure identifier is written in to cover the upgrading failure identifier; if the target software fails to be upgraded, any mark is not written into the running area, and the original upgrading failure mark is reserved. If the target software self-check is determined not to meet the requirements, a third party can feed back a message of failed upgrade, and record an upgrade log. The third party may not send a system restart instruction to the server, and the upgrade process is finished. And the third party can also continuously send a system restart instruction, the U-Boot reads the upgrading mark in the operating area, the upgrading mark is an upgrading failure mark, the upgrading failure of the target software is determined, and the identities of the operating area and the upgrading area are not required to be exchanged. The beneficial effect of setting like this lies in, can in time feed back the upgrading result to the third party, through setting up the upgrading sign, can avoid continuing to upgrade the target software when upgrading the failure, effectively improve the efficiency of software upgrading and operation.
According to the technical scheme, the storage firmware is divided into the operation area and the upgrading area, the operation area stores the software upgrading compression package, the upgrading area is upgraded according to the software upgrading compression package, after upgrading is finished, the roles of the upgrading area and the operation area are exchanged, the upgrading area serves as a new operation area to operate the software, and the original operation area serves as a new upgrading area to wait for next upgrading. The problem that the whole storage firmware can only be in one state of upgrading or running during upgrading or running in the prior art is solved, the upgrading area and the running area cannot be in the running state at the same time, and data loss during running is avoided. And by dividing different areas, the division of the function of the storage firmware is realized, and the efficiency of software upgrading is effectively improved.
Example two
Fig. 2 is a flowchart illustrating a software upgrading method according to a second embodiment of the present invention, which is further optimized based on the above embodiments and can be executed by a software upgrading apparatus. As shown in fig. 2, the method specifically includes the following steps:
And step 220, if so, receiving the software upgrading compression package, and storing the software upgrading compression package to an operation area for storing the firmware.
And step 230, releasing the software upgrading compression packet in the operation area to an upgrading area for storing firmware according to a preset decompression algorithm to obtain software upgrading data.
And releasing the software upgrading compression packet into an upgrading region according to the preset decompression algorithm to obtain software upgrading data. The obtained software data comprises files required by upgrading and can also comprise preset hash values. The preset hash value is data obtained by encrypting the software upgrading data by a third party according to a hash algorithm. After the software upgrading compression packet is decompressed, a preset hash value can be obtained.
And 240, checking the directory file of the software upgrading data according to a preset data checking algorithm.
The software upgrading data is verified, the format of a directory file can be verified, and whether errors exist in the software upgrading data can be judged according to a preset hash value, so that the data is prevented from being maliciously tampered in the transmission process.
In this embodiment, optionally, the software upgrade data includes a preset hash value; correspondingly, according to a preset data verification algorithm, verifying the directory file of the software upgrading data, including: generating a hash value to be verified according to a preset data verification algorithm and a directory file of the software upgrading data; comparing the hash value to be checked with a preset hash value in the software upgrading data; and if the hash value to be verified is consistent with the preset hash value, determining that the software upgrading data is verified successfully.
Specifically, a preset data verification algorithm may be set as a hash algorithm, and a directory file of the software upgrade data is encrypted according to the hash algorithm to obtain a hash value to be verified. And comparing the decompressed preset hash value with the hash value to be verified, and determining whether the hash value to be verified is consistent with the preset hash value. If so, determining that the software upgrading data is successfully verified, and upgrading the target software; if not, determining that the software upgrading data is failed to be verified, and sending a message of data error to the third party to prompt the third party to resend the software upgrading compressed packet. The method has the advantages that the data of the directory file of the software upgrading data can be verified by generating the hash value to be verified, errors of the data in the transmission process are avoided, the probability of upgrading errors is reduced, and the efficiency of software upgrading is improved.
And step 250, if the verification is successful, upgrading the target software according to the software upgrading data.
If the hash value to be verified is consistent with the preset hash value, it is determined that the software upgrading data is verified successfully, and a message of successful verification can be sent to a third party. And upgrading and updating according to the software upgrading data in the upgrading area for storing the firmware.
And step 260, if the target software is upgraded, taking the upgrading area as a new operation area, and operating the target software in the new operation area.
According to the embodiment of the invention, the storage firmware is divided into the operation area and the upgrading area, the software upgrading compression packet is stored in the operation area, the upgrading area is upgraded according to the software upgrading compression packet, the software upgrading data can be verified before upgrading, and the correctness of the data is ensured. After the upgrade is finished, the roles of the upgrade area and the operation area are exchanged, the upgrade area is used as a new operation area to operate the software, and the original operation area is used as the new upgrade area to wait for the next upgrade. The problem that the whole storage firmware can only be in one state of upgrading or running during upgrading or running in the prior art is solved, the upgrading area and the running area cannot be in the running state at the same time, and data loss during running is avoided. And by dividing different areas, the division of the function of the storage firmware is realized, and the efficiency of software upgrading is effectively improved.
EXAMPLE III
Fig. 3 is a block diagram of a software upgrading apparatus provided in a third embodiment of the present invention, which is capable of executing a software upgrading method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 3, the apparatus specifically includes:
an upgrade determining module 301, configured to determine target software to be upgraded according to a received software upgrade request, and determine whether to perform software upgrade on the target software;
a compressed packet storage module 302, configured to receive a software upgrade compressed packet if the software upgrade compressed packet is received, and store the software upgrade compressed packet in an operating area where firmware is stored;
the software upgrading module 303 is configured to decompress the software upgrading compression packet to an upgrading region of the storage firmware to obtain software upgrading data, and upgrade the target software according to the software upgrading data;
a software running module 304, configured to, if the target software is upgraded, take the upgraded area as a new running area, and run the target software in the new running area.
Optionally, the upgrade determining module 301 is specifically configured to:
determining target software and a target version to be upgraded according to a received software upgrading request of a third party;
acquiring a current version of the target software, and comparing the current version with the target version;
and if the current version is inconsistent with the target version, determining to upgrade the target software.
Optionally, the apparatus further comprises:
the upgrade agreement determining module is used for determining target software to be upgraded according to the received software upgrading request, judging whether the target software is subjected to software upgrading or not, and if the target software is determined to be subjected to software upgrading, sending an upgrade agreement feedback message to a third party for the third party to receive the upgrade agreement feedback message and send a software upgrading compression packet;
and the upgrading stop determining module is used for determining target software to be upgraded according to the received software upgrading request, judging whether the target software is subjected to software upgrading, and if the target software is not subjected to software upgrading, sending a feedback message for stopping upgrading to the third party to finish the upgrading process of the target software.
Optionally, the software upgrading module 303 includes:
the upgrading data obtaining unit is used for releasing the software upgrading compression packet in the operation area to the upgrading area of the storage firmware according to a preset decompression algorithm to obtain software upgrading data;
the upgrading data verification unit is used for verifying the directory file of the software upgrading data according to a preset data verification algorithm;
and the target software upgrading unit is used for upgrading the target software according to the software upgrading data if the verification is successful.
Optionally, the software upgrade data includes a preset hash value;
correspondingly, the upgrade data verification unit is specifically configured to:
generating a hash value to be verified according to a preset data verification algorithm and the directory file of the software upgrading data;
comparing the hash value to be verified with a preset hash value in the software upgrading data;
and if the hash value to be verified is consistent with the preset hash value, determining that the software upgrading data is verified successfully.
Optionally, the software running module 304 is specifically configured to:
if the target software is upgraded, triggering a preset self-starting request, and carrying out self-starting within preset time;
checking whether the target software meets the preset software self-checking requirement;
if yes, determining that the target software is successfully upgraded, writing an upgrade success identifier into the operation area, and feeding back an upgrade success message to a third party;
and in response to a system restart instruction, taking the upgrading area as a new operation area, taking the operation area as a new upgrading area, and operating the target software in the new operation area.
Optionally, the apparatus further comprises:
and the self-checking failure module is used for determining that the target software is failed to be upgraded after checking whether the target software meets the preset software self-checking requirement or not and writing an upgrading failure identifier into the operation area if the target software does not meet the preset software self-checking requirement, and feeding back an upgrading failure message to a third party.
The embodiment of the invention divides the storage firmware into the operation area and the upgrading area, the operation area stores the software upgrading compression package, the upgrading area is upgraded according to the software upgrading compression package, after the upgrading is finished, the roles of the upgrading area and the operation area are exchanged, the upgrading area is used as a new operation area to operate the software, and the original operation area is used as a new upgrading area to wait for the next upgrading. The problem that the whole storage firmware can only be in one state of upgrading or running during upgrading or running in the prior art is solved, the upgrading area and the running area cannot be in the running state at the same time, and data loss during running is avoided. And by dividing different areas, the division of the function of the storage firmware is realized, and the efficiency of software upgrading is effectively improved.
Example four
Fig. 4 is a schematic structural diagram of a software upgrading device according to a fourth embodiment of the present invention. The software upgrading device may be a computer device and fig. 4 shows a block diagram of an exemplary computer device 400 suitable for use in implementing embodiments of the present invention. The computer device 400 shown in fig. 4 is only an example and should not bring any limitations to the functionality or scope of use of the embodiments of the present invention.
As shown in fig. 4, computer device 400 is in the form of a general purpose computing device. The components of computer device 400 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 that couples the various system components including the system memory 402 and the processing unit 401.
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)404 and/or cache memory 405. The computer device 400 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 by one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may include an implementation of a network environment. Program modules 407 generally perform the functions and/or methodologies of the described embodiments of the invention.
The computer device 400 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), with one or more devices that enable a user to interact with the computer device 400, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 400 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interface 411. Moreover, computer device 400 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 412. As shown in FIG. 4, network adapter 412 communicates with the other modules of computer device 400 via bus 403. It should be appreciated that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with computer device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 401 executes various functional applications and data processing by running the program stored in the system memory 402, for example, implementing a software upgrading method provided by the embodiment of the present invention, including:
determining target software to be upgraded according to a received software upgrading request, and judging whether to upgrade the target software;
if so, receiving a software upgrading compression package, and storing the software upgrading compression package to an operation area for storing firmware;
decompressing the software upgrading compression packet to an upgrading area of the storage firmware to obtain software upgrading data, and upgrading the target software according to the software upgrading data;
and if the target software is upgraded, taking the upgrading area as a new operation area, and operating the target software in the new operation area.
EXAMPLE five
The fifth embodiment of the present invention further provides a storage medium containing computer-executable instructions, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method for upgrading software according to the fifth embodiment of the present invention is implemented, where the method includes:
determining target software to be upgraded according to a received software upgrading request, and judging whether to upgrade the target software;
if so, receiving a software upgrading compression package, and storing the software upgrading compression package to an operation area for storing firmware;
decompressing the software upgrading compression packet to an upgrading area of the storage firmware to obtain software upgrading data, and upgrading the target software according to the software upgrading data;
and if the target software is upgraded, taking the upgrading area as a new operation area, and operating the target software in the new operation area.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example, but is not limited to: an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions without departing from the scope of the invention. Therefore, although the present invention has been described in more detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (10)
1. A method of upgrading software, comprising:
determining target software to be upgraded according to a received software upgrading request, and judging whether to upgrade the target software;
if so, receiving a software upgrading compression package, and storing the software upgrading compression package to an operation area for storing firmware;
decompressing the software upgrading compression packet to an upgrading area of the storage firmware to obtain software upgrading data, and upgrading the target software according to the software upgrading data;
and if the target software is upgraded, taking the upgrading area as a new operation area, and operating the target software in the new operation area.
2. The method of claim 1, wherein determining target software to be upgraded according to the received software upgrade request, and determining whether to perform software upgrade on the target software comprises:
determining target software and a target version to be upgraded according to a received software upgrading request of a third party;
acquiring a current version of the target software, and comparing the current version with the target version;
and if the current version is inconsistent with the target version, determining to upgrade the target software.
3. The method of claim 1, wherein after determining target software to be upgraded according to the received software upgrade request and determining whether to perform software upgrade on the target software, the method further comprises:
if the target software is determined to be upgraded, sending a feedback message agreeing to the upgrade to a third party, so that the third party receives the feedback message agreeing to the upgrade and sends a software upgrading compressed packet;
and if the target software is determined not to be upgraded, sending a feedback message for stopping upgrading to the third party, and ending the upgrading process of the target software.
4. The method of claim 1, wherein decompressing the software upgrade compressed packet to an upgrade area of the storage firmware to obtain software upgrade data, and upgrading the target software according to the software upgrade data comprises:
according to a preset decompression algorithm, releasing the software upgrading compression packet in the operation area into the upgrading area of the storage firmware to obtain software upgrading data;
verifying the directory file of the software upgrading data according to a preset data verification algorithm;
and if the verification is successful, upgrading the target software according to the software upgrading data.
5. The method of claim 4, wherein the software upgrade data includes a preset hash value;
correspondingly, according to a preset data verification algorithm, verifying the directory file of the software upgrading data, including:
generating a hash value to be verified according to a preset data verification algorithm and the directory file of the software upgrading data;
comparing the hash value to be verified with a preset hash value in the software upgrading data;
and if the hash value to be verified is consistent with the preset hash value, determining that the software upgrading data is verified successfully.
6. The method of claim 1, wherein if the target software is upgraded, taking the upgrade area as a new operating area, and operating the target software in the new operating area comprises:
if the target software is upgraded, triggering a preset self-starting request, and carrying out self-starting within preset time;
checking whether the target software meets the preset software self-checking requirement;
if yes, determining that the target software is successfully upgraded, writing an upgrade success identifier into the operation area, and feeding back an upgrade success message to a third party;
and in response to a system restart instruction, taking the upgrading area as a new operation area, taking the operation area as a new upgrading area, and operating the target software in the new operation area.
7. The method according to claim 6, after checking whether the target software meets a preset software self-test requirement, further comprising:
and if the target software does not meet the preset software self-checking requirement, determining that the target software fails to be upgraded, writing an upgrade failure identifier into the operation area, and feeding back an upgrade failure message to a third party.
8. A software upgrading apparatus, comprising:
the upgrading judgment module is used for determining target software to be upgraded according to the received software upgrading request and judging whether to upgrade the target software;
the compression package storage module is used for receiving the software upgrading compression package and storing the software upgrading compression package to an operation area for storing firmware if the software upgrading compression package is received;
the software upgrading module is used for decompressing the software upgrading compression packet to an upgrading area of the storage firmware to obtain software upgrading data and upgrading the target software according to the software upgrading data;
and the software running module is used for taking the upgrading area as a new running area and running the target software in the new running area if the target software is upgraded.
9. A software upgrading device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the software upgrading method as claimed in any one of claims 1-7 when executing the program.
10. A storage medium containing computer-executable instructions for performing the software upgrade method of any one of claims 1-7 when executed by a computer processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110181887.9A CN112882743A (en) | 2021-02-09 | 2021-02-09 | Software upgrading method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110181887.9A CN112882743A (en) | 2021-02-09 | 2021-02-09 | Software upgrading method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112882743A true CN112882743A (en) | 2021-06-01 |
Family
ID=76056379
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110181887.9A Pending CN112882743A (en) | 2021-02-09 | 2021-02-09 | Software upgrading method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112882743A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113641390A (en) * | 2021-10-18 | 2021-11-12 | 苏州万店掌软件技术有限公司 | System upgrading method, device, equipment and storage medium |
CN113760332A (en) * | 2021-08-30 | 2021-12-07 | 青岛信芯微电子科技股份有限公司 | Software upgrading method and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140157251A1 (en) * | 2012-12-04 | 2014-06-05 | International Business Machines Corporation | Software version management |
WO2016086654A1 (en) * | 2014-12-03 | 2016-06-09 | 广州广电运通金融电子股份有限公司 | Remote upgrade method and system for software on self-service terminal, and upgrade package creation method |
CN109117168A (en) * | 2018-08-29 | 2019-01-01 | 拓攻(南京)机器人有限公司 | Unmanned plane firmware update, device, unmanned plane and storage medium |
CN110311960A (en) * | 2019-06-19 | 2019-10-08 | 浙江吉利控股集团有限公司 | A kind of method for upgrading software, device, equipment and storage medium |
CN110851157A (en) * | 2019-10-28 | 2020-02-28 | 上海旗旌科技有限公司 | Method and equipment for updating vehicle-mounted terminal equipment system |
-
2021
- 2021-02-09 CN CN202110181887.9A patent/CN112882743A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140157251A1 (en) * | 2012-12-04 | 2014-06-05 | International Business Machines Corporation | Software version management |
WO2016086654A1 (en) * | 2014-12-03 | 2016-06-09 | 广州广电运通金融电子股份有限公司 | Remote upgrade method and system for software on self-service terminal, and upgrade package creation method |
CN109117168A (en) * | 2018-08-29 | 2019-01-01 | 拓攻(南京)机器人有限公司 | Unmanned plane firmware update, device, unmanned plane and storage medium |
CN110311960A (en) * | 2019-06-19 | 2019-10-08 | 浙江吉利控股集团有限公司 | A kind of method for upgrading software, device, equipment and storage medium |
CN110851157A (en) * | 2019-10-28 | 2020-02-28 | 上海旗旌科技有限公司 | Method and equipment for updating vehicle-mounted terminal equipment system |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113760332A (en) * | 2021-08-30 | 2021-12-07 | 青岛信芯微电子科技股份有限公司 | Software upgrading method and electronic equipment |
CN113641390A (en) * | 2021-10-18 | 2021-11-12 | 苏州万店掌软件技术有限公司 | System upgrading method, device, equipment and storage medium |
CN113641390B (en) * | 2021-10-18 | 2022-03-22 | 苏州万店掌网络科技有限公司 | System upgrading method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110716895B (en) | Target data archiving method, device, computer equipment and medium | |
US20210349710A1 (en) | Software update agent device and software patching method through the same | |
CN112925679A (en) | Firmware upgrading method, nonvolatile memory, computer storage medium and terminal | |
CN104052818A (en) | Version upgrade method and device for mobile terminal | |
CN112882743A (en) | Software upgrading method | |
WO2022237122A1 (en) | In-vehicle welcome animation updating method and apparatus, vehicle-mounted terminal, and storage medium | |
CN113384896B (en) | Resource packaging method, device, equipment and medium based on Unity | |
CN110659210A (en) | Information acquisition method and device, electronic equipment and storage medium | |
CN115202686A (en) | Virtualization system upgrading method and device, electronic equipment and storage medium | |
CN114449047B (en) | File data processing method and device | |
CN113434254B (en) | Client deployment method, client deployment apparatus, computer device, and storage medium | |
CN113037850A (en) | Application program upgrading method and device, electronic equipment and storage medium | |
CN112988192A (en) | Version updating method and device, electronic equipment and storage medium | |
CN112925796A (en) | Write consistency control method, device, equipment and storage medium | |
CN106933604B (en) | System upgrading method and device | |
CN110134419B (en) | System upgrading method, device, equipment and storage medium for double-sided cabinet | |
WO2020233044A1 (en) | Plug-in verification method and device, and server and computer-readable storage medium | |
CN111694724B (en) | Test method and device of distributed form system, electronic equipment and storage medium | |
CN116820528A (en) | Firmware version upgrading method and device, chip and electronic equipment | |
CN113360172B (en) | Application deployment method, device, computer equipment and storage medium | |
CN111046389A (en) | Method for securely updating firmware components and portable computer station for implementation | |
CN112527371B (en) | Boot loader upgrading method and device, electronic equipment and storage medium | |
CN113434151A (en) | Service deployment method, server and system | |
CN113515299A (en) | Software development kit SDK hot upgrading method, device, equipment and storage medium | |
CN113127029A (en) | Firmware updating method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |