Method and apparatus for process rollback of an automated switching system
By using task symmetric relationship automation to construct fallback tasks in the payment system, the problem of inefficient task backback in the existing technology is solved, and timely fallback and business continuity when task failure is achieved.
Patent Information
- Application Number
- CN202210113776.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-30
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-01-30
AI Technical Summary
When the task execution fails, it is difficult for existing payment systems to implement complex task back-ups, resulting in staff having to write large numbers of fallback scripts, which is inefficient.
By obtaining the task symmetry relationship of the switching process between the first site and the second site, adjusting the switch instructions in reverse order, and automatically building the fallback task to ensure business continuity.
It realizes timely fallback when the task fails, ensures business continuity, reduces the time for manual writeback scripts, and improves work efficiency.
Smart Images

Figure CN114461364B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and particularly to a method and device for process rollback of an automatic switching system. Background Art
[0002] When the payment system is in use, it is impossible to ensure that each task is executed successfully, and due to emergencies, tasks may also need to be terminated urgently. At this time, the relevant processes need to be rolled back to ensure data accuracy. In the prior art, for the operation of task rollback, most are to write rollback scripts for the normally executed scripts; or, match the corresponding rollback data for rollback in these two ways. However, these rollback logics are suitable for sequential execution and reverse rollback; or are suitable for the one-to-one rollback scenario, and are not very applicable to the scenario where the task complex combination process also needs to be rolled back in a specified order during rollback. At the same time, for the execution scripts in the payment system, as the logical relationship becomes more complex and the number of execution sites increases, the required execution scripts also increase significantly; the way that staff write rollback scripts for each execution script will greatly occupy working time. Therefore, the industry urgently desires a process rollback method for the characteristics of complex logical relationships, a large number of execution scripts and execution sites to improve efficiency on the premise of ensuring system stability. Summary of the Invention
[0003] The purpose of this application is to provide a method and device for process rollback of an automatic switching system, so as to ensure business continuity and perform rollback in a timely manner when a switch is found to fail, ensuring that the business is accepted immediately.
[0004] To achieve the above object, a method for process rollback of an automatic switching system provided by this application includes: obtaining a first task process for switching a task from a first site to a second site; monitoring the execution status of each task process during the switching process from the first site to the second site according to the task process; when any task process fails to execute, obtaining the executed tasks that have been successfully executed during the current switching process, and obtaining a second task process through the first task process according to the task symmetry relationship of the switching process between the first site and the second site; adjusting the second task process according to the execution progress of the first task process to obtain a rollback task; and completing the process rollback process according to the rollback task.
[0005] In the above method for process rollback of an automatic switching system, optionally, obtaining a second task process through the first task process according to the task symmetry relationship of the switching process between the first site and the second site includes: obtaining the execution order and switch instructions of each task process in the first task process; and reversing the execution order and symmetrically adjusting the switch instructions according to the task symmetry relationship of the switching process between the first site and the second site to obtain the second task process.
[0006] In the method for rolling back the process of the above-mentioned automated switching system, optionally, adjusting the second task process according to the execution progress of the first task process to obtain a rollback task includes: determining the execution status of each task process according to the execution progress of the first task process; identifying the corresponding task processes in the second task process according to the execution status; and constructing a rollback task according to the identified task processes.
[0007] In the method for rolling back the process of the above-mentioned automated switching system, optionally, identifying the corresponding task processes in the second task process according to the execution status includes: obtaining the task processes that have been executed and completed according to the execution status; and identifying the corresponding task processes in the second task process as processes to be rolled back according to the symmetry relationship between the second task process and the first task process through the task processes that have been executed and completed.
[0008] In the method for rolling back the process of the above-mentioned automated switching system, optionally, constructing a rollback task according to the identified task processes includes: obtaining the task processes that have failed to execute and the unexecuted task processes according to the execution status; identifying the corresponding task processes in the second task process as skipped processes according to the symmetry relationship between the second task process and the first task process through the task processes that have failed to execute and the unexecuted task processes; and constructing a rollback task according to the processes to be rolled back and the skipped processes.
[0009] This application also provides a device for rolling back the process of an automated switching system. The device includes an acquisition module, a monitoring module, an analysis module, and a rollback module; the acquisition module is used to obtain the first task process of the switching task from the first site to the second site; the monitoring module is used to monitor the execution status of each task process during the switching process from the first site to the second site according to the task process; the analysis module is used to, when any task process fails to execute, obtain the executed tasks that have been successfully executed during the current switching process, and obtain the second task process through the first task process according to the task symmetry relationship of the switching process between the first site and the second site; the rollback module is used to adjust the second task process according to the execution progress of the first task process to obtain a rollback task; and complete the process rollback processing according to the rollback task.
[0010] In the device for rolling back the process of the above-mentioned automated switching system, optionally, the analysis module includes an adjustment unit, and the adjustment unit is used to obtain the execution order and switch instructions of each task process in the first task process; and reverse the execution order and symmetrically adjust the switch instructions according to the task symmetry relationship of the switching process between the first site and the second site to obtain the second task process.
[0011] In the process rollback device of the above-mentioned automatic switching system, optionally, the rollback module includes a construction unit, and the construction unit is configured to determine the execution status of each task process according to the execution progress of the first task process; identify the corresponding task processes in the second task process according to the execution status; and construct a rollback task according to the identified task processes.
[0012] The present application also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above method is implemented.
[0013] The present application also provides a computer-readable storage medium storing a computer program for executing the above method.
[0014] The beneficial technical effects of the present application are as follows: By utilizing the characteristics that the flow chart directions between two locations in the automatic switching system are opposite and the tasks are symmetric; when any task process fails to execute, it can be rolled back in time to ensure the continuity of the service; at the same time, for scenarios with complex switching logics, there is no need for staff to write rollback scripts one by one, which greatly improves the relevant work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application, but do not limit the present application. In the drawings:
[0016] Figure 1 is a schematic flowchart of a process rollback method for an automatic switching system provided by an embodiment of the present application;
[0017] Figure 2 is a schematic flowchart of the acquisition process of a second task process provided by an embodiment of the present application;
[0018] Figure 3 is a schematic flowchart of the acquisition process of a rollback task provided by an embodiment of the present application;
[0019] Figure 4 is a schematic flowchart of the switching process from a first site to a second site provided by an embodiment of the present application;
[0020] Figure 5 is a schematic flowchart of the switching process from a second site to a first site provided by an embodiment of the present application;
[0021] Figure 6 is a schematic diagram of successful switching from a first site to a second site provided by an embodiment of the present application;
[0022] Figure 7 is a schematic flowchart of the rollback process from a second site to a first site provided by an embodiment of the present application;
[0023] Figure 8 The structural schematic diagram of the process rollback device of the automatic switching system provided by an embodiment of the present application;
[0024] Figure 9 The structural schematic diagram of the electronic device provided by an embodiment of the present application. Detailed implementation manners
[0025] The embodiments of the present application will be described in detail below in conjunction with the accompanying drawings and embodiments, so as to fully understand how the present application uses technical means to solve technical problems and the implementation process of achieving technical effects and implement accordingly. It should be noted that as long as there is no conflict, the various embodiments in the present application and the various features in each embodiment can be combined with each other, and the formed technical solutions are all within the protection scope of the present application.
[0026] In addition, the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0027] Please refer to Figure 1 As shown, a process rollback method for an automatic switching system provided by the present application, the method includes:
[0028] S101 Obtain the first task process of the switching task from the first site to the second site;
[0029] S102 Monitor the execution status of each task process during the switching process from the first site to the second site according to the task process;
[0030] S103 When any task process fails to execute, obtain the executed tasks that have been successfully executed during the current switching process, and obtain the second task process through the first task process according to the task symmetry relationship of the switching process between the first site and the second site;
[0031] S104 Adjust the second task process according to the execution progress of the first task process to obtain a rollback task;
[0032] S105 Complete the process rollback processing according to the rollback task.
[0033] Therefore, based on the above embodiments, this application performs process rollback on the basis of the opposite direction of the inter-site handover flow chart and symmetric tasks, solving the problem of time waste caused by a large number of rollback scripts in the prior art. In actual work, when the first site A switches to the second site B, once the handover fails and a rollback is required, according to the tasks that have been successfully executed in the current handover process, set the corresponding tasks in the B-to-A handover process to be executed, and the remaining tasks to be skipped, and then start the B-to-A handover process to complete the rollback. The specific implementation process will be described in detail in the subsequent embodiments and will not be elaborated here one by one.
[0034] Please refer to Figure 2 As shown, in an embodiment of the present application, according to the task symmetry relationship of the handover process between the first site and the second site, obtaining the second task process through the first task process includes:
[0035] S201 Obtain the execution order and switch instructions of each task process in the first task process;
[0036] S202 According to the task symmetry relationship of the handover process between the first site and the second site, reverse the execution order and symmetrically adjust the switch instructions to obtain the second task process.
[0037] Specifically, please refer to Figure 3 As shown, adjusting the second task process according to the execution progress of the first task process to obtain the rollback task may include:
[0038] S301 Determine the execution status of each task process according to the execution progress of the first task process;
[0039] S302 Identify the corresponding task processes in the second task process according to the execution status;
[0040] S303 Construct a rollback task according to the identified task processes.
[0041] Among them, identifying the corresponding task processes in the second task process according to the execution status may include: obtaining the task processes that have been executed and completed according to the execution status; according to the symmetry relationship between the second task process and the first task process, identify the corresponding task processes in the second task process as the processes to be rolled back through the task processes that have been executed and completed. Further, constructing a rollback task according to the identified task processes may include: obtaining the task processes that have failed to execute and the unexecuted task processes according to the execution status; according to the symmetry relationship between the second task process and the first task process, identify the corresponding task processes in the second task process as skipped processes through the task processes that have failed to execute and the unexecuted task processes; construct a rollback task according to the processes to be rolled back and the skipped processes.
[0042] In actual work, the handover processes between the first site A and the second site B are symmetric to each other. Figure 4 is the handover process from the first site A to the second site B. Figure 5 is the handover process from the second site B to the first site A, where each task process in the handover process from the first site A to the second site B and each task process in the handover process from the second site B to the first site A are one-to-one rollback tasks; when the handover process from the first site A to the second site B fails at any task and needs to be rolled back, then according to the tasks that have been successfully executed in the handover process from the first site A to the second site B, set the rollback tasks in the handover process from the second site B to the first site A to be executed, and other tasks to be skipped. For details, please refer to Figures 6 to 7 as shown, where Figure 6 in the figure shown, the rectangular boxes are the successfully executed task processes, the oval boxes are the failed task processes, and the ones without an outer frame are the unexecuted task processes; Figure 7 the task processes in the rectangular boxes in
[0043] Please refer to Figure 8 as shown, the present application also provides a process rollback device for an automated handover system. The device includes an acquisition module, a monitoring module, an analysis module, and a rollback module; the acquisition module is used to obtain the first task process of the handover task from the first site to the second site; the monitoring module is used to monitor the execution status of each task process during the handover process from the first site to the second site according to the task process; the analysis module is used to, when any task process fails to execute, obtain the successfully executed tasks in the current handover process, and according to the task symmetry relationship of the handover process between the first site and the second site, obtain the second task process through the first task process; the rollback module is used to adjust the second task process according to the execution progress of the first task process to obtain rollback tasks; and complete the process rollback processing according to the rollback tasks.
[0044] In the above embodiment, the analysis module may include an adjustment unit, and the adjustment unit is used to obtain the execution order and switch instructions of each task process in the first task process; according to the task symmetry relationship of the handover process between the first site and the second site, reverse the execution order and symmetrically adjust the switch instructions to obtain the second task process. Further, the rollback module may include a construction unit, and the construction unit is used to determine the execution status of each task process according to the execution progress of the first task process; identify the corresponding task processes in the second task process according to the execution status; and construct rollback tasks according to the identified task processes. The specific implementation processes of each module and unit have been described in detail in the foregoing embodiments, and will not be elaborated herein one by one.
[0045] The beneficial technical effects of the present application are as follows: By taking advantage of the characteristics that the flowchart directions between two locations in the automated switching system are opposite and the tasks are symmetric, when any task process fails, it can be promptly rolled back to ensure the continuity of the service. At the same time, for scenarios with complex switching logics, there is no need for staff to write rollback scripts one by one, greatly improving the relevant work efficiency.
[0046] The present application also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above method is implemented.
[0047] The present application also provides a computer-readable storage medium storing a computer program for executing the above method.
[0048] As Figure 9 shown, the electronic device 600 may further include: a communication module 110, an input unit 120, an audio processing unit 130, a display 160, and a power supply 170. It should be noted that the electronic device 600 does not necessarily have to include Figure 9 all the components shown in Figure 9 ; in addition, the electronic device 600 may further include
[0049] components not shown in Figure 9 ; reference may be made to the prior art.
[0050] Among them, the memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices. It can store the above information related to failures, and can also store programs for executing relevant information. And the central processing unit 100 can execute the program stored in the memory 140 to implement information storage or processing, etc.
[0051] The input unit 120 provides input to the central processing unit 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to supply power to the electronic device 600. The display 160 is used for displaying display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.
[0052] The memory 140 can be a solid-state memory, for example, a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It can also be a memory that stores information even when power is off, can be selectively erased and has more data. An example of this memory is sometimes referred to as an EPROM, etc. The memory 140 can also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 can include an application / function storage unit 142 that is used to store application programs and function programs or the processes for operating the electronic device 600 by the central processor 100.
[0053] The memory 140 can also include a data storage unit 143 that is used to store data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 can include various drivers of the electronic device for communication functions and / or for performing other functions of the electronic device (such as a messaging application, an address book application, etc.).
[0054] The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via the antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processor 100 to provide input signals and receive output signals, which can be the same as in the case of a conventional mobile communication terminal.
[0055] Based on different communication technologies, multiple communication modules 110 can be provided in the same electronic device, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module, etc. The communication module (transmitter / receiver) 110 is also coupled to the speaker 131 and the microphone 132 via the audio processor 130 to provide an audio output via the speaker 131 and receive an audio input from the microphone 132, thereby implementing normal telecommunications functions. The audio processor 130 can include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 130 is also coupled to the central processor 100, so that recording can be performed on the local machine through the microphone 132 and the sound stored on the local machine can be played through the speaker 131.
[0056] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0057] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a means for implementing the functions specified in one or more flows Figure 1 one or more flows and / or blocks Figure 1 or a means for implementing the functions specified in one or more blocks.
[0058] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction means that implements the functions specified in one or more flows Figure 1 one or more flows and / or blocks Figure 1 or a means for implementing the functions specified in one or more blocks.
[0059] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows Figure 1 one or more flows and / or blocks Figure 1 or a means for implementing the functions specified in one or more blocks.
[0060] The specific embodiments described above further elaborate on the purpose, technical solutions, and beneficial effects of the present application. It should be understood that the above are only specific embodiments of the present application and are not used to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for process rollback of an automated switching system, characterized in that, The method includes: Obtaining a first task process for the first site to switch tasks to the second site; Monitoring the execution status of each task process during the process of the first site switching to the second site according to the task process; When any task process fails to execute, obtaining the executed tasks that have been successfully executed during the current switching process, and obtaining a second task process according to the task symmetry relationship of the switching process between the first site and the second site, where the second task process is the switching process for the second site to switch tasks to the first site; Adjusting the second task process according to the execution progress of the first task process to obtain a fallback task; Completing the fallback process according to the fallback task; Adjusting the second task process according to the execution progress of the first task process to obtain a fallback task includes: Determining the execution status of each task process according to the execution progress of the first task process; Identifying the corresponding task processes in the second task process according to the execution status; Constructing a fallback task according to the identified task processes.
2. The process rollback method of the automated switching system according to claim 1, characterized in that Identifying the corresponding task processes in the second task process according to the execution status includes: Obtaining the task processes that have been executed and completed according to the execution status; According to the symmetry relationship between the second task process and the first task process, identifying the corresponding task processes in the second task process as processes to be fallback by the executed and completed task processes.
3. The method for process rollback of the automated switching system according to claim 2, wherein Constructing a fallback task according to the identified task processes includes: Obtaining the task processes that have failed to execute and the unexecuted task processes according to the execution status; According to the symmetry relationship between the second task process and the first task process, identifying the corresponding task processes in the second task process as skipped processes by the task processes that have failed to execute and the unexecuted task processes; Constructing a fallback task according to the processes to be fallback and the skipped processes.
4. A process rollback device for an automated switching system, characterized in that, The device includes a collection module, a monitoring module, an analysis module, and a fallback module; The collection module is used to obtain a first task process for the first site to switch tasks to the second site; The monitoring module is used to monitor the execution status of each task process during the process of the first site switching to the second site according to the task process; The analysis module is used to, when any task process fails to execute, obtain the executed tasks that have been successfully executed during the current switching process, and obtain a second task process according to the task symmetry relationship of the switching process between the first site and the second site, where the second task process is the switching process for the second site to switch tasks to the first site; The fallback module is used to adjust the second task process according to the execution progress of the first task process to obtain a fallback task; and complete the fallback process according to the fallback task; The fallback module includes a construction unit, and the construction unit is used to determine the execution status of each task process according to the execution progress of the first task process; identify the corresponding task processes in the second task process according to the execution status; and construct a fallback task according to the identified task processes.
5. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program for the computer to execute the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Workflow abnormity handling method and system
CN106611297A
Configuration state backspacing method and apparatus
CN107528709A