A method and device for software upgrading

By using an independent upgrade tool to download and apply the upgrade package locally or from the server when the device starts, it solves the software upgrade problem in the scenario where the upgrade package cannot be installed online, realizes a safe upgrade process and simplifies the maintenance of the file server.

CN110908681BActive Publication Date: 2024-10-18BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201811087213.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-09-18
Publication Date
2024-10-18
Estimated Expiration
2038-09-18

AI Technical Summary

Technical Problem

Existing software upgrade solutions cannot be applied to software upgrades during task execution, resulting in the status of the upgraded software being out of sync with other collaborative software, making it impossible to apply new upgrade packages by restarting alone, and unable to solve the 'cannot install upgrade package online' scenario. software upgrade issue.

Method used

The independent upgrade tool starts automatically when the device starts, checks whether there is an upgrade package in the local non-volatile memory, and if so, upgrades it. Otherwise, it downloads and stores the new upgrade package from the server, and notifies the user to restart to complete the software upgrade.

Benefits of technology

It realizes software upgrade when the device is started, avoids the problem of status desynchronization caused by online upgrade, ensures the security of the upgrade process, and simplifies the construction of the file server and the production of upgrade packages, making maintenance easier.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110908681B_ABST
    Figure CN110908681B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for software upgrades, relating to the field of computer technology. The software upgrade method is executed by an independent upgrade tool, which automatically starts upon device startup. A specific implementation of the method includes: upon device startup, checking whether an upgrade package is stored in the device's local non-volatile memory; if so, performing a software upgrade based on the upgrade package; otherwise, initiating a software upgrade check process until a new upgrade package is detected, downloading the new upgrade package from the server and storing it in the device's local non-volatile memory, and then notifying the user to restart the device to complete the software upgrade. This implementation enables software upgrades in scenarios where "upgrade packages cannot be installed online," allowing the upgrade package to be installed via device startup, making the upgrade process safer and avoiding problems such as response errors caused by asynchronous states of software within the same system due to online upgrades.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for software upgrading. Background Art

[0002] In the existing software upgrade solutions, most of the upgrade methods are that the device to be upgraded searches the file server for upgrade package information, or the file server pushes upgrade instructions to the device to be upgraded. Then, the device to be upgraded can download a file containing a file list and version numbers from the file server to determine whether there is a new upgrade package to download, or it can access the file server with its own device ID to obtain a file list specifically for its own upgrade.

[0003] Since most software or programs can achieve the purpose of software upgrade by installing the upgrade package online and restarting the software itself, the existing software upgrade solutions are mostly aimed at the scenario where the upgrade package can be installed online. Here, "online" specifically refers to the device to be upgraded working in task mode rather than standby mode.

[0004] However, when some devices to be upgraded install software upgrade packages during task execution, the new upgrade package cannot be applied by restarting the upgraded software itself alone because the status of the upgraded software is not synchronized with other software that needs to work together in the same system. In other words, the existing technical solutions are not applicable to software upgrades in the scenario of "unable to install upgrade packages online". Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for software upgrading, which can realize software upgrading in the scenario of "unable to install the upgrade package online". The upgrade package can be installed by starting the device, making the upgrade process safer and avoiding problems such as response confusion caused by the state asynchrony caused by online upgrade of various software that need to work together in the same system.

[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for software upgrading is provided.

[0007] A method for software upgrade, the method is executed by an independent upgrade tool, and the upgrade tool is automatically started when a device is started. The method includes: when the device is started, searching whether an upgrade package is stored in the local non-volatile memory of the device; if so, performing software upgrade according to the upgrade package; otherwise, starting a software upgrade check process, until a new upgrade package is detected, downloading the new upgrade package from a server and storing it in the local non-volatile memory of the device, and then notifying the user to restart the device to complete the software upgrade.

[0008] Optionally, the software upgrade configuration is performed by starting the upgrade tool with parameters.

[0009] Optionally, performing software upgrade according to the upgrade package includes: calculating a verification code corresponding to a file in the upgrade package, and comparing the verification code with a preset verification code; when the two are consistent, installing the upgrade package to perform software upgrade.

[0010] Optionally, after performing software upgrade according to the upgrade package, the method further includes: deleting all upgrade packages stored on the device; and updating the version number of the upgraded software on the device.

[0011] Optionally, before starting the software upgrade check process, the process further includes: obtaining a current version number of the software on the device.

[0012] Optionally, before starting the software upgrade check process, it also includes: starting the main function program of the device; and notifying the user to restart the device to complete the software upgrade includes: notifying the main function program through inter-process communication, and the main function program notifies the user to restart the device to complete the software upgrade.

[0013] Optionally, the software upgrade check process includes: obtaining an identification of a device that does not need to be upgraded from a server; if the identification is not obtained or the identification obtained does not include the identification of the device, obtaining the highest version number of the upgrade package of the software on the device from the server, and determining whether the highest version number is higher than the current version number of the software on the device; if it is higher, using the upgrade package with the highest version number as a new upgrade package.

[0014] Optionally, the identification of the device includes information about the group to which the device belongs; and obtaining the highest version number of the upgrade package of the software on the device from the server includes: obtaining an upgrade package list from the server; searching the upgrade package list for upgrade packages whose names contain the group information to which the device belongs and upgrade packages that do not contain the group field; and obtaining the version number of the upgrade package based on the name of the found upgrade package to determine the highest version number.

[0015] According to another aspect of an embodiment of the present invention, a software upgrading device is provided.

[0016] A device for software upgrade, the device is located in an independent upgrade tool, and the upgrade tool is automatically started when the device is started, the device comprises: a determination module, which is used to search whether an upgrade package is stored in the local non-volatile memory of the device when the device is started, and if so, execute the upgrade module, otherwise execute the check module; the upgrade module is used to perform software upgrade according to the upgrade package; the check module is used to start the software upgrade check process, until a new upgrade package is detected, the new upgrade package is downloaded from a server and stored in the local non-volatile memory of the device, and then the user is notified to restart the device to complete the software upgrade.

[0017] Optionally, the software upgrade configuration is performed by starting the upgrade tool with parameters.

[0018] Optionally, the upgrade module is further used to: calculate the verification code corresponding to the file in the upgrade package, and compare it with a preset verification code, and when the two are consistent, install the upgrade package to perform software upgrade.

[0019] Optionally, it also includes an update module, which is used to: delete all upgrade packages stored on the device after the software is upgraded according to the upgrade package; and update the version number of the upgraded software on the device.

[0020] Optionally, it also includes an acquisition module, which is used to: before starting the software upgrade check process, obtain the current version number of the software on the device.

[0021] Optionally, it also includes a program startup module, which is used to: start the main function program of the device before starting the software upgrade check process; and the check module is also used to: notify the main function program by inter-process communication, and the main function program notifies the user to restart the device to complete the software upgrade.

[0022] Optionally, the software upgrade check process includes: obtaining an identification of a device that does not need to be upgraded from a server; if the identification is not obtained or the identification obtained does not include the identification of the device, obtaining the highest version number of the upgrade package of the software on the device from the server, and determining whether the highest version number is higher than the current version number of the software on the device; if it is higher, using the upgrade package with the highest version number as a new upgrade package.

[0023] Optionally, the identification of the device includes information about the group to which the device belongs; and obtaining the highest version number of the upgrade package of the software on the device from the server includes: obtaining an upgrade package list from the server; searching the upgrade package list for upgrade packages whose names contain the group information to which the device belongs and upgrade packages that do not contain the group field; and obtaining the version number of the upgrade package based on the name of the found upgrade package to determine the highest version number.

[0024] According to yet another aspect of an embodiment of the present invention, a software-upgradeable electronic device is provided.

[0025] A software upgrade electronic device includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the software upgrade method provided by an embodiment of the present invention.

[0026] According to still another aspect of the embodiments of the present invention, a computer readable medium is provided.

[0027] A computer readable medium stores a computer program, which, when executed by a processor, implements a software upgrade method provided by an embodiment of the present invention.

[0028] An embodiment of the above invention has the following advantages or beneficial effects: by using an independent upgrade tool to perform software upgrade, and setting the upgrade tool to start automatically when the device starts, the upgrade tool can perform software upgrade processing when the device starts: if there is an upgrade package on the local non-volatile memory of the device, the software upgrade is directly performed, otherwise the software upgrade check process is started, until a new upgrade package is detected, the new upgrade package is downloaded from the server and saved to the local non-volatile memory of the device, and then the user is notified to restart the device to complete the software upgrade, realizing the software upgrade in the scenario of "cannot install the upgrade package online", and the upgrade package can be installed by starting the device, making the upgrade process safer, avoiding the response confusion caused by the state asynchronization caused by the online upgrade of various software that need to work together in the same system, and at the same time, it can also make the construction of the file server more convenient, the upgrade package production simpler, and the file server maintenance more convenient. In addition, storing the upgrade package on the local non-volatile memory can ensure that the upgrade package will not be lost after the device is restarted. By adding the group information to which the device belongs in the device identifier, the purpose of group upgrade can be achieved. By starting the upgrade tool with parameters (password), you can configure parameters such as equipment and software related to the upgrade, so as to accurately control the equipment to be upgraded.

[0029] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0031] Figure 1 is a schematic diagram of main steps of a method for software upgrading according to an embodiment of the present invention;

[0032] Figure 2 is a flowchart of software upgrade in an embodiment of the present invention;

[0033] Figure 3 is a schematic diagram of main modules of a software upgrade device according to an embodiment of the present invention;

[0034] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0035] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0037] The upgrade scenario targeted by the present invention is that the device to be upgraded can only download the upgrade package but cannot install it during the execution of the main function program, and cannot achieve the purpose of applying the upgrade package by restarting the software. The upgrade package can only be installed when the device is restarted, and then the main function program is started.

[0038] Figure 1 Schematic diagram of the main steps of the software upgrade method according to an embodiment of the present invention. The software upgrade method according to the embodiment of the present invention is executed by an independent, dedicated upgrade tool, rather than by the main function program, and the upgrade tool is automatically started when the device is started. Figure 1 As shown, the software upgrade method of the embodiment of the present invention mainly includes the following steps S101 to S103.

[0039] Step S101: when the device is started, searching whether there is an upgrade package stored in the local non-volatile memory of the device;

[0040] Step S102: If yes, perform software upgrade according to the upgrade package;

[0041] Step S103: Otherwise, start the software upgrade check process until a new upgrade package is detected, download the new upgrade package from the server and store it in the local non-volatile memory of the device, and then notify the user to restart the device to complete the software upgrade.

[0042] According to the technical solution of the present invention, the upgrade package is stored in the local non-volatile memory of the device. Non-volatile memory NVM (non-volatile memory) refers to a computer memory whose stored data will not disappear when the current is turned off, such as a hard disk or flash memory. In this way, it can be ensured that after the device is restarted, the upgrade package downloaded before the restart is still stored in the device.

[0043] According to an embodiment of the present invention, software upgrade is performed by an independent and special upgrade tool UpdaterTool, instead of deploying the upgrade program in the main function program of the software, so that the upgraded device and the upgraded software can be accurately controlled. UpdaterTool is a software upgrade tool that can perform software upgrade according to the set logic. UpdaterTool has two startup methods: the startup method with parameters (for example, password) can configure the parameters related to the upgrade, and the startup method without parameters (self-start) can enter the upgrade mode. Software upgrade configuration can be performed by starting the upgrade tool with parameters. For example, relevant information of the file server, relevant information of the software to be upgraded, and relevant information of the device to be upgraded can be configured.

[0044] According to one embodiment of the present invention, performing software upgrade according to the upgrade package specifically includes: calculating the verification code corresponding to the file in the upgrade package, and comparing it with the preset verification code. When the two are consistent, the upgrade package is installed to perform software upgrade. In this way, the validity of the upgrade package can be judged by verifying the files in the upgrade package. Only when the upgrade package passes the verification can it be installed. Generally, the upgrade package is compressed, so before verifying the upgrade package, the upgrade package needs to be decompressed first. The upgrade package may include the upgrade program, the verification code generated by the system, the upgrade history record and other contents. When calculating the verification code corresponding to the file in the upgrade package, the verification code corresponding to the upgrade program is generally calculated. Then, the calculated verification code is compared with the system-generated verification code included in the upgrade package to determine whether the file in the upgrade package is correct, complete and valid. When calculating the verification code corresponding to the upgrade ascending order, a common hash or encryption algorithm can be used, such as: MD5 (MD5Message-Digest Algorithm, message digest algorithm version 5), CRC (Cyclic Redundancy Check) or MD2, MD3, etc. In addition, according to another embodiment of the present invention, the upgrade package may also include only the upgrade program, and then download a file for recording the verification code from the file server, and then compare the calculated verification code with the verification code on the downloaded file for recording the verification code to determine the validity of the upgrade package.

[0045] According to an embodiment of the present invention, after performing software upgrade according to the upgrade package, it is also possible to: delete all upgrade packages stored on the device; and update the version number of the upgraded software on the device. In this way, when an upgrade package is found on the device, it can be determined that the upgrade package is the upgrade package to be upgraded, without having to determine whether it is the latest, thereby simplifying the upgrade package determination operation; in addition, by updating the version number of the upgraded software, the software version number can be compared with the corresponding version number in the upgrade package to determine whether an upgrade is required, further simplifying the upgrade determination process.

[0046] According to another embodiment of the present invention, before starting the software upgrade check process, the process further includes: obtaining the current version number of the software on the device.

[0047] According to another embodiment of the present invention, before starting the software upgrade check process, the main function program of the device can also be started; and when notifying the user to restart the device to complete the software upgrade, it can specifically include: notifying the main function program in an inter-process communication manner, and the main function program notifying the user to restart the device to complete the software upgrade. Since the main function program is displayed in full screen on the user interface, the main function program is notified by the upgrade tool, and the main function program notifies the user to restart the device, so that the user can be better notified on the user interface. In addition, during the specific implementation process, the upgrade tool can also notify the user to restart the device through other notification methods, such as: SMS, email, buzzer, etc. In addition, when restarting the device, the user can flexibly choose the restart time according to the usage situation. For example, the device can be restarted when it is not working or in standby state.

[0048] According to an embodiment of the present invention, the software upgrade check process may specifically include:

[0049] Obtain the identifier of the device that does not need to be upgraded from the server;

[0050] If the identifier is not obtained or the identifier of the device is not included in the obtained identifier, the highest version number of the upgrade package of the software on the device is obtained from the server, and it is determined whether the highest version number is higher than the current version number of the software on the device;

[0051] If it is higher, the upgrade package with the highest version number will be used as the new upgrade package.

[0052] According to another embodiment of the present invention, the identification of the device includes information about the group to which the device belongs; and obtaining the highest version number of the upgrade package of the software on the device from the server may specifically include:

[0053] Get the upgrade package list from the server;

[0054] Search the upgrade package list for upgrade packages whose names contain the group information to which the device belongs and upgrade packages that do not contain the group field.

[0055] The version number of the upgrade package is obtained according to the name of the found upgrade package to determine the highest version number.

[0056] The implementation process of the present invention is described below in conjunction with specific embodiments.

[0057] According to an embodiment of the present invention, the following scene settings can be made:

[0058] 1. Assume that the ID of the device is GroupNM_IDx, where the GroupNM field identifies the name of the group to which the device belongs, and IDx is the index value of the device in the group to which it belongs;

[0059] 2. Assume that the upgradeable software of the device includes SoftWareA, SoftWareB and SoftWareC (the specific number can be arbitrary), and the version number of each software can be set in the format of X or XY or XYZ, where X, Y and Z are the major version number, minor version number and revision number respectively. For example, if the version number of a software is 2.3.5, its major version number is 2, the minor version number is 3, and the revision number is 5. The major version number will only change when there is an important function change, and the minor version number corresponds to a minor function upgrade. The revision number will be updated every time the software is upgraded;

[0060] 3. For example, the file server is an FTP server (File Transfer Protocol Server, which is a computer that provides file storage and access services on the Internet. They provide services in accordance with the FTP protocol). The device has the permissions to read, list directories, and enter subdirectories on the FTP file directory of the file server. The maintenance personnel have full permissions to operate files and folders on the FTP file directory of the file server. Listing directories means that the client can ask the server to return a list of all files under a folder; entering subdirectories means that the client can access directories at all levels in the file server.

[0061] 4. The executable program that implements the device software upgrade function is UpdaterTool. In the embodiment of the present invention, UpdaterTool is a software upgrade tool that can perform software upgrades according to the set logic. UpdaterTool has two startup modes: startup with parameters (e.g., password) to configure parameters related to the upgrade, and startup without parameters to enter the upgrade mode.

[0062] Before upgrading the software, you need to perform the following preparations:

[0063] 1. Initially set the parameters related to the upgrade or modify the previously set parameters:

[0064] The UpdaterTool is manually started with a parameter (the parameter can be a specific string used as a maintenance password), and the program enters the parameter configuration mode after startup. In the parameter configuration mode, the configuration personnel can enter the IP (Internet Protocol, a protocol for interconnection between networks) address of the file server, the user name and password of the file server, the current version number of SoftWareA, the current version number of SoftWareB, the current version number of SoftWareC, and the ID (IDentity) of the device to be upgraded and other parameters related to the upgrade under the prompt of the program (a user interface or a command line prompt can be presented), and after the configuration personnel confirms the input, these parameters are saved in the non-volatile memory (hard disk or flash memory, etc.) of the device to be upgraded. Among them, if the current device to be upgraded does not have software such as SoftWareA, SoftWareB and SoftWareC, their version numbers can be set to 0 or 0.0 or 0.0.0 during the initial parameter setting;

[0065] 2. Prepare the upgrade package:

[0066] Take SoftWareA as an example. Assuming that its version number is named in the form of "XYZ", the corresponding upgrade package name is SoftWareA-GroupNM-XYZ-YYYYMMDD.bin, where YYYYMMDD is the year, month, and day information when the upgrade package is created. It is not mandatory, but the name of the upgrade package must contain the software name and the version number information of the upgrade package. The upgrade package is generally a compressed package, which is compressed from the following three files (folders): SoftWareA's upgrade program, md5.txt (the file content is the MD5 code of SoftWareA) and update.log (the content is the upgrade history of SoftWareA). If SoftWareA is multiple files or a folder, they need to be compressed into a compressed file, and then the MD5 code of the compressed file is written into md5.txt. Among them, the GroupNM field in the upgrade package name is optional. If there is no GroupNM field, it means that all devices in the group can download and install the upgrade package. If the GroupNM field is included, only devices belonging to the GroupNM group will download and install the upgrade package;

[0067] 3. Put the upgrade package into the corresponding file directory of the file server:

[0068] The file directory of the file server can be organized in this way: put the IDNotAllowed.txt file in the root directory, and the content of the file is the ID of the devices that do not need to be upgraded, separated by spaces. Create three folders in the root directory with the names of the software to be upgraded, SoftWareA, SoftWareB, and SoftWareC, and then put the new upgrade package (such as SoftWareA-GroupNM-XYZ-YYYYMMDD.bin) into the corresponding folder (such as SoftWareA). Among them, IDNotAllowed.txt is not necessary. Its function is to write the IDs of the devices that do not need to be upgraded into this file when it is necessary to upgrade some devices.

[0069] Through the above preparation operations, you can set the devices and software that need to be upgraded, prepare the upgrade package, and store the upgrade package in the corresponding file directory of the file server. After that, you can upgrade the software. Enter the upgrade mode by starting UpdaterTool without parameters, so that UpdaterTool can perform software upgrades according to the pre-set logic. Specifically, it is necessary to put "Start UpdaterTool without parameters" into the automatic startup sequence of the device's startup software. When the computer is turned on, some software can be started in a certain order. In Linux, you can enter the names of these software in a script file to achieve this. By putting UpdaterTool in this self-starting script as one of the items, you can automatically start UpdaterTool when the device starts.

[0070] Figure 2 FIG. 1 is a flowchart of software upgrade according to an embodiment of the present invention. Figure 2 As shown, the software upgrade process of the embodiment of the present invention mainly includes the following steps S1 to S7.

[0071] Step S1: When the device starts, check whether there is an upgrade package in the folder where the upgrade package is stored on the local non-volatile memory of the device. If there is no upgrade package, go to step S2; if there is an upgrade package, decompress and verify the upgrade package (MD5 code), and install the upgrade package after normal decompression and verification. Then delete all upgrade package files in the folder where the upgrade package is stored, and update the version number of the software that has just been upgraded on the device, and then go to step S2. The above-mentioned operation sequence of installing the upgrade package and then deleting all upgrade package files and updating the software version number can minimize the impact caused by accidental power outages during the software upgrade process.

[0072] Step S2: Obtain the current version number of each software on the device from the local non-volatile memory of the device, and then proceed to step S3.

[0073] Step S3: Start the main function program of the device, the device starts working, and then enters step S4. Each device has its own main function program. For example, the main function program of an ATM (Automatic Teller Machine) is a program related to deposits and withdrawals. The main function programs of multiple devices of the same type can be the same or different (for example, different version numbers).

[0074] Step S4: Start the software upgrade check process, wherein the software upgrade check process is a process of periodically checking whether there is software on the file server that needs to be upgraded. When a new upgrade package is detected, proceed to step S5. The software upgrade check process may specifically include the following steps:

[0075] Step S41: Access the file server to check whether there is a file called IDNotAllowed.txt (which records the ID of the device that does not need to be upgraded). If not, go to step S42. Otherwise, download the file and check whether the ID of the device is in the file. If it is, it means that there is no need to upgrade. Wait for a certain period of time (the set check period) and then execute step S41 again. Otherwise, go to step S42.

[0076] Step S42: Switch to the upgrade package storage directories corresponding to the three softwares SoftWareA, SoftWareB and SoftWareC of the file server respectively, and obtain the upgrade package directory list in each directory (if the file server is an FTP server, the file list can be obtained by sending the "LIST" command). After that, determine whether there is a new upgrade package for the software according to the upgrade package directory list corresponding to each software. Taking software SoftWareA as an example, according to the name of the upgrade package in the upgrade package directory list corresponding to the software, parse the upgrade package name containing the group information GroupNM to which the device belongs and the upgrade package name without the GroupNM field to obtain the version number of the upgrade package of SoftWareA, and determine the name of the upgrade package with the highest version number. Compare this highest version number with the current version number of the software SoftWareA installed on the device. If this highest version number is higher than the current version number of the software SoftWareA installed on the device, the upgrade package with the highest version number is used as a new upgrade package, and enter step S5; otherwise, wait for a certain period of time (the set inspection cycle) and execute step S41 again. According to an embodiment of the present invention, when comparing version numbers, the size of the main version number X is first compared. The version number with a larger X is higher; when X is the same, the version number with a larger Y is higher; when X and Y are the same, the version number with a larger Z is higher.

[0077] Step S5: The device downloads a new upgrade package from the file server and saves the downloaded new upgrade package in the folder storing the upgrade package on the local non-volatile memory of the device. If there is an older version of the upgrade package in the folder storing the upgrade package locally (the upgrade package has not been decompressed and installed), the old version of the upgrade package is directly deleted, that is, the folder storing the upgrade package stores at most one upgrade package of the same type, so as to ensure that the upgrade package found in the folder storing the upgrade package each time the device is started is the latest version of the upgrade package. Then, enter step S6.

[0078] Step S6: The UpdaterTool notifies the main function program of the device that the new upgrade package has been downloaded by means of inter-process communication. The main function program notifies the user in a certain way (such as through a pop-up window in the user interface) to restart the device to complete the software upgrade. Specifically, the user can choose an appropriate time to restart the device, for example: restart the device when the device is in a non-working state or standby state. Then, proceed to step S7.

[0079] Step S7: After waiting for a certain period of time (set inspection cycle), proceed to step S41.

[0080] Among them, step S2 and step S3 can be executed simultaneously, or step S2 can be executed first and then step S3; or step S3 can be executed first and then step S2, which will not affect the implementation effect of the present invention.

[0081] In addition, in a specific implementation of the present invention, the devices implementing the upgrade are controlled by saving the identification of the devices that do not need to be upgraded into the configuration file and including the group name of the device to be upgraded in the name of the upgrade package; similarly, the device may query the server whether there is an upgrade instruction, or the device may request an upgrade from the server based on its own identification ID, and the server may reply whether the upgrade is possible, etc. to control the devices implementing the upgrade.

[0082] Figure 3 1 is a schematic diagram of the main modules of the software upgrade device according to an embodiment of the present invention. The software upgrade device according to the embodiment of the present invention is located in an independent upgrade tool, and the upgrade tool is automatically started when the device is started. Figure 3 As shown, the software upgrade device 300 according to the embodiment of the present invention mainly includes a determination module 301 , an upgrade module 302 and a check module 303 .

[0083] The determination module 301 is used to check whether there is an upgrade package stored in the local non-volatile memory of the device when the device is started. If yes, the upgrade module 302 is executed, otherwise, the check module 303 is executed;

[0084] The upgrade module 302 is used to perform software upgrade according to the upgrade package;

[0085] The checking module 303 is used to start the software upgrade checking process, and when a new upgrade package is detected, the new upgrade package is downloaded from the server and stored in the local non-volatile memory of the device, and then the user is notified to restart the device to complete the software upgrade.

[0086] According to an embodiment of the present invention, the software upgrade configuration is performed by starting the upgrade tool with parameters.

[0087] According to one embodiment of the present invention, the upgrade module 302 may also be used to:

[0088] The verification code corresponding to the file in the upgrade package is calculated and compared with the preset verification code. When the two are consistent, the upgrade package is installed to perform the software upgrade.

[0089] According to another embodiment of the present invention, the software upgrade device 300 may further include an update module (not shown in the figure) for:

[0090] After performing software upgrade according to the upgrade package, delete all upgrade packages stored on the device;

[0091] And, update the version number of the upgraded software on the device.

[0092] According to another embodiment of the present invention, the software upgrade apparatus 300 may further include an acquisition module (not shown in the figure) for:

[0093] Before starting the software upgrade check process, obtain the current version number of the software on the device.

[0094] According to another embodiment of the present invention, the software upgrade device 300 may further include a program startup module (not shown in the figure) for:

[0095] Before starting the software upgrade check process, start the main function program of the device;

[0096] Furthermore, the inspection module 303 may also be used for:

[0097] The main function program is notified by inter-process communication, and the main function program notifies the user to restart the device to complete the software upgrade.

[0098] According to yet another embodiment of the present invention, the software upgrade check process may include:

[0099] Obtain the identifier of the device that does not need to be upgraded from the server;

[0100] If the identifier is not obtained or the identifier of the device is not included in the obtained identifier, the highest version number of the upgrade package of the software on the device is obtained from the server, and it is determined whether the highest version number is higher than the current version number of the software on the device;

[0101] If it is higher, the upgrade package with the highest version number will be used as the new upgrade package.

[0102] According to an embodiment of the present invention, the identification of the device includes information about the group to which the device belongs; and obtaining the highest version number of the upgrade package of the software on the device from the server includes:

[0103] Get the upgrade package list from the server;

[0104] Search the upgrade package list for upgrade packages whose names contain the group information to which the device belongs and upgrade packages that do not contain the group field.

[0105] The version number of the upgrade package is obtained according to the name of the found upgrade package to determine the highest version number.

[0106] According to the embodiment of the present invention, the software upgrading apparatus 300 may be implemented as an independent upgrading tool.

[0107] According to the technical solution of the embodiment of the present invention, by using an independent upgrade tool to perform software upgrade, and setting the upgrade tool to start automatically when the device starts, the upgrade tool can perform software upgrade processing when the device starts: if there is an upgrade package on the local non-volatile memory of the device, the software upgrade is directly performed, otherwise the software upgrade check process is started, until a new upgrade package is detected, the new upgrade package is downloaded from the server and saved to the local non-volatile memory of the device, and then the user is notified to restart the device to complete the software upgrade, so that the software upgrade in the scenario of "cannot install the upgrade package online" is realized, and the upgrade package can be installed by starting the device, making the upgrade process safer, avoiding the problem of response confusion caused by the asynchronous state of each software that needs to work together in the same system due to online upgrade, and at the same time, it can also make the construction of the file server more convenient, the upgrade package production is simpler, and the file server maintenance is more convenient. In addition, storing the upgrade package in the local non-volatile memory can ensure that the upgrade package will not be lost after the device is restarted. By adding the group information to which the device belongs in the device identifier, the purpose of group upgrade can be achieved. By starting the upgrade tool with parameters (password), you can configure parameters such as equipment and software related to the upgrade, so as to accurately control the equipment to be upgraded.

[0108] Figure 4 An exemplary system architecture 400 is shown to which the method for software upgrading or the apparatus for software upgrading according to an embodiment of the present invention can be applied.

[0109] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0110] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0111] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0112] The server 405 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 401, 402, and 403. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.

[0113] It should be noted that the software upgrade method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the software upgrade device is generally set in the server 405 .

[0114] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0115] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 5 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0116] like Figure 5As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0117] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0118] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0119] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0120] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0121] The units or modules involved in the embodiments of the present invention may be implemented by software or hardware. The units or modules described may also be arranged in a processor. For example, they may be described as: a processor includes a determination module, an upgrade module, and an inspection module. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves. For example, the determination module may also be described as "a module used to search for an upgrade package stored in the local non-volatile memory of the device when the device is started, and if so, execute the upgrade module, otherwise execute the inspection module".

[0122] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: a method for performing software upgrade by an independent upgrade tool, and the upgrade tool is automatically started when the device is started, and the method includes: when the device is started, searching whether there is an upgrade package stored in the local non-volatile memory of the device; if so, performing software upgrade according to the upgrade package; otherwise, starting the software upgrade check process, until a new upgrade package is detected, downloading the new upgrade package from the server and storing it in the local non-volatile memory of the device, and then notifying the user to restart the device to complete the software upgrade.

[0123] According to the technical solution of the embodiment of the present invention, by using an independent upgrade tool to perform software upgrade, and setting the upgrade tool to start automatically when the device starts, the upgrade tool can perform software upgrade processing when the device starts: if there is an upgrade package on the local non-volatile memory of the device, the software upgrade is directly performed, otherwise the software upgrade check process is started, until a new upgrade package is detected, the new upgrade package is downloaded from the server and saved to the local non-volatile memory of the device, and then the user is notified to restart the device to complete the software upgrade, so that the software upgrade in the scenario of "cannot install the upgrade package online" is realized, and the upgrade package can be installed by starting the device, making the upgrade process safer, avoiding the problem of response confusion caused by the asynchronous state of each software that needs to work together in the same system due to online upgrade, and at the same time, it can also make the construction of the file server more convenient, the upgrade package production is simpler, and the file server maintenance is more convenient. In addition, storing the upgrade package in the local non-volatile memory can ensure that the upgrade package will not be lost after the device is restarted. By adding the group information to which the device belongs in the device identifier, the purpose of group upgrade can be achieved. By starting the upgrade tool with parameters (password), you can configure parameters such as equipment and software related to the upgrade, so as to accurately control the equipment to be upgraded.

[0124] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for software upgrading, characterized in that: The method is performed by an independent upgrade tool, and the upgrade tool is automatically started when the device is started. The method includes: When the device is started, searching whether an upgrade package is stored in the local non-volatile memory of the device; If yes, perform software upgrade according to the upgrade package; Otherwise, start the software upgrade check process until a new upgrade package is detected, download the new upgrade package from the server and store it in the local non-volatile memory of the device, and then notify the user to restart the device to complete the software upgrade; Before starting the software upgrade check process, it also includes: starting the main function program of the device; Furthermore, notifying the user to restart the device to complete the software upgrade includes: notifying the main function program in an inter-process communication manner, and the main function program notifying the user to restart the device to complete the software upgrade; The software upgrade check process includes: obtaining an identifier of a device that does not need to be upgraded from a server; if the identifier is not obtained or the identifier of the device is not included in the obtained identifier, obtaining the highest version number of the upgrade package of the software on the device from the server, and determining whether the highest version number is higher than the current version number of the software on the device; if higher, using the upgrade package with the highest version number as a new upgrade package; The identification of the device includes the group information to which the device belongs; and obtaining the highest version number of the upgrade package of the software on the device from the server includes: obtaining an upgrade package list from the server; searching the upgrade package list for an upgrade package whose name contains the group information to which the device belongs and an upgrade package that does not contain a group field; and obtaining the version number of the upgrade package based on the name of the found upgrade package to determine the highest version number.

2. The method according to claim 1, characterized in that The software upgrade configuration is performed by starting the upgrade tool with parameters.

3. The method according to claim 1, characterized in that Upgrading the software according to the upgrade package includes: The verification code corresponding to the file in the upgrade package is calculated and compared with the preset verification code. When the two are consistent, the upgrade package is installed to perform software upgrade.

4. The method according to claim 1, characterized in that: After the software is upgraded according to the upgrade package, the following steps are also included: Deleting all upgrade packages stored on the device; And, updating the version number of the upgraded software on the device.

5. The method according to claim 1, characterized in that Before starting the software upgrade check process, it also includes: Get the current version number of the software on the device.

6. A software upgrade device, characterized in that: The device is located in an independent upgrade tool, and the upgrade tool is automatically started when the device is started. The device includes: A determination module, used for searching whether an upgrade package is stored in the local non-volatile memory of the device when the device is started, and if so, executing the upgrade module, otherwise executing the check module; The upgrade module is used to perform software upgrade according to the upgrade package; The checking module is used to start the software upgrade checking process, and when a new upgrade package is detected, the new upgrade package is downloaded from the server and stored in the local non-volatile memory of the device, and then the user is notified to restart the device to complete the software upgrade; A program startup module, used to: start the main function program of the device before starting the software upgrade check process; Furthermore, the checking module is further used to: notify the main function program in an inter-process communication manner, and the main function program notifies the user to restart the device to complete the software upgrade; The software upgrade check process includes: obtaining an identifier of a device that does not need to be upgraded from a server; if the identifier is not obtained or the identifier of the device is not included in the obtained identifier, obtaining the highest version number of the upgrade package of the software on the device from the server, and determining whether the highest version number is higher than the current version number of the software on the device; if higher, using the upgrade package with the highest version number as a new upgrade package; The identification of the device includes the group information to which the device belongs; and obtaining the highest version number of the upgrade package of the software on the device from the server includes: obtaining an upgrade package list from the server; searching the upgrade package list for an upgrade package whose name contains the group information to which the device belongs and an upgrade package that does not contain a group field; and obtaining the version number of the upgrade package based on the name of the found upgrade package to determine the highest version number.

7. The device according to claim 6, characterized in that The software upgrade configuration is performed by starting the upgrade tool with parameters.

8. The device according to claim 6, characterized in that The upgrade module is also used for: The verification code corresponding to the file in the upgrade package is calculated and compared with the preset verification code. When the two are consistent, the upgrade package is installed to perform software upgrade.

9. The device according to claim 6, characterized in that Also includes update modules for: After performing software upgrade according to the upgrade package, deleting all upgrade packages stored on the device; And, updating the version number of the upgraded software on the device.

10. The device according to claim 6, characterized in that Also includes acquisition modules for: Before starting the software upgrade check process, obtain the current version number of the software on the device.

11. An electronic device for software upgrade, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

12. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Remote upgrade method and system for automatic drive test systems

    CN103064715A