Service rollback method, electronic device and program product

By receiving rollback instructions, determining the service name and current version, querying the target version and rolling back in batches, it solves the time-consuming and error-prone problems in traditional methods, realizes the intelligent and reliable rollback of the system, and ensures the overall consistency and stability of the system.

CN120255944APending Publication Date: 2025-07-04KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510309038.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

Traditional service rollback methods are time-consuming and error-prone, making it difficult to deal with complex deployment scenarios, resulting in system inconsistency, especially in large-scale distributed systems, which are difficult to accurately identify devices that need to be rolled back.

Method used

By receiving rollback instructions, determine the service name, current version and device, query the target version, adopt smooth or fast rollback methods, combine system load and application characteristics to perform rollback operations in batches, support PHP and JAVA applications, display rollback information and time estimates.

Benefits of technology

It realizes precise identification and rollback of devices in complex deployment environments, ensures system consistency, and improves system maintainability and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120255944A_ABST
    Figure CN120255944A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a service rollback method, electronic equipment and a program product, and the method comprises the steps: receiving a rollback instruction for a deployed specified service, and enabling the rollback instruction to comprise a service name of the specified service; according to the service name of the specified service, determining a current version of the specified service and a device to which the current version is deployed; determining a target version for performing rollback operation on the specified service according to the service name of the specified service; and performing rollback operation on the specified service according to the equipment deployed to the target version and the current version, so that the target version of the rollback operation can be determined according to the current deployment state, and the equipment needing to be subjected to the rollback operation can be accurately identified, thereby adapting to a complex deployment environment, and improving the user experience. According to the method, all devices needing rollback operation are ensured to return to correct versions, the overall consistency of the system is kept, and intelligent and reliable rollback is realized, so that the maintainability and stability of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer software technology, and in particular, to a service rollback method, an electronic device, and a program product. Background Art

[0002] Traditional service rollback methods usually adopt a manual operation method, which is not only time-consuming but also error-prone. In addition, traditional methods often lack flexibility and are difficult to cope with complex deployment scenarios, such as partial deployment and multi-stage deployment scenarios. Especially in large-scale distributed systems, manual rollback may lead to system inconsistency and increase operation risks. For example, in a large system, a new version of a service may only be deployed to some devices in the system. In this case, the manual rollback method is difficult to accurately identify the devices that need to be rolled back, cannot ensure that all devices that need to be rolled back are rolled back to the correct version, and is difficult to maintain the overall consistency of the system. Summary of the Invention

[0003] In view of the above problems in the prior art, embodiments of the present disclosure provide a service rollback method, an electronic device, and a program product.

[0004] A first aspect of the embodiments of the present disclosure provides a service rollback method, including:

[0005] Receiving a rollback instruction for a specified service that has been deployed, where the rollback instruction includes the service name of the specified service;

[0006] Determining the current version of the specified service and the devices to which the current version is deployed according to the service name of the specified service;

[0007] Determining a target version for performing a rollback operation on the specified service according to the service name of the specified service;

[0008] Performing a rollback operation on the specified service according to the target version and the devices to which the current version is deployed.

[0009] As a possible implementation manner of the first aspect, determining the current version of the specified service and the devices to which the current version is deployed according to the service name of the specified service includes:

[0010] Obtaining the service name of the specified service from the rollback instruction;

[0011] Querying the current version of the specified service and the devices to which the current version is deployed in a database that records service release information according to the service name of the specified service.

[0012] As a possible implementation manner of the first aspect, determining a target version for performing a rollback operation on the specified service according to the service name of the specified service includes:

[0013] Obtain the service name of the specified service from the rollback instruction;

[0014] According to the service name of the specified service, query the latest full release version before the current version of the specified service in the database that records service release information;

[0015] Determine the full release version as the target version for the rollback operation of the specified service.

[0016] As a possible implementation of the first aspect, the rollback instruction further includes a rollback method; according to the target version and the device where the current version is deployed, performing a rollback operation on the specified service further includes:

[0017] Obtain the rollback method from the rollback instruction;

[0018] In the case where the rollback method is a smooth rollback, after draining the specified service, roll back the specified service to the target version;

[0019] In the case where the rollback method is a quick rollback, after forcibly ending the process of the specified service, roll back the specified service to the target version.

[0020] As a possible implementation of the first aspect, according to the target version and the device where the current version is deployed, performing a rollback operation on the specified service further includes:

[0021] Determine the selection range of rollback batches based on the system load and application characteristics, where the rollback batch is the number of batches for performing a rollback operation on the device where the current version of the specified service is deployed in batches;

[0022] Obtain the rollback method from the rollback instruction, and determine the default option of the rollback batch according to the rollback method and the selection range of the rollback batch;

[0023] Display the default option of the rollback batch and the selection range of the rollback batch to the user, and receive the rollback batch specified by the user according to the default option and the selection range;

[0024] Perform a rollback operation on the specified service according to the specified rollback batch.

[0025] As a possible implementation of the first aspect, performing a rollback operation on the specified service further includes:

[0026] According to the configuration information of the specified service, determine the application type of the specified service; wherein, the application type includes at least one of PHP applications and JAVA applications;

[0027] Obtain the rollback program corresponding to the application type of the specified service, and use the rollback program to perform a rollback operation on the specified service.

[0028] As a possible implementation of the first aspect, the above method further includes:

[0029] Estimate and display rollback time information for performing a rollback operation on a specified service based on historical data of the specified service.

[0030] As a possible implementation of the first aspect, the above method further includes:

[0031] During the process of performing a rollback operation on a specified service, display rollback information to the user, where the rollback information includes at least one of the release status of the current version of the specified service, the rollback progress, the target version, and the devices to which the current version is deployed.

[0032] A second aspect of the embodiments of the present disclosure provides a service rollback device, including:

[0033] A receiving unit, configured to receive a rollback instruction for a deployed specified service, where the rollback instruction includes the service name of the specified service;

[0034] A first determination unit, configured to determine the current version of the specified service and the devices to which the current version is deployed according to the service name of the specified service;

[0035] A second determination unit, configured to determine the target version for performing a rollback operation on the specified service according to the service name of the specified service;

[0036] An operation unit, configured to perform a rollback operation on the specified service according to the target version and the devices to which the current version is deployed.

[0037] As a possible implementation of the second aspect, the first determination unit is configured to:

[0038] Obtain the service name of the specified service from the rollback instruction;

[0039] Query the current version of the specified service and the devices to which the current version is deployed in a database that records service release information according to the service name of the specified service.

[0040] As a possible implementation of the second aspect, the second determination unit is configured to:

[0041] Obtain the service name of the specified service from the rollback instruction;

[0042] Query the latest full release version before the current version of the specified service in a database that records service release information according to the service name of the specified service;

[0043] Determine the full release version as the target version for performing a rollback operation on the specified service.

[0044] As a possible implementation of the second aspect, the rollback indication further includes a rollback method; the operation unit is configured to:

[0045] Obtain the rollback method from the rollback indication;

[0046] In the case where the rollback method is smooth rollback, after draining traffic from the specified service, roll back the specified service to the target version;

[0047] In the case where the rollback method is fast rollback, after forcibly ending the process of the specified service, roll back the specified service to the target version.

[0048] As a possible implementation of the second aspect, the operation unit is configured to:

[0049] Determine the selection range of rollback batches based on the system load and application characteristics, where the rollback batch is the number of batches for performing rollback operations on the devices to which the current version of the specified service is deployed;

[0050] Obtain the rollback method from the rollback indication, and determine the default option of the rollback batch according to the rollback method and the selection range of the rollback batch;

[0051] Display the default option of the rollback batch and the selection range of the rollback batch to the user, and receive the rollback batch specified by the user according to the default option and the selection range;

[0052] Perform a rollback operation on the specified service according to the specified rollback batch.

[0053] As a possible implementation of the second aspect, the operation unit is configured to:

[0054] Determine the application type of the specified service according to the configuration information of the specified service; where the application type includes at least one of PHP applications and JAVA applications;

[0055] Obtain a rollback program corresponding to the application type of the specified service, and use the rollback program to perform a rollback operation on the specified service.

[0056] As a possible implementation of the second aspect, the above device further includes a display unit, configured to:

[0057] Estimate and display rollback time information for performing a rollback operation on the specified service according to the historical data of the specified service.

[0058] As a possible implementation of the second aspect, the above device further includes a display unit, configured to:

[0059] During the rollback operation of a specified service, rollback information is presented to the user, and the rollback information includes at least one of the release status of the current version of the specified service, the rollback progress, the target version, and the devices to which the current version is deployed.

[0060] A third aspect of the embodiments of the present disclosure provides an electronic device, including:

[0061] A memory for storing a computer program product;

[0062] A processor for executing the computer program product stored in the memory, and when the computer program product is executed, implementing the method according to any one of the first aspects above.

[0063] A fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, implementing the method according to any one of the first aspects above.

[0064] A fifth aspect of the present disclosure provides a computer program product, including computer program instructions, and when the computer program instructions are executed by a processor, implementing the method according to any one of the first aspects above.

[0065] Based on the embodiments of the present disclosure, by confirming the current version of the specified service and the devices to which the current version is deployed, and determining the target version for the rollback operation of the specified service, and then performing the rollback operation on the specified service according to the target version and the devices to which the current version is deployed, the target version of the rollback operation can be determined according to the current deployment status, and the devices that need to perform the rollback operation can be accurately identified, adapting to a complex deployment environment, ensuring that all devices that need to perform the rollback operation return to the correct version, maintaining the overall consistency of the system, realizing intelligent and reliable rollback, thereby improving the maintainability and stability of the system.

[0066] Next, through the drawings and embodiments, the technical solutions of the present disclosure will be further described in detail. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] The drawings forming a part of the specification depict the embodiments of the present disclosure and, together with the description, are used to explain the principles of the present disclosure.

[0068] Referring to the drawings, according to the following detailed description, the present disclosure can be more clearly understood, wherein:

[0069] Figure 1 is a flowchart of an embodiment of the service rollback method of the present disclosure;

[0070] Figure 2 is a schematic diagram of the system interaction interface of an embodiment of the service rollback method of the present disclosure;

[0071] Figure 3 The flowchart of an embodiment of the service rollback method of the present disclosure;

[0072] Figure 4 The structural schematic diagram of an embodiment of the service rollback device of the present disclosure;

[0073] Figure 5 The structural schematic diagram of an embodiment of the service rollback device of the present disclosure;

[0074] Figure 6 The block diagram of the electronic device of the embodiment of the present disclosure. Detailed implementation manners

[0075] Now, various exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be noted that: unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions and values set forth in these embodiments do not limit the scope of the present invention.

[0076] The following description of at least one exemplary embodiment is actually merely illustrative and is not intended to impose any limitation on the present invention or its application or use.

[0077] Techniques, methods and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the techniques, methods and devices should be regarded as part of the specification.

[0078] It should be noted that: similar reference numerals and letters denote similar items in the following drawings, and thus, once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.

[0079] Embodiments of the present invention can be applied to electronic devices such as computer systems / servers, which can operate together with numerous other general-purpose or special-purpose computing system environments or configurations. Examples of well-known computing systems, environments and / or configurations suitable for use with computer systems / servers and other electronic devices include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, minicomputer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the above systems, and so on.

[0080] Computer systems, servers, and other electronic devices can be described in the general context of computer system-executable instructions (such as program modules) executed by a computer system. Generally, program modules can include routines, programs, target programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. The computer system / server can be implemented in a distributed cloud computing environment where tasks are executed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0081] Figure 1 This is a flowchart of an embodiment of the service rollback method of the present disclosure. As Figure 1 shown, the method may specifically include:

[0082] Step S110, receiving a rollback instruction for a specified deployed service, where the rollback instruction includes the service name of the specified service.

[0083] Rollback refers to the act of restoring a program to the most recent correct version when an error occurs in the service program. This mechanism is widely used in multiple fields such as software development and system deployment, aiming to ensure system stability and data integrity. For example, during service deployment, when problems or non-conformances occur after a new version is launched, the service program is rolled back to the previous stable version. This operation aims to quickly restore system stability and availability. By quickly rolling back to the stable version, service interruptions and user impacts caused by new version problems can be reduced, ensuring continuous system operation and user satisfaction.

[0084] When problems or non-conformances occur in the current version of the deployed service, the user can issue a rollback instruction for the deployed service through the interaction interface of the software release system. Among them, the rollback instruction can include the service name of the specified service for which the user wants to perform the rollback operation. In one way, a list of service names of all services in the system can be displayed in the interaction interface, and the user can select the service name of the specified service for which they want to perform the rollback operation from the list. In another way, the user can also enter the service name of the specified service for which they want to perform the rollback operation in the input box. The software release system receives the rollback instruction for the specified deployed service through the interaction interface and can obtain the service name of the specified service that needs to be rolled back from the rollback instruction.

[0085] Step S120, determining the current version of the specified service and the device to which the current version is deployed according to the service name of the specified service.

[0086] The current version of the specified service may be in a fully deployed or partially deployed state. Among them, full deployment means that the current version has been deployed to all devices in the system; partial deployment means that the current version has only been deployed to a part of the devices in the system. For example, if there are 10 servers in the system. Then full deployment means that the current version has been fully deployed to all 10 servers. In the case of partial deployment, the current version may only be deployed to 5 of the servers.

[0087] The software release system can obtain the service name of the specified service that needs to be rolled back according to the rollback instruction. Then, based on the service name, it can use the query method provided by the system to query the current version of the specified service. For example, it can use a query command or view the current version of the specified service in the system control panel.

[0088] In addition, when each version of the service is released, release information will be recorded in the release record of the software release system. The release information includes the version number of the service and which devices in the system this version has been deployed to, etc. After querying the current version of the specified service, further, the software release system can query the devices to which the current version has been deployed in the release record of the software release system. In subsequent steps, the devices to which the current version has been deployed are used as the devices that need to be rolled back, ensuring that all devices that need to be rolled back return to the correct version, enabling the system to adapt to a complex deployment environment, thereby achieving a reliable rollback operation and maintaining the overall consistency of the system.

[0089] Step S130, determine the target version for rolling back the specified service according to the service name of the specified service.

[0090] The software release system can also query the release versions before the current version of the specified service in the release record of the software release system according to the service name of the specified service, and determine the target version for rolling back the specified service as the previous release version. For example, the target version of the rollback operation can be determined according to the current deployment status. Specifically, query the latest full deployment version before the current version of the specified service, and determine this full deployment version as the target version for rolling back the specified service.

[0091] Step S140, perform a rollback operation on the specified service according to the target version and the devices to which the current version has been deployed.

[0092] The software release system performs a rollback operation on the specified service according to the target version determined in step S130 and the devices to which the current version has been confirmed in step S120. Specifically, roll back the specified service to the target version on the devices to which the current version has been deployed.

[0093] Based on the embodiments of the present disclosure, by confirming the current version of the specified service and the devices to which the current version is deployed, and determining the target version for rolling back the specified service, and then performing a rollback operation on the specified service according to the target version and the devices to which the current version is deployed, the target version of the rollback operation can be determined according to the current deployment status, and the devices that need to perform the rollback operation can be accurately identified, adapting to complex deployment environments, ensuring that all devices that need to perform the rollback operation return to the correct version, maintaining the overall consistency of the system, achieving intelligent and reliable rollback, thereby improving the maintainability and stability of the system.

[0094] In one implementation, Figure 1 In step S120 of, determining the current version of the specified service and the devices to which the current version is deployed according to the service name of the specified service includes:

[0095] Obtain the service name of the specified service from the rollback instruction;

[0096] According to the service name of the specified service, query the current version of the specified service and the devices to which the current version is deployed in the database recording service release information.

[0097] Figure 2 It is a schematic diagram of the system interaction interface of an embodiment of the service rollback method of the present disclosure. Refer to Figure 2 The "appid / cdn directory" in indicates the service name, and this directory is also the storage address of the service program. There may be multiple services saved in the software release system. Related services can be stored together. For example, the front-end program and the back-end program corresponding to a service can be stored together, or the related programs of the same project can be stored together to facilitate users to find them when going online.

[0098] When problems occur or the deployed service does not meet expectations, the user can Figure 2 issue a rollback instruction for the deployed service through the interaction interface shown. Specifically, the service name of the specified service to be rolled back can be selected in the list of "appid / cdn directory" of the interaction interface. The software release system receives the rollback instruction for the deployed specified service through this interaction interface, obtains the service name of the specified service that needs to perform the rollback operation from the rollback instruction, and then queries the current version of the specified service and the devices to which the current version is deployed in the database recording service release information, and takes the devices to which the current version is deployed as the devices that need to perform the rollback operation.

[0099] Refer to Figure 2 , after the software release system confirms the current version of the specified service and the devices that need to perform the rollback operation, it displays the current version and the list of machines to be rolled back on the interaction interface. For example, inFigure 2 Among them, the current version number of the service named "i.release.ke.com" in the service list is "253", and the list of machines to be rolled back includes servers with Internet Protocol Address (IP address) "10.26.10.96, 10.26.10.104".

[0100] In the embodiments of the present disclosure, by querying the current version of the specified service and the devices to which the current version is deployed in the database, the devices that need to be rolled back can be accurately identified, so that the software release system can adapt to complex deployment environments, including partial deployment and multi-stage deployment. For example, in the case of partial deployment, the software release system can accurately determine the rollback scope. This method ensures that in a complex deployment environment, only the devices to which the current version is deployed are rolled back, without affecting other normally running devices, thereby minimizing the impact on the overall system. Finally, it ensures that all devices that need to be rolled back return to the correct version, maintaining the overall consistency of the system, achieving intelligent and reliable rollback, and thus improving the maintainability and stability of the system.

[0101] In one implementation manner, Figure 1 In step S130 of, determining the target version for performing a rollback operation on the specified service according to the service name of the specified service includes:

[0102] Obtain the service name of the specified service from the rollback instruction;

[0103] According to the service name of the specified service, query the latest full release version before the current version of the specified service in the database recording service release information;

[0104] Determine the full release version as the target version for performing a rollback operation on the specified service.

[0105] The software release system obtains the service name of the specified service that needs to be rolled back from the rollback instruction, and then, according to the service name of the specified service, queries the version of the last full online release of the specified service in the database recording service release information as the target version for performing a rollback operation on the specified service. Specifically, the software release system executes a rollback version selection algorithm to select the target version based on the deployment status of the specified service. In one example, the rollback version selection algorithm includes the following strategies:

[0106] 1) If the current version of the specified service is not fully released, query whether the previous version of the current version is fully released until the latest fully released version is found, and then roll back to the latest fully released version;

[0107] 2) If the current version of the specified service has been fully released, roll back to the previous fully released version.

[0108] In the embodiments of the present disclosure, through the above intelligent version selection mechanism, the target version of the rollback operation is determined according to the current deployment status, and the most suitable rollback version is automatically selected by using the rollback version selection algorithm, avoiding and reducing human decision-making errors, ensuring that all devices that need to perform rollback operations return to the correct version, thereby realizing intelligent and reliable rollback.

[0109] In one implementation, Figure 1 In step S140 of, the rollback instruction further includes a rollback method; performing a rollback operation on the specified service according to the target version and the devices deployed with the current version further includes:

[0110] Obtain the rollback method from the rollback instruction;

[0111] In the case where the rollback method is smooth rollback, after draining the traffic of the specified service, roll back the specified service to the target version;

[0112] In the case where the rollback method is fast rollback, after forcibly ending the process of the specified service, roll back the specified service to the target version.

[0113] Refer to Figure 2 In the system interaction interface shown, the user can select the rollback method in the rollback parameters of the interaction interface. The rollback methods include smooth rollback and non-smooth rollback. Non-smooth rollback is also called fast rollback. The software release system can receive the rollback instruction of the specified service through this interaction interface and obtain the rollback method from the rollback instruction.

[0114] Among them, smooth rollback means draining the traffic of the specified service, that is, first not allowing the service to establish new connections and processing the tasks that have already established connections first. After all the tasks with established connections are processed, then perform a rollback operation on the specified service. If there are some minor problems that do not affect user use online, such as unclear page layout, etc., the smooth rollback method can be used to perform the rollback operation. If the user selects the smooth rollback method, the software release system will cut off all the traffic of the specified service and then kill the process of the service, so that the specified service can be smoothly rolled back to the target version.

[0115] Among them, fast rollback means that the connection established between the server and the client has not been interrupted, and the rollback operation is immediately performed while the server and the client are still in a communication state. That is to say, in the case of using fast rollback, there is no need to wait for the service process to be processed, and the service process is directly killed. Refer to Figure 2, the process can be killed using the kill --- 9 command without draining the traffic of the specified service, that is, directly killing the process of the service regardless of the status of the service connection. If problems such as service interruption occur online and affect user usage, a rollback operation can be performed in a fast rollback manner. The longer the service interruption time, the greater the impact and loss. The impact and loss may include inability to access online, unable to open online pages, unable to access interfaces, white screens on pages, etc. Using the fast rollback method can reduce the interruption time. Users can measure the urgency of the problems that occur online and then perform the fast rollback operation. This operation may cause all traffic requested to the machine being operated on to report errors during the rollback. If the user selects the fast rollback method, the software release system does not consider the traffic situation and directly uses the method of forcibly killing the process of the service to minimize the impact and loss caused.

[0116] As Figure 3 shown, in one implementation, Figure 1 in step S140, according to the target version and the devices to which the current version is deployed, a rollback operation is performed on the specified service, and it further includes:

[0117] Step S210, determining the selection range of rollback batches based on the system load and application characteristics. The rollback batch is the number of batches for performing a batch-by-batch rollback operation on the devices to which the current version of the specified service is deployed;

[0118] Step S220, obtaining the rollback method from the rollback instruction, and determining the default option of the rollback batch according to the rollback method and the selection range of the rollback batch;

[0119] Step S230, presenting the default option of the rollback batch and the selection range of the rollback batch to the user, and receiving the rollback batch specified by the user according to the default option and the selection range;

[0120] Step S240, performing a rollback operation on the specified service according to the specified rollback batch.

[0121] During the rollback operation, the software release system can manage the rollback batches according to the specific situation. Specifically, in step S210, the software release system can query the system load and application characteristics in the system database, and use a dynamic rollback batch algorithm based on the system load and application characteristics to determine the selection range of the rollback batch. Among them, the system load is the total number of devices to which the current version of the specified service is deployed; the application characteristics are the limitations of the batch number of the batch-by-batch rollback operation due to the business requirements of some services.

[0122] In one example, the software release system queries that a total of 10 servers are deployed for the current version of the specified service, and its application characteristics do not limit the batch quantity to an upper limit value of 3. Then the selection range of the rollback batch is from 1 to 3. That is to say, the upper limit value of the rollback batch is 3, which means that the 10 servers are rolled back in 3 batches. The number of servers for which the rollback operation is performed in each batch can be 4, 4, 2 or 4, 3, 3 respectively; the lower limit value of the rollback batch is 1, which means that the 10 servers start the rollback operation simultaneously in one batch and are rolled back to the target version at one time.

[0123] In another example, the software release system queries that a total of 5 servers are deployed for the current version of the specified service, and its application characteristics do not limit the batch quantity. Then the selection range of the rollback batch is from 1 to 5. That is to say, the upper limit value of the rollback batch is 5, which means that the 5 servers are rolled back in 5 batches, and 1 server is rolled back to the target version in each batch; the lower limit value of the rollback batch is 1, which means that the 5 servers start the rollback operation simultaneously in one batch and are rolled back to the target version at one time.

[0124] In Figure 2 In the system interaction interface shown, the user selects the rollback method in the rollback parameters of the interaction interface. In step S220, the software release system can receive the rollback instruction for the specified service from the user through this interaction interface and obtain the rollback method from the rollback instruction. Then the software release system determines the default option of the rollback batch according to the rollback method and the selection range of the rollback batch.

[0125] In one case, if the rollback method selected by the user is fast rollback, the default option of the rollback batch is determined to be 1, and all the servers released in the current version are rolled back at one time. The situation of performing fast rollback is usually that there are relatively serious problems in the system. In this case, determining the default option of the rollback batch to be 1 can perform the rollback at the fastest speed and reduce the service interruption time.

[0126] In another case, if the rollback method selected by the user is smooth rollback, the value of the default option for the rollback batch cannot be set to 1. If the rollback batch is 1, the devices deploying the service performing rollback simultaneously may cause the service to be unavailable externally at the moment of rollback, and the service may be in a hung state and unable to be accessed. Therefore, in the case of smooth rollback, to enable the system to perform rollback stably, the value of the default option for the rollback batch cannot be set to 1. If the rollback method selected by the user is smooth rollback, then set the value of the default option for the rollback batch to be greater than 1 and less than or equal to the upper limit of the selection range. For example, if the selection range of the rollback batch is from 1 to 3, then if the rollback method selected by the user is smooth rollback, the default option for the rollback batch can be set to 2 or 3, and the specific value set can be determined according to service requirements. For example, in a business scenario with relatively high requirements for rollback efficiency, to increase the rollback speed, the default option for the rollback batch can be set to a relatively small value.

[0127] In step S230, the software release system presents the default option for the rollback batch and the selection range of the rollback batch to the user. If the user deems the default option inappropriate, the user can adjust the rollback batch on the interaction interface, and the user can select a specified rollback batch based on the default option and the selection range. Refer to Figure 2 , and can select a specified rollback batch from the drop-down menu of "batch quantity". The software release system can receive the rollback batch specified by the user through the interaction interface. In step S240, the software release system performs rollback operations on the specified service in batches according to the rollback batch specified by the user.

[0128] In this implementation, by determining the selection range of the rollback batch based on the system load and application characteristics, and determining the default option for the rollback batch according to the rollback method and the selection range of the rollback batch, reasonable reference options for the rollback batch are provided for the user, intelligent batch management is achieved during the rollback process, while ensuring system stability, the rollback speed is optimized, and the service interruption time is reduced in the case of fast rollback, realizing intelligent and efficient rollback operations.

[0129] Refer to Figure 2Example: When the user clicks the "One - key Rollback" on the interactive interface, the system can pop up a dialog box for the user to confirm again whether to perform the rollback. If the user chooses to cancel, the current operation is cancelled. If the user chooses to confirm, the software release system concatenates the information confirmed by the system and each parameter selected by the user on the interactive interface to form a rollback instruction. Among them, the information confirmed by the system includes the current version of the specified service, the device to which the current version is deployed, and the target version for the rollback operation; the parameters selected by the user on the interactive interface can include the service name, the rollback method, and the specified rollback batch. In addition, the software release system can also verify the rollback instruction to check whether the user has the permission for the current operation. After passing the verification, the concatenated parameters are sent to the operation and maintenance module in the system, and the operation and maintenance module performs the rollback operation on the specified service according to the rules specified in the rollback instruction. Thus, the entire process of a rollback operation is completed.

[0130] In one implementation, Figure 1 In step S140, for the rollback operation of the specified service, it further includes:

[0131] According to the configuration information of the specified service, determine the application type of the specified service; among them, the application type includes at least one of PHP (Hypertext Preprocessor) applications and JAVA applications;

[0132] Obtain the rollback program corresponding to the application type of the specified service, and use the rollback program to perform the rollback operation on the specified service.

[0133] Services of different application types are written based on different programming languages, so their specific implementation schemes are also different, specifically including different interfaces called at the bottom layer, different parameters passed, etc. For example, when the service starts, a JAVA application needs to perform a signature verification operation to verify the parameters, while a PHP application does not need to perform a signature verification operation. Corresponding rollback programs can be pre-written for different rollback methods of different application types of the service, including process termination programs and restart programs. For example, for JAVA applications, two sets of rollback programs are pre-written, namely the corresponding smooth rollback and fast rollback programs; similarly, for JAVA applications, two sets of rollback programs are also pre-written, namely the corresponding smooth rollback and fast rollback programs. When performing a rollback operation on a specified service, the software release system first determines the application type of the specified service according to the configuration information of the specified service, for example, by viewing the service configuration file, viewing the running environment information, etc. to determine the application type of the specified service, or by viewing the file extension of the program file, viewing the comment information in the source code, etc. to determine the application type of the specified service. Then, obtain the rollback method indicated by the user, obtain the corresponding rollback program based on the application type and rollback method of the specified service, and use the rollback program to perform a rollback operation on the specified service.

[0134] In the embodiments of the present disclosure, the software release system can intelligently select a suitable rollback program according to different application types of the service, so that the system can adapt to the specific requirements of different types of applications (such as PHP applications, Java applications, etc.), improving the efficiency and success rate of rollback.

[0135] In one implementation manner, the above method further includes:

[0136] Estimate and display rollback time information for performing a rollback operation on a specified service according to the historical data of the specified service.

[0137] The software release system can combine historical data and the real-time system status to provide a high-precision rollback time estimate. Among them, the rollback time is the duration of a single fast release of the service. An average value can be estimated based on the historical start time as an estimated value of the rollback time. In addition, it can be estimated in combination with the real-time system status, and the rollback times of different application types may be different. For example, the expected rollback time for a PHP application is 30s, and the rollback time for a Java application is a start time.

[0138] In the embodiments of the present disclosure, the software release system can accurately estimate the time required for rollback, improve the predictability of the rollback operation, and can display the estimated rollback time in real time on the user interface during the rollback operation, providing a reliable time reference for operation and maintenance decisions and enhancing the user experience.

[0139] In one implementation manner, the above method further includes:

[0140] During the rollback operation of a specified service, rollback information is presented to the user. The rollback information includes at least one of the release status of the current version of the specified service, the rollback progress, the target version, and the devices to which the current version is deployed.

[0141] During the rollback operation of a specified service, the rollback progress can be obtained from a pre-set interface. For example, fetching code, deploying the service, starting the service, service start completed, performing health checks, etc. After each device is released, the rollback status is recorded in the database of the software release system, such as rollback successful or rollback failed. A visual interface can be set up in the software release system to obtain information such as the rollback progress and rollback status from the above interfaces and databases, and display the rollback progress, rollback status, and potential problems in real time. Potential problems can include code fetch failure, service start failure, etc.

[0142] In addition, on the visual interface, the release status of the current version of the specified service, the target version, and the devices to which the current version is deployed can also be presented to the user. Among them, by presenting the release status of the current service, the user can be informed whether the current service is being released or rolled back. Refer to Figure 2 In the example of, the release status of the current service is shown as "idle". The status of "idle" means that the service is neither being released nor rolled back. If a user instructs to release or roll back a specified service, during the execution of the release or rollback operation, the release status of the service is shown as being released or being rolled back, so that after other users learn the release status of the service, they will not perform operations on the service again. In this way, conflicts caused by multiple users operating on the same service simultaneously can be effectively avoided.

[0143] In the embodiments of the present disclosure, by presenting rollback information during the rollback process, the rollback progress and status are clearly shown, improving the manageability and transparency of the rollback process and enhancing the user experience.

[0144] In addition, an error detection and automatic recovery mechanism during the rollback process can also be introduced in the software release system. The system can monitor anomalies during the rollback process in real time and automatically take corrective measures. For example, when the service fetches code and then performs a health check, if the operation fails in each process, it will be retried to handle operation anomalies caused by network reasons. For example, if the interface is not accessible during the operation, resulting in the operation failure, then retry to make the operation proceed normally. In this way, the reliability of the rollback operation can be improved.

[0145] In a software release system, APIs (Application Programming Interfaces) and plugin systems that are easy to integrate can also be designed, enabling the rollback solution to be seamlessly integrated into existing CI / CD (Continuous Integration / Continuous Delivery / Continuous Deployment) processes, significantly reducing the adoption cost. Among them, CI / CD is a software development practice aimed at frequently building, testing, and releasing software in an automated manner to improve the speed and quality of software delivery and enable the team to respond more quickly to market changes and user needs.

[0146] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including the above method embodiments; and the foregoing storage medium includes various media such as ROM, RAM, magnetic disks, or optical discs that can store program codes.

[0147] As Figure 4 shown, the present disclosure also provides an embodiment of a corresponding service rollback device. Regarding the beneficial effects or technical problems solved by the device, reference can be made to the descriptions in the methods corresponding to each device respectively, or to the descriptions in the summary of the invention. Details are not repeated here.

[0148] In the embodiment of the service rollback device, the device includes:

[0149] A receiving unit 100, configured to receive a rollback instruction for a specified service that has been deployed, where the rollback instruction includes the service name of the specified service;

[0150] A first determination unit 200, configured to determine the current version of the specified service and the device to which the current version is deployed according to the service name of the specified service;

[0151] A second determination unit 300, configured to determine the target version for performing a rollback operation on the specified service according to the service name of the specified service;

[0152] An operation unit 400, configured to perform a rollback operation on the specified service according to the target version and the device to which the current version is deployed.

[0153] In an implementation manner, the first determination unit 200 is configured to:

[0154] Obtain the service name of the specified service from the rollback instruction;

[0155] Query the current version of the specified service and the devices to which the current version is deployed in the database that records service release information according to the service name of the specified service.

[0156] In one implementation, the second determination unit 300 is configured to:

[0157] Obtain the service name of the specified service from the rollback instruction;

[0158] Query the latest full release version before the current version of the specified service in the database that records service release information according to the service name of the specified service;

[0159] Determine the full release version as the target version for the rollback operation on the specified service.

[0160] In one implementation, the rollback instruction further includes a rollback method; the operation unit 400 is configured to:

[0161] Obtain the rollback method from the rollback instruction;

[0162] In the case where the rollback method is smooth rollback, after draining the specified service, roll back the specified service to the target version;

[0163] In the case where the rollback method is fast rollback, after forcibly ending the process of the specified service, roll back the specified service to the target version.

[0164] In one implementation, the operation unit 400 is configured to:

[0165] Determine the selection range of rollback batches based on the system load and application characteristics, where the rollback batch is the number of batches for the batch rollback operation on the devices to which the current version of the specified service is deployed;

[0166] Obtain the rollback method from the rollback instruction, and determine the default option of the rollback batch according to the rollback method and the selection range of the rollback batch;

[0167] Display the default option of the rollback batch and the selection range of the rollback batch to the user, and receive the rollback batch specified by the user according to the default option and the selection range;

[0168] Perform a rollback operation on the specified service according to the specified rollback batch.

[0169] In one implementation, the operation unit 400 is configured to:

[0170] Determine the application type of the specified service according to the configuration information of the specified service; wherein, the application type includes at least one of PHP applications and JAVA applications;

[0171] Obtain a rollback program corresponding to the application type of a specified service, and use the rollback program to perform a rollback operation on the specified service.

[0172] As Figure 5 shown, in one embodiment, the above device further includes a display unit 500, configured to:

[0173] Estimate and display rollback time information for performing a rollback operation on the specified service according to the historical data of the specified service.

[0174] As Figure 5 shown, in one embodiment, the above device further includes a display unit 500, configured to:

[0175] During the process of performing a rollback operation on the specified service, display rollback information to the user, where the rollback information includes at least one of the release status of the current version of the specified service, the rollback progress, the target version, and the devices to which the current version is deployed.

[0176] The service rollback device in the embodiments of the present disclosure corresponds to the above service rollback method embodiments of the present disclosure in terms of specific implementation and beneficial technical effects, and the relevant content can be referred to each other, and will not be elaborated here.

[0177] Next, refer to Figure 6 to describe an electronic device according to an embodiment of the present disclosure. The electronic device can be any one or both of the first device and the second device, or a stand-alone device independent of them, and the stand-alone device can communicate with the first device and the second device to receive the input signals collected from them.

[0178] Figure 6 The block diagram of an electronic device according to an embodiment of the present disclosure is illustrated.

[0179] As Figure 6 shown, the electronic device includes one or more processors and a memory.

[0180] The processor can be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and can control other components in the electronic device to perform desired functions.

[0181] The memory can store one or more computer program products. The memory can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory can include, for example, random access memory (RAM) and / or cache memory, etc. Non-volatile memory can include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program products can be stored on the computer-readable storage media, and the processor can run the computer program products to implement the service rollback method of the various embodiments of the present disclosure above and / or other desired functions.

[0182] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown).

[0183] In addition, the input device may further include, for example, a keyboard, a mouse, and so on.

[0184] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, and so on.

[0185] Of course, for simplicity, Figure 6 only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application scenarios, the electronic device may further include any other appropriate components.

[0186] In addition to the above methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions that cause the processor to execute the steps in the service rollback method according to various embodiments of the present disclosure described in the above part of this specification when the computer program instructions are run by the processor.

[0187] The computer program product can be written in any combination of one or more programming languages for programming code to perform the operations of the embodiments of the present disclosure. The programming languages include object-oriented programming languages, such as Java, C++, etc., and also include conventional procedural programming languages, such as the "C" language or similar programming languages. The programming code can be executed entirely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0188] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium storing computer program instructions, which, when run by a processor, cause the processor to execute the steps in the service rollback method according to various embodiments of the present disclosure described in the foregoing part of this specification.

[0189] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable 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.

[0190] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, benefits, effects, etc. are essential for each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purposes of illustration and facilitating understanding, rather than limitations, and the above details do not limit the present disclosure to necessarily adopt the above specific details for implementation.

[0191] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference may be made to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and reference may be made to the corresponding part of the method embodiment for the relevant content.

[0192] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present disclosure are only illustrative examples and do not intend to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open-ended terms, meaning "including but not limited to", and can be used interchangeably with each other. The word "or" and "and" used herein refer to the word "and / or", and can be used interchangeably with each other unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to", and can be used interchangeably with each other.

[0193] The methods and apparatuses of the present disclosure may be implemented in many ways. For example, the methods and apparatuses of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the specific order described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, and these programs include machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0194] It should also be noted that in the apparatuses, devices, and methods of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of the present disclosure.

[0195] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0196] The above description has been presented for purposes of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the form disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.

Claims

1. A service rollback method, characterized in that, Including: Receiving a rollback instruction for a specified deployed service, where the rollback instruction includes the service name of the specified service; Determining the current version of the specified service and the device to which the current version is deployed according to the service name of the specified service; Determining the target version for performing a rollback operation on the specified service according to the service name of the specified service; Performing a rollback operation on the specified service according to the target version and the device to which the current version is deployed.

2. The method according to claim 1, characterized in that, The determining the current version of the specified service and the device to which the current version is deployed according to the service name of the specified service includes: Obtaining the service name of the specified service from the rollback instruction; Querying the current version of the specified service and the device to which the current version is deployed in the database recording service release information according to the service name of the specified service.

3. The method according to claim 1, wherein The determining the target version for performing a rollback operation on the specified service according to the service name of the specified service includes: Obtaining the service name of the specified service from the rollback instruction; Querying the latest full release version before the current version of the specified service in the database recording service release information according to the service name of the specified service; Determining the full release version as the target version for performing a rollback operation on the specified service.

4. The method according to any one of claims 1 to 3, characterized in that, The rollback instruction further includes a rollback method; The performing a rollback operation on the specified service according to the target version and the device to which the current version is deployed further includes: Obtaining the rollback method from the rollback instruction; In the case where the rollback method is a smooth rollback, after performing a traffic diversion process on the specified service, rolling back the specified service to the target version; In the case where the rollback method is a quick rollback, after forcibly ending the process of the specified service, rolling back the specified service to the target version.

5. The method according to any one of claims 1 to 3, characterized in that, The performing a rollback operation on the specified service according to the target version and the device to which the current version is deployed further includes: Determining a selection range of rollback batches based on system load and application characteristics, where the rollback batch is the number of batches for performing a rollback operation on the devices to which the current version of the specified service is deployed in batches; Obtaining the rollback method from the rollback instruction, and determining the default option of the rollback batch according to the rollback method and the selection range of the rollback batch; Displaying the default option of the rollback batch and the selection range of the rollback batch to the user, and receiving the rollback batch specified by the user according to the default option and the selection range; Performing a rollback operation on the specified service according to the specified rollback batch.

6. The method according to any one of claims 1 to 3, characterized in that, The performing a rollback operation on the specified service further includes: Determining the application type of the specified service according to the configuration information of the specified service; where the application type includes at least one of PHP applications and JAVA applications; Obtaining a rollback program corresponding to the application type of the specified service, and using the rollback program to perform a rollback operation on the specified service.

7. The method according to any one of claims 1 to 3, characterized in that The method further includes: Estimate and display rollback time information for performing a rollback operation on the specified service according to the historical data of the specified service.

8. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Display rollback information to the user during the process of performing a rollback operation on the specified service, where the rollback information includes at least one of the release status of the current version of the specified service, the rollback progress, the target version, and the devices to which the current version is deployed.

9. An electronic device, characterized in that, Includes: A memory for storing a computer program product; A processor for executing the computer program product stored in the memory, and when the computer program product is executed, implementing the method according to any one of claims 1-8 above.

10. A computer program product, comprising computer program instructions, characterized in that, When the computer program instructions are executed by the processor, the method according to any one of claims 1-8 is implemented.