Computer implementations, systems, and computer programs

By tracking the order of global variable modifications in a distributed system and generating a rollback execution plan, the data consistency problem in multi-service transactions is solved, and the correct recovery of global variables is achieved.

JP7856374B2Active Publication Date: 2026-05-11INTERNATIONAL BUSINESS MACHINE CORPORATION
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
INTERNATIONAL BUSINESS MACHINE CORPORATION
Filing Date
2022-09-29
Publication Date
2026-05-11

AI Technical Summary

Technical Problem

In distributed systems, it is difficult to guarantee data consistency management across multiple service transactions, especially when transactions fail, traditional rollback mechanisms cannot properly restore the state of shared variables.

Method used

By detecting the order in which global variables are modified within a transaction, a rollback execution plan is generated to ensure that multiple compensation services are executed in the correct order to restore data consistency.

Benefits of technology

Effectively restore the initial state of global variables when a transaction fails, ensuring data consistency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007856374000001
    Figure 0007856374000001
  • Figure 0007856374000002
    Figure 0007856374000002
  • Figure 0007856374000003
    Figure 0007856374000003
Patent Text Reader

Abstract

To provide a method, a system, and a computer program, for rollback of services with global variable changes.SOLUTION: A method include: detecting that at least two of multiple services in a transaction are executed to change a value of a first global variable; acquiring tracking information to indicate a first order in which the at least two services change the value of the first global variable during execution of the multiple services; and determining, in response to a failure of the transaction, a rollback execution plan for multiple compensation services at least partially based on the tracking information. The multiple compensation services are configured to compensate for the multiple services respectively. The method further includes executing the multiple compensation services according to the rollback execution plan.SELECTED DRAWING: Figure 15
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to rollback of services by changing global variables. The present disclosure generally relates to data consistency techniques in distributed computing, and more particularly to data rollback for global variables in a multi-service setting.

Background Art

[0002] Service implementations are increasingly commonly including multiple serial (subsequent), parallel (concurrent), or combinations thereof calls to other services in a distributed system. A transaction can be designed to include multiple services, and serial, parallel, or combinations thereof calls are possible among the multiple services. These service calls may succeed, may fail due to some error, or may become in an unknown state due to timeout, in which case the transaction may succeed or fail. In a distributed system, a transaction spanning multiple services requires a mechanism for ensuring data consistency across the services, especially when the transaction fails. Typically, a rollback mechanism for managing failures is to provide a rollback compensation service for each service of the transaction to ensure consistency and accuracy across the services of the transaction.

Summary of the Invention

Problems to be Solved by the Invention

[0003] An object of the present invention is to provide a computer-implemented method, system, and computer program.

Means for Solving the Problems

[0004] According to one embodiment of the present disclosure, a method is provided that is implemented on a computer. According to the method, it is detected that at least two of a plurality of services in a transaction are executed and modify the value of a first global variable. During the execution of the plurality of services, tracking information is obtained indicating a first order in which the at least two services modify the value of the first global variable. In response to the failure of the transaction, a rollback execution plan is determined for the plurality of compensation services, at least in part, based on the tracking information, wherein the plurality of compensation services are configured to compensate each of the plurality of services. The plurality of compensation services are made to execute in accordance with the rollback execution plan.

[0005] A further embodiment of the present disclosure provides a system comprising a processor unit and a memory connected to the processor unit, the memory storing instructions. When the instructions are executed by the processing unit, they perform one of the methods described above according to embodiments of the present disclosure.

[0006] Further embodiments of the present disclosure provide a computer program product which includes a computer program product which is tangibly stored in a non-temporary machine-readable medium and includes machine-executable instructions. When the instructions are executed on a device, the instructions cause the device to execute one of the methods described above according to embodiments of the present disclosure. Further embodiments of the present disclosure provide a computer program product which includes a computer-readable storage medium having program instructions embedded therein, and the program instructions, which are executable by an electronic device, cause the electronic device to perform operations which include detecting that at least two of a plurality of services in a transaction are executed to change the value of a first global variable; obtaining tracking information indicating a first order in which the at least two services change the value of the first global variable while the plurality of services are being executed; determining a rollback execution plan for a plurality of compensation services in response to a failure of the transaction, at least in part based on the tracking information, wherein the plurality of compensation services are configured to compensate each of the plurality of services; and causing the plurality of compensation services to be executed according to the rollback execution plan.

[0007] The above and other purposes, features and advantages of this disclosure will become more apparent through a more detailed description of some embodiments of this disclosure in the accompanying drawings. Here, the same reference generally refers to the same components in embodiments of the present invention. [Brief explanation of the drawing]

[0008] [Figure 1] Figure 1 shows a cloud computing node according to several embodiments of this disclosure. [Figure 2] Figure 2 shows a cloud computing environment according to several embodiments of this disclosure. [Figure 3] Figure 3 shows an abstraction model layer according to several embodiments of this disclosure. [Figure 4A] Figure 4A shows several examples of transaction execution and rollback with the same global variables. [Figure 4B] Figure 4B shows several examples of transaction execution and rollback with the same global variables. [Figure 5] Figure 5 shows a block diagram of a computing architecture according to some embodiments of the present disclosure. [Figure 6A] Figure 6A shows an exemplary division of a service according to some embodiments of the present disclosure. [Figure 6B] Figure 6B shows an exemplary correlation between multiple service segments and multiple compensation service segments according to some embodiments of the present disclosure. [Figure 7] Figure 7 shows an example of a compensation service generated for a service according to some embodiments of the present disclosure. [Figure 8] Figure 8 shows an exemplary correlation between multiple service segments and multiple compensation service segments according to some embodiments of the present disclosure. [Figure 9] Figure 9 shows an exemplary execution of a transactional service according to some embodiments of the present disclosure. [Figure 10] Figure 10 shows examples of tracking information according to some embodiments of this disclosure: "METHOD ENTER"; "GLOBAL_VAR_X CHANGED" [Figure 11] Figure 11 shows an example of a rollback execution plan according to some embodiments of the present disclosure. [Figure 12] Figure 12 shows an exemplary execution of a compensation service rollback for a transaction, according to some embodiments of the present disclosure. [Figure 13A] Figure 13A shows an exemplary correlation between multiple service segments and multiple compensation service segments according to some embodiments of the present disclosure. [Figure 13B]Figure 13B shows an exemplary execution of a transaction service according to some other embodiments of the present disclosure. [Figure 13C] Figure 13C shows an example of a rollback execution plan according to some other embodiments of the present disclosure. [Figure 13D] Figure 13D shows an exemplary rollback execution of a compensation service for a transaction according to some other embodiments of the present disclosure. [Figure 14A] Figure 第十四条A shows an exemplary correlation between a plurality of service segments and a plurality of compensation service segments according to some further embodiments of the present disclosure. [Figure 14B] Figure 14B shows an exemplary execution of a transaction service according to some further embodiments of the present disclosure. [Figure 14C] Figure 14C shows an example of a rollback execution plan according to some further embodiments of the present disclosure. [Figure 14D] Figure 14D shows an exemplary rollback execution of a compensation service for a transaction according to some further embodiments of the present disclosure. [Figure 15] Figure 15 shows a flowchart of an exemplary method according to some embodiments of the present disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Some embodiments are described in more detail with reference to the accompanying drawings in which embodiments of the present disclosure are illustrated. However, the present disclosure can be implemented in various ways and should not be construed as limited to the embodiments disclosed herein.

[0010] The present disclosure includes a detailed description of cloud computing, but it should be understood that the implementation of the teachings recited herein is not limited to a cloud computing environment. Rather, embodiments of the present disclosure can be implemented in combination with any other type of computing environment now known or later developed.

[0011] Cloud computing is a service delivery model that enables convenient on-demand network access to a shared pool of configurable computing resources (e.g., networks, network bandwidth, servers, processing, memory, storage, applications, virtual machines, and services) that can be rapidly provisioned and released with minimal management effort or interaction with a service provider. This cloud model can include at least five characteristics, at least three service models, and at least four deployment models.

[0012] The characteristics are as follows.

[0013] On-demand self-service: A cloud consumer can unilaterally provision computing capabilities, such as server time and network storage, as needed, without the need for human interaction with the service provider.

[0014] Broad network access: The capabilities are available over a network and accessed through standard mechanisms that promote use by heterogeneous thin client platforms or thick client platforms (e.g., mobile phones, laptops, and PDAs).

[0015] Resource pooling: A provider's computing resources are pooled to serve multiple consumers using a multi-tenant model, and various physical and virtual resources are dynamically allocated and reallocated according to demand. Consumers generally do not have control or knowledge of the exact location of the resources provided, but can identify the location at a higher level of abstraction (e.g., country, state, or data center), making it location-independent.

[0016] Rapid Adaptability: Features can be provisioned quickly and flexibly, and in some cases automatically, scale out quickly, release quickly, and scale in quickly. For consumers, the features available for provisioning are often unlimited and can be purchased at any amount at any time.

[0017] Service Measurement: Cloud systems automatically control and optimize resource usage by employing metric functions at some level of abstraction appropriate to the type of service (e.g., storage, processing, bandwidth, and active user accounts). Resource usage can be monitored, controlled, and reported, providing transparency to both service providers and consumers.

[0018] The service model is as follows:

[0019] Software as a Service (SaaS): This refers to the functionality provided to consumers for using a provider's applications running on a cloud infrastructure. These applications are accessible from various client devices through a thin client interface, such as a web browser (e.g., web-based email). The consumer does not manage or control the underlying cloud infrastructure, such as the network, servers, operating system, storage, or even the underlying cloud infrastructure encompassing individual application functions, with the possible exception of limited, user-specific application configuration settings.

[0020] Platform as a Service (PaaS): A service provided to a consumer to deploy applications they have created or acquired, generated using programming languages ​​and tools supported by the provider, onto a cloud infrastructure. The consumer does not manage or control the underlying cloud infrastructure, such as the network, servers, operating system, or storage, but has control over the deployed applications and, in some cases, the application hosting environment configuration.

[0021] Infrastructure as a Service (IaaS): This is a service provided to a consumer to provision processing, storage, networking, and other basic computing resources, enabling the consumer to deploy and run any software, including operating systems and applications. The consumer does not manage or control the underlying cloud infrastructure, but has limited control over the operating system, storage, deployed applications, and, in some cases, network components (e.g., the host's firewall).

[0022] The deployment model is as follows:

[0023] Private Cloud: A cloud infrastructure is operated solely for a specific organization. This cloud infrastructure may be managed by that organization or a third party, and may reside on-premises or off-premises.

[0024] Community Cloud: Cloud infrastructure is shared by several organizations and supports a specific community that shares common interests (e.g., mission, security requirements, policies, and compliance considerations). The cloud infrastructure may be managed by the organization or a third party and may reside on-premises or off-premises.

[0025] Public cloud: Cloud infrastructure is available to the general public or large industry groups and is owned by organizations that sell cloud services.

[0026] Hybrid Cloud: Cloud infrastructure is a hybrid of two or more clouds (private, community, or public) that remain separate entities but are brought together by standardized or proprietary technologies (e.g., cloud bursting for load balancing between clouds) that enable data and application migration.

[0027] Cloud computing environments are oriented services that focus on statelessness, low coupling, modularity, and semantic interoperability. The heart of cloud computing is the infrastructure, which includes a network of interconnected nodes.

[0028] Referring here to Figure 1, a schematic diagram of an example of a cloud computing node is shown. Cloud computing node 10 is merely an example of a suitable cloud computing node and is not intended to imply any limitations on the scope of use or functionality of the embodiments of disclosure described herein. Nevertheless, cloud computing node 10 can implement or perform, or implement and perform, any of the functions described above.

[0029] Cloud computing nodes 10 include computer systems / servers 12 or portable electronic devices, such as communication devices, which can operate in a number of other general-purpose or dedicated computing system environments or configurations. Examples of well-known computing systems, environments, or configurations or combinations thereof suitable for use with computer systems / servers 12 include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable home appliances, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments that include any of the above systems or devices.

[0030] The computer system / server 12 can be described in the general context of computer system executable instructions, such as program modules, that are executed by the computer system. Generally, a program module may encompass routines, programs, objects, components, logic, data structures, etc., that perform a specific task or implement a specific abstract data type. The computer system / server 12 may be implemented in a distributed cloud computing environment where tasks are executed by remote processing devices linked via a communication network. In a distributed cloud computing environment, program modules may be located in computer system storage media, such as memory storage devices, encompassing both local and remote computer system storage media.

[0031] As shown in Figure 1, the computer system / server 12 in the cloud computing node 10 is represented in the form of a general-purpose computing device. The components of the computer system / server 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 connecting various system components, such as various system components encompassing the system memory 28, to the processor 16.

[0032] Bus 18 represents any one or more of the above bus structures, including several types of bus structures such as memory buses or memory controllers, peripheral buses, accelerated graphics ports, and processor or local buses using any of the various bus architectures. Such architectures, but not limited to, include Industry Standard Architecture (ISA) buses, Micro Channel Architecture (MCA) buses, Enhanced ISA (EISA) buses, Video Electronics Standards Association (VESA) local buses, and Peripheral Component Interconnect (PCI) buses.

[0033] The computer system / server 12 typically has various computer system-readable media. Such media can be any available media accessible by the computer system / server 12, and it includes both volatile and non-volatile media, removable and non-removable media.

[0034] The system memory 28 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 30 or cache memory 32, or a combination thereof. The computer system / server 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. As just one example, the storage system 34 may be provided for reading from and writing to a non-removable, non-volatile magnetic medium (not shown, typically called a "hard drive"). Not shown, a magnetic disk drive may be provided for reading from and writing to a removable, non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive may be provided for reading from and writing to a removable, non-volatile optical disk, such as a CD-ROM, DVD-ROM, or other optical medium. In such cases, each may be connected to the bus 18 by one or more data medium interfaces. As will be further illustrated and described below, the memory 28 may contain at least one program product having a set of program modules (e.g., at least one) configured to perform the functions of the embodiments of this disclosure.

[0035] A program / utility 40 having a set (at least one) of program modules 42, and, as an example but not limited to, an operating system, one or more application programs, other program modules and program data may be stored in memory 28. Each of the operating system, one or more application programs, other program modules and program data, or any combination thereof, may include an implementation of a networking environment. The program modules 42 generally perform functions or methodologies, or combinations thereof, of the embodiments of the disclosure described herein.

[0036] The computer system / server 12 may also communicate with one or more external devices 14, such as a keyboard, pointing device, display 24, etc.; with one or more devices that enable a user to interact with the computer system / server 12; or with any device (such as a network card, modem, etc.) that enables the computer system / server 12 to communicate with one or more other computing devices; or with a combination thereof. Such communication can be carried out via the input / output (I / O) interface 22. Furthermore, the computer system / server 12 may communicate with one or more networks, such as a local area network (LAN), a general wide area network (WAN), or a public network (such as the Internet) via the network adapter 20, or a combination thereof. As illustrated, the network adapter 20 communicates with other components of the computer system / server 12 via the bus 18. It should be understood that other hardware components or software components, or combinations thereof, may be used with the computer system / server 12, although these are not illustrated. Examples include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archive storage systems.

[0037] Referring here to Figure 2, an exemplary cloud computing environment 50 is illustrated. As shown, the cloud computing environment 50 comprises one or more cloud computing nodes 10, and local computing devices used by cloud consumers, such as personal digital assistants (PDAs) or mobile phones 54A, desktop computers 54B, laptop computers 54C, or automotive computer systems 54N, or combinations thereof, can communicate with the cloud computing nodes 10. The nodes 10 can communicate with each other. The nodes 10 can be physically or virtually grouped into one or more networks, such as private clouds, community clouds, public clouds, or hybrid clouds, or combinations thereof, as described herein (not shown). This allows the cloud computing environment 50 to provide infrastructure, platforms, or software, or combinations thereof, as a service that does not require cloud consumers to maintain resources on their local computing devices. It is understood that the types of computing devices 54A-N shown in Figure 2 are intended to be illustrative only, and that the computing node 10 and the cloud computing environment 50 can communicate with any type of computerized device via any type of network or network addressable connection or a combination thereof (for example, using a web browser).

[0038] Referring here to Figure 3, a set of functional abstraction layers provided by the cloud computing environment 50 (Figure 2) is shown. Repeated descriptions of similar elements used in other embodiments described herein have been omitted for brevity. It should be understood that the components, layers, and functions shown in Figure 3 are intended to be illustrative only, and that embodiments of the present invention are not limited thereto. The following layers and corresponding functions are provided as illustrated:

[0039] The hardware and software layer 60 includes hardware and software components. Examples of hardware components include a mainframe 61, RISC (Reduced Instruction Set Computer) architecture-based servers 62, 63, blade servers 64, storage devices 65, and network and networking components 66. In some embodiments, the software components include network application server software 67 and database software 68.

[0040] The virtualization layer 70 provides an abstraction layer from which the following examples of virtual entities are provided: namely, a virtual server 71, virtual storage 72, a virtual network 73, such as a virtual private network 73, a virtual application and operating system 74, and a virtual client 75.

[0041] In one example, the management layer 80 may provide the following functions: Resource provisioning 81 provides the dynamic procurement of computing resources and other resources used to perform tasks within the cloud computing environment. Metering and Pricing 82 provides cost tracking when resources are used within the cloud computing environment and billing or invoicing for the consumption of these resources. In one example, these resources may include application software licenses. Security provides identification and verification of cloud consumers and tasks, and protection for data and other resources. The user portal 83 provides access to the cloud computing environment for consumers and system administrators. Service level management 84 provides the allocation and management of cloud computing resources to ensure that the required service levels are met. Service Level Agreement (SLA) planning and execution 85 provides the pre-placement and procurement of cloud computing resources for which future requirements are anticipated in accordance with the SLA.

[0042] The workload layer 90 provides examples of functions that can be utilized in a cloud computing environment. Examples of workloads and functions that can be provided from this layer include mapping and navigation 91, software development and lifecycle management 92, virtual classroom education delivery 93, data analytics processing 94, transaction processing 95, and service rollback 96. The functionality of service rollback 96 will be described in the following embodiments of this disclosure.

[0043] In distributed systems, transactions spanning multiple services require a mechanism to ensure data consistency across services. The distributed "saga" pattern is a failure management pattern where each action has a compensatory action for rollback, which helps ensure consistency and accuracy across services. A "saga" represents a higher-level business process consisting of several lower-level requests, each updating data within a single service. Each service has a compensatory service that is executed when that service fails or the saga is aborted.

[0044] As used herein, the term “service” means any type of software program or collection of software modules that provide some functionality. As used herein, the term “transaction” means a high-level service consisting of several low-level services, each updating data within a single service. Thus, a transaction may include multiple services that can be considered a saga. In some cases, a transaction involving multiple services may be referred to as a macro-transaction, and such services may be referred to as micro-transactions. In some cases, a “transaction” may be referred to as a service, while the “services” contained within that transaction may be referred to as microservices.

[0045] As mentioned above, a rollback mechanism is needed to manage transaction failures in distributed services. Typically, once a transaction is initiated, data can be accessed and modified by the execution of those services. Rolling back a transaction means reverting any changes made during execution so that the data modified during execution can be returned to the value it had before the execution began. Individual compensation services may be provided to implement the rollback of their respective services.

[0046] Traditional rollback processes are executed based on service levels. However, in some cases, rollback results may be incorrect when two or more services are running and modifying the same variable. Figures 4A and 4B show several examples of transaction execution and rollback using the same global variable. A global variable is a variable that has a global scope that is visible or accessible across multiple services (or multiple microservices within a single service), or that is both visible and accessible.

[0047] As illustrated, the example transaction 402 for “trip booking” includes multiple services, such as the “book a trip” service 410 for initiating the transaction, the “order flight” service 420 for ordering a flight, the “order hotel” service 430 for ordering a hotel, the “add points” service 440 for adding reward points to the account after the flight has been ordered, and the “add points” service 450 for adding reward points to the account after the hotel has been ordered. The “add points” service 440 is configured to increase the reward points by 1000, and the “add points” service 450 is configured to weight the reward points with a coefficient of “1.01”.

[0048] Figure 4A shows the time spans of each service of the transaction during its execution. Service 410 is started at T0, and then services 420 and 430 are called in parallel by service 410 at T1 to order a flight and a hotel, respectively. The execution of services 420 and 430 can continue for a certain period of time. As shown in Figure 4A, the execution of service 420 is completed first at T2. Once service 420 is complete, service 440 is called and executed, updating the global variable "reward points" from its initial value of "5000" to "6000" at T3. The execution of service 440 is completed at T7. The execution of service 430 is completed at T4, later than the completion time of service 420 (T2). Once service 430 is complete, service 450 is called and executed, changing the global variable "reward points". Because Service 440 updates the global variable "Reward Points" to a value of "6000", Service 450 can continue updating the value from "6000" to "6060" in T5. Service 450 completes execution in T6. After Services 420, 430, 440, and 450 are all completed, Service 410 completes in T8.

[0049] In some cases, if transaction 402 fails (or is aborted), a rollback of transaction 402 may be performed by executing compensatory services for the services included in transaction 402. As shown in Figure 4B, the rollback of transaction 402 begins at Tm0 (note that the timeline is from right to left). A rollback 445 of the "Add Points" service 440 begins at Tm2, ​​and the global variable "Reward Points" is changed from "6060" to "5060" at Tm3 by reversing the operation of service 440 (for example, reversing the weighting). Rollback 445 is completed at Tm4, and then a rollback 425 of the "Order Flight" service 420 is called. A rollback 455 of the "Add Points" service 450 is also started, and the global variable "Reward Points" is changed at Tm5, which is later than Tm3. Therefore, the global variable "reward points" is changed from "5060" to "5009" by undoing the operation of service 450 (for example, undoing the increase). Rollback 455 is completed at Tm6, and then rollback 435 of service 430 for "order a hotel" is called. After rollbacks 425 and 435 of services 420 and 430 are completed at Tm7, the entire rollback 415 of service 410 for "book a trip" is completed.

[0050] However, after the rollback, the value of the global variable "reward points" has not been changed back to its initial value of "5000" when transaction 402 was started. This is because the global variable is first changed in service 450's rollback 445, and then again in service 440's rollback 440 during the rollback process. Following the execution order of services 440 and 450 in Figure 4A, the correct order to revert the changes is to first change the global variable "reward points" by undoing the operation by service 450, and then to change the global variable afterward by canceling the operation by service 440.

[0051] Since services 420, 440 and services 430, 450 run in parallel, their execution can last for different durations and complete at different times, depending, for example, on the tasks being executed and the corresponding resources available to the two services. Thus, in the example in Figure 4A, service 450 is called and modifies the global variable before service 440, but in other cases, service 420 may complete before service 430, and then service 440 may be called and modify the global variable before service 450. Therefore, changes made to the same global variable by different services may be applied in different cases and in different orders.

[0052] Tracking these global variables is extremely important. If a transaction fails, there is always a need to roll back to a previous, consistent state, i.e., to its initial value when the transaction is initiated. Without careful control over the rollback sequence of changes made to these global variables, there is a possibility that the global variables may not revert to their initial state when the transaction is rolled back, which is undesirable.

[0053] According to exemplary embodiments of this disclosure, a solution is proposed for rolling back services involving changes to a global variable. In this solution, the order in which two or more services modify the value of a global variable is tracked during the execution of the services of the transaction, in cases where two or more services of a transaction are executed and the same global variable is modified. In the event of a transaction failure, a rollback execution plan is determined based on the tracked order for multiple compensatory services. The multiple compensatory services are executed in accordance with the rollback execution plan.

[0054] By tracking the order in which changes were made to global variables during the execution of the service, it is possible to control the rollback sequence of the compensation service based on when the global variables were changed. This ensures that the global variables are correctly restored to their initial state.

[0055] Other advantages of this disclosure will be described with reference to the following exemplary embodiments and accompanying drawings.

[0056] Herein, Figure 5 shows a block diagram of a computing architecture 500 according to some embodiments of the present disclosure.

[0057] As illustrated, in the computing architecture 500, the service management system 502 is configured to control and manage the deployment, execution, and rollback of transaction services. For illustrative purposes, an exemplary transaction 510 is shown. As illustrated, transaction 510 includes the above-mentioned services, for example, service 512 (represented as "service_A"), service 514 (represented as "service_B"), service 516 (represented as "service_C"), service 515 (represented as "service_D"), and service 517 (represented as "service_E"). These services of transaction 510 may be deployed to the service execution environment 504 for execution. The services of transaction 510 may make multiple serial, parallel, or combination thereof calls to one or more other services. For example, service 512 may make parallel calls to services 514 and 516, and services 514 and 515 may be executed serially.

[0058] It will be understood that transaction 510 is provided as an example. In some examples, service 512 may make parallel calls to three or more services, or calls to a single service. In some examples, one or more of services 514, 515, 516, and 517 may make serial, parallel, or a combination thereof calls to one or more other services.

[0059] In some embodiments, the service management system 502 may deploy each service of transaction 510 to the service execution environment 504, for example, in response to a user request or other event. The service execution environment 504 may include various infrastructure devices to provide a pool of physical resources to support the services executed thereon. The resources provided in the service execution environment 504 may include processing resources, memory, storage, network resources, etc. In some embodiments, the service execution environment 504 may be a cloud computing environment, such as a public cloud or a private cloud.

[0060] The service management system 502 includes a coordinator 520 configured to deploy each service of transaction 510 in a distributed manner to the service execution environment 504. In a specific example, the services of transaction 510 may be deployed in the service execution environment 504 based on containers. As shown in Figure 5, service 512 is deployed in container 550, service 514 is deployed in container 552, service 515 is deployed in container 554, service 516 is deployed in container 556, and service 517 is deployed in container 558. In some examples, depending on the deployment requirements and the configuration of the service management system 502, one or more containers may be started and form a pod in which one or more services run. In some examples, services implemented in containers of the service execution environment 504 may communicate with each other, for example, via multiple application programming interfaces (APIs) configured for multiple proxies and services provisioned in multiple containers. In other implementations, services do not necessarily have to be deployed based on containers, and therefore, please understand that the service execution environment 504 does not include containers.

[0061] A distributed implementation of transaction 510 can be described as a Saga pattern. In some embodiments, during operation, the services of transaction 510 may run in command / orchestration mode, in which the coordinator 520 is configured to centralize decision-making and ordering logic among multiple services. In some embodiments, during operation, the services of transaction 510 may run in event-driven choreography, in which there is no central coordination, and each service runs and listens for events from other services to decide whether an action should be taken.

[0062] According to exemplary embodiments of this disclosure, the service management system 502 is further configured to implement a rollback mechanism for transactions, for example, transaction 510. As shown in Figure 5, in addition to the coordinator 520, the service management system 502 further comprises a global variable checker 530 and a tracking server 540.

[0063] The global variable checker 530 is configured to detect whether there is one or more global variables in transaction 510. As used herein, a global variable is a variable whose value is modified by two or more services in a transaction. Such variables may be defined according to the services and transactions. In some embodiments, the global variable checker 530 may detect such one or more global variables by checking the code or deployment specifications of each service in transaction 510. The global variable checker 530 may perform the check for the one or more global variables when transaction 510 is to be deployed, during deployment, or after the deployment is complete.

[0064] If one or more global variables are detected, the tracking server 540 is configured to collect tracking information 542 during the execution of the service of transaction 510. In some embodiments, the tracking server 540 may communicate with the container in which the service is deployed, or with a proxy (if available) within the container, to collect the tracking information 542. In particular, for a detected global variable in transaction 510, the collected tracking information 542 may be used to determine or indicate the order in which two or more services of transaction 510 changed the value of the global variable during the execution of the service. If two or more global variables are detected, the tracking server 540 may be configured to obtain tracking information for each global variable. In some embodiments, the tracking information 542 may indicate the timing of changes made to the one or more global variables by two or more services during the execution.

[0065] The service of transaction 510 in the service execution environment 504 may be executed in response to a user request, another service or other event, or a combination thereof. Since transaction 510 does not always complete successfully, tracking information 542 related to the detected one or more global variables may be collected for use in rolling back transaction 510 in order to ensure data consistency across the entire service.

[0066] The coordinator 520 is configured to generate a rollback execution plan 522 based on at least the tracking information 542 in the event of a failure of transaction 510. To support the rollback of transaction 510, multiple compensation services are configured to compensate for multiple services of transaction 510, respectively. The rollback execution plan 522 shows how the multiple compensation services will be executed when performing a rollback for transaction 510. These compensation services are also deployed to the service execution environment 504 for execution.

[0067] As illustrated, compensation service 562 (represented as "service_A_C") is deployed to compensate service 512, where "C" means "compensating" in this specification. Compensation service 562 may be deployed in container 550 together with service 512. Compensation service 564 (represented as "service_B_C") is deployed to compensate service 514 and may be deployed in container 552. Compensation service 566 (represented as "service_C_C") is deployed to compensate service 516 and may be deployed in container 556. Reimbursement service 565 (represented as "service_D_C") is deployed to compensate service 515 and may be deployed in container 554. Compensation service 567 (represented as "service_E_C") is deployed to compensate service 517 and may be deployed in container 558.

[0068] Although the compensation service is shown in Figure 5 to be deployed within the same container as the transaction service, it should be understood that in other embodiments, the compensation service may be deployed in a separate container.

[0069] The tracking information obtained during service execution may indicate one or more sequences in which two or more services of transaction 510 change one or more values ​​of one or more global variables each time they are executed. Therefore, the rollback execution plan 522 may be generated to specify the execution order of these compensatory services. In some embodiments, for a global variable, the rollback execution plan 522 may be generated to specify the sequence in which two or more compensatory services are executed to change the value of a first global variable. These two or more compensatory services are configured to compensate two or more services of transaction 510 in which the global variable was detected. The changes made to the global variable by these two or more compensatory services may be specified in the rollback execution plan 522 to be in the reverse order of the changes made to the global variable by the corresponding services of transaction 510. Thus, according to the rollback execution plan, the changes made to each global variable can be reversed in sequence.

[0070] Once the rollback execution plan 522 is generated, the coordinator 520 configures the compensation service to be executed in the service execution environment 504 according to the rollback execution plan 522. The compensation service can then be controlled to be executed in the order specified by the rollback execution plan 522. By using the tracking information 542 collected during the execution of the service, the execution order of the compensation service can be adequately controlled to achieve a correct rollback for the one or more global variables. Thus, transaction 510 can be correctly rolled back to its initial state.

[0071] It will be understood that the service management system 502 may be implemented by one or more computing systems or devices having computing and storage functions. For example, the service management system 502 may be implemented by one or more computing platforms, servers, mainframes, general-purpose computing devices, cloud environments, etc.

[0072] It will also be understood that the components of the service management system 502 shown in Figure 5 may be implemented as one or more software engines, components, etc., composed of logic to implement functions originating from specific modules. Each component may be implemented using one or more such software engines, components, etc. These software engines, components, etc., run on one or more processors of one or more computing systems or devices and utilize or manipulate data stored in one or more storage devices, memory, etc., in one or more computing systems among multiple computing systems. In some embodiments, the coordinator 520 may be implemented as an ingress gateway to the service execution environment 504. In some embodiments, the global variable checker 530 may be implemented as a function as a service (FaaS) master. Although shown separately, the service management system 502 may be implemented in the same computing environment as the service execution environment 504, for example, in a cloud environment.

[0073] In some embodiments, to have finer control over a set of changes applied to global variables, one or more compensation services may be generated, each comprising a service segment that can be invoked independently. One or more compensation services may be defined in this manner to compensate for a service that changes one or more values ​​of one or more global variables. Several detailed embodiments will be discussed above. In some embodiments, the generation, deployment, or management of such compensation services, or a combination thereof, may be performed by the coordinator 520.

[0074] Of the services 512, 514, 515, 516, and 517 of transaction 510, services 515 and 517 ("service_D" and "service_E") are executed in some examples to change the value of the same global variable (represented as global variable "x"). In some other examples, two or more services from services 512, 514, 515, 516, and 517 may be executed to change the value of one or more further global variables, exemplary embodiments of which will also be described later.

[0075] To generate compensatory services 565 and 567 for services 515 and 517, each of services 515 and 517 may be divided into a series of service segments based on the location of a code snippet that can be executed to change the value of the global variable "x". Then, each of the compensatory services 565 and 567 may be generated to contain a series of multiple compensatory service segments to each compensate a series of multiple service segments of the corresponding service. The sequence of compensatory services may be called independently during execution.

[0076] The generation of the compensation service 515 is shown in Figures 6A and 6B. Figure 6A shows an exemplary division of service 515 according to some embodiments of the present disclosure. A global variable checker 530 may detect from the code of service 515 a code snippet 605 that can be executed to change the value of the global variable "x". The global variable checker 530 may inform the coordinator 520 of the result of the detection. The coordinator 520 may divide service 515 into a series of service segments 610-1, 610-2, and 610-3, which are represented as "service_D_P1", "service_D_P2", and "service_D_P3", as shown in Figure 6A. These service segments 610-1, 610-2, and 610-3 may be referred to as service segment 610, collectively or individually. Service segment 610-2 includes code snippet 605, which can therefore be executed to change the value of the global variable "x".

[0077] In some embodiments, service segments 610-1, 610-2, and 610-3 may be sequentially divided from the beginning to the end of the code for service 515. The division may be performed based on the location of code snippet 605. In some embodiments, service segments 610-1, 610-2, and 610-3 may be determined so that they are executable when the code snippets contained in each service segment are invoked. In some examples, service segment 610-2 is identified from the code of service 515, and the remaining code snippet preceding service segment 610-2 may form service segment 610-1, and the remaining code snippet following service segment 610-2 may form service segment 610-3.

[0078] In some embodiments, the span labels of service segments 610 may be marked with the service code 515 in order to identify the start and end boundaries of each service segment 610. In some embodiments, in order to facilitate the collection of tracking information 542, a set of statements 608 may be added to service segment 610-2 to state that service segment 610-2 contains a global variable "x". Following the set of statements 608, when service segment 610-2 is executed, the message "global_var_x changed" may be produced as output.

[0079] It should be understood that multiple service segments of a service can be divided at a finer granularity than the example shown for service 515. In some examples, if a service contains multiple code snippets that can be executed to change the value of a global variable multiple times, or if a service is executed to change the value of two or more global variables, or a combination thereof, more service segments may be divided to generate multiple corresponding compensatory service segments. Such examples will be illustrated and described in the embodiments below.

[0080] To generate a compensation service 565 for service 515, a series of compensation service segments 620-1, 620-2, and 630-3, represented as "service_D_C_P1", "service_D_C_P2", and "service_D_C_P3", as shown in Figure 6B, may be included in the compensation service 565. Compensation services 620-1, 620-2, and 630-3 may be referred to collectively or individually as compensation service segment 620.

[0081] Compensation service 620-1 is configured to compensate service segment 610-3, compensation service 620-2 is configured to compensate service segment 610-2, and compensation service 620-3 is configured to compensate service segment 610-1. The multiple compensation service segments 620-1, 620-2, and 620-3 are arranged in compensation service 565 in reverse order with respect to service segments 620-3, 620-2, and 620-1 in service 515. In such arrangement, the multiple compensation service segments 620-1, 620-2, and 620-3 can be invoked in the order in which they are arranged in compensation service 565.

[0082] In some embodiments, a compensation service 565, or one or more of several compensation service segments 620, may be input by a user, for example, a user designing a service 515. To facilitate the user generating the compensation service 565, or one or more compensation service segments 620, in some embodiments, a compensation layout may be presented to the user, for example, by a coordinator 520. The compensation layout may show the structure of the compensation service 565 and, more specifically, the sequence order of several compensation service segments 620. The sequence order of the compensation segments 620 may be the reverse of the sequence order of several service segments 610. The presentation of the compensation layout makes it convenient for the user to input code snippets to compensate for the corresponding service segments within the service 515.

[0083] In some embodiments, the compensation layout may be presented for compensation service 565 in a similar representation to that shown in Figure 6B. In some examples, the layout of multiple service segments 610 within service 515 may be presented together with the compensation layout, also shown in Figure 6B. A blank space may be provided for compensation service 630, and the user may enter a code snippet into the corresponding blank space.

[0084] In some embodiments, the coordinator 520 may receive one or more of a set of compensation segments 620 entered by the user. For example, the user may enter code snippets for one or more compensation service segments 620, for example, via a user terminal, and then the entered code snippets may be transmitted to the coordinator 520. Figure 7 shows an example of compensation services 565 obtained from the user, where the code snippets within each compensation service segment are entered and arranged in the order shown in the presented compensation layout.

[0085] In some embodiments, several automated code generation methods may be suitable for generating a compensation service 565, or one or more of several compensation services 620 within a compensation service 565. Automated code generation for several compensation service segments 620 may be based on several service segments 610 to compensate for or roll back operations / actions performed by those service segments 610.

[0086] Several embodiments for generating a compensatory service 565 for service 515 have been described above. A compensatory service 576 for service 517, which is performed to modify the same global variable, may also be generated in a similar manner. Compensatory services for other services performed to modify one or more values ​​of one or more global variables may also be generated in a similar manner to that described above with respect to service 515.

[0087] Figure 8 shows the correlation between multiple service segments and multiple compensation service segments according to several embodiments, where Table 800 shows the correlation for service 515 "Service_D", and Table 810 shows the correlation for service 517 "Service_E".

[0088] In Tables 800 and 810, the “Segment Name” column lists the compensatory service segments in order, the “Global Variable” column indicates whether the multiple compensatory service segments include rollback changes made to the value of a global variable (in this example, the global variable “x”), and the “Previous Segment” column lists the previous multiple compensatory service segments that precede the corresponding multiple service segments. Table 800 further includes a “Compensation” column indicating the multiple service segments 610 to be compensated.

[0089] For example, in Table 800, compensation service segment 620-1 "Service_D_C_P1" is configured to compensate service segment 610-3 "Service_D_P3" which spans code lines 21-30 of service 515 "Service D", compensation service segment 620-2 "Service_D_C_P2" is configured to compensate service segment 610-2 "Service_D_P2" which spans code lines 11-20, and compensation service segment 620-3 "Service_D_C_P3" is configured to compensate service segment 610-3 "Service_D_P1" which spans code lines 1-10. Table 810 shows similar compensation information for multiple service segments of service 517 "Service_E" and multiple compensation service segments of its compensation service 567 "Service_E_C".

[0090] In some embodiments, in addition to compensation layouts generated in a representation similar to that shown in Figure 6B or alternatively, Table 800 or Table 810, or a combination thereof, may also be presented to the user to show one compensation layout for multiple compensation service segments.

[0091] For services of transaction 510 that are not executed to change any value of a global variable, such as services 512, 514, or 516, the compensation service may be generated as a whole, without generating separate compensation service segments depending on the location of the code snippet that could be executed to change the value of the global variable.

[0092] As described above, the compensation service for the service of transaction 510 may be deployed within the service execution environment 504 and may be executed in accordance with the rollback execution plan 522 based on the tracking information 542 captured during the execution of the service.

[0093] Figure 9 shows an example of the above execution in which tracking information 542 may be captured by the tracking server 540 during the execution of the service of transaction 510. The time span of the service execution is shown along the timeline in Figure 9. As shown, service 512 starts at T0, and then services 514 and 516 are called in parallel by service 512 and executed at T1. The execution of services 514 and 516 may continue for different durations. As shown in Figure 9, the execution of service 516 is completed at T2. The execution of service 514 is completed at T3, later than the completion time of service 516. After service 514 is completed at T3, service 515 is called and executed, changing the initial value of the global variable "x" at T4. After service 516 is completed, service 517 is called and executed, changing the value of the global variable "x" at T5. The execution of service 515 is completed at T6. The execution of service 517 is completed at T7. Service 512 is completed after all of services 514, 516, 515, and 517 have been completed.

[0094] In response to the execution of transaction 510 in the example in Figure 9, the tracking server 540 may obtain the tracking information 542 shown in Figure 10. Figure 10 shows the timing of changes made to a global variable by two or more services during execution. Specifically, in the example in Figure 10, the "Time" column indicates the corresponding time, the "Segment Name" column indicates the corresponding compensating service for the transaction (e.g., "Service_D" and "Service_E" in this example), the "Row" column indicates which line of code in the multiple compensating service segments 620 determines the "Global Variable Result", and the "Global Variable" column indicates which global variable is included in the corresponding service. In addition, the "Global Variable Result" indicates whether the global variable "x" was changed by the multiple corresponding services at the corresponding time, and the "Message" column indicates the message received during the execution of the service, where the message "global_var_x_changed" (global variable X was changed) indicates that the value of the corresponding global variable was changed.

[0095] In some embodiments, a compensation service may be generated to include a series of compensation service segments that are invoked independently, and therefore the rollback execution plan 522 may be determined to specify the execution order of the compensation service segments. In particular, the execution order of the compensation service segments generated to reverse changes made to the global variable may be carefully specified according to the order shown in the tracking information 542.

[0096] Specifically, from the tracking information 542 shown in Figure 10, it can be determined that service 515 "Service_D" changes the value of the global variable "x" before service 517 "Service_E". Thus, the correct rollback order for the global variable "x" is that its value is first changed by compensation service 567 "Service_E_C", and then by compensation service 565 "Service_D_C". In compensation services 567 and 565, as can be seen from tables 800 and 810 in Figure 8, multiple compensation service segments "Service_E_C_P2" and "Service_D_C_P2" are generated to compensate for multiple service segments of the two services 517 and 515 that are executed to change the value of the global variable "x".

[0097] According to the above information, when generating rollback execution plan 522 to indicate the correct rollback order for the global variable "x", the coordinator 520 will ensure that in rollback execution plan 522, the compensation service segment "service_E_C_P2" is called first, and then the compensation service segment "service_D_C_P2" is called after the compensation service segment "service_E_C_P2" has been executed and the value of the global variable "x" has been changed. In other words, the compensation service segment "service_D_C_P2" is called after the execution of the compensation service segment "service_E_C_P2" is complete.

[0098] By configuring multiple compensation segments, the entire compensation service 565 "Service_D_C" does not need to wait for the entire compensation service 567 "Service_E_C" to complete. For example, one or more compensation service segments preceding compensation service segment "Service_D_C_P2" may be executed at appropriate times. The calling conditions apply to compensation service segment "Service_D_C_P2".

[0099] In addition to specifying the execution order of compensation service segments "Service_D_C_P2" and "Service_E_C_P2", multiple compensation service segments of the same compensation service may be executed in a contiguous order, and if the corresponding services of transaction 510 are called in parallel, the multiple compensation services may be called in parallel. The multiple compensation services may also be called in reverse order if the corresponding services of transaction 510 are called sequentially.

[0100] Figure 11 shows an example of a rollback execution plan 522 for compensation services 562, 564, 565, 566, and 567. In this example, the "Segment / Service Name" column lists multiple compensation service segments or multiple compensation services, and the "Previous Segment / Service" column indicates the invocation condition for one compensation service segment or one compensation service on the same row. For example, in the case of compensation service segments "Service_D_C_P1" and "Service_E_C_P1", the previous segment is not shown, and they can be invoked without requiring the invocation condition to be met.

[0101] In the case of compensation service segment "Service_E_C_P2", the preceding compensation service segment is specified as compensation service segment "Service_E_C_P1", which means that compensation service segment "Service_E_C_P2" will not be called until compensation service segment "Service_E_C_P1" has been fully executed. This is valid because compensation service segment "Service_E_C_P1" is placed before compensation service segment "Service_E_C_P2" in compensation service "Service_E_C".

[0102] In the case of the compensation service segment "Service_D_C_P2", the preceding compensation service segment is specified to include compensation service segments "Service_D_C_P1" and "Service_E_C_P2". Therefore, the compensation service segment "Service_D_C_P2" is not called until the compensation service segment "Service_D_C_P1" has fully executed, because the compensation service segment "Service_D_C_P1" is placed before the compensation service segment "Service_D_C_P2" within the compensation service "Service_D_C". In addition, the compensation service segment "Service_D_C_P2" may still need to wait until the execution of the compensation service segment "Service_E_C_P2" is complete, and therefore the global variable "x" can be modified by the compensation service segment "Service_E_C_P2" before the compensation service segment "Service_D_C_P2". In this way, the rollback order of the global variable "x" is correct.

[0103] Other compensation service segments and the invocation conditions for multiple compensation services are also specifically indicated in the rollback execution plan 522. Figure 12 shows an exemplary rollback execution of compensation services 562, 564, 565, 566, and 567 that are executed according to the rollback execution plan 522 shown in Figure 11. As illustrated, when a rollback for transaction 510 is initiated, compensation service segment 620-1 "Service_D_C_P1" and compensation service segment 1210-1 "Service_E_C_P1" are invoked and executed in Tm0.

[0104] The execution of compensation service segment 620-1 "Service_D_C_P1" is completed at Tm1. However, the next compensation service segment 620-2 "Service_D_C_P2" within the same compensation service 565 "Service_D_C" is not called at Tm0. This is because rollback execution plan 522 specifies that compensation service segment 620-1 "Service_D_C_P1" is called after the completion of compensation service segment 1210-2 "Service_E_C_P2". The execution of compensation service segment 1210-1 "Service_E_C_P1" is completed at Tm2, ​​after which compensation service segment 1210-2 "Service_E_C_P2" is called and executed. During the execution of compensation service segment 1210-2 "Service_E_C_P2", the value of the global variable "x" is changed, and the changes applied by the execution of service 517 "Service_E" are undone (in T5 during the execution of transaction 510 in Figure 9).

[0105] The execution of compensation service segment 1210-2 "Service_E_C_P2" is completed in Tm3. At this time, the calling conditions for compensation service segment 620-2 "Service_D_C_P2" are met according to rollback execution plan 522. Therefore, compensation service segment 620-2 "Service_D_C_P2" is called and executed in Tm3. Compensation service segment 1210-3 "Service_E_C_P3" can also be called and executed in Tm3. During the execution of compensation service segment 620-2 "Service_D_C_P2", the value of the global variable "x" is further changed, and the changes applied by the execution of service 515 "Service_D" are undone (in T4 during the execution of transaction 510 in Figure 9). Thus, any changes made to the value of the global variable "x" during the failed execution of transaction 510 are recursively applied to the global variable "x" during the rollback process, thereby ensuring that the global variable is rolled back to its initial state (value). The execution of compensation service segment 620-2 "Service_D_C_P2" is completed at Tm4.

[0106] Other compensation service segments and compensation services can also be called and executed according to the rollback execution plan 522, and their call times and durations are shown in Figure 12. At Tm8, compensation service 562 "Service_A_C" is called because both parallel compensation services 564 and 565 are fully executed. At Tm9, compensation service 562 "Service_A_C" is completed.

[0107] In the example above, the global variable is modified or updated only once by one service of transaction 510. In some cases, the same global variable may be modified or updated multiple times by one or more services of transaction 510. In such cases, multiple compensatory service segments and rollback execution plans 522 may also be determined in a similar manner. To better understand embodiments in which the global variable is modified more than once, the examples shown in Figures 13A to 13D will be referenced. In these examples, it is determined that the same global variable should be modified twice by service 515 during the execution of this service, and twice by service 517 during the execution of the same service.

[0108] As shown in Figure 13A, the global variable checker 530 may detect from the code of service 515 that the global variable "x" should be changed twice. Based on the location of the code snippet where it is defined that the global variable "x" should be changed, the coordinator 520 may then divide service 515 into a series of service segments 1310-1, 1310-2, 1310-3, 1310-4, and 1310-5, which are represented as "service_D_P1", "service_D_P2", "service_D_P3", "service_D_P4", and "service_D_P5", as shown in Figure 13A. These service segments 1310-1, 1310-2, 1310-3, 1310-4, and 1310-5 may be referred to collectively or individually as service segment 1310. Of the multiple service segments 1310, service segment 1310-2 is configured to first change the value of the global variable "x" according to the configuration of service 515, and service segment 1340 is configured to second change the value of the global variable "x" according to the configuration of service 515.

[0109] Accordingly, compensation service 565 may be determined (automatically or by user input) to include a series of compensation service segments 1320-1, 1320-2, 1320-3, 1320-4 and 1320-5 (which may be referred to as multiple compensation service segments 1320, either collectively or individually) represented as "Service_D_C_P1", "Service_D_C_P2", "Service_D_C_P3", "Service_D_C_P4" and "Service_D_C_P5", as shown in Figure 13A. The multiple compensation service segments 1320 are arranged and called in the reverse order of the multiple service segments 1310, where "Service_D_C_P1" compensates for "Service_D_P5", "Service_D_C_P2" compensates for "Service_D_4", "Service_D_C_P3" compensates for "Service_D_P3", "Service_D_C_P4" compensates for "Service_D_P2", and "Service_D_C_P5" compensates for "Service_D_P1".

[0110] Compensation service 567 "Service_E" may also be determined in a similar manner to include a series of multiple compensation service segments. Multiple compensation service segments for compensation service 517 may be represented as "Service_E_C_P1", "Service_E_C_P2", "Service_E_C_P3", "Service_E_C_P4", and "Service_E_C_P5", where "Service_E_C_P2" and "Service_E_C_P4" are configured to compensate for multiple service segments of service 517 that are performed to change the value of the global variable "x" twice.

[0111] Figure 13B shows an exemplary execution of multiple services in transaction 510, where the time spans of the execution of these services are shown along the timeline. As illustrated, service 517 is called and executed at T2, and at T3, it changes the initial value of the global variable "x" for the first time within the service. Service 515 is called and executed at T4, and at T5, it changes the initial value of the global variable "x" for the first time within the service. Service 515 continues to execute, and at T6, it changes the value of the global variable "x" for the second time within the service. Service 517 continues to execute, and at T7 (T7 is later than T6), it changes the value of the global variable "x". The execution of service 515 is completed at T8, and the execution of service 517 is completed at T9. The execution of service 512 is completed at T9, after services 514, 516, 515 and 517 have all been completed.

[0112] During the execution of the example in Figure 13B, the value of the global variable "x" is changed sequentially by service 517 at T3, by service 515 at T5 and T6, and by service 517 at T7. The tracking server 540 can track and record the order in which changes were applied to the global variable "x" in the tracking information 542. According to the tracking information 542, the coordinator 520 may generate a rollback execution plan 522 to perform a rollback for transaction 510 in the event of execution failure, as shown in Figure 13B.

[0113] Figure 13C shows an example of a rollback execution plan 522 generated based on tracking information 542 tracked during execution, as shown in Figure 13B. In the rollback execution plan 522 of Figure 13C, among other things, the preceding multiple compensation service segments for compensation service segment "Service_D_C_P2" are specified to include multiple compensation service segments "Service_D_C_P1" and "Service_E_C_P2". Thus, compensation service segment "Service_D_C_P2" is called after the execution of both compensation service segments "Service_D_C_P2" and "Service_E_C_P2" is complete.

[0114] In addition, the compensation service segment "Service_D_C_P4" is specified to be called after the compensation service segment "Service_D_C_P3", and therefore, again after the compensation service segment "Service_D_C_P2". In the case of the compensation service segment "Service_E_C_P4", the preceding multiple compensation service segments are specified to include multiple compensation service segments "Service_E_C_P3" and "Service_D_C_P4". Therefore, the compensation service segment "Service_E_C_P4" is called after the execution of both compensation service segments "Service_E_C_P3" and "Service_D_C_P4" has been completed.

[0115] Figure 13D shows an exemplary rollback execution of compensation services 562, 564, 565, 566, and 567, which are executed according to rollback execution plan 522, as shown in Figure 13B. As illustrated, compensation service segment 1330-2 "Service_E_C_P2" is called at Tm1 after compensation service segment 1330-1 "Service_E_C_P1" has been fully executed. During the execution of "Service_E_C_P2", the value of the global variable "x" is changed to compensate for a second change made to this global variable during the execution of service 517 "Service_E".

[0116] Compensation service segment 1320-2 "Service_D_C_P2" is called in Tm2 after compensation service segments 1320-1 "Service_D_C_P1" and 1330-2 "Service_E_C_P2" have been fully executed. During the execution of "Service_D_C_P2", the value of the global variable "x" is changed to compensate for a second change made to this global variable during the execution of service 515 "Service_D".

[0117] Compensation service segment 1320-4 "Service_D_C_P4" is called in Tm4 after compensation service segment 1320-3 "Service_D_C_P3" has fully executed. During the execution of "Service_D_C_P4", the value of the global variable "x" is changed to compensate for the initial change made to this global variable during the execution of service 515 "Service_D".

[0118] Compensation service segment 1330-4 "Service_E_C_P4" is called in Tm5 after compensation service segments 1330-3 "Service_E_C_P3" and 1320-4 "Service_D_C_P4" have been fully executed. During the execution of "Service_E_C_P4", the value of the global variable "x" is changed to compensate for the initial change made to this global variable during the execution of service 517 "Service_E".

[0119] During the rollback execution in the example shown in Figure 13D, the value of the global variable "x" is rolled back sequentially by multiple compensation service segments "Service_E_C_P2", "Service_D_C_P2", "Service_D_C_P4", and "Service_E_C_P4". Multiple other compensation service segments and multiple compensation services may also be called and executed according to the rollback execution plan 522. Their call times and durations are shown in Figure 13D.

[0120] In some cases, two or more global variables may be modified or updated one or more times by multiple services in transaction 510. Multiple services, either the same or different, may be executed to modify two or more global variables. In such cases, multiple compensatory service segments and rollback execution plans 522 may also be determined in a similar manner. To better understand embodiments in which global variables are modified two or more times, the examples shown in Figures 14A to 14D will be referenced. In these examples, assume that it is detected that two global variables "x" and "y" should be modified by services 515 and 517. However, it will be understood that it is possible that the same global variables "x" and "y" may be detected to be modified by multiple other different services.

[0121] As shown in Figure 14A, the global variable checker 530 may detect from the code of service 515 that two global variables "x" and "y" should be changed in service 515. Based on the location of the code snippets that define that the global variables "x" and "y" should be changed, the coordinator 520 may divide service 515 into a series of service segments 1410-1, 1410-2, 1410-3, 1410-4, and 1410-5, which are represented as "service_D_P1", "service_D_P2", "service_D_P3", "service_D_P4", and "service_D_P5", as shown in Figure 14A. These service segments 1410-1, 1410-2, 1410-3, 1410-4, and 1410-5 may be referred to collectively or individually as service segment 1410. Of the multiple service segments 1410, service segment 1410-2 is configured to change the value of the global variable "x", and service segment 1440 is configured to change the value of the global variable "y".

[0122] Accordingly, compensation service 565 may be determined (automatically or by user input) to include a series of compensation service segments 1420-1, 1420-2, 1420-3, 1420-4 and 1420-5 (which may be referred to as multiple compensation service segments 1420, either collectively or individually) represented as "Service_D_C_P1", "Service_D_C_P2", "Service_D_C_P3", "Service_D_C_P4" and "Service_D_C_P5", as shown in Figure 14A. The multiple compensation service segments 1420 are arranged in the reverse order of the multiple service segments 1410, where "Service_D_C_P1" compensates for "Service_D_P5", "Service_D_C_P2" compensates for "Service_D_4", "Service_D_C_P3" compensates for "Service_D_P3", "Service_D_C_P4" compensates for "Service_D_P2", and "Service_D_C_P5" compensates for "Service_D_1".

[0123] Compensation service 567 "Service_E" may also be determined in a similar manner to include a series of multiple compensation service segments. Multiple compensation service segments for compensation service 517 may be represented as "Service_E_C_P1", "Service_E_C_P2", "Service_E_C_P3", "Service_E_C_P4", and "Service_E_C_P5", where "Service_E_C_P2" and "Service_E_C_P4" are configured to compensate for multiple service segments of service 517 that are performed to change the value of global variable "x" and the value of global variable "y", respectively.

[0124] Figure 14B shows an exemplary execution of multiple services in transaction 510, where the time spans of the execution of these services are shown along the timeline. As illustrated, service 517 is called and executed at T2, changing the initial value of the global variable "x" for the first time at T3. Service 515 is called and executed at T4, changing the initial value of the global variable "x" again at T5. Service 515 continues to execute, changing the value of the global variable "y" for the first time at T6. Service 517 continues to execute, changing the value of the global variable "y" for the second time at T7. The execution of service 515 is completed at T8, and the execution of service 517 is completed at T9. The execution of service 512 is completed at T9, after services 514, 516, 515 and 517 have all been completed.

[0125] During the execution of the example in Figure 14B, the value of the global variable "x" is changed sequentially by service 517 at T3 and by service 515 at T5, while the value of the global variable "y" is changed sequentially by service 515 at T6 and by service 517 at T7. The tracking server 540 can track and record the order in which changes were applied to the global variable "x" in the tracking information 542. According to the tracking information 542, the coordinator 520 may generate a rollback execution plan 522 to perform a rollback for transaction 510 in the event of execution failure, as shown in Figure 14B.

[0126] Figure 14C shows an example of a rollback execution plan 522 generated based on tracking information 542 tracked during execution, as shown in Figure 14B. In the rollback execution plan 522 of Figure 14C, among other things, the preceding multiple compensatory service segments for the compensatory service segment "service_D_C_P2" are specified to include multiple compensatory service segments "service_D_C_P1" and "service_E_C_P2". Thus, the compensatory service segment "service_D_C_P2" is called after the execution of both compensatory service segments "service_D_C_P1" and "service_E_C_P2" is complete, ensuring the correct rollback order for the global variable "y".

[0127] In addition, the compensation service segment "Service_D_C_P4" is specified to be called after the compensation service segment "Service_D_C_P3". In the case of the compensation service segment "Service_E_C_P4", the preceding multiple compensation service segments are specified to include multiple compensation service segments "Service_E_C_P3" and "Service_D_C_P4". Therefore, the compensation service segment "Service_E_C_P4" is called after the execution of both compensation service segments "Service_E_C_P3" and "Service_D_C_P4" is complete, ensuring the correct rollback order for the global variable "x".

[0128] Figure 14D shows an exemplary rollback execution of compensation services 562, 564, 565, 566, and 567, which are executed according to rollback execution plan 522, as shown in Figure 14B. As illustrated, compensation service segment 1430-2 "Service_E_C_P2" is called at Tm1 after compensation service segment 1430-1 "Service_E_C_P1" has been fully executed. During the execution of "Service_E_C_P2", the value of the global variable "y" is changed to compensate for a second change made to this global variable during the execution of service 517 "Service_E".

[0129] Compensation service segment 1420-2 "Service_D_C_P2" is called in Tm2 after compensation service segments 1420-1 "Service_D_C_P1" and 1430-2 "Service_E_C_P2" have been fully executed. During the execution of "Service_D_C_P2", the value of the global variable "y" is changed to compensate for the initial change made to this global variable during the execution of service 515 "Service_D".

[0130] Compensation service segment 1420-4 "Service_D_C_P4" is called in Tm4 after compensation service segment 1420-3 "Service_D_C_P3" has fully executed. During the execution of "Service_D_C_P4", the value of the global variable "x" is changed to compensate for a second change made to this global variable during the execution of service 515 "Service_D".

[0131] Compensation service segment 1430-4 "Service_E_C_P4" is called at Tm5 after the execution of compensation service segments 1430-3 "Service_E_C_P3" and 1420-4 "Service_D_C_P4" is complete. During the execution of "Service_E_C_P4", the value of the global variable "x" is changed to compensate for the first change made to this global variable during the execution of service 517 "Service_E". At Tm6, after the execution of compensation service segment 1430-4 "Service_E_C_P4" is complete, compensation service segment 1430-5 "Service_E_C_P5" is called.

[0132] During the rollback execution in the example in Figure 14D, the value of the global variable "y" is rolled back sequentially by the compensation service segments "Service_E_C_P2" and "Service_D_C_P2," while the value of the global variable "x" is rolled back sequentially by the compensation service segments "Service_D_C_P4" and "Service_E_C_P4." Multiple other compensation service segments and multiple compensation services may also be called and executed according to the rollback execution plan 522. Their call times and durations are shown in Figure 14D.

[0133] In the examples shown and described above, the value of a global variable is changed in two services, but it will be understood that in other examples, the same global variable may be changed in more than two services. In addition, in some examples, the same global variable may be updated more than once within a single service, and more than two different global variables may be detected from multiple services in a single transaction. In some alternative cases, a rollback execution plan may also be determined, and a compensation service may be generated to execute in a similar manner to that described above.

[0134] Figure 15 shows a flowchart of an exemplary method 1500 according to some embodiments of the present disclosure. The method 1500 can be implemented in a service management system 502, as shown in Figure 5. For the purposes of discussion, the method 1500 will be described in relation to Figure 5.

[0135] In block 1510, the service management system 502 detects that at least two of several services within a transaction are being executed and changing the value of a first global variable. In block 1520, the service management system 502 obtains tracking information indicating a first order in which the at least two services change the value of the first global variable during the execution of the several services. In block 1530, in response to the failure of the transaction, the service management system 502 determines a rollback execution plan for several compensation services, at least in part, based on the tracking information. The several compensation services are configured to compensate each of the several services. In block 1540, the service management system 502 ensures that the several compensation services are executed according to the rollback execution plan.

[0136] In some embodiments, determining the rollback execution plan involves determining the rollback execution plan based at least in part on the tracking information to specify a second order in which at least two of the plurality of compensation services are executed to change the value of the first global variable, wherein the second order is the reverse of the first order.

[0137] In some embodiments, the method further includes, with respect to a first service of at least two services, dividing the first service into a first sequence of multiple service segments, where the first service segments in the first sequence of multiple service segments are executed and the value of a first global variable is modified; and determining a first compensation service from among multiple compensation services based on the first sequence of multiple service segments. In some embodiments, the first compensation service includes a first sequence of multiple compensation service segments, each to be called independently to compensate for the first sequence of multiple service segments.

[0138] In some embodiments, determining the first compensation service includes presenting the user with a layout of the first sequence of a plurality of compensation service segments, wherein the first sequence of the plurality of compensation service segments is in the reverse order of the first sequence of the plurality of service segments; and receiving user input for at least one sequence of the first sequence of compensation services.

[0139] In some embodiments, a first compensation service segment in a first sequence of multiple compensation service segments is determined to compensate the first service segment. In some embodiments, determining the rollback execution plan includes generating the rollback execution plan after the execution of the compensation service segment of the second compensation service among the multiple compensation services is complete, in response to tracking information indicating that the first service modifies the value of the first global variable, before the execution of the second compensation service among the multiple compensation services, specifying that the first compensation service segment of the first compensation service should be invoked. In some embodiments, the compensation service segment of the second compensation service is determined to compensate the service segment of the second service where the value of the first global variable is modified.

[0140] In some embodiments, the first service segment first changes the value of the first global variable, and hereby dividing the first service includes identifying from the first service a second service segment which is executed after the first service segment to second change the value of the first global variable; and further dividing the first service into a first sequence of multiple service segments based on the location of the second service segment, where the first sequence of multiple service segments includes the second service segment. In some embodiments, the first compensation service is determined to further include a second compensation service segment to compensate the second service segment, where the second compensation service segment is invoked before the first compensation service segment.

[0141] In some embodiments, determining the rollback execution plan includes generating a rollback execution plan after the execution of the first and second compensation service segments of the first compensation service is complete, in response to tracking information further indicating that a third service of the plurality of services modifies the value of the first global variable before the first service, and further specifying that the compensation service segment of the third compensation service of the plurality of compensation services should be invoked. In some embodiments, the compensation service segment of the third compensation service is determined to compensate the service segment of the third service where the value of the first global variable is modified.

[0142] In some embodiments, the division of the first service includes identifying a third service segment from the first service to change the value of a second global variable, according to a decision that the first service and at least one further service from the plurality of services are performed to change the value of the second global variable; and dividing the first service by the one or more processors into a first sequence of service segments, further based on the location of the third service segment in the first service, where the first sequence of the plurality of service segments includes the third service segment. In some embodiments, the first compensation service is determined to include a third compensation service segment to compensate for the third service segment.

[0143] In some embodiments, the tracking information further indicates a third sequence in which the first service and the at least one further service modify the value of the second global variable. In some embodiments, determining the rollback execution plan further includes generating the rollback execution plan by the one or more processors after the execution of the compensating service segment of the fourth compensating service among the plurality of compensating services is completed, in response to the third sequence in which the first service modifies the value of the second global variable, before the fourth service of the at least one further service, specifying that the third compensating service segment of the first compensating service should be called. In some embodiments, the compensating service segment of the fourth compensating service is determined to compensate the service segment of the fourth service in which the value of the second global variable is modified.

[0144] It should be noted that, in accordance with the embodiments of this disclosure, the processing of global variable changes or service rollback using the service management system 502 can be implemented by the computer system / server 12 in Figure 1.

[0145] This disclosure may, at a level of technical detail that allows for integration, be a system, method, and / or a computer program or computer program product or a combination thereof. Such computer program product may encompass one or more computer-readable storage media having computer-readable program instructions for causing a processor to perform the aspects of this disclosure.

[0146] The computer-readable storage medium can be a tangible device capable of holding and storing instructions for use by an instruction execution device. The computer-readable storage medium may be, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. A non-exhaustive list of more specific examples of the computer-readable storage medium includes: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), compact disc read-only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically encoded devices such as punch cards or grooved structures on which instructions are recorded, or any suitable combination thereof. As used herein, a computer-readable storage medium should not be interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses passing through optical fiber cables), or electrical signals transmitted via wires.

[0147] The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to individual computing devices / processing devices, or to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, or a wireless network, or a combination thereof. The network may consist of copper transmission cables, optical transmission fibers, wireless transmissions, routers, firewalls, switches, gateway computers, or edge servers, or a combination thereof. A network adapter card or network interface in each computing device / processing device receives computer-readable program instructions from the network and transmits them for storage in a computer-readable storage medium within the individual computing device / processing device.

[0148] The computer-readable program instructions for performing the operations of the Disclosure may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, configuration data for integrated circuits, or source code or object code written in any combination of one or more programming languages, such as object-oriented programming languages ​​(e.g., Smalltalk, C++, etc.) or idiomatic procedural programming languages ​​(e.g., the "C" programming language or similar programming languages). The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, partially as a standalone software package on the user's computer, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer via any type of network, such as a local area network (LAN) or a wide area network (WAN), or such connection may be made to an external computer (e.g., via the Internet using an Internet Service Provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), can execute computer-readable program instructions by personalizing the electronic circuit by utilizing state information of computer-readable program instructions in order to implement the aspects of this disclosure.

[0149] The aspects of this disclosure are described herein with reference to flowcharts, block diagrams, or combinations thereof of methods, apparatus (systems), and computer programs or computer program products, in accordance with embodiments of this disclosure. It will be understood that each block in such flowcharts, block diagrams, or combinations thereof, and any combination of blocks in such flowcharts, block diagrams, or combinations thereof, can be implemented by computer-readable program instructions.

[0150] These computer-readable program instructions can be provided to a computer processor or other programmable data processing device to create a machine, such that the instructions executed via the processor of the computer or other programmable data processing device generate means for implementing functions / operations specified in one or more blocks of the flowchart or block diagram or a combination thereof. These computer-readable program instructions can also be stored in a computer-readable storage medium that can instruct a computer-programmable data processing device or other device or a combination thereof to function in a particular manner, such that the stored instructions include a product containing instructions that implement the functional / operational aspects specified in one or more blocks of the flowchart or block diagram or a combination thereof.

[0151] The computer-readable program instructions may also be loaded onto the computer, other programmable data processing device, or other device such that instructions executed on the computer, other programmable data processing device, or other device implement the functions / operations specified in one or more blocks of the flowchart or block diagram or combination thereof, thereby causing a series of operational steps on the computer, other programmable device, or other device to generate a computer-implemented process.

[0152] The flowcharts and block diagrams in the drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer programs or computer program products according to various embodiments of this disclosure. In this regard, each block in the flowchart or block diagram may represent a module, segment, or part thereof of instructions, which includes one or more executable instructions for implementing one or more specified logical functions. In some alternative implementations, the functions shown in the blocks may occur in a different order than shown in the drawings. For example, two consecutively shown blocks may actually be achieved as a single step executed simultaneously, substantially simultaneously, partially or entirely in a temporally overlapping manner, depending on the functions involved, or the blocks may be executed in reverse order. It should also be noted that each block in the block diagram or flowchart or a combination thereof, and any combination of blocks in the block diagram or flowchart or a combination thereof, may be implemented by a special-purpose hardware-based system that performs the specified functions or operations, or by a combination of special-purpose hardware and computer instructions.

[0153] The descriptions of various embodiments of this disclosure are provided for illustrative purposes only and are not intended to be exhaustive or to limit the disclosed embodiments. Similarly, examples of features or functions of the embodiments of this disclosure described herein, whether used in a particular embodiment description or described as examples, are not intended to limit the embodiments of this disclosure described herein or to limit the disclosure to the examples described herein. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terms used herein have been selected to describe the principles of the embodiments, their practical application to or improvement over technologies seen in the market, or to enable those skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method implemented in a computer, One or more processors detect that at least two of the services within a transaction are executing and changing the value of the first global variable. One or more processors acquire tracking information indicating a first sequence in which at least two of the services change the value of the first global variable while the multiple services are running. In response to the failure of the transaction, one or more processors determine a rollback execution plan for multiple compensation services, at least in part, based on the tracking information, wherein each of the multiple compensation services is configured to compensate for the other, and The plurality of compensation services are to be executed by one or more processors in accordance with the rollback execution plan. The method, including the method described above.

2. Determining the aforementioned rollback execution plan is The rollback execution plan is determined by one or more processors, at least in part, based on the tracking information, and a second order is specified in which at least two of the plurality of compensation services are executed to change the value of the first global variable, wherein the second order is the reverse of the first order. The method according to claim 1, including the method described in claim 1.

3. Regarding the first of the two services mentioned above, The first service is divided into a first sequence of multiple service segments by one or more processors, where the first service segment in the first sequence of multiple service segments is executed, and the value of the first global variable is changed, and Based on the first sequence of multiple service segments, one or more processors determine a first compensation service from among the multiple compensation services. It further includes, Here, the first compensation service includes the first sequence of a plurality of compensation service segments which are to be called independently to compensate for the first sequence of each of the plurality of service segments. The method according to claim 1.

4. The first compensation service segment in the first sequence of multiple compensation service segments is determined to compensate the first service segment and to determine the rollback execution plan. Before the second service among the plurality of services, in response to tracking information indicating that the first service changes the value of the first global variable, After the execution of the compensation service segment of the second compensation service among the plurality of compensation services is completed, the rollback execution plan is generated by the one or more processors, specifying that the first compensation service segment of the first compensation service should be called. Includes, Here, the compensation service segment of the second compensation service is determined to compensate the service segment of the second service in which the value of the first global variable is changed. The method according to claim 3.

5. The first service segment first changes the value of the first global variable, Here, dividing the first service means Identifying from the first service by one or more processors a second service segment that is executed after the first service segment to change the value of the first global variable a second time, and Based on the location of the second service segment, the first service is further divided by the one or more processors into a first sequence of multiple service segments, where the first sequence of multiple service segments includes the second service segment. Includes, Here, the first compensation service is determined to further include a second compensation service segment to compensate the second service segment, wherein the second compensation service segment is invoked before the first compensation service segment. The method according to claim 4.

6. Determining the aforementioned rollback execution plan is In response to the tracking information further indicating that a third service among the plurality of services changes the value of the first global variable before the first service, After the execution of the first and second compensation service segments of the first compensation service is completed, one or more processors generate a rollback execution plan, further specifying that the compensation service segment of the third compensation service of the plurality of compensation services should be called. Includes, Here, the compensation service segment of the third compensation service is determined to compensate the service segment of the third service in which the value of the first global variable is changed. The method according to claim 5.

7. Dividing the first service mentioned above means Identifying by one or more processors a third service segment from the first service to be performed to change the value of the second global variable, in accordance with a decision that the first service and at least one further service from the plurality of services are performed to change the value of the second global variable, and The first service is divided by one or more processors into a first sequence of service segments, based on the position of the third service segment in the first service, where the first sequence of multiple service segments includes the third service segment. Includes, Here, the first compensation service is determined to include a third compensation service segment in order to compensate the third service segment. The method according to claim 3.

8. The tracking information further indicates a third sequence in which the first service and at least one further service change the value of the second global variable, where the rollback execution plan is determined. In response to a third sequence in which the first service changes the value of the second global variable, prior to the fourth service of at least one further service, After the execution of the compensation service segment of the fourth compensation service among the plurality of compensation services is completed, the rollback execution plan is generated by one or more processors, further specifying that the third compensation service segment of the first compensation service should be called. Includes, Here, the compensation service segment of the fourth compensation service is determined to compensate the service segment of the fourth service where the value of the second global variable is changed. The method according to claim 7.

9. It is a system, Processing unit, and A memory connected to the processing unit, which stores instructions therein The system includes the following, and when the instruction is executed by the processing unit, To detect that at least two of the multiple services within a transaction were executed to change the value of the first global variable, Obtaining tracking information indicating a first order in which at least two of the services change the value of the first global variable while the multiple services are running, In response to the failure of the transaction, a rollback execution plan is determined for multiple compensation services, at least in part, based on the tracking information, wherein the multiple compensation services are configured to compensate each of the multiple services, and To ensure that the aforementioned multiple compensation services are executed in accordance with the rollback execution plan. The system that performs operations including the following.

10. Determining the aforementioned rollback execution plan is Determine the rollback execution plan based at least in part on the tracking information and specify a second order in which at least two of the plurality of compensation services are executed to change the value of the first global variable, wherein the second order is the reverse of the first order. The system according to claim 9, including the following:

11. The aforementioned instruction further states that, with respect to the first of the at least two services, Dividing the first service into a first sequence of multiple service segments, where the first service segment in the first sequence of multiple service segments is executed, and the value of the first global variable is changed, and Based on the first sequence of multiple service segments, a first compensation service is determined from among the multiple compensation services. It further includes, Here, the first compensation service includes a first sequence of a plurality of compensation service segments which are to be called independently to compensate for the first sequence of each of the plurality of service segments. The system according to claim 9.

12. The first compensation service segment in the first sequence of multiple compensation service segments is determined to compensate the first service segment and to determine the rollback execution plan. Before the second service among the plurality of services, in response to tracking information indicating that the first service changes the value of the first global variable, After the execution of the compensation service segment of the second compensation service among the multiple compensation services is completed, the rollback execution plan is generated and specifies that the first compensation service segment of the first compensation service should be called. Includes, Here, the compensation service segment of the second compensation service is determined to compensate the service segment of the second service in which the value of the first global variable is changed. The system according to claim 11.

13. The first service segment first changes the value of the first global variable, Here, dividing the first service means Identifying from the first service a second service segment which is performed after the first service segment to change the value of the first global variable a second time, and Based on the location of the second service segment, the first service is further divided into a first sequence of multiple service segments, where the first sequence of multiple service segments includes the second service segment. Includes, Here, the first compensation service is determined to further include a second compensation service segment to compensate the second service segment, wherein the second compensation service segment is invoked before the first compensation service segment. The system according to claim 12.

14. Determining the aforementioned rollback execution plan is In response to the tracking information indicating that a third service among the plurality of services changes the value of the first global variable before the first service, To generate a rollback execution plan that specifies that after the execution of the first and second compensation service segments of the first compensation service is completed, the compensation service segment of the third compensation service of the plurality of compensation services should be called. Includes, Here, the compensation service segment of the third compensation service is determined to further compensate the service segment of the third service in which the value of the first global variable is changed. The system according to claim 13.

15. Dividing the first service mentioned above means Identifying a third service segment from the first service to change the value of the second global variable, in accordance with the decision that the first service and at least one further service from the plurality of services are performed in order to change the value of the second global variable, and The first service is divided by one or more processors into a first sequence of multiple service segments, based on the position of the third service segment in the first service, wherein the first sequence of multiple service segments includes the third service segment. Includes, Here, the first compensation service is determined to include a third compensation service segment in order to compensate the third service segment. The system according to claim 11.

16. The tracking information further indicates a third sequence in which the first service and at least one further service change the value of the second global variable, where the rollback execution plan is determined. In response to a third sequence in which the first service changes the value of the second global variable, prior to the fourth service of at least one further service, After the execution of the compensation service segment of the fourth compensation service among the plurality of compensation services is completed, the rollback execution plan is generated and further specifies that the third compensation service segment of the first compensation service should be called. Includes, Here, the compensation service segment of the fourth compensation service is determined to compensate the service segment of the fourth service where the value of the second global variable is changed. The system according to claim 15.

17. It is a computer program, To detect that at least two of the multiple services within a transaction are executing and changing the value of the first global variable, Obtaining tracking information indicating a first order in which at least two of the services change the value of the first global variable while the multiple services are running, In response to the failure of the transaction, a rollback execution plan is determined for multiple compensation services, at least in part, based on the tracking information, wherein the multiple compensation services are configured to compensate each of the multiple services, and To ensure that the aforementioned multiple compensation services are executed in accordance with the rollback execution plan. A computer program that causes an electronic device to perform a method including the execution of the method.

18. Determining the aforementioned rollback execution plan is Determine the rollback execution plan based at least in part on the tracking information and specify a second order in which at least two of the plurality of compensation services are executed to change the value of the first global variable, wherein the second order is the reverse of the first order. including, The computer program according to claim 17.

19. With respect to the first of the at least two services, Dividing the first service into a first sequence of multiple service segments, where the first service segment in the first sequence of multiple service segments is executed, and the value of the first global variable is changed, and Based on the first sequence of multiple service segments, a first compensation service is determined from among the multiple compensation services. This further includes causing the electronic device to perform the following: Here, the first compensation service includes the first sequence of a plurality of compensation service segments which are to be called independently to compensate for the first sequence of each of the plurality of service segments. The computer program according to claim 17.