A system upgrade method, device and storage medium for different network environments

By uploading the upgrade packages simultaneously by physical machines and using the server's target tools to automatically judge and execute system upgrades, the problems of errors and low efficiency during the system upgrade process in the existing technology are solved, and higher accuracy and efficiency are achieved.

CN118945175BActive Publication Date: 2025-04-25GUANGZHOU BAOLUN ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410994067.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2025-04-25
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

In the prior art, files need to be uploaded and downloaded manually during the system upgrade process, which is prone to errors and may cause delays when network problems or personnel cannot access the system, resulting in poor upgrade efficiency.

Method used

Upload the upgrade package to the server simultaneously through a physical machine, and use the server's target tool to determine whether to upgrade the system based on the upgrade package version number. If necessary, automatically upgrade the system.

Benefits of technology

Reduces manual errors, improves the accuracy and efficiency of system upgrades, and improves scalability and traceability by recording version numbers and execution information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945175B_ABST
    Figure CN118945175B_ABST
Patent Text Reader

Abstract

The present application discloses a system upgrade method, device and storage medium in different network environments, belonging to the field of computer technology. The method comprises: when it is detected that a physical machine has uploaded an upgrade package in a target directory of a server, obtaining a version number of the upgrade package; comparing the version number of the upgrade package with a historical version number to determine whether to perform a system upgrade; wherein the upgrade package is generated by a user by packaging a target file on a cloud desktop, and the cloud desktop is transferred to the physical machine so that the physical machine synchronizes the upgrade package to the target directory of the server; the cloud desktop is in a first network environment; the physical machine and the server are in a second network environment; if a system upgrade is performed, a target tool is deployed, and the upgrade package is loaded using the target tool; according to the version number of the upgrade package, a corresponding first Docker image is run to start a service container for a system upgrade; the accuracy and efficiency of the system upgrade are improved by synchronizing the upgrade package with the physical machine and automatically performing a system upgrade on the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a system upgrade method, device and storage medium for different network environments. Background Art

[0002] In the prior art, users upload files (such as upgrade packages) on the intranet (such as cloud desktop), and the cloud desktop downloads and transfers the upgrade packages to the physical machine; users manually upload the upgrade packages to the server that needs to be upgraded on the physical machine, and the server performs system upgrades based on the received upgrade packages. In this process, files need to be manually uploaded and downloaded, and the error rate is high, such as selecting the wrong file, interrupting the upload / download operation, etc. In addition, if there is a problem with the network during the upload or download process, or the personnel cannot access the system, the upgrade process may be delayed, and the system upgrade and upgrade efficiency are poor. Summary of the invention

[0003] The present application provides a system upgrade method, device and storage medium for different network environments, which improves the accuracy and efficiency of system upgrades by synchronizing upgrade packages with physical machines and automatically upgrading the system on servers.

[0004] This application provides a system upgrade method for different network environments, including:

[0005] When it is detected that the physical machine has uploaded an upgrade package in the target directory of the server, the version number of the upgrade package is obtained; the version number of the upgrade package is compared with the historical version number to determine whether to perform a system upgrade;

[0006] The upgrade package is generated by the user by packaging the target file on the cloud desktop, and the cloud desktop is transferred to the physical machine, so that the physical machine synchronizes the upgrade package to the target directory of the server; the cloud desktop is in a first network environment; the physical machine and the server are in a second network environment;

[0007] If a system upgrade is performed, a target tool is deployed, and the upgrade package is loaded using the target tool; according to the version number of the upgrade package, the corresponding first Docker image is run to start the service container for system upgrade.

[0008] Furthermore, the version number of the upgrade package is compared with the historical version number to determine whether to perform a system upgrade, specifically:

[0009] Obtaining a historical version number in the target file, wherein the historical version number is recorded in the target file after the historical version is successfully upgraded;

[0010] Compare the version number of the upgrade package with the historical version number;

[0011] If the version number of the upgrade package is greater than the historical version number, then determine to perform a system upgrade;

[0012] If the version number of the upgrade package is less than or equal to the historical version number, it is determined not to perform the system upgrade.

[0013] Furthermore, the target tool is used to define, configure and manage a number of containerized services, and when loading an upgrade package, a corresponding Docker image is configured according to the version number of the upgrade package.

[0014] Further, according to the version number of the upgrade package, after running the corresponding first Docker image to start the service container for system upgrade, it also includes:

[0015] When the first status code returned by the target tool is received, it is determined that the system upgrade is successful; and the version number of the upgrade package is recorded in the target file.

[0016] Further, according to the version number of the upgrade package, after running the corresponding first Docker image to start the service container for system upgrade, it also includes:

[0017] When the second status code returned by the target tool is received, it is determined that the system upgrade has failed; and the execution information and the information of the upgrade package are recorded in the work log.

[0018] As a preferred solution, this application automatically synchronizes the upgrade package to the server by deploying the synchronization function of the physical machine, and uses the server's target tool to determine whether an upgrade is required based on the upgrade package version number. If so, an automatic system upgrade is performed, which reduces manual errors and improves the accuracy and efficiency of system upgrades. At the same time, this application records the version number, upgrade package information, and execution information, improving the scalability and traceability of the entire upgrade process.

[0019] Accordingly, the present application also provides a system upgrade device for different network environments, including: a judgment module and an upgrade module;

[0020] The judgment module is used to obtain the version number of the upgrade package when it is detected that the physical machine has uploaded the upgrade package in the target directory of the server; compare the version number of the upgrade package with the historical version number to determine whether to perform a system upgrade;

[0021] The upgrade package is generated by the user by packaging the target file on the cloud desktop, and is transferred from the cloud desktop to the physical machine, so that the physical machine synchronizes the upgrade package to the target directory of the server; the cloud desktop is in a first network environment; the physical machine and the server are in a second network environment;

[0022] The upgrade module is used to deploy a target tool if a system upgrade is performed, and use the target tool to load the upgrade package; according to the version number of the upgrade package, run the corresponding first Docker image to start the service container for system upgrade;

[0023] After detecting that the system upgrade is successful, deleting the upgrade package and deleting the second Docker image;

[0024] The version number corresponding to the second Docker image is smaller than the version number of the upgrade package.

[0025] Further, the judgment module includes: a comparison unit and an upgrade judgment unit;

[0026] The comparison unit is used to obtain a historical version number in the target file, and the historical version number is recorded in the target file after the historical version is successfully upgraded;

[0027] Compare the version number of the upgrade package with the historical version number;

[0028] The upgrade judgment unit is used to determine to perform a system upgrade if the version number of the upgrade package is greater than the historical version number;

[0029] If the version number of the upgrade package is less than or equal to the historical version number, it is determined not to perform the system upgrade.

[0030] Further, the upgrade module includes a configuration unit;

[0031] The configuration unit is used to configure a corresponding Docker image according to the version number of the upgrade package when loading the upgrade package using the target tool;

[0032] The target tool is used to define, configure and manage a number of containerized services.

[0033] Furthermore, the upgrade module further includes: a success processing unit and a failure processing unit;

[0034] The success processing unit is used to determine that the system upgrade is successful when receiving the first status code returned by the target tool; and record the version number of the upgrade package in the target file;

[0035] The failure processing unit is used to determine that the system upgrade fails when receiving the second status code returned by the target tool; and record the execution information and the information of the upgrade package in the work log;

[0036] Delete the upgrade package and delete the second Docker image;

[0037] The version number corresponding to the second Docker image is smaller than the version number of the upgrade package.

[0038] Accordingly, the present application also provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute a system upgrade method for different network environments as described in the content of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flowchart of an embodiment of a system upgrade method for different network environments provided by the present application;

[0040] Figure 2 It is a structural diagram of an embodiment of a system upgrade device for different network environments provided by the present application. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0042] Embodiment 1

[0043] Please refer to Figure 1 , a system upgrade method for different network environments provided in an embodiment of the present application, comprising steps S101-S102:

[0044] Step S101: when it is detected that the physical machine has uploaded an upgrade package in the target directory of the server, the version number of the upgrade package is obtained; the version number of the upgrade package is compared with the historical version number to determine whether to perform a system upgrade;

[0045] The upgrade package is generated by the user by packaging the target file on the cloud desktop, and is transferred from the cloud desktop to the physical machine, so that the physical machine synchronizes the upgrade package to the target directory of the server; the cloud desktop is in a first network environment; the physical machine and the server are in a second network environment;

[0046] Step S102: If a system upgrade is to be performed, a target tool is deployed, and the upgrade package is loaded using the target tool; according to the version number of the upgrade package, a corresponding first Docker image is run to start a service container for system upgrade.

[0047] In some preferred embodiments, a script dep l oy.sh is written to execute the system upgrade method in different network environments, and a scheduled task is set to execute the dep l oy.sh script once every minute to timely detect new update packages and upgrade them for use.

[0048] In some preferred embodiments, the user packages the target file on the cloud desktop to generate an upgrade package, and the cloud desktop automatically transfers the upgrade package to the physical machine.

[0049] The physical machine synchronizes the upgrade package to the target directory of the server, specifically:

[0050] Traverse all compressed files in the source folder of the upgrade package and obtain the file names of all compressed files;

[0051] It is determined in turn whether there is a file name identical to that of each compressed file in the synchronization log. If so, scp is executed to synchronize the current compressed file to the target directory of the server.

[0052] If it does not exist, skip the synchronization operation of the current file.

[0053] If the scp is executed successfully, the file name of the compressed file is recorded in the synchronization log. If the scp fails, the synchronization failure information is recorded.

[0054] In some preferred embodiments, the first network environment is an intranet, the second network environment is an extranet, the cloud desktop transfers the upgrade package to a specified directory of a Windows physical machine in the extranet, such as D:\Users\guowf\AppData\Loca l\ifts. The physical machine scps the upgrade package to a specified directory on the server, such as / usr / loca l / huoke.

[0055] Furthermore, the version number of the upgrade package is compared with the historical version number to determine whether to perform a system upgrade, specifically:

[0056] Obtaining a historical version number in the target file, wherein the historical version number is recorded in the target file after the historical version is successfully upgraded;

[0057] Compare the version number of the upgrade package with the historical version number;

[0058] If the version number of the upgrade package is greater than the historical version number, then determine to perform a system upgrade;

[0059] If the version number of the upgrade package is less than or equal to the historical version number, it is determined not to perform the system upgrade.

[0060] In some preferred embodiments, the target file is version.txt, which records the version number of the currently successfully upgraded upgrade package, and is recorded after the upgrade package is successfully upgraded and the old image is deleted. When comparing the version number of the upgrade package with the historical version number, the first version number of the current upgrade package in version.txt is read and compared with the second version number of the upgrade package detected in the / usr / loca l / huoke directory to determine whether an upgrade is required.

[0061] For example, the web-server version number recorded in version.txt is 10, but the upgrade package version number detected in the / usr / logal / huoke directory is 9, so no upgrade operation is required.

[0062] Furthermore, the target tool is used to define, configure and manage a number of containerized services, and when loading an upgrade package, a corresponding Docker image is configured according to the version number of the upgrade package.

[0063] In some preferred embodiments, the target tool is Docker Compose, which is a management tool. After the Docker Compose tool is deployed, the Docker Compose tool can be used to define, configure, and manage multiple Docker containerized services so as to run and manage them as a whole application.

[0064] Further, according to the version number of the upgrade package, after running the corresponding first Docker image to start the service container for system upgrade, it also includes:

[0065] When the first status code returned by the target tool is received, it is determined that the system upgrade is successful; and the version number of the upgrade package is recorded in the target file.

[0066] In some preferred embodiments, a status code will be returned when deploying using docker composer. When the status code is not equal to 0, it means that the deployment has failed. When the status code is equal to 0, it means that the deployment has been successful, thereby determining whether the system has been upgraded successfully.

[0067] Further, according to the version number of the upgrade package, after running the corresponding first Docker image to start the service container for system upgrade, it also includes:

[0068] When receiving the second status code returned by the target tool, determining that the system upgrade has failed; recording the execution information and the information of the upgrade package in the work log;

[0069] Delete the upgrade package and delete the second Docker image;

[0070] The version number corresponding to the second Docker image is smaller than the version number of the upgrade package.

[0071] In some preferred embodiments, if the system upgrade fails, the dep l oy.sh script execution information and upgrade package information are recorded in the work log.

[0072] In some preferred embodiments, each image will correspond to a version number (corresponding to the version number of the upgrade package), and the image to be deleted is determined by the corresponding version number. If the system is upgraded successfully, the old version, that is, the image corresponding to the smaller version number, is deleted.

[0073] Implementing the embodiments of the present application has the following effects:

[0074] This application automatically synchronizes the upgrade package to the server through the physical machine SPC synchronization method, and uses the server's target tool to determine whether an upgrade is required based on the upgrade package version number. If so, an automatic system upgrade is performed, which reduces manual errors and improves the accuracy and efficiency of system upgrades. At the same time, this application records the version number, upgrade package information, and execution information, improving the scalability and traceability of the entire upgrade process.

[0075] Embodiment 2

[0076] Please refer to Figure 2 , a system upgrade device for different network environments provided by an embodiment of the present application, comprising: a judgment module 201 and an upgrade module 202;

[0077] The judgment module 201 is used to obtain the version number of the upgrade package when it is detected that the physical machine has uploaded the upgrade package in the target directory of the server; compare the version number of the upgrade package with the historical version number to determine whether to perform a system upgrade;

[0078] The upgrade package is generated by the user by packaging the target file on the cloud desktop, and is transferred from the cloud desktop to the physical machine, so that the physical machine synchronizes the upgrade package to the target directory of the server; the cloud desktop is in a first network environment; the physical machine and the server are in a second network environment;

[0079] The upgrade module 202 is used to deploy a target tool if a system upgrade is performed, and use the target tool to load the upgrade package; according to the version number of the upgrade package, run the corresponding first Docker image to start the service container for system upgrade.

[0080] Further, the judgment module 201 includes: a comparison unit and an upgrade judgment unit;

[0081] The comparison unit is used to obtain a historical version number in the target file, and the historical version number is recorded in the target file after the historical version is successfully upgraded;

[0082] Compare the version number of the upgrade package with the historical version number;

[0083] The upgrade judgment unit is used to determine to perform a system upgrade if the version number of the upgrade package is greater than the historical version number;

[0084] If the version number of the upgrade package is less than or equal to the historical version number, it is determined not to perform the system upgrade.

[0085] Further, the upgrade module 202 includes a configuration unit;

[0086] The configuration unit is used to configure a corresponding Docker image according to the version number of the upgrade package when loading the upgrade package using the target tool;

[0087] The target tool is used to define, configure and manage a number of containerized services.

[0088] Furthermore, the upgrade module 202 further includes: a success processing unit and a failure processing unit;

[0089] The success processing unit is used to determine that the system upgrade is successful when receiving the first status code returned by the target tool; and record the version number of the upgrade package in the target file;

[0090] The failure processing unit is used to determine that the system upgrade fails when receiving the second status code returned by the target tool; and record the execution information and the information of the upgrade package in the work log;

[0091] Delete the upgrade package and delete the second Docker image;

[0092] The version number corresponding to the second Docker image is smaller than the version number of the upgrade package.

[0093] The above-mentioned system upgrade device for different network environments can implement the system upgrade method for different network environments of the above-mentioned method embodiment. The options in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here. The rest of the embodiments of the present application can refer to the contents of the above-mentioned method embodiment, and in some preferred embodiments, no further description will be given.

[0094] Embodiment 3

[0095] Accordingly, the present application also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the system upgrade method for different network environments as described in any one of the above embodiments.

[0096] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the terminal device.

[0097] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0098] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.

[0099] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the terminal device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile terminal, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0100] Wherein, if the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0101] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims

1. A system upgrade method for different network environments, characterized in that: include: When it is detected that the cloud desktop has uploaded an upgrade package in the target directory of the server, the version number of the upgrade package is obtained; Compare the version number of the upgrade package with the historical version number to determine whether to perform a system upgrade; The upgrade package is generated by the user by packaging the target file on the cloud desktop, and is automatically transferred from the cloud desktop to the physical machine, so that the physical machine automatically synchronizes the upgrade package to the target directory of the server; the cloud desktop is in a first network environment; the physical machine and the server are in a second network environment; the first network environment is an intranet, and the second network environment is an extranet; If a system upgrade is performed, a target tool is deployed, and the upgrade package is loaded using the target tool; according to the version number of the upgrade package, the corresponding first Docker image is run to start the service container for system upgrade.

2. A system upgrade method for different network environments as claimed in claim 1, characterized in that: Compare the version number of the upgrade package with the historical version number to determine whether to perform a system upgrade, specifically: Obtaining a historical version number in the target file, wherein the historical version number is recorded in the target file after the historical version is successfully upgraded; Compare the version number of the upgrade package with the historical version number; If the version number of the upgrade package is greater than the historical version number, then determine to perform a system upgrade; If the version number of the upgrade package is less than or equal to the historical version number, it is determined not to perform the system upgrade.

3. A system upgrade method for different network environments as claimed in claim 1, characterized in that: The target tool is used to define, configure and manage several containerized services. When loading an upgrade package, a corresponding Docker image is configured according to the version number of the upgrade package.

4. A system upgrade method for different network environments as claimed in claim 1, characterized in that: According to the version number of the upgrade package, after running the corresponding first Docker image to start the service container for system upgrade, the method further includes: When the first status code returned by the target tool is received, it is determined that the system upgrade is successful; and the version number of the upgrade package is recorded in the target file.

5. A system upgrade method for different network environments as claimed in claim 4, characterized in that: According to the version number of the upgrade package, after running the corresponding first Docker image to start the service container for system upgrade, the method further includes: When receiving the second status code returned by the target tool, determining that the system upgrade has failed; recording the execution information and the information of the upgrade package in the work log; Delete the upgrade package and delete the second Docker image; The version number corresponding to the second Docker image is smaller than the version number of the upgrade package.

6. A system upgrade device for different network environments, characterized in that: include: Judgment module and upgrade module; The judgment module is used to obtain the version number of the upgrade package when it is detected that the physical machine has uploaded the upgrade package in the target directory of the server; Compare the version number of the upgrade package with the historical version number to determine whether to perform a system upgrade; The upgrade package is generated by the user by packaging the target file on the cloud desktop, and is automatically transferred from the cloud desktop to the physical machine, so that the physical machine automatically synchronizes the upgrade package to the target directory of the server; The cloud desktop is in a first network environment; the physical machine and the server are in a second network environment; the first network environment is an intranet, and the second network environment is an extranet; The upgrade module is used to deploy a target tool if a system upgrade is performed, and use the target tool to load the upgrade package; according to the version number of the upgrade package, run the corresponding first Docker image to start the service container for system upgrade.

7. The system upgrade device for different network environments as claimed in claim 6, characterized in that: The judgment module includes: a comparison unit and an upgrade judgment unit; The comparison unit is used to obtain a historical version number in the target file, and the historical version number is recorded in the target file after the historical version is successfully upgraded; Compare the version number of the upgrade package with the historical version number; The upgrade judgment unit is used to determine to perform a system upgrade if the version number of the upgrade package is greater than the historical version number; If the version number of the upgrade package is less than or equal to the historical version number, it is determined not to perform the system upgrade.

8. The system upgrade device for different network environments as claimed in claim 6, characterized in that: The upgrade module includes a configuration unit; The configuration unit is used to configure a corresponding Docker image according to the version number of the upgrade package when loading the upgrade package using the target tool; The target tool is used to define, configure and manage a number of containerized services.

9. The system upgrade device for different network environments as claimed in claim 6, characterized in that: The upgrade module further includes: a success processing unit and a failure processing unit; The success processing unit is used to determine that the system upgrade is successful when receiving the first status code returned by the target tool; and record the version number of the upgrade package in the target file; The failure processing unit is used to determine that the system upgrade fails when receiving the second status code returned by the target tool; and record the execution information and the information of the upgrade package in the work log; Delete the upgrade package and delete the second Docker image; The version number corresponding to the second Docker image is smaller than the version number of the upgrade package.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program; wherein, when the computer program is run, it controls the device where the computer-readable storage medium is located to execute a system upgrade method for different network environments as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Server upgrading method and system

    CN112860294A

  • Software upgrading method, device and system, electronic equipment and storage medium

    CN115934133A