Software upgrade method, device, equipment and storage medium
By using a combination of encrypted upgrade files and executable files in embedded devices, combined with secure communication protocols, the low efficiency and data security issues of offline upgrades of embedded devices are solved, and reliable upgrade operations and information protection for external personnel are achieved.
Patent Information
- Application Number
- CN202210223836.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-07
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-03-07
AI Technical Summary
Offline upgrade solutions for embedded devices require professional technicians to operate, resulting in low system upgrade efficiency and high labor costs. Online upgrade solutions also face challenges in terms of network dependence and data security.
Using a combination of encrypted upgrade files, executable files, and checkpoint files, it automatically logs into embedded devices through secure communication protocols and completes software upgrades under external personnel operation, ensuring data security and reducing labor costs.
This allows external personnel to upgrade embedded devices while protecting device information from being leaked, reducing upgrade complexity and improving information security.
Smart Images

Figure CN114647426B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of information security, Internet of Things, and information flow technology in computer technology, and in particular to a software upgrading method, apparatus, device, and storage medium. Background Art
[0002] With the rapid development of computer technology and internet applications, the system software in smart devices is often updated at a rapid pace. After a smart device is manufactured or has been used for a period of time, it is often necessary to upgrade its version. To address data security concerns, software upgrades in smart devices, especially embedded devices, are typically performed offline.
[0003] In the related art, offline upgrade solutions for embedded devices involve users copying software upgrade packages to the embedded device via a storage medium such as a USB flash drive and then performing the upgrade. To ensure data security in the embedded device, this offline upgrade solution typically requires specialized technicians, resulting in low system upgrade efficiency and high labor costs. Summary of the Invention
[0004] The present disclosure provides a software upgrade method, apparatus, device, and storage medium.
[0005] According to a first aspect of the present disclosure, there is provided a software upgrade method, comprising:
[0006] Obtain a software upgrade package for the device to be upgraded, the software upgrade package including: an encrypted upgrade file, an executable file, and a checkpoint file;
[0007] Using the login information in the checkpoint file, log in to the device to be upgraded;
[0008] Copying the encrypted upgrade file and the executable file to the device to be upgraded;
[0009] The encrypted upgrade file and the executable file are used to execute a software upgrade process of the device to be upgraded to obtain a software upgrade result.
[0010] According to a second aspect of the present disclosure, there is provided a software upgrading device, comprising:
[0011] An acquisition unit, configured to acquire a software upgrade package for a device to be upgraded, the software upgrade package comprising: an encrypted upgrade file, an executable file, and a checkpoint file;
[0012] A login unit, configured to log in to the device to be upgraded using the login information in the checkpoint file;
[0013] a copying unit, configured to copy the encrypted upgrade file and the executable file to the device to be upgraded;
[0014] The upgrading unit is used to execute the software upgrading process of the device to be upgraded by using the encrypted upgrading file and the executable file to obtain a software upgrading result.
[0015] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0016] at least one processor; and
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect.
[0019] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.
[0020] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising: a computer program, wherein the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program so that the electronic device executes the method described in the first aspect.
[0021] According to the technical solution disclosed in the present invention, the information of the device to be upgraded is protected from being leaked, the complexity of upgrading the device to be upgraded is reduced, and information security is improved.
[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0024] Figure 1 This is a schematic diagram of an application scenario applicable to the embodiments of the present disclosure;
[0025] Figure 2 is a flowchart of a software upgrade method provided by the first embodiment of the present disclosure;
[0026] Figure 3 is a flowchart of a software upgrade method provided by the second embodiment of the present disclosure;
[0027] Figure 4 This is a schematic diagram of the file structure after the encrypted upgrade file is decompressed and decrypted;
[0028] Figure 5 is a flowchart of a software upgrade method provided in the third embodiment of the present disclosure;
[0029] Figure 6 This is a schematic diagram of the file structure after the software upgrade package is decompressed;
[0030] Figure 7 is a flowchart of a software upgrade method provided by the fourth embodiment of the present disclosure;
[0031] Figure 8 is a flowchart of a software upgrade method provided by the fifth embodiment of the present disclosure;
[0032] Figure 9 is a schematic diagram of a security solution in the software upgrade method provided by an embodiment of the present disclosure;
[0033] Figure 10 This is a structural diagram of a software upgrading device provided by an embodiment of the present disclosure;
[0034] Figure 11 is a schematic block diagram of an example electronic device for implementing an embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0036] With the continuous development of science and technology, smart devices are gradually applied to various fields. When the system performance or application performance of smart devices cannot meet user needs, the system software of the smart devices needs to be upgraded.
[0037] An embedded device is a type of smart device that uses an embedded system. It refers to a device that does not use large-capacity storage media and can operate independently. An embedded device consists of hardware and software running on the hardware. The embodiments of this disclosure are explained using the software upgrade of an embedded device.
[0038] In actual applications, since the business software in embedded devices is usually updated quickly, the number of embedded devices produced from the factory is relatively large. Some devices will be stored in the warehouse for a long time before being sold. Or, after the embedded device has been used for a period of time, the software in the embedded device may be outdated. In order to ensure the subsequent normal use of the embedded device, the software in the embedded device needs to be upgraded, and some versions need to be upgraded to the latest version.
[0039] Currently, when embedded devices and other smart devices are connected to the internet, they can use over-the-air (OTA) technology to perform software upgrades. Specifically, the upgrade package is downloaded from the cloud via the network and then the upgrade is performed. However, this solution relies on the network. When the system software of the embedded device changes significantly, it takes a long time to download the upgrade package. In addition, the network operation of the embedded device may also lead to data insecurity issues.
[0040] In addition, in order to ensure data security, some device users may not have the conditions for networking of embedded devices (especially medical institutions, which are very resistant to networking of devices due to data security issues) or when network conditions are poor, they can only adopt offline upgrade solutions. Specifically, users (or external personnel such as agents' engineers) copy the software upgrade package to the embedded device through storage media such as USB flash drives and perform upgrade operations. For example, they can upgrade to the latest version during on-site installation. At this time, it is necessary to consider both the convenience of software upgrade operation and the security of files (the software upgrade package contains core business software and algorithms such as artificial intelligence (AI) models, which cannot be obtained and cracked by outsiders. That is, during the upgrade process, it is necessary to log in to the embedded system before performing related upgrade operations. When logging in to the embedded system, an account and password are required, but the account and password can only be known by internal company personnel and cannot be known to outsiders). Therefore, offline upgrade solutions usually require professional technical personnel to operate, which has the problem of high labor costs.
[0041] In response to the above technical problems, the technical conception process of the embodiment of the present disclosure is as follows: In order to ensure the data security of embedded devices (especially embedded devices in the medical field) during the upgrade process, an offline upgrade solution can be adopted. By loading the upgrade tool software on the host computer, and then using the upgrade tool software to monitor the connection status between the host computer and the embedded device, it automatically logs in to the embedded device based on the secure communication protocol, and finally copies the software upgrade package in the host computer to the embedded device, and executes the upgrade process in the embedded device. In this way, the data security of the embedded device can be guaranteed while allowing external personnel to upgrade the embedded device, while reducing labor costs.
[0042] Based on the above technical concept, the disclosed embodiments provide a software upgrade method. This method obtains a software upgrade package for the device to be upgraded, which includes an encrypted upgrade file, an executable file, and a checkpoint file. The method then uses the login information in the checkpoint file to log in to the device to be upgraded, copies the encrypted upgrade file and the executable file to the device to be upgraded, and finally uses the encrypted upgrade file and the executable file to execute the software upgrade process on the device to be upgraded, obtaining the software upgrade results. This technical solution allows external personnel to upgrade embedded devices while protecting embedded device information from leakage, reducing the complexity of embedded device upgrades, and improving information security.
[0043] The present disclosure provides a software upgrade method, apparatus, device, and storage medium, which are applied to information security, the Internet of Things, and information flow technology in the field of computer technology, so as to reduce the complexity of embedded device upgrades, improve upgrade efficiency, and reduce labor costs on the basis of ensuring embedded device data security.
[0044] It should be noted that the device to be upgraded in this embodiment is not a specific type of device and cannot reflect the information of a specific device. For example, the device to be upgraded in the embodiment of the present disclosure can be any computer that can run the Linux system. The embodiment of the present disclosure takes the device to be upgraded as an embedded device as an example.
[0045] In the embodiments of the present disclosure, the upgrade tool software typically runs on a Windows system. Once the Windows device hosting the upgrade tool software is connected to the device to be upgraded via a network cable, the upgrade tool software can log in to the device to be upgraded via a secure communication protocol and perform certain operations. For example, the secure communication protocol can be a secure shell (SSH) protocol. The upgrade tool software can utilize the SSH protocol to log in from the Windows system to the Linux system and execute commands such as upgrading and copying files.
[0046] It is understandable that the technical solution of the present disclosure can be implemented by coding in multiple languages. For example, the embodiment of the present disclosure uses C++ to write the code. However, the language is only a tool to implement the technical solution. For example, the technical solution of the present disclosure can also be implemented by writing the code in languages such as Java and Python, and the embodiment of the present disclosure does not limit it.
[0047] Accordingly, when the embodiments of the present disclosure are implemented using C++ code, the various files involved in the following embodiments of the present disclosure are commanded according to the naming conventions of the C++ language environment. For example, bdota files, bdota_pre files, ota_bin files, checkpoint files, and update_files, update.sh, MD5.txt, etc. are all written in the C++ language environment. They are also exemplary descriptions and are not limited in this embodiment, and will not be repeated in the following embodiments.
[0048] It should be noted that the software upgrade package in this embodiment and the various files or information included in the software upgrade package are all from public data sets.
[0049] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0050] For example, Figure 1 This is a schematic diagram of an application scenario applicable to the embodiment of the present disclosure. Figure 1 As shown, the application scenario diagram includes: a control device 11 and a device to be upgraded 12.
[0051] In an embodiment of the present disclosure, when the device to be upgraded 12 requires software upgrade, the user can connect the control device 11 to the device to be upgraded 12 via a network cable or a USB cable, so that the control device 11 and the device to be upgraded 12 are physically connected.
[0052] Optionally, the control device 11 stores a software upgrade package of at least one device to be upgraded, and the control device 11 is loaded with upgrade tool software with software upgrade function. When the control device 11 and the device to be upgraded 12 are in a connected state and the upgrade tool software is in an opened state, the user can add the software upgrade package of the device to be upgraded 12 to the upgrade tool software by dragging or selecting, so that the upgrade tool software executes the software upgrade solution provided by the embodiment of the present disclosure.
[0053] In the embodiment of the present disclosure, the control device 11 refers to a computer that can directly issue control commands, which can be called a host computer. The device to be upgraded 12 is a computer that can receive commands from the control device 11 and perform corresponding operations, which can be called a slave computer, for example, an embedded device. In this embodiment, the device that needs to perform software upgrades is the slave computer.
[0054] Optionally, in an embodiment of the present disclosure, the control device 11 can run the upgrade tool software loaded thereon, and the upgrade tool software can automatically log in to the device to be upgraded 12 through a secure communication protocol such as ssh and https, and copy (or copy) the software upgrade package in the control device 11 to the device to be upgraded 12 to execute the software upgrade program.
[0055] Optionally, taking into account security issues and other issues, on the basis of the above-mentioned secure connection protocol, the solution of this embodiment also adds verification processes for each process, such as verification of encrypted upgrade files in the software upgrade package, verification of the copy process, verification of the upgrade process, etc., as well as encryption and decryption of upgrade files and checkpoint files.
[0056] Exemplarily, the control device 11 may be a device with a display function and / or a voice playback function, which can display or play the software upgrade results. Optionally, in this embodiment, if the control device does not have a display function and a voice playback function, the application scenario may also include a display device or a voice playback device.
[0057] It is understandable that Figure 1 The application scenario shown may also include other devices, such as a terminal device, which may be connected to a control device. The control device may push the obtained software upgrade result to the terminal device so that the user may be informed of the software upgrade result in a timely manner.
[0058] It should be noted that the embodiments of this disclosure are not Figure 1 The equipment included is not limited, nor is it Figure 1 The positional relationship between the devices in the Figure 1 When a display device is included, the display function of the display device can be integrated into the control device, that is, the control device can directly display the software upgrade result after obtaining it, etc., which will not be elaborated here.
[0059] In actual applications, since both the terminal device and the server can be devices running the upgrade tool software, Figure 1 The control device in the embodiment can be implemented by a terminal device or a server, and the embodiments of the present disclosure do not limit it. The following explains the software upgrade method executed by the upgrade tool software in the control device.
[0060] The following will be combined with the accompanying drawings to describe in detail the software upgrade solution provided by the embodiments of the present disclosure. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0061] Figure 2FIG. 1 is a flow chart of the software upgrade method provided by the first embodiment of the present disclosure. Figure 2 As shown, the software upgrade method may include the following steps:
[0062] S201: Obtain a software upgrade package for a device to be upgraded, where the software upgrade package includes an encrypted upgrade file, an executable file, and a checkpoint file.
[0063] In this embodiment, when a device needs to undergo a software upgrade, the upgrader can connect the control device and the device to be upgraded via a network cable or USB cable, and when the control device and the device to be upgraded are connected, open the upgrade software tool in the control device. At this time, the upgrade tool software will automatically create two threads. One thread is used to continuously check the connection status between the control device and the device to be upgraded until the software upgrade process of the device to be upgraded is completed. If it is detected that the connection between the control device and the device to be upgraded is disconnected, a pop-up prompt is given through the human-computer interaction interface of the control device (in this case, the control device has a human-computer interaction interface) or a voice prompt is issued (in this case, the control device has a voice playback function); the other thread is used to execute the software upgrade solution provided in the embodiment of the present disclosure.
[0064] Illustratively, in this embodiment, when the control device is connected to the device to be upgraded and the upgrade tool software is open, the upgrade tool software can obtain the software upgrade package selected by the upgrader or added to the upgrade tool software by dragging and dropping.
[0065] It is understandable that in actual applications, the software upgrade package is a compressed package, and the upgrade tool software can obtain the encrypted upgrade file, executable file and checkpoint file by decompressing the compressed package.
[0066] Optionally, in the C++ language environment, the encrypted upgrade file can be expressed as a bdota file, which is a file obtained by encrypting the bdota_pre file. The bdota_pre file is a file generated by packaging all upgrade files, upgrade scripts, and verification files of the device to be upgraded.
[0067] The executable file can be represented as an ota_bin file, which is specifically an executable program that can decrypt and decompress the bdota file to obtain the original upgrade file of the device to be upgraded. Since the public key corresponding to the private key is required for decryption during the decryption process, the public key is stored in the embedded device when it leaves the factory. Therefore, it is ensured that the encrypted upgrade file can only be decrypted in the corresponding device to be upgraded. The encrypted upgrade file cannot be decrypted in other environments, ensuring the security of the encrypted upgrade file.
[0068] The checkpoint file may be expressed as a checkpoint file, which is an encrypted text file that records login information required for logging into the device to be upgraded, verification information required for verifying the encrypted upgrade file, and the like.
[0069] It is understandable that the embodiments of the present disclosure do not limit the encryption method of the encrypted upgrade files and checkpoint files. For example, the encryption method of the encrypted upgrade files and checkpoint files can be symmetric encryption or asymmetric encryption, which is not described here.
[0070] S202: Log in to the device to be upgraded using the login information in the checkpoint file.
[0071] In this embodiment, the checkpoint file records the login information required for logging into the device to be upgraded. Therefore, when the software in the device to be upgraded needs to be upgraded, it is necessary to first log into the device to be upgraded.
[0072] For example, the login information in the checkpoint file may include the account number, password, port number and other information for logging into the device to be upgraded. Therefore, the upgrade tool software can use the account number, password, port number and other information of the device to be upgraded to log in to the embedded device through a secure login protocol to execute subsequent operation processes.
[0073] S203: Copy the encrypted upgrade file and the executable file to the device to be upgraded.
[0074] For example, if you want to upgrade the software in the device to be upgraded, after the upgrade tool software logs in to the device to be upgraded, it needs to copy the encrypted upgrade file and executable file required for the software upgrade to the device to be upgraded.
[0075] Optionally, the upgrade tool software can copy the encrypted upgrade file (bdota file) and executable file (ota_bin file) to the device to be upgraded through a secure copy protocol (including but not limited to secure copy (scp) protocol, etc.) using the account, password, port number and other information of the device to be upgraded.
[0076] S204: Execute the software upgrade process of the device to be upgraded using the encrypted upgrade file and the executable file to obtain a software upgrade result.
[0077] Optionally, in this embodiment, after the upgrade tool software logs in to the device to be upgraded and copies the encrypted upgrade file and executable file required for the upgrade to the device to be upgraded, the software upgrade process of the device to be upgraded can be executed.
[0078] That is, the technical solution of this embodiment allows outsiders to upgrade the equipment to be upgraded. At the same time, the account, password, port number and other login information of the equipment to be upgraded can be protected from being leaked. Therefore, the software upgrade package and upgrade tool software can be open to the outside world, and anyone can obtain the software upgrade package, but cannot obtain the business software, AI algorithm files and other data in the software upgrade package, thereby ensuring data security.
[0079] For example, the encrypted upgrade file is first decompressed or encrypted using an executable file to obtain an upgrade file set and an upgrade script. The software upgrade process can then be executed by running the upgrade script. After the software upgrade process is completed, the software upgrade result is obtained.
[0080] In an embodiment of the present disclosure, a software upgrade package is obtained for the device to be upgraded, comprising an encrypted upgrade file, an executable file, and a checkpoint file. The software upgrade package then uses the login information in the checkpoint file to log in to the device to be upgraded, copy the encrypted upgrade file and the executable file to the device to be upgraded, and finally execute the software upgrade process on the device to be upgraded using the encrypted upgrade file and the executable file to obtain the software upgrade result. This technical solution allows external personnel to upgrade embedded devices while protecting the upgraded device's information from being leaked, reducing the upgrade complexity and improving information security.
[0081] exist Figure 2 Based on the illustrated embodiment, the software upgrade method provided by the embodiment of the present disclosure is introduced in more detail below.
[0082] For example, Figure 3 FIG. 1 is a flow chart of a software upgrade method provided by the second embodiment of the present disclosure. Figure 3 As shown, in the embodiment of the present disclosure, the above S204 can be implemented by the following steps:
[0083] S301: Decompress and decrypt the encrypted upgrade file using an executable file to obtain an upgrade file set, an upgrade script, and a verification file.
[0084] In this embodiment, the upgrade files of the device to be upgraded include business software, AI algorithm models and other information that need to be kept confidential. A bdota_pre file can be generated by packaging all the upgrade files of the device to be upgraded. To prevent outsiders from directly obtaining the upgrade files after decompressing bdota_pre, the encrypted upgrade file is obtained by encrypting the bdota_pre file.
[0085] Accordingly, in the embodiment of the present disclosure, after the upgrade tool software logs into the embedded device through the secure login protocol, it can run the executable file (ota_bin file) to decompress and decrypt the encrypted upgrade file to obtain the upgrade file set, upgrade script and verification file required for the upgrade.
[0086] Exemplarily, in this embodiment, step S301 may include the following steps:
[0087] A1. Run the executable file to decompress and decrypt the encrypted upgrade file.
[0088] A2. During the decompression and decryption process of the encrypted upgrade file, query the device to be upgraded to obtain the public key file of the encrypted upgrade file;
[0089] A3. Use the known private key file to verify the public key file;
[0090] A4. In response to the public key file passing verification and the decompression and decryption process of the encrypted upgrade file being completed, the upgrade file set, upgrade script, and verification file included in the encrypted upgrade file are obtained.
[0091] For example, assuming that the encryption algorithm used to generate the encrypted upgrade file is an asymmetric encryption algorithm, since the asymmetric encryption process involves a public-private key pair, the private key file can be used to sign and encrypt the bdota_pre file to generate a bdota file, and the public key file can be written into the system of the device to be upgraded before the device to be upgraded leaves the factory.
[0092] Accordingly, in this embodiment, when using the executable file to decompress and decrypt the encrypted upgrade file, you can query in the device to be upgraded to find the public key file that has been written into the system at the factory, and use the known private key file to verify the public key file.
[0093] Optionally, after the public key file is verified, the encrypted upgrade file can be decompressed and decrypted. Figure 4 This is a schematic diagram of the file structure after the encrypted upgrade file is decompressed and decrypted. Figure 4 As shown, the encrypted upgrade file 400 is decompressed and decrypted. It can be seen that the encrypted upgrade file 400 includes three parts: an upgrade file set 401, an upgrade script 402 and a verification file 403.
[0094] Optionally, in a C++ language environment, the upgrade file set 401 can be represented by update_files, and the upgrade file set 401 includes: all files required for upgrading the device to be upgraded, such as business software, AI algorithm models and other information.
[0095] The upgrade script 402 may be represented by update.sh, and is used to copy each file in the upgrade file set 401 (update_files) to a specified directory and perform upgrade operations (including but not limited to database operations, deleting or creating folders, modifying file contents, etc.);
[0096] The verification file 403 can be represented by MD5.txt, which is a text file that can specifically include: the verification value of each file in the upgrade file set, for example, recording the md5 values of all files in update_files.
[0097] S302: Run the upgrade script based on the upgrade file set to ensure that each file in the upgrade file set is copied to a designated directory.
[0098] For example, since the function of the upgrade script is to copy each file in the upgrade file set to the specified directory and perform corresponding upgrade operations, when the upgrade tool software runs the upgrade script, it can trigger the operation of copying each file in the upgrade file set to the specified directory.
[0099] S303: Determine the actual checksum of each file in the upgrade file set.
[0100] Optionally, after each file in the upgrade file set is copied to the specified directory, you can verify whether the copying process of each file in the upgrade file set is normal. At this time, you can calculate the actual checksum of each file in the upgrade file set, for example, calculate the md5 value of each file after all files in update_files are copied to the target directory after the upgrade.
[0101] S304: Determine the software upgrade result according to the checksum of each file in the upgrade file set and the theoretical checksum of each file recorded in the checksum file.
[0102] For example, the checksum of each file in the upgrade file set can be compared with the theoretical checksum (md5 value) recorded in the verification file (MD5.txt), and the checksum result (md5 checksum result) can be used as a sign of whether the upgrade is successful.
[0103] For example, if the verification result is failure, the software upgrade result is determined to be an abnormal software upgrade process, and a pop-up reminder is given; if the verification result is success, the software upgrade result is determined to be normal, and subsequent operations are performed.
[0104] In the disclosed embodiments, an executable file is used to decompress and decrypt encrypted upgrade files, resulting in an upgrade file set, an upgrade script, and a verification file. Based on the upgrade file set, the upgrade script is run to ensure that each file in the upgrade file set is copied to a specified directory. The actual verification value of each file in the upgrade file set is then determined. Finally, the software upgrade result is determined based on the verification value of each file in the upgrade file set and the theoretical verification value of each file recorded in the verification file. This technical solution ensures that the encrypted upgrade file can only be decompressed and decrypted in the device to be upgraded and cannot be decrypted in other environments, thus ensuring the security of the upgrade file.
[0105] For example, Figure 5 FIG. 1 is a flow chart of a software upgrade method provided by the third embodiment of the present disclosure. Figure 5 As shown, in an embodiment of the present disclosure, before the above S202, the software upgrade method may further include the following steps:
[0106] S501. Decompress the software upgrade package to obtain an encrypted upgrade file, an executable file, and a checkpoint file.
[0107] In the embodiment of the present disclosure, the software upgrade package is in the form of a compressed package. Therefore, by decompressing the software upgrade package, the encrypted upgrade file, executable file and checkpoint file contained in the software upgrade package can be obtained.
[0108] For example, Figure 6 This is a schematic diagram of the file structure after the software upgrade package is decompressed. Figure 6 As shown, the software upgrade package 600 includes: an encrypted upgrade file 601, an executable file 602 and a checkpoint file 603. The specific functions of the encrypted upgrade file 601, the executable file 602 and the checkpoint file 603 can be found in the above Figure 2 The record in S201 in the illustrated embodiment is not repeated here.
[0109] S502: Use the checkpoint file to verify the encrypted upgrade file to determine the validity of the encrypted upgrade file.
[0110] In this embodiment, the checkpoint file (checkpoint file) can be a symmetrically encrypted text file, which can store the theoretical check value of the encrypted upgrade file (md5 value, to prevent users from generating fake encrypted upgrade files to perform some destructive operations). Therefore, the theoretical check value corresponding to the encrypted upgrade file in the checkpoint file can be used to verify the validity of the encrypted upgrade file.
[0111] Exemplarily, S502 may be implemented through the following steps:
[0112] B1. Decrypt the checkpoint file to obtain the plaintext information in the checkpoint file.
[0113] The plain text information includes: login information, validity period of the software upgrade package, and theoretical checksum of the encrypted upgrade file.
[0114] In this embodiment, a checkpoint file (checkpoint file) records the login information of the device to be upgraded, including the account number, password, and port number. This information is not accessible to external personnel, but the upgrade tool software requires this information to copy files to the device to be upgraded, log in to the device to be upgraded, and perform the upgrade operation. Therefore, the checkpoint file can be obtained using symmetric encryption, and the symmetric encryption key is stored in the upgrade tool software.
[0115] Accordingly, the upgrade tool software can use its own stored key to encrypt the checkpoint file and obtain the decrypted plaintext information of the checkpoint file, which can specifically include: the account, password, and port number required for the upgrade tool software to log in to the device to be upgraded, and record the validity period of the software upgrade package, the theoretical checksum value of the encrypted upgrade file, etc. That is, the decrypted plaintext information of the checkpoint file can be exemplarily explained as follows:
[0116]
[0117] It is understandable that the specific forms of the plaintext information after decryption of the checkpoint file are all exemplary descriptions, which can be determined according to actual conditions and are not limited here.
[0118] B2. Determine whether the software upgrade package is within the validity period.
[0119] For example, in actual applications, each software upgrade package has a certain validity period. Therefore, after obtaining the validity period of the software upgrade package, you can first obtain the current system time of the control device, and then compare the current system time with the validity period of the software upgrade package recorded in the checkpoint file to determine whether the software upgrade package is within the validity period. If it exceeds the validity period, it cannot be used, for example, you need to pay to purchase the software upgrade package again.
[0120] B3. In response to the software upgrade package being within the validity period, determining a first actual checksum value of the encrypted upgrade file.
[0121] B4. Determine the validity of the encrypted upgrade file based on the first actual check value and the theoretical check value of the encrypted upgrade file.
[0122] As an example, if the software upgrade package is within its validity period, the encrypted upgrade file can be verified to be a genuine encrypted upgrade file. In this case, an actual checksum value for the encrypted upgrade file (herein referred to as a first actual checksum value) can be calculated, for example, by calculating the MD5 value of the encrypted upgrade file. This first actual checksum value is then compared with the theoretical checksum value of the encrypted upgrade file recorded in the plaintext information of the checkpoint file to determine whether the two values are consistent. If they are consistent, the encrypted upgrade file is determined to be valid; otherwise, the encrypted upgrade file is determined to be invalid. This prevents users from generating fake encrypted upgrade files and performing destructive operations.
[0123] In this embodiment, when verifying the validity of the encrypted upgrade file, the above S202 can be replaced by the following steps:
[0124] In response to the encrypted upgrade file being valid, the device to be upgraded is logged in using the login information provided by the checkpoint file.
[0125] As an example, if the encrypted upgrade file is determined to be valid, the user can use the login information provided in the checkpoint file, such as the account, password, and port number, to log in to the device to be upgraded. As another example, if the encrypted upgrade file is determined to be invalid, login to the device to be upgraded is stopped, and a message indicating that the encrypted upgrade file is invalid is displayed to promptly notify the upgrade personnel.
[0126] In the disclosed embodiment, the software upgrade package is decompressed to obtain an encrypted upgrade file, an executable file, and a checkpoint file. The encrypted upgrade file is then verified using the checkpoint file to determine the validity of the encrypted upgrade file. That is, the scheme for logging into the device to be upgraded is executed only when the encrypted upgrade file is valid. This can avoid malicious attempts to log into the device to be upgraded, and effectively ensure the data security of the device to be upgraded.
[0127] For example, Figure 7 FIG. 4 is a flow chart of a software upgrade method provided by the fourth embodiment of the present disclosure. Figure 7 As shown, in an embodiment of the present disclosure, before the above S203, the software upgrade method may further include the following steps:
[0128] S701: Determine whether the copying process of the encrypted upgrade file and the executable file is completed.
[0129] In this embodiment, to improve the success rate of the software upgrade process in the device to be upgraded, the upgrade tool software can also verify whether errors occurred during the copying process of the encrypted upgrade file and the executable file after the encrypted upgrade file and the executable file are copied. Therefore, the upgrade tool software first needs to determine whether the copying process of the encrypted upgrade file and the executable file has completed, and then perform a verification of the copying process when the copying process is completed.
[0130] S702: In response to the copy process being completed, calculate a second actual verification value after the encrypted upgrade file is copied to the device to be upgraded.
[0131] As an example, when the upgrade tool software determines that the copying process is complete, the upgrade software tool can use the account, password, and port number obtained after decrypting the checkpoint file to log in to the device to be upgraded through the remote security login protocol, and calculate the second actual verification value (md5 value) after the encrypted upgrade file is copied to the device to be upgraded.
[0132] S703: Determine whether the copying process is normal based on the second actual check value and the theoretical check value of the encrypted upgrade file.
[0133] Exemplarily, the second actual check value can be compared with the theoretical check value of the encrypted upgrade file recorded in the plaintext information of the checkpoint file to determine whether the two are consistent. If they are consistent, it is determined that the copying process is normal; otherwise, it is determined that the copying process is abnormal. Exemplarily, an abnormal prompt message can be output to prevent the software upgrade device from using an abnormal encrypted upgrade file to perform an upgrade operation, thereby improving the success rate of the software upgrade process to a certain extent.
[0134] Accordingly, in this embodiment, the above S204 can be implemented through the following steps:
[0135] In response to the copying process being normal, the encrypted upgrade file and the executable file are used to execute the software upgrade process of the device to be upgraded to obtain a software upgrade result.
[0136] As an example, when it is determined that the copying process is normal, the encrypted upgrade file and the executable file can be used to execute the software upgrade process in the device to be upgraded. For example, the encrypted upgrade file can be decompressed and decrypted using the executable file, and the upgrade script obtained by decompression and decryption can be run to execute the software upgrade process. After the software upgrade process is completed, the software upgrade result is obtained.
[0137] In the disclosed embodiment, the system determines whether the copying process of the encrypted upgrade file and the executable file has completed. When the copying process is complete, it calculates a second actual checksum value after the encrypted upgrade file has been copied to the device to be upgraded. Based on the second actual checksum value and the theoretical checksum value of the encrypted upgrade file, it is determined whether the copying process is normal. Finally, if the copying process is normal, the encrypted upgrade file and the executable file are used to execute the software upgrade process on the device to be upgraded, obtaining the software upgrade result. This technical solution, which executes the software upgrade process when the copying process is normal, can improve the success rate of software upgrades and reduce the complexity of upgrading the device to be upgraded.
[0138] Optionally, in a possible example of the present disclosure, the software upgrade method may further include the following steps:
[0139] C1. Based on the above software upgrade result, determine whether the software upgrade process of the device to be upgraded is completed.
[0140] C2. In response to the completion of the software upgrade process of the device to be upgraded, detecting whether the running status of each service in the device to be upgraded is normal.
[0141] C3. In response to the running status of each service in the device to be upgraded being normal, outputting an upgrade success prompt.
[0142] As can be seen from the above embodiments, the software upgrade result is whether the software upgrade process is normal or abnormal. Therefore, whether the software upgrade process of the device to be upgraded is completed can be determined based on the software upgrade result.
[0143] As an example, when the software upgrade result indicates an abnormal software upgrade process, an incomplete software upgrade process is determined for the device to be upgraded, and a notification of an incomplete upgrade process can be generated and issued. Optionally, if the control device has a human-computer interaction interface, an upgrade failure notification can be displayed on the human-computer interaction interface. If the control device has a voice playback function, the upgrade failure notification can be played through the voice playback function.
[0144] As another example, when the software upgrade result is that the software upgrade process is normal, it is determined that the software upgrade process of the device to be upgraded is completed. At this time, it can be judged whether the software upgrade process is successful. For example, whether the software upgrade process is successful can be determined by detecting whether the operating status of each service in the device to be upgraded is normal.
[0145] Optionally, if all services in the device to be upgraded are running normally, the software upgrade process is determined to be successful and a prompt of successful upgrade is given. If there are services in the device to be upgraded that are running abnormally (abnormally), an upgrade failure prompt is displayed on the human-computer interaction interface (in this case, the control device has a human-computer interaction interface) and / or an upgrade failure prompt is played through the voice playback function (in this case, the control device has a voice playback function).
[0146] It can be understood that the technical solutions provided by the embodiments of the present disclosure are all automatically executed by the upgrade tool software in the control device. When the checkpoint file is symmetrically encrypted and the encryption and decryption keys are stored in the upgrade tool software, considering that there are certain security risks if the upgrade tool software is decompiled or cracked, the upgrade tool software can be protected by virtualization, shell and other software protection methods at this time, so that the upgrade tool software can be run directly, but decompilation and cracking become extremely difficult. This can avoid the problem of the decryption key of the checkpoint file being leaked after the upgrade tool software is cracked, thereby avoiding the problem of the account, password, port number and other login information of the device to be upgraded being leaked, thereby ensuring the data security of the device to be upgraded.
[0147] Based on the technical solutions provided by the above embodiments of the present disclosure, a detailed description of the software upgrade process of the device to be upgraded is given below.
[0148] For example, Figure 8 FIG. 5 is a flow chart of a software upgrade method provided by the fifth embodiment of the present disclosure. Figure 8 As shown, the process of the software upgrade method may include: a login and connection part 801, a decompression and verification part 802, an upload and upgrade part 803 and a status check part 804.
[0149] The login and connection part 801 may include the following steps:
[0150] S8011, account login.
[0151] When the device to be upgraded needs to be upgraded, the user can open the upgrade tool software through the user interaction interface of the control device after confirming that the device to be upgraded is in a physically connected state, log in to the upgrade tool software using login information such as account number, password and port number, and execute S8012 after verification.
[0152] S8012. Enter the upgrade tool software interface.
[0153] S8013. Continuously check the device connection status.
[0154] In this step, the upgrade tool software continuously checks the device connection status (at this time, the device to be upgraded and the control device are in a connected state), and then executes S8014 and S8021 respectively.
[0155] S8014. Check whether the device is connected successfully; if so, execute S8015 and then execute S8014; if not, execute S8016.
[0156] S8015, delay preset duration.
[0157] Exemplarily, the preset duration may be 1 second, 2 seconds or other durations, which is not limited in this embodiment.
[0158] S8016, output status reminder.
[0159] Optionally, the decompression and verification part 802 may include the following steps:
[0160] S8021. Determine the selected software upgrade package;
[0161] S8022, decompress the software upgrade package;
[0162] S8023, decrypt the checkpoint file to memory;
[0163] S8024. Verify whether the MD5 and validity period in the encrypted upgrade file meet the requirements. If so, execute S8031; if not, execute S8025.
[0164] S8025, output status reminder.
[0165] Optionally, the upload and upgrade part 803 may include the following steps:
[0166] S8031. Upload the encrypted upgrade file and executable file to the device to be upgraded.
[0167] S8032. Determine whether the MD5 verification of the encrypted upgrade file passes. If so, execute S8033 to S8035; if not, execute S8036.
[0168] S8033. Decompress and decrypt the encrypted upgrade file;
[0169] S8034, execute the upgrade script;
[0170] S8035: Determine whether the upgrade is complete. If so, go to S8041; if not, go to S8036.
[0171] S8036, output status reminder.
[0172] Optionally, the status checking portion 804 may include the following steps:
[0173] S8041. Determine whether the status of each service of the device to be upgraded is normal. If so, execute S8042; if not, execute S8043.
[0174] S8042, output upgrade success prompt;
[0175] S8043, output status reminder.
[0176] It is understandable that the specific implementation of each step in this embodiment can be found in the records of the above embodiments, and will not be repeated here.
[0177] Optionally, based on the above embodiments, Figure 9 This is a schematic diagram of the security solution in the software upgrade method provided by the embodiment of the present disclosure. Figure 9 As shown, in this embodiment, the software upgrade package 91 may include: an encrypted upgrade file 911 , an executable file 912 , and a checkpoint file 913 .
[0178] In this case, based on the asymmetric key B, the encrypted upgrade file 911 can be decompressed and decrypted using the executable file 912 to obtain the upgrade file set 9111, the upgrade script 9112, and the verification file 9113. It can be understood that in this embodiment, the encrypted upgrade file 911 is obtained using an asymmetric encryption algorithm.
[0179] The checkpoint file 913 can be decrypted using the symmetric key A to obtain the plaintext information of the checkpoint file 913, such as login information 9131, validity period 9132 of the software upgrade package, and theoretical checksum 9133 of the encrypted upgrade file.
[0180] The software upgrade package 91 can be executed by the plaintext upgrade tool software 92. However, in order to prevent the plaintext upgrade tool software from being cracked, the encrypted upgrade tool software 93 can be obtained by virtualization or packaging.
[0181] Understandable, Figure 9 The schematic diagram shown only provides a processing solution for ensuring data security during the software upgrade process. For the specific process of the solution, please refer to the description in the above embodiment and will not be repeated here.
[0182] Figure 10 This is a schematic diagram of the structure of a software upgrade device provided by an embodiment of the present disclosure. The software upgrade device provided by this embodiment can be Figure 1 The control device in the control device or the device in the control device. Figure 10 As shown, the software upgrade device 1000 provided in the embodiment of the present disclosure may include:
[0183] The acquisition unit 1001 is configured to acquire a software upgrade package for a device to be upgraded, wherein the software upgrade package includes an encrypted upgrade file, an executable file, and a checkpoint file.
[0184] A login unit 1002 is configured to log in to the device to be upgraded using the login information in the checkpoint file;
[0185] The copying unit 1003 is configured to copy the encrypted upgrade file and the executable file to the device to be upgraded;
[0186] The upgrading unit 1004 is configured to execute a software upgrading process of the device to be upgraded using the encrypted upgrading file and the executable file to obtain a software upgrading result.
[0187] In a possible implementation of the present disclosure, the upgrading unit 1004 includes:
[0188] A parsing module, configured to decompress and decrypt the encrypted upgrade file using the executable file to obtain an upgrade file set, an upgrade script, and a verification file;
[0189] A running module, configured to run the upgrade script based on the upgrade file set, and determine whether each file in the upgrade file set is copied to a designated directory;
[0190] A calculation module, configured to determine an actual checksum value of each file in the upgrade file set;
[0191] The verification module is used to determine the software upgrade result according to the verification value of each file in the upgrade file set and the theoretical verification value of each file recorded in the verification file.
[0192] Wherein, the analysis module includes:
[0193] An execution submodule, configured to execute a decompression and decryption process of the encrypted upgrade file by running the executable file;
[0194] An acquisition submodule, configured to query the device to be upgraded during the decompression and decryption of the encrypted upgrade file to obtain a public key file of the encrypted upgrade file;
[0195] A verification submodule, used to verify the public key file using a known private key file;
[0196] The determination submodule is configured to obtain an upgrade file set, an upgrade script, and a verification file included in the encrypted upgrade file in response to the public key file verification passing and the decompression and decryption process of the encrypted upgrade file being completed.
[0197] In one possible implementation of the present disclosure, the software upgrading apparatus further includes:
[0198] a decompression unit (not shown), configured to decompress the software upgrade package to obtain the encrypted upgrade file, the executable file, and the checkpoint file;
[0199] a first verification unit (not shown), configured to verify the encryption upgrade file using the checkpoint file to determine the validity of the encryption upgrade file;
[0200] The login unit 1002 is specifically configured to log in to the device to be upgraded using the login information provided by the checkpoint file in response to the encrypted upgrade file being valid.
[0201] The first verification unit includes:
[0202] A decryption module, configured to decrypt the checkpoint file and obtain plaintext information in the checkpoint file, wherein the plaintext information includes: login information, the validity period of the software upgrade package, and a theoretical checksum value of the encrypted upgrade file;
[0203] A determination module, configured to determine whether the software upgrade package is within its validity period;
[0204] a calculation module, configured to determine a first actual checksum value of the encrypted upgrade file in response to the software upgrade package being within a validity period;
[0205] The verification module is used to determine the validity of the encryption upgrade file according to the first actual verification value and the theoretical verification value of the encryption upgrade file.
[0206] In one possible implementation of the present disclosure, the apparatus further includes:
[0207] a first determining unit (not shown), configured to determine whether the copying process of the encrypted upgrade file and the executable file is completed;
[0208] a calculation unit (not shown), configured to calculate, in response to the completion of the copying process, a second actual checksum value after the encrypted upgrade file is copied to the device to be upgraded;
[0209] a second verification unit (not shown), configured to determine whether the copying process is normal based on the second actual verification value and the theoretical verification value of the encrypted upgrade file;
[0210] The upgrading unit 1004 is specifically configured to, in response to the copying process being normal, execute a software upgrading process of the device to be upgraded using the encrypted upgrading file and the executable file to obtain a software upgrading result.
[0211] In one possible implementation of the present disclosure, the apparatus further includes:
[0212] A second determining unit is configured to determine whether the software upgrade process of the device to be upgraded is completed based on the software upgrade result;
[0213] a detection unit, configured to detect whether the running status of each service in the device to be upgraded is normal in response to the completion of the software upgrade process of the device to be upgraded;
[0214] The output unit is configured to output an upgrade success prompt in response to the running status of each service in the device to be upgraded being normal.
[0215] The software upgrade device provided in this embodiment can be used to execute the software upgrade method performed by the control device in any of the above method embodiments. Its implementation principles and technical effects are similar and will not be described in detail here.
[0216] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0217] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.
[0218] Figure 11 is a schematic block diagram of an example electronic device used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0219] like Figure 11 As shown, the device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a random access memory (RAM) 1103. Various programs and data required for the operation of the device 1100 can also be stored in the RAM 1103. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0220] Various components in device 1100 are connected to I / O interface 1105, including an input unit 1106, such as a keyboard and mouse; an output unit 1107, such as various types of displays and speakers; a storage unit 1108, such as a magnetic disk and optical disk; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. Communication unit 1109 allows device 1100 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0221] The computing unit 1101 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1101 performs the various methods and processes described above, such as the software upgrade method. For example, in some embodiments, the software upgrade method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 1108. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 1100 via the ROM 1102 and / or the communication unit 1109. When the computer program is loaded into the RAM 1103 and executed by the computing unit 1101, one or more steps of the software upgrade method described above can be performed. Alternatively, in other embodiments, the computing unit 1101 can be configured to perform the software upgrade method by any other appropriate means (e.g., by means of firmware).
[0222] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0223] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0224] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, 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 foregoing.
[0225] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0226] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0227] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.
[0228] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0229] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A software upgrade method, comprising: Obtain a software upgrade package for the device to be upgraded, the software upgrade package including: an encrypted upgrade file, an executable file, and a checkpoint file; Using the login information in the checkpoint file, log in to the device to be upgraded; Copying the encrypted upgrade file and the executable file to the device to be upgraded; Executing a software upgrade process of the device to be upgraded using the encrypted upgrade file and the executable file to obtain a software upgrade result; The method of executing the software upgrade process of the device to be upgraded by using the encrypted upgrade file and the executable file to obtain a software upgrade result includes: Decompressing and decrypting the encrypted upgrade file using the executable file to obtain an upgrade file set, an upgrade script, and a verification file; A software upgrade result is obtained according to the upgrade file set, the upgrade script and the verification file.
2. The method according to claim 1, wherein The step of executing the software upgrade process of the device to be upgraded by using the encrypted upgrade file and the executable file to obtain a software upgrade result further includes: Based on the upgrade file set, running the upgrade script to ensure that each file in the upgrade file set is copied to a designated directory; Determining an actual checksum value of each file in the upgrade file set; The software upgrade result is determined according to the checksum of each file in the upgrade file set and the theoretical checksum of each file recorded in the checksum file.
3. The method according to claim 2, wherein: The encrypted upgrade file is decompressed and decrypted using the executable file to obtain an upgrade file set, an upgrade script, and a verification file, including: By running the executable file, the decompression and decryption process of the encrypted upgrade file is performed; During the decompression and decryption process of the encrypted upgrade file, querying in the device to be upgraded to obtain a public key file of the encrypted upgrade file; Using a known private key file, verify the public key file; In response to the public key file passing verification and the decompression and decryption process of the encrypted upgrade file being completed, the upgrade file set, upgrade script and verification file included in the encrypted upgrade file are obtained.
4. The method according to any one of claims 1 to 3, before logging into the device to be upgraded using the login information in the checkpoint file, further comprising: Decompressing the software upgrade package to obtain the encrypted upgrade file, the executable file, and the checkpoint file; Verifying the encrypted upgrade file using the checkpoint file to determine the validity of the encrypted upgrade file; The step of logging into the device to be upgraded by using the login information in the checkpoint file includes: In response to the encrypted upgrade file being valid, the device to be upgraded is logged in using the login information provided by the checkpoint file.
5. The method according to claim 4, wherein The verifying the encrypted upgrade file by using the checkpoint file to determine the validity of the encrypted upgrade file includes: Decrypting the checkpoint file to obtain plaintext information in the checkpoint file, the plaintext information including: login information, the validity period of the software upgrade package, and a theoretical checksum value of the encrypted upgrade file; Determining whether the software upgrade package is within its validity period; In response to the software upgrade package being within a validity period, determining a first actual checksum value of the encrypted upgrade file; The validity of the encryption upgrade file is determined according to the first actual check value and the theoretical check value of the encryption upgrade file.
6. The method according to any one of claims 1 to 3 and 5, further comprising, after copying the encrypted upgrade file and the executable file to the device to be upgraded: Determining whether the copying process of the encrypted upgrade file and the executable file is completed; In response to the copying process being completed, calculating a second actual check value after the encrypted upgrade file is copied to the device to be upgraded; determining whether the copying process is normal according to the second actual check value and the theoretical check value of the encrypted upgrade file; The method of executing the software upgrade process of the device to be upgraded by using the encrypted upgrade file and the executable file to obtain a software upgrade result includes: In response to the copying process being normal, the software upgrade process of the device to be upgraded is executed using the encrypted upgrade file and the executable file to obtain a software upgrade result.
7. The method according to any one of claims 1 to 3 or 5, further comprising: Based on the software upgrade result, determining whether the software upgrade process of the device to be upgraded is completed; In response to the completion of the software upgrade process of the device to be upgraded, detecting whether the running status of each service in the device to be upgraded is normal; In response to the running status of each service in the device to be upgraded being normal, an upgrade success prompt is output.
8. A software upgrade device, comprising: An acquisition unit, configured to acquire a software upgrade package for a device to be upgraded, the software upgrade package comprising: an encrypted upgrade file, an executable file, and a checkpoint file; A login unit, configured to log in to the device to be upgraded using the login information in the checkpoint file; a copying unit, configured to copy the encrypted upgrade file and the executable file to the device to be upgraded; An upgrading unit, configured to execute a software upgrading process of the device to be upgraded using the encrypted upgrading file and the executable file, and obtain a software upgrading result; The upgrade unit includes a parsing module, which is used to decompress and decrypt the encrypted upgrade file using the executable file to obtain an upgrade file set, an upgrade script and a verification file; The upgrade unit is further configured to obtain a software upgrade result based on the upgrade file set, the upgrade script, and the verification file.
9. The device according to claim 8, wherein The upgrading unit further includes: A running module, configured to run the upgrade script based on the upgrade file set, and determine whether each file in the upgrade file set is copied to a designated directory; A calculation module, configured to determine an actual checksum value of each file in the upgrade file set; The verification module is used to determine the software upgrade result according to the verification value of each file in the upgrade file set and the theoretical verification value of each file recorded in the verification file.
10. The device according to claim 9, wherein The parsing module includes: An execution submodule, configured to execute a decompression and decryption process of the encrypted upgrade file by running the executable file; An acquisition submodule, configured to query the device to be upgraded during the decompression and decryption of the encrypted upgrade file to obtain a public key file of the encrypted upgrade file; A verification submodule, used to verify the public key file using a known private key file; The determination submodule is configured to obtain an upgrade file set, an upgrade script, and a verification file included in the encrypted upgrade file in response to the public key file verification passing and the decompression and decryption process of the encrypted upgrade file being completed.
11. The apparatus according to any one of claims 8 to 10, further comprising: a decompression unit, configured to decompress the software upgrade package to obtain the encrypted upgrade file, the executable file, and the checkpoint file; a first verification unit, configured to verify the encryption upgrade file using the checkpoint file to determine the validity of the encryption upgrade file; The login unit is specifically configured to log in to the device to be upgraded using the login information provided by the checkpoint file in response to the encrypted upgrade file being valid.
12. The device according to claim 11, wherein The first verification unit includes: A decryption module, configured to decrypt the checkpoint file and obtain plaintext information in the checkpoint file, wherein the plaintext information includes: login information, the validity period of the software upgrade package, and a theoretical checksum value of the encrypted upgrade file; A determination module, configured to determine whether the software upgrade package is within its validity period; a calculation module, configured to determine a first actual checksum value of the encrypted upgrade file in response to the software upgrade package being within a validity period; The verification module is used to determine the validity of the encryption upgrade file according to the first actual verification value and the theoretical verification value of the encryption upgrade file.
13. The apparatus according to any one of claims 8 to 10 or 12, further comprising: a first determining unit, configured to determine whether the copying process of the encrypted upgrade file and the executable file is completed; a calculation unit, configured to calculate, in response to the completion of the copying process, a second actual checksum value after the encrypted upgrade file is copied to the device to be upgraded; a second verification unit, configured to determine whether the copying process is normal according to the second actual verification value and a theoretical verification value of the encryption upgrade file; The upgrading unit is specifically configured to, in response to the copying process being normal, execute the software upgrading process of the device to be upgraded using the encrypted upgrading file and the executable file to obtain a software upgrading result.
14. The device according to any one of claims 8 to 10 or 12, further comprising: A second determining unit is configured to determine whether the software upgrade process of the device to be upgraded is completed based on the software upgrade result; a detection unit, configured to detect whether the running status of each service in the device to be upgraded is normal in response to the completion of the software upgrade process of the device to be upgraded; The output unit is configured to output an upgrade success prompt in response to the running status of each service in the device to be upgraded being normal.
15. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.
17. A computer program product comprising a computer program, which implements the steps of the method according to any one of claims 1 to 7 when the computer program is executed by a processor.
Citation Information
Patent Citations
USB interface-based unmanned ship system automatic upgrading method
CN107943530A
Realization method of one-key upgrading of host-standby board cards under Linux system
CN108600031A