Software upgrading method, device, storage medium and electronic device
By generating the package to be deployed on the server and modifying the root directory to the preset directory identifier, and using soft link pointers for deployment, the problem of low efficiency of software upgrades in multi-server environments is solved and fast and efficient software deployment is achieved.
Patent Information
- Application Number
- CN202210254492.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-15
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-03-15
AI Technical Summary
Existing software deployment solutions require one-by-one operations in a multi-server environment, resulting in inefficient software upgrades and inability to quickly complete deployment.
When the server receives the package synchronization instruction, it generates the package to be deployed, modifies the root directory of each package to be deployed to the preset directory identifier, and uses the soft link pointer for deployment to achieve rapid deployment.
It improves software deployment efficiency, reduces deployment time, and improves the overall efficiency of software upgrades.
Smart Images

Figure CN114640687B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software technology, and in particular to a software upgrading method, device, storage medium and electronic equipment. Background Art
[0002] As system requirements continue to change, most software companies will need to release deployment / release software monthly, quarterly, and annually. Every change to the software goes through a complex process in the release process. The process involves building the software and then taking those builds through multiple testing and deployment stages.
[0003] In the existing software deployment solution, the server that needs to be deployed is first determined, and then the software package is sent to the server for deployment through the command line. Since there are usually multiple servers to be deployed in reality, it is necessary to operate the servers to be deployed one by one, which wastes a lot of time and reduces the efficiency of software upgrade. Summary of the invention
[0004] The embodiments of the present application provide a software upgrade method, device, storage medium and electronic device. In order to have a basic understanding of some aspects of the disclosed embodiments, a simple summary is given below. This summary is not a general review, nor is it intended to determine key / important components or describe the scope of protection of these embodiments. Its only purpose is to present some concepts in a simple form as a preface to the detailed description below.
[0005] In a first aspect, an embodiment of the present application provides a software upgrade method, which is applied to a server, and the method includes:
[0006] When receiving a package synchronization instruction, data synchronization is performed according to the client's package to be upgraded to generate a package to be deployed;
[0007] Modify the root directory of each package to be deployed to a preset directory identifier, and generate a modified root directory of the package to be deployed;
[0008] Back up the current version of the software package, and deploy the package to be deployed according to the modified root directory of the package to be deployed to generate the upgraded software.
[0009] Optionally, the server includes a parent node server and at least one first-level child node server;
[0010] Synchronize data based on the client's package to be upgraded to generate a package to be deployed, including:
[0011] The parent node server obtains the program package to be upgraded from the client, and performs data synchronization according to the program package to be upgraded to generate the program package to be deployed of the parent node server;
[0012] The parent node server sends the program package to be upgraded to at least one first-level child node server;
[0013] At least one first-level child node server receives the program package to be upgraded from the parent node server, and performs data synchronization according to the program package to be upgraded to generate a program package to be deployed for the child node server.
[0014] Optionally, perform data synchronization based on the program package to be upgraded, including:
[0015] Obtain a first hash value pre-marked on the program package to be upgraded;
[0016] Calculate a second hash value according to the program package to be upgraded;
[0017] Whether to perform data synchronization is determined according to the first Hash value and the second Hash value.
[0018] Optionally, determining whether to perform data synchronization according to the first hash value and the second hash value includes:
[0019] When the first hash value is the same as the second hash value, determining that data synchronization is required;
[0020] or,
[0021] When the first hash value is different from the second hash value, a data resynchronization operation is triggered.
[0022] Optionally, the method further includes:
[0023] Test the upgraded software and obtain the test results;
[0024] When the test results contain abnormal information, the upgraded software package is rolled back to the previous historical version of the software package;
[0025] or,
[0026] When there is no abnormal information in the test results, a software upgrade success message is generated and fed back to the client.
[0027] Optionally, roll back the upgraded software package to the previous historical version of the software package, including:
[0028] Initialize the target version directory of the previous historical version of the software package backed up in advance;
[0029] The deployment pointer is pointed to the target version directory by using a soft link pointer, so as to roll back the upgraded software package to the previous historical version of the software package.
[0030] In a second aspect, an embodiment of the present application provides a software upgrade method, which is applied to a client, and the method includes:
[0031] Determine the package to be upgraded;
[0032] Calculate a first hash value of the program package to be upgraded;
[0033] Marking the first hash value in the program package to be upgraded;
[0034] Connect to the parent node server in the server side;
[0035] Receive a package synchronization instruction input for a parent node server, and send the package synchronization instruction to the parent node server.
[0036] In a third aspect, an embodiment of the present application provides a software upgrade device, which is applied to a server, and the device includes:
[0037] A program package generation module to be deployed, used for synchronizing data according to the program package to be upgraded of the client and generating a program package to be deployed when receiving a program package synchronization instruction;
[0038] A directory modification module, used to modify the root directory of each to-be-deployed program package to a preset directory identifier, and generate a modified root directory of the to-be-deployed program package;
[0039] The package deployment module is used to back up the current version of the software package, and deploy the package to be deployed according to the modified root directory of the package to be deployed to generate the upgraded software.
[0040] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0041] In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0042] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0043] In an embodiment of the present application, when the server receives a package synchronization instruction, it first synchronizes data according to the client's package to be upgraded to generate a package to be deployed, then modifies the root directory of each package to be deployed to a preset directory identifier, generates a modified root directory of the package to be deployed, and finally backs up the current version of the software package, and deploys the package to be deployed according to the modified root directory of the package to be deployed to generate the upgraded software. Since the present application uniformly modifies the root directory of each package to be deployed to a preset directory identifier, when performing program deployment, only the version package to be deployed is pointed to the directory of the preset directory identifier by a soft link pointer, and rapid deployment can be completed, thereby improving deployment efficiency, and further improving software deployment efficiency.
[0044] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0046] Figure 1 It is a flowchart of a software upgrade method of a server provided in an embodiment of the present application;
[0047] Figure 2 It is a schematic diagram of a multi-layer synchronization method for data synchronization provided by an embodiment of the present application;
[0048] Figure 3 This is a schematic diagram of a deployment program directory provided in an embodiment of the present application;
[0049] Figure 4 This is another schematic diagram of a deployment program directory provided in an embodiment of the present application;
[0050] Figure 5 It is a flowchart of a method for upgrading software of a client provided in an embodiment of the present application;
[0051] Figure 6 It is a structural schematic diagram of a software upgrading device provided in an embodiment of the present application;
[0052] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The following description and the drawings sufficiently illustrate specific embodiments of the invention to enable those skilled in the art to practice them.
[0054] It should be clear that the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are only examples of devices and methods consistent with some aspects of the present invention as detailed in the attached claims.
[0056] In the description of the present invention, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. In addition, in the description of the present invention, unless otherwise specified, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.
[0057] The present application provides a software upgrade method, device, storage medium and electronic device to solve the problems existing in the above-mentioned related technical problems. In the technical solution provided by the present application, since the present application uniformly modifies the root directory of each program package to be deployed into a preset directory identifier, when performing program deployment, only the version program package to be deployed is pointed to the directory of the preset directory identifier by a soft link pointer, and rapid deployment can be completed, thereby improving deployment efficiency, and further improving software deployment efficiency. The following uses an exemplary embodiment for detailed description.
[0058] The following will be combined with the attached Figure 1 -Attached Figure 5 , the software upgrade method provided by the embodiment of the present application is introduced in detail. The method can be implemented by a computer program and can be run on a software upgrade device based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application.
[0059] See also Figure 1 , which is a flowchart of a software upgrade method provided by the present application embodiment, and is applied to the server. Figure 1 As shown, the method of the embodiment of the present application may include the following steps:
[0060] S101, when a program package synchronization instruction is received, data synchronization is performed according to the program package to be upgraded of the client to generate a program package to be deployed;
[0061] The instruction is the script code that controls the server to execute the corresponding function. The instruction is entered by the user in the client console and sends a corresponding request to the server after execution. The server can be understood as a server room, which contains a large number of servers, including a parent node server and at least one level of child node server. The package to be upgraded is a compressed package of the program that has been built and verified to be problem-free in the test environment.
[0062] Usually, the server is connected to the client for communication. The client has a console for controlling the server, and the console is used for users to input commands.
[0063] In an embodiment of the present application, first, the parent node server obtains the program package to be upgraded from the client, and performs data synchronization based on the program package to be upgraded to generate the program package to be deployed of the parent node server. Then, the parent node server sends the program package to be upgraded to at least one first-level child node server. At least one first-level child node server receives the program package to be upgraded from the parent node server, and performs data synchronization based on the program package to be upgraded to generate the program package to be deployed of the child node server.
[0064] Specifically, when data synchronization is performed according to the program package to be upgraded, a first hash value pre-marked on the program package to be upgraded is first obtained, a second hash value is calculated according to the program package to be upgraded, and finally whether to perform data synchronization is determined according to the first hash value and the second hash value.
[0065] It should be noted that this application uses rsync technology to perform point-to-point synchronization of program packages. Due to various complex problems that may cause synchronization interruptions, this method in this application can support breakpoint resumption. After receiving the program package, the server calculates the hash value again. If it is consistent with the hash tag value marked on the program package, it is considered that this synchronization is valid. Otherwise, resynchronization is automatically triggered.
[0066] Specifically, when determining whether to perform data synchronization based on the first hash value and the second hash value, when the first hash value is the same as the second hash value, it is determined that data synchronization is required; or, when the first hash value is different from the second hash value, a re-data synchronization operation is triggered.
[0067] In a possible implementation, in the prior art, when synchronizing program packages to multiple servers, the synchronization is performed one by one. This method may have the problem of high bandwidth cost for synchronization across the Internet, such as Figure 2As shown, the present application is designed as a multi-level distribution synchronization. Each data center receives the program package that needs to be deployed from the parent node layer (first layer). After receiving the program package, the parent node layer provides it to the child node (second layer) where the program package needs to be deployed. This greatly saves the Internet bandwidth for synchronization. Here it is only explained that the second-level synchronization can continue to be graded downward according to the usage scenario, and the number of grades is not limited.
[0068] It should be noted that, for the deployment environment of multiple data centers and multiple zone clusters, this application only synchronizes one package to the same data center and the same zone domain, which greatly improves the deployment efficiency.
[0069] S102, modifying the root directory of each to-be-deployed program package to a preset directory identifier, generating a modified root directory of the to-be-deployed program package;
[0070] Among them, each synchronized program package is stored in the root directory, which is the top-level directory in the computer file system, sometimes also called the parent directory or the main directory.
[0071] Usually, since there are usually multiple servers deployed in reality, it is necessary to operate on the servers that need to be deployed one by one. This application can perform batch deployment operations on the selected servers based on a multi-concurrent asynchronous manner.
[0072] In a possible implementation, the present application uniformly modifies the root directory of each to-be-deployed program package into a preset directory identifier, for example, uniformly defines it as the current_release directory. When deploying the program, only the version program package to be deployed is pointed to the directory of the preset directory identifier by means of a soft link pointer, and rapid deployment can be completed. After deployment, the program directory is as follows: Figure 3 shown.
[0073] S103, backing up the current version of the software package, and deploying the package to be deployed according to the modified root directory of the package to be deployed, to generate upgraded software.
[0074] Usually, the previous historical versions of the program will be backed up in advance before the program is deployed. Generally speaking, the server will store the five most recently deployed historical versions of the program. The purpose of the backup is to be able to roll back to the previous historical version when the current program encounters a running error. The deployment server always keeps the latest five version packages. If you want to release the release_1.1.6 version package now, the pointer to release_1.1.5 will be deleted and a new pointer to release_1.1.6 will be re-established.
[0075] In a possible implementation, the current version of the software package is backed up, and the program package to be deployed is deployed according to the modified root directory of the program package to be deployed to generate upgraded software.
[0076] Furthermore, after the deployment is completed, the upgraded software is first tested to obtain the test results, and then when there is abnormal information in the test results, the upgraded software package is rolled back to the previous historical version of the software package; or, when there is no abnormal information in the test results, software upgrade success information is generated and fed back to the client.
[0077] Specifically, when a bug or other unknown problem is found after the program is deployed, it is necessary to quickly roll back to the previous version of the program. The existing technology is to upload the previous version of the program package to the server and redeploy it again or redeploy it based on the original backup program. This method will take a long time. This application uses a soft link pointer to point the deployment pointer to the version directory to be rolled back to achieve the purpose of rolling back in seconds. For example, if you want to roll back to the previous version 2.11.4, you can use Figure 4 The command script can roll back to the previous version of the program.
[0078] In an embodiment of the present application, when the server receives a package synchronization instruction, it first synchronizes data according to the client's package to be upgraded to generate a package to be deployed, then modifies the root directory of each package to be deployed to a preset directory identifier, generates a modified root directory of the package to be deployed, and finally backs up the current version of the software package, and deploys the package to be deployed according to the modified root directory of the package to be deployed to generate the upgraded software. Since the present application uniformly modifies the root directory of each package to be deployed to a preset directory identifier, when performing program deployment, only the version package to be deployed is pointed to the directory of the preset directory identifier by a soft link pointer, and rapid deployment can be completed, thereby improving deployment efficiency, and further improving software deployment efficiency.
[0079] See also Figure 5 , which is a flowchart of a software upgrade method provided by the present application embodiment, and is applied to a client. Figure 5 As shown, the method of the embodiment of the present application may include the following steps:
[0080] S201, determining a program package to be upgraded;
[0081] S202, calculating a first hash value of the program package to be upgraded;
[0082] S203, marking the first hash value in the program package to be upgraded;
[0083] S204, connecting to the parent node server in the server;
[0084] S205, receiving a program package synchronization instruction input for the parent node server, and sending the program package synchronization instruction to the parent node server.
[0085] Usually, after the package is built and verified to be problem-free in the test environment, a hash calculation is actively performed on the package. After the calculated hash value is obtained, the hash is used as the label of the package for subsequent calculation of the package's integrity.
[0086] In one possible implementation, first, a console linked to the server is opened on the client, and the server is determined through a command line on the console. Then, the package to be upgraded is determined, and a first hash value of the package to be upgraded is calculated. The first hash value is marked in the package to be upgraded. Finally, the parent node server in the server is connected, and a package synchronization instruction input for the parent node server is received, and the package synchronization instruction is sent to the parent node server.
[0087] In an embodiment of the present application, when the server receives a package synchronization instruction, it first synchronizes data according to the client's package to be upgraded to generate a package to be deployed, then modifies the root directory of each package to be deployed to a preset directory identifier, generates a modified root directory of the package to be deployed, and finally backs up the current version of the software package, and deploys the package to be deployed according to the modified root directory of the package to be deployed to generate the upgraded software. Since the present application uniformly modifies the root directory of each package to be deployed to a preset directory identifier, when performing program deployment, only the version package to be deployed is pointed to the directory of the preset directory identifier by a soft link pointer, and rapid deployment can be completed, thereby improving deployment efficiency, and further improving software deployment efficiency.
[0088] The following are embodiments of the device of the present invention, which can be used to implement the method embodiments of the present invention. For details not disclosed in the device embodiments of the present invention, please refer to the method embodiments of the present invention.
[0089] See also Figure 6 , which shows a schematic diagram of the structure of a software upgrade device provided by an exemplary embodiment of the present invention, which is applied to a server. The software upgrade device can be implemented as all or part of an electronic device through software, hardware or a combination of both. The device 1 includes a to-be-deployed program package generation module 10, a directory modification module 20, and a program package deployment module 30.
[0090] The to-be-deployed program package generating module 10 is used to perform data synchronization according to the to-be-upgraded program package of the client and generate the to-be-deployed program package when receiving the program package synchronization instruction;
[0091] A directory modification module 20, used to modify the root directory of each to-be-deployed program package to a preset directory identifier, and generate a modified root directory of the to-be-deployed program package;
[0092] The program package deployment module 30 is used to back up the current version of the software program package, and deploy the program package to be deployed according to the modified root directory of the program package to be deployed to generate upgraded software.
[0093] It should be noted that the software upgrade device provided in the above embodiment only uses the division of the above functional modules as an example when executing the software upgrade method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the software upgrade device provided in the above embodiment and the software upgrade method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0094] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0095] In an embodiment of the present application, when the server receives a package synchronization instruction, it first synchronizes data according to the client's package to be upgraded to generate a package to be deployed, then modifies the root directory of each package to be deployed to a preset directory identifier, generates a modified root directory of the package to be deployed, and finally backs up the current version of the software package, and deploys the package to be deployed according to the modified root directory of the package to be deployed to generate the upgraded software. Since the present application uniformly modifies the root directory of each package to be deployed to a preset directory identifier, when performing program deployment, only the version package to be deployed is pointed to the directory of the preset directory identifier by a soft link pointer, and rapid deployment can be completed, thereby improving deployment efficiency, and further improving software deployment efficiency.
[0096] The present invention also provides a computer-readable medium on which program instructions are stored. When the program instructions are executed by a processor, the software upgrading methods provided by the above-mentioned various method embodiments are implemented.
[0097] The present invention also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the software upgrading methods of the above-mentioned various method embodiments.
[0098] See also Figure 7, is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .
[0099] The communication bus 1002 is used to realize the connection and communication between these components.
[0100] The user interface 1003 may include a display screen (Display) and a camera (Camera), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
[0101] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0102] Among them, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect the various parts of the entire electronic device 1000, and executes various functions and processes data of the electronic device 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (ProgrammableLogic Array, PLA). The processor 1001 can integrate one or more combinations of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1001, and it can be implemented separately through a chip.
[0103] Among them, the memory 1005 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may optionally be at least one storage device located away from the aforementioned processor 1001. As Figure 7 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a software upgrade application.
[0104] exist Figure 7 In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 1001 can be used to call the software upgrade application stored in the memory 1005 and specifically perform the following operations:
[0105] When receiving a package synchronization instruction, data synchronization is performed according to the client's package to be upgraded to generate a package to be deployed;
[0106] Modify the root directory of each package to be deployed to a preset directory identifier, and generate a modified root directory of the package to be deployed;
[0107] Back up the current version of the software package, and deploy the package to be deployed according to the modified root directory of the package to be deployed to generate the upgraded software.
[0108] In one embodiment, when the processor 1001 performs data synchronization according to the program package to be upgraded of the client and generates the program package to be deployed, the processor 1001 specifically performs the following operations:
[0109] The parent node server obtains the program package to be upgraded from the client, and performs data synchronization according to the program package to be upgraded to generate the program package to be deployed of the parent node server;
[0110] The parent node server sends the program package to be upgraded to at least one first-level child node server;
[0111] At least one first-level child node server receives the program package to be upgraded from the parent node server, and performs data synchronization according to the program package to be upgraded to generate a program package to be deployed for the child node server.
[0112] In one embodiment, when the processor 1001 performs data synchronization according to the program package to be upgraded, the processor 1001 specifically performs the following operations:
[0113] Obtain a first hash value pre-marked on the program package to be upgraded;
[0114] Calculate a second hash value according to the program package to be upgraded;
[0115] Whether to perform data synchronization is determined according to the first Hash value and the second Hash value.
[0116] In one embodiment, when the processor 1001 determines whether to perform data synchronization according to the first hash value and the second hash value, the processor 1001 specifically performs the following operations:
[0117] When the first hash value is the same as the second hash value, determining that data synchronization is required;
[0118] or,
[0119] When the first hash value is different from the second hash value, a data resynchronization operation is triggered.
[0120] In one embodiment, the processor 1001 further performs the following operations:
[0121] Test the upgraded software and obtain the test results;
[0122] When the test results contain abnormal information, the upgraded software package is rolled back to the previous historical version of the software package;
[0123] or,
[0124] When there is no abnormal information in the test results, a software upgrade success message is generated and fed back to the client.
[0125] In one embodiment, when executing to roll back the upgraded software package to the software package of the previous historical version, the processor 1001 specifically performs the following operations:
[0126] Initialize the target version directory of the previous historical version of the software package backed up in advance;
[0127] The deployment pointer is pointed to the target version directory by using a soft link pointer, so as to roll back the upgraded software package to the previous historical version of the software package.
[0128] In an embodiment of the present application, when the server receives a package synchronization instruction, it first synchronizes data according to the client's package to be upgraded to generate a package to be deployed, then modifies the root directory of each package to be deployed to a preset directory identifier, generates a modified root directory of the package to be deployed, and finally backs up the current version of the software package, and deploys the package to be deployed according to the modified root directory of the package to be deployed to generate the upgraded software. Since the present application uniformly modifies the root directory of each package to be deployed to a preset directory identifier, when performing program deployment, only the version package to be deployed is pointed to the directory of the preset directory identifier by a soft link pointer, and rapid deployment can be completed, thereby improving deployment efficiency, and further improving software deployment efficiency.
[0129] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the software upgrade program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0130] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A software upgrade method, characterized in that: Applied to the server, the method includes: When receiving the package synchronization instruction, data synchronization is performed according to the client's package to be upgraded to generate a package to be deployed; wherein, The server includes a parent node server and at least one level of child node server; The step of performing data synchronization according to the program package to be upgraded on the client to generate the program package to be deployed includes: The parent node server obtains the program package to be upgraded from the client, and performs data synchronization according to the program package to be upgraded to generate a program package to be deployed of the parent node server; The parent node server sends the program package to be upgraded to the at least one first-level child node server; At least one first-level child node server receives the program package to be upgraded from the parent node server, and performs data synchronization according to the program package to be upgraded to generate a program package to be deployed for the child node server; Modify the root directory of each of the to-be-deployed program packages to a preset directory identifier, so that the to-be-deployed program package points to the directory of the preset directory identifier by way of a soft link pointer, and generate a modified root directory of the to-be-deployed program package; The current version of the software package is backed up, and the package to be deployed is deployed according to the modified root directory of the package to be deployed to generate upgraded software.
2. The method according to claim 1, characterized in that The step of synchronizing data according to the program package to be upgraded includes: Obtaining a first hash value pre-marked on the program package to be upgraded; Calculate a second hash value according to the program package to be upgraded; Determine whether to perform data synchronization according to the first Hash value and the second Hash value.
3. The method according to claim 2, characterized in that The determining whether to perform data synchronization according to the first Hash value and the second Hash value includes: When the first Hash value is the same as the second Hash value, determining that data synchronization is required; or, When the first hash value is different from the second hash value, a data resynchronization operation is triggered.
4. The method according to claim 1, characterized in that: The method further comprises: Test the upgraded software and obtain the test results; When there is abnormal information in the test result, the upgraded software package is rolled back to the previous historical version of the software package; or, When there is no abnormal information in the test result, software upgrade success information is generated and fed back to the client.
5. The method according to claim 4, characterized in that The step of rolling back the upgraded software package to the previous historical version of the software package includes: Initialize the target version directory of the previous historical version of the software package backed up in advance; The deployment pointer is pointed to the target version directory by using a soft link pointer, so as to roll back the upgraded software package to the previous historical version of the software package.
6. A software upgrade device, characterized in that: Applied to the server, the device comprises: The module for generating the program package to be deployed is used to synchronize data with the program package to be upgraded on the client and generate the program package to be deployed when receiving the program package synchronization instruction; wherein, The server includes a parent node server and at least one level of child node server; The step of performing data synchronization according to the program package to be upgraded on the client to generate the program package to be deployed includes: The parent node server obtains the program package to be upgraded from the client, and performs data synchronization according to the program package to be upgraded to generate a program package to be deployed of the parent node server; The parent node server sends the program package to be upgraded to the at least one first-level child node server; At least one first-level child node server receives the program package to be upgraded from the parent node server, and performs data synchronization according to the program package to be upgraded to generate a program package to be deployed for the child node server; A directory modification module, used for modifying the root directory of each of the to-be-deployed program packages to a preset directory identifier, so as to point the to-be-deployed program package to the directory of the preset directory identifier by way of a soft link pointer, thereby generating a modified root directory of the to-be-deployed program package; The program package deployment module is used to back up the current version of the software program package, and deploy the program package to be deployed according to the modified root directory of the program package to be deployed to generate upgraded software.
7. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, which are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 5.
8. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 5.
