Application system switching and transaction processing method and system, medium and program product
By using a synchronous database for incremental data synchronization and real-time synchronization during the switching process of the main and standby application system, the problem of untimely and compatibility of data synchronization is solved, and the switching speed and system stability are improved.
Patent Information
- Application Number
- CN202411923590.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-03-28
AI Technical Summary
During the switching process of main and standby application systems, data synchronization may occur, data loss and compatibility may occur, affecting the availability and stability of the system.
By synchronizing the database, incremental data is used to synchronize data between application systems before and after switching, avoiding the time and resource overhead of full data synchronization, and enabling the real-time synchronization mechanism during the switching process.
Ensure the integrity and consistency of the data of the primary and secondary application system, significantly improve the switching speed, solve compatibility problems, simplify system maintenance and management, and ensure the seamless operation of applications and services during the switching process.
Smart Images

Figure CN119719230A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of cloud computing technology, and in particular to an application system switching and transaction processing method, system, medium and program product. Background Art
[0002] In modern computer systems, the availability and stability of the system are crucial to users. In order to improve the availability and stability of the system, many systems adopt a primary-backup switching mechanism, that is, when the primary application system fails, it automatically switches to the backup application system.
[0003] During the master-slave switching process, the master and standby application systems may be unable to synchronize data in real time or data may be lost, resulting in inconsistent data between the master and standby systems. In addition, during the switching process, the system needs to complete a series of complex operations, resulting in a slow switching speed. In addition, during the switching process, some applications or services cannot adapt to the complex business scenarios generated by the master-slave system switching due to code upgrades, resulting in failure to operate normally or errors, compatibility issues, and thus affecting user experience. Summary of the invention
[0004] The embodiment of the present invention provides an application system switching and transaction processing method, system, medium and program product, which can ensure the consistency of data between the main and standby application systems, increase the system switching speed, and enhance the availability and stability of the system.
[0005] In a first aspect, an application system switching method provided by an embodiment of the present invention is applied to a synchronization database in a transaction system, wherein the transaction system further includes a main application system, a backup application system, and a switching controller. The application system switching method includes:
[0006] In response to the switching instruction sent by the switching controller, a system before switching and a system after switching are determined from the main application system and the backup application system;
[0007] Obtain the data that has changed since the last data synchronization from the system before the switch to obtain incremental data;
[0008] The incremental data is stored in the data buffer area set for the system after the switch;
[0009] The incremental data cached in the data cache area is synchronized to the switched system to assist in the switch between the primary application system and the backup application system.
[0010] In a second aspect, a transaction processing method provided by an embodiment of the present invention is applied to a switching controller in a transaction system, wherein the transaction system further includes a main application system, a backup application system, and a synchronization database, and the transaction processing method includes:
[0011] Respond to transaction requests initiated by clients, query the maintained system status table to identify system status;
[0012] When the system status is in switching, query the synchronization database to determine the synchronization result of the target data involved in the transaction request, and the switching includes the switching of the main application system to the backup application system or the switching of the backup application system to the main application system;
[0013] Determine the target application system from the primary application system and the backup application system according to the synchronization result;
[0014] Send the transaction request to the target application system for processing.
[0015] In a third aspect, the transaction system provided by an embodiment of the present invention includes a main application system, a backup application system, a synchronization database for executing the application system switching method as described in any embodiment of the present invention, and a switching controller for executing the transaction processing method as described in any embodiment of the present invention.
[0016] In a fourth aspect, an electronic device provided by an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, an application system switching method as in any embodiment of the present invention is implemented; or, when the processor executes the program, a transaction processing method as in any embodiment of the present invention is implemented.
[0017] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, an application system switching method such as any embodiment of the present invention is implemented, or when the program is executed by a processor, a transaction processing method such as any embodiment of the present invention is implemented.
[0018] In a sixth aspect, a computer program product provided by an embodiment of the present invention includes a computer program, which, when executed by a processor, implements the application system switching method as described in any embodiment of the present invention, or, when executed by a processor, implements the transaction processing method as described in any embodiment.
[0019] In an embodiment of the present invention, during the switching process of the primary and standby application systems, data synchronization is performed between the application systems before and after the switching by using incremental data through the synchronization database. The incremental data synchronization only synchronizes the data that has changed since the last synchronization, thereby avoiding the time and resource overhead required for full data synchronization. In this way, the system can quickly and accurately synchronize the data of the primary and standby application systems, reduce the risk of data loss and duplication, and ensure the integrity and consistency of the data during the primary and standby switching process; when the primary and standby application systems are switched, the real-time synchronization mechanism is enabled to quickly synchronize incremental data to ensure that data synchronization is completed in the shortest time, thereby significantly improving the switching speed; the switching controller and the synchronization database perform analysis and operations at the data level, and there is no need to modify the existing application and service program codes, thereby solving the compatibility issues caused by code upgrades of certain applications or services during the primary and standby switching process, avoiding system operation errors due to version inconsistencies, simplifying system maintenance and management, ensuring that all applications and services can run seamlessly during the switching process, and optimizing user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 is a flow chart of an application system switching method provided by an embodiment of the present invention;
[0022] Figure 2 It is a flowchart of a transaction processing method provided by an embodiment of the present invention;
[0023] Figure 3a It is a schematic diagram of a framework of a trading system provided by an embodiment of the present invention;
[0024] Figure 3b is a structural diagram of a synchronization database provided by an embodiment of the present invention;
[0025] Figure 4a is a structural schematic diagram of an application system switching device provided by an embodiment of the present invention;
[0026] Figure 4b is a structural schematic diagram of a transaction processing device provided by an embodiment of the present invention;
[0027] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Figure 1 The present invention provides a flowchart of an application system switching method. The application system switching method provided by the present invention can be applied to the scenario of switching between the main application system and the backup application system. The application system switching method can be executed by the synchronization database provided by the present invention. The synchronization database is located in the transaction system. The transaction system also includes the main application system, the backup application system and the switching controller. The main application system can be composed of a main application server and a main database, and the backup application system can be composed of a backup application server and a backup database. Figure 1 The application system switching method of this embodiment may include the following steps:
[0031] Step 110, responding to the switching instruction sent by the switching controller, determining a system before switching and a system after switching from the main application system and the backup application system.
[0032] The switch controller is a core component responsible for monitoring the system status, managing the master-slave switch process, and sending switch instructions. It determines when it is necessary to switch between the master and slave application systems and coordinates various operations during the switch process. The switch instruction is information sent by the switch controller to indicate the switch status. It can instruct the system to start switching from the master application system to the slave application system or from the slave application system back to the master application system. This instruction triggers a series of operations, including data synchronization, system status update, etc.
[0033] The primary application system is the application system that currently handles the main business functions and user requests. The backup application system is the backup of the primary application system and is the application system that takes over the business functions when the primary application system has problems. The system before switching refers to the system that is currently running and processing business after receiving the switching instruction. This can be the primary application system or the backup application system, depending on the initial state of the system. The system after switching refers to the new system that takes over the business and services after the switching process is completed. If the system before switching is the primary application system, the system after switching is the backup application system, and vice versa.
[0034] The switching controller can switch the system after monitoring certain trigger conditions (such as failure of the main application system or scheduled maintenance), and send a switching instruction to the synchronization database, indicating that the system switch is currently in progress. The synchronization database recognizes and responds to this instruction, determines the system currently processing the business, that is, the system before switching (which may be the main application system or the backup application system), and determines the system that will take over the business, that is, the system after switching (which may be the backup application system or the main application system).
[0035] Step 120, obtaining the data that has changed since the last data synchronization from the system before the switch to obtain incremental data.
[0036] Data synchronization refers to the process of maintaining data consistency between the primary application system and the backup application system. Data synchronization can be full synchronization or incremental synchronization. Full synchronization refers to synchronizing all data, while incremental synchronization refers to synchronizing only the data that has changed since the last synchronization. These changed data can be new, modified, or deleted data items. Incremental data refers to all data that has changed between the last synchronization and the current moment. These data changes may involve adding new records, modifying existing records, or deleting records. The purpose of obtaining these incremental data is to ensure that during the switching process, the application system can be updated to the latest status in a timely manner after the switch.
[0037] The purpose of determining the incremental data is to ensure data consistency between the system before switching and the system after switching, so that the system after switching can have the same data status as the system before switching when receiving services, thereby ensuring business continuity.
[0038] Step 130, storing the incremental data into a data buffer area set for the system after the switch.
[0039] The data cache is a location for temporarily storing data, which can speed up the reading and writing of data and improve the overall performance of the system. In this embodiment, the synchronization database can set data caches for the main application system and the backup application system respectively. The data cache set for the main application system can be called the main data cache, and the data cache set for the backup application system can be called the backup data cache.
[0040] These incremental data are stored in a temporary storage area specially prepared for the switched system to ensure that during the switching process, the switched system can quickly and reliably access the latest incremental data, thereby maintaining data consistency and integrity.
[0041] Step 140: Synchronize the incremental data cached in the data cache area to the switched system to assist in the switch between the primary application system and the backup application system.
[0042] During the system switching process, the incremental data stored in the data cache area is synchronized to the switched system. This process ensures that the switched system has the latest data when it takes over the business, thereby maintaining data consistency between the main application system and the backup application system. In this way, the switching process becomes smooth and efficient, ensuring business continuity and stability.
[0043] Furthermore, the synchronization database can also feedback the data synchronization results of this time to the switching controller, so that the switching controller maintains the system status table according to the data synchronization results of this time; the system status in the system status table includes the normal operation of the main application system, switching or the normal operation of the backup application system, and switching includes the switching of the main application system to the backup application system or the switching of the backup application system to the main application system.
[0044] Data synchronization results refer to the specific situation of data synchronization fed back by the synchronization database after the data synchronization operation, such as success, failure, or partial success. These results provide detailed information about the synchronization process. The system status table is a table or data structure that records and monitors the system status. It contains information such as the current operating status and switching status of the system so that the switching controller can manage and make decisions. The main application system is running normally, which means that the current main application system is in a normal operating state and the main application system handles all major businesses. The standby application system is running normally, which means that the current standby application system has taken over the main business and is in a normal operating state.
[0045] Specifically, according to different synchronization results, the switching controller will update the status of the system status table respectively. For example, if data synchronization fails, the switching controller may maintain or re-mark the system as "switching" until the problem is resolved. If data synchronization is successful, the switching controller may mark the normal operation status of the system after the switch.
[0046] Furthermore, after the synchronization is completed, the synchronization database can also delete the incremental data cached in the data cache area. This operation ensures the neatness of the cache area and the effective use of storage space, avoids unnecessary data accumulation, and ensures that the cache area can efficiently support future synchronization operations.
[0047] In this embodiment, during the switching process of the primary and standby application systems, data synchronization is performed between the application systems before and after the switching by using incremental data through the synchronization database. The incremental data synchronization only synchronizes the data that has changed after the last synchronization, avoiding the time and resource overhead required for full data synchronization. In this way, the system can quickly and accurately synchronize the data of the primary and standby application systems, reduce the risk of data loss and duplication, and ensure the integrity and consistency of the data during the primary and standby switching process; when the primary and standby application systems are switched, the real-time synchronization mechanism is enabled to quickly synchronize incremental data to ensure that data synchronization is completed in the shortest time, significantly improving the switching speed; the switching controller and the synchronization database operate at the data level, and there is no need to modify the existing application and service program code, which solves the compatibility issues caused by code upgrades of certain applications or services during the primary and standby switching process, avoids system operation errors due to version inconsistencies, simplifies system maintenance and management, ensures that all applications and services can run seamlessly during the switching process, and optimizes the user experience.
[0048] The transaction processing method provided by the embodiment of the present invention is introduced below. The transaction processing method can be applied to a switching controller in a transaction system. The transaction system also includes a main application system, a backup application system and a synchronization database. The specific method can be as follows: Figure 2 As shown, including:
[0049] Step 210, responding to the transaction request initiated by the client, querying the maintained system status table to identify the system status.
[0050] A transaction request initiated by a client refers to a request sent by a user or application from a client (such as a computer, mobile phone or other device) to a server or system to perform a transaction operation, such as data query, order processing, payment, etc. The system status table is a data structure or table used to record and maintain the current status of the system, including whether the main application system is running normally, whether the backup application system is running normally, whether it is switching, and the specific switching direction.
[0051] The switch controller has a real-time maintained "system status table" that records the current system operation status and switch status. When the client submits a transaction request, the switch controller reads the information in the system status table to determine whether the current application system is the main application system or the backup application system, or whether the system is in the process of switching.
[0052] Step 220, when the system status is in switching, query the synchronization database to determine the synchronization result of the target data involved in the transaction request, and the switching includes the switching of the main application system to the backup application system or the switching of the backup application system to the main application system.
[0053] The switching state indicates that the system is in the process of switching between the main application system and the backup application system. It may be that the main business processing responsibilities are being transferred from the main application system to the backup application system, or it may be that the business processing responsibilities are being transferred from the backup application system back to the main application system. The synchronization database is a database dedicated to synchronizing information and data. It ensures that the data of the main application system and the backup application system remain consistent during the system switching process. It records the situation and results of data synchronization. The target data refers to the data related to the transaction request. This data needs to be synchronized between the main application system and the backup application system to ensure the accuracy of transaction processing. The synchronization result refers to the status information of the data synchronization operation recorded by the synchronization database, such as whether the synchronization is successful, whether there is a synchronization error, etc. These results help the system determine whether the target data has been synchronized.
[0054] When the system status table shows the "Switching" status, it means that the system is currently in the process of switching between the main application system and the backup application system. The switching controller needs to query the synchronization database to determine the synchronization result of the target data involved in the current transaction request. In other words, the synchronization database checks whether the target data has been successfully synchronized between the main application system and the backup application system. For example, the synchronization database confirms whether a certain order data has been synchronized from the main application system to the backup application system, or vice versa.
[0055] Step 230: determine the target application system from the primary application system and the backup application system according to the synchronization result.
[0056] The target application system refers to the application system selected to process a transaction request at a specific point in time. The target application system can be the primary application system or the backup application system, depending on the current system status and data synchronization results.
[0057] Step 240: Send the transaction request to the target application system for processing.
[0058] Specifically, if the synchronization result is that the synchronization is not completed, it means that the target data is still in the system before the switch, and the system before the switch can be determined as the target application system; if the synchronization result is that the synchronization is completed, it means that the target data is already in the system after the switch, and the system after the switch is determined as the target application system. Among them, when this switch is from the main application system to the backup application system, the application system before the switch is the main application system, and when this switch is from the backup application system to the main application system, the application system before the switch is the backup application system.
[0059] In addition, when the system status is that the main application system is operating normally, the transaction request can be sent to the main application system for processing; when the system status is that the backup application system is operating normally, the transaction request can be sent to the backup application system for processing.
[0060] In this embodiment, a synchronization database is used to assist the transaction processing process. When the system status is "switching", the synchronization database is queried to determine the synchronization results of the data involved in the transaction request, and the target application system is selected to process the transaction request based on the synchronization results, ensuring that the transaction can proceed smoothly during the switching process; based on the real-time synchronization results and system status, the target application system that can effectively process the transaction is intelligently determined from the main application system and the backup application system to ensure that the transaction request is processed in a timely and efficient manner.
[0061] The following describes the architecture of the transaction system provided by the embodiment of the present invention. Figure 3a As shown, the transaction system may include a switching controller, a main application system, a standby application system and a synchronization database. The main application system includes a main application server and a main database, and the standby application system includes a standby application server and a standby database.
[0062] The switching controller is responsible for registering and maintaining the system status, which includes:
[0063] 0: The main application system runs normally.
[0064] 1: The main application system is switching to the backup application system.
[0065] 2: The standby application system is running normally.
[0066] 3: The backup application system is switching to the main application system.
[0067] These system states can be maintained manually by the backend administrator, or the system can automatically identify the running state of the main application server or the backup application server and then automatically switch. The switching controller can route the transaction request according to the transaction request and system state according to the following table 1:
[0068]
[0069]
[0070] Table 1
[0071] The primary application server and the standby application server can run the same application and connect to the primary database and the standby database respectively. The primary database and the standby database are used to store the transaction data generated by the primary application server and the standby application server respectively. The two can be databases of the same structure or heterogeneous databases. The two can realize data synchronization between the primary and standby databases through the synchronization database.
[0072] The structure of the synchronization database can be as follows Figure 3b As shown, it includes a data drive control unit, a data download unit, a data upload unit, a main data cache area and a backup data cache area.
[0073] The data drive control unit is externally connected to the switching controller, receives the switching instructions sent by the switching controller, processes the data differently according to the active / standby switching status, and feeds back the processing results to the switching controller. It is internally connected to the other four components, and controls different processing of data according to the active / standby switching status. The specific processing can be shown in Table 2 below:
[0074]
[0075]
[0076] Table 2
[0077] The data download unit is externally connected to the primary database and the standby database, and internally connected to the primary data cache area and the standby data cache area, and periodically (for example, every 10 minutes or 30 minutes) downloads the data of the primary database / standby database to the primary data cache area / standby data cache area. It receives the switching instruction of the data drive control unit, and downloads the data of the primary database / standby database to the primary data cache area / standby data cache area in real time.
[0078] The data upload unit is externally connected to the primary database and the standby database, and internally connected to the primary data cache area and the standby data cache area, and regularly (for example, every 10 minutes or 30 minutes) uploads the data in the primary data cache area / standby data cache area to the primary database / standby database. It receives the switching instruction from the data drive control unit and uploads the primary data cache area / standby data cache area to the primary database / standby database in real time.
[0079] When the system is running normally, the data of the primary database and the standby database are synchronized regularly to maintain basic consistency. In the switching state, the real-time synchronization mechanism is enabled to quickly synchronize incremental data to ensure that data synchronization is completed in the shortest time, which significantly improves the switching efficiency. This flexible synchronization strategy reduces a series of complex operations in the switching process, greatly shortens the switching time, and improves the availability and response speed of the system.
[0080] Figure 4a : is a structural diagram of an application system switching device provided by an embodiment of the present invention, the device is applied to a synchronization database in a trading system, the trading system also includes a main application system, a backup application system and a switching controller, the switching device includes:
[0081] A response module 301 is used to respond to the switching instruction sent by the switching controller and determine a system before switching and a system after switching from the main application system and the backup application system;
[0082] The acquisition module 302 is used to acquire the data that has changed since the last data synchronization from the system before the switch to obtain incremental data;
[0083] Storage module 303, used for storing the incremental data into a data buffer area set for the system after the switch;
[0084] The synchronization module 304 is used to synchronize the incremental data cached in the data cache area to the switched system to assist the switching between the primary application system and the backup application system.
[0085] In one embodiment, it further includes:
[0086] A feedback module, used to feed back the data synchronization result of this time to the switching controller, so that the switching controller maintains the system status table according to the data synchronization result of this time;
[0087] The system status in the system status table includes the main application system operating normally, switching or the standby application system operating normally, and switching includes the main application system switching to the standby application system or the standby application system switching to the main application system.
[0088] In one embodiment, it further includes:
[0089] The deletion module is used to delete the incremental data cached in the data cache area.
[0090] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0091] The device of the embodiment of the present invention uses incremental data to synchronize data between the application systems before and after the switching of the primary and standby application systems through a synchronization database. The incremental data synchronization only synchronizes the data that has changed since the last synchronization, thereby avoiding the time and resource overhead required for full data synchronization. In this way, the system can quickly and accurately synchronize the data of the primary and standby application systems, reduce the risk of data loss and duplication, and ensure the integrity and consistency of the data during the primary and standby switching process; when the primary and standby application systems are switched, the real-time synchronization mechanism is enabled to quickly synchronize incremental data to ensure that data synchronization is completed in the shortest time, thereby significantly improving the switching speed; the switching controller and the synchronization database operate at the data level, and there is no need to modify the existing application and service program codes, thereby solving the compatibility issues caused by code upgrades of certain applications or services during the primary and standby switching process, avoiding system operation errors due to version inconsistencies, simplifying system maintenance and management, ensuring that all applications and services can run seamlessly during the switching process, and optimizing user experience.
[0092] Figure 4b is a structural diagram of a transaction processing device provided by an embodiment of the present invention, the device is applied to a switching controller in a transaction system, and the transaction system also includes a main application system, a backup application system and a synchronization database, such as Figure 4b As shown, the transaction processing device includes:
[0093] The first query module 401 is used to respond to a transaction request initiated by a client, query the maintained system status table to identify the system status;
[0094] The second query module 402 is used to query the synchronization database to determine the synchronization result of the target data involved in the transaction request when the system status is in switching, and the switching includes the switching of the main application system to the backup application system or the switching of the backup application system to the main application system;
[0095] A determination module 403 is used to determine a target application system from the primary application system and the backup application system according to the synchronization result;
[0096] The sending module 404 is used to send the transaction request to the target application system for processing.
[0097] In one embodiment, the determination module 403 determines the target application system from the primary application system and the backup application system according to the synchronization result, including:
[0098] If the synchronization result is that the synchronization is not completed, the system before the switch is determined as the target application system;
[0099] If the synchronization result is synchronization completed, the switched system is determined as the target application system;
[0100] Among them, when the current switch is from the main application system to the backup application system, the application system before the switch is the main application system, and when the current switch is from the backup application system to the main application system, the application system before the switch is the backup application system.
[0101] In one embodiment, the sending module 404 is further used for:
[0102] When the system status is that the main application system is operating normally, the transaction request is sent to the main application system for processing;
[0103] When the system status is that the standby application system is operating normally, the transaction request is sent to the standby application system for processing.
[0104] The device of this embodiment uses a synchronization database to assist in the transaction processing process. When the system status is "switching", the synchronization database is queried to determine the synchronization results of the data involved in the transaction request, and the target application system is selected to process the transaction request based on the synchronization results, thereby ensuring that the transaction can proceed smoothly during the switching process; based on the real-time synchronization results and system status, the target application system that can effectively process the transaction is intelligently determined from the main application system and the backup application system, thereby ensuring that the transaction request is processed in a timely and efficient manner.
[0105] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of an electronic device suitable for implementing an embodiment of the present invention. The electronic device may be a synchronization database or a switching controller. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0106] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the computer system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0107] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0108] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0109] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0110] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0111] The modules and / or units involved in the embodiments of the present invention may be implemented in software or hardware. The modules and / or units described may also be arranged in a processor, for example, may be described as: a processor includes a response module, an acquisition module, a storage module and a synchronization module. Or may be described as: a processor includes a first query module, a second query module, a determination module and a sending module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.
[0112] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0113] In response to the switching instruction sent by the switching controller, the system before switching and the system after switching are determined from the main application system and the backup application system; the data that has changed since the last data synchronization is obtained from the system before switching to obtain incremental data; the incremental data is stored in the data cache area set for the system after switching; the incremental data cached in the data cache area is synchronized to the system after switching to assist in switching between the main application system and the backup application system.
[0114] Alternatively, when the above one or more programs are executed by a device, the device includes:
[0115] Respond to the transaction request initiated by the client, query the maintained system status table to identify the system status; when the system status is switching, query the synchronization database to determine the synchronization result of the target data involved in the transaction request, the switching includes switching from the main application system to the backup application system or switching from the backup application system to the main application system; determine the target application system from the main application system and the backup application system according to the synchronization result; send the transaction request to the target application system for processing.
[0116] The technical solution of the embodiment of the present invention is that during the switching process of the primary and standby application systems, data is synchronized between the application systems before and after the switching by synchronizing the database with incremental data. The incremental data synchronization only synchronizes the data that has changed after the last synchronization, avoiding the time and resource overhead required for full data synchronization. In this way, the system can quickly and accurately synchronize the data of the primary and standby application systems, reduce the risk of data loss and duplication, and ensure the integrity and consistency of the data during the primary and standby switching process; when the primary and standby application systems are switched, the real-time synchronization mechanism is enabled to quickly synchronize incremental data to ensure that data synchronization is completed in the shortest time, significantly improving the switching speed; the switching controller and the synchronization database operate at the data level, and there is no need to modify the existing application and service program codes, which solves the compatibility issues caused by code upgrades of certain applications or services during the primary and standby switching process, avoids system operation errors due to version inconsistencies, simplifies system maintenance and management, ensures that all applications and services can run seamlessly during the switching process, and optimizes user experience.
[0117] Furthermore, the synchronization database is used to assist the transaction processing process. When the system status is "switching", the synchronization database is queried to determine the synchronization results of the data involved in the transaction request, and the target application system is selected to process the transaction request based on the synchronization results, ensuring that the transaction can proceed smoothly during the switching process; based on the real-time synchronization results and system status, the target application system that can effectively process the transaction is intelligently determined from the main application system and the backup application system to ensure that the transaction request is processed in a timely and efficient manner.
[0118] An embodiment of the present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the application system switching method provided in any embodiment of the present application, or, when executed by a processor, implements the transaction processing method provided in any embodiment of the present application.
[0119] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0120] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0121] It should be noted that the collection, use, storage, sharing and transfer of user personal information involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations, and the user needs to be informed and the user's consent or authorization is obtained. When applicable, the user's personal information is de-identified and / or anonymized and / or encrypted. In addition, the corresponding operation entrance is provided for the user to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0122] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An application system switching method, characterized in that: A synchronous database is applied to a transaction system, wherein the transaction system also includes a main application system, a backup application system and a switching controller, and the application system switching method includes: In response to the switching instruction sent by the switching controller, a system before switching and a system after switching are determined from the main application system and the backup application system; Obtain the data that has changed since the last data synchronization from the system before the switch to obtain incremental data; The incremental data is stored in the data buffer area set for the system after the switch; The incremental data cached in the data cache area is synchronized to the switched system to assist in the switch between the primary application system and the backup application system.
2. The method according to claim 1, characterized in that Also includes: Feedback the data synchronization result to the switching controller so that the switching controller maintains the system status table according to the data synchronization result; The system status in the system status table includes the main application system operating normally, switching or the standby application system operating normally, and switching includes the main application system switching to the standby application system or the standby application system switching to the main application system.
3. The method according to claim 1, characterized in that Also includes: Delete the incremental data cached in the data cache.
4. A transaction processing method, characterized in that: A switching controller is applied to a transaction system, wherein the transaction system also includes a main application system, a backup application system and a synchronization database, and a transaction processing method includes: Respond to transaction requests initiated by clients, query the maintained system status table to identify system status; When the system status is in switching, query the synchronization database to determine the synchronization result of the target data involved in the transaction request, and the switching includes the switching of the main application system to the backup application system or the switching of the backup application system to the main application system; Determine the target application system from the primary application system and the backup application system according to the synchronization result; Send the transaction request to the target application system for processing.
5. The method according to claim 4, characterized in that Determine the target application system from the primary application system and the backup application system based on the synchronization results, including: If the synchronization result is that the synchronization is not completed, the system before the switch is determined as the target application system; If the synchronization result is synchronization completed, the switched system is determined as the target application system; Among them, when the current switch is from the main application system to the backup application system, the application system before the switch is the main application system, and when the current switch is from the backup application system to the main application system, the application system before the switch is the backup application system.
6. The method according to claim 4, characterized in that Also includes: When the system status is that the main application system is operating normally, the transaction request is sent to the main application system for processing; When the system status is that the standby application system is operating normally, the transaction request is sent to the standby application system for processing.
7. A trading system, characterized in that: It comprises a main application system, a backup application system, a synchronization database for executing the application system switching method as described in any one of claims 1 to 3, and a switching controller for executing the transaction processing method as described in any one of claims 4 to 6.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the application system switching method according to any one of claims 1 to 3 is implemented, or when the processor executes the program, the transaction processing method according to any one of claims 4 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the application system switching method according to any one of claims 1 to 3 is implemented, or when the program is executed by a processor, the transaction processing method according to any one of claims 4 to 6 is implemented.
10. A computer program product, characterized in that The computer program product includes a computer program, which, when executed by a processor, implements the application system switching method as described in any one of claims 1 to 3, or, when executed by a processor, implements the transaction processing method as described in any one of claims 4 to 6.