Application system and method for service read-write separation and automatic exception processing

By adopting the three-layer deployment mode of transaction middleware load balancing server and database server in the bank database system, real-time consistency and automatic switching of the master and backup databases are achieved, and data consistency and high availability problems of existing systems under high load and abnormal conditions are solved, and system efficiency and reliability are improved.

CN119690743APending Publication Date: 2025-03-25RURAL CREDIT COOP OF SHANDONG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411351466.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

When existing bank database systems face high load and abnormal situations, it is difficult to ensure data consistency and high system availability, resulting in business interruption and waste of resources.

Method used

The three-layer deployment mode of transaction middleware load balancing server, application server, and database server is adopted. The main database operations are transmitted to the standby database in real time through logs to achieve consistency of the main and standby databases, and the main and standby databases are automatically switched through the database self-check and reconnect mechanism in abnormal situations.

Benefits of technology

Real-time consistency of the main and standby database is realized, ensuring that the system automatically switches in abnormal situations, avoiding business interruptions, making full use of the backup database resources, reducing the pressure during peak periods of the main database, and improving the overall efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690743A_ABST
    Figure CN119690743A_ABST
Patent Text Reader

Abstract

An application system for service read-write separation and automatic exception processing comprises a core business platform, and the core business platform adopts a mode of three-layer deployment of a transaction middleware load balancing server, an application server and a database server to support service read-write separation and automatic exception identification. The transaction middleware load balancing server is used for receiving a service request from the service bus system, balancing the transaction pressure of each application server according to a load balancing strategy, and automatically distributing the transaction pressure to a target application server; the application server is used for installing and deploying core application services and is responsible for completing logic processing, service control, data calculation and data processing of core services; and the database server is used for installing and deploying relational database software and storing and managing data information of core businesses, so that the main database and the standby database provide services to the outside at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field:

[0001] The invention relates to an application system and method for service read-write separation and automatic abnormality processing. Background technology:

[0002] With the rapid development of banking technology and the increasing degree of informatization, the access and storage operations of massive data every day have caused considerable load pressure on the database, and at the same time have brought great challenges to the stability and high availability of the entire bank's core business platform; the database is the core of bank data and is used to store all business processing results. Once the database has software and hardware problems, operational errors, virus attacks and other failures that cause the bank's business to be suddenly interrupted, the economic losses and social impacts caused by it are unimaginable.

[0003] Currently, more and more banks have realized this problem. For the purpose of disaster recovery, one or more databases are generally established to store bank data at the same time, one of which serves as the main database to undertake the bank's main business, and the other one or more serve as backup databases.

[0004] The commonly used master database synchronization mode currently adopts synchronous or super asynchronous mode. The synchronous mode adopts serial mode. Although it protects data consistency to the greatest extent, the data transaction performance on the host is sacrificed the most and the network speed requirement is very high. In the super asynchronous mode, the backup machine actively applies to the host for obtaining database logs and performs forward roll processing. Although the transaction processing efficiency is high, there may be a large log gap between the host and the backup machine. When the host is abnormal, the log data that is not synchronized in real time between the host and the backup machine will be lost. In addition, in most existing master-slave database modes, the user's read and write operation services are all on the unified database server, which can easily cause excessive pressure on the master database to cause downtime, while the backup database is idle, resulting in resource waste, and the backup database data resources cannot be fully utilized. In addition, under abnormal circumstances, the switching mechanism of the master-slave database is not perfect, and it is difficult to ensure the continuity of the services provided to the outside between the master and the backup database. Summary of the invention:

[0005] The embodiment of the present invention provides an application system and method for service read-write separation and automatic exception processing. The structure and method are reasonably designed, and a three-layer deployment mode of a transaction middleware load balancing server, an application server, and a database server is adopted to support service read-write separation and automatic exception identification. All operations of the main database are transmitted to the backup database in real time through logs. After receiving the logs, the backup database performs a forward roll operation to achieve consistency between the main and backup databases. In the event of an abnormality, the main and backup databases are automatically switched through the self-checking and reconnecting mechanism of the database to ensure the high availability of the system itself. The system can automatically identify the anomalies of the main and backup data, realize the self-checking and reconnecting of the database, and make full use of the resources of the backup database, thereby reducing the pressure of the main database during the peak period, improving the overall efficiency of the system, and solving the problems existing in the prior art.

[0006] The technical solution adopted by the present invention to solve the above technical problems is:

[0007] An application system for service read-write separation and automatic exception processing, the application system includes a core business platform, the core business platform adopts a three-layer deployment mode of transaction middleware load balancing server, application server, and database server to support service read-write separation and automatic exception identification;

[0008] The transaction middleware load balancing server is used to receive service requests from the service bus system, balance the transaction pressure of each application server according to the load balancing strategy, and automatically distribute them to the target application server;

[0009] The application server is used to install and deploy core application services and is responsible for completing the logic processing, business control, data calculation and data processing of core businesses;

[0010] The database server is used to install and deploy relational database software, store and manage data information of core business, so that the main and standby databases can provide services to the outside world at the same time; the main database supports read-write access and provides various databases for application operations; the standby database supports read-only access and provides query operations.

[0011] The transaction middleware load balancing server adopts a dual-machine cluster deployment mode to improve the efficiency of transaction distribution; the transaction middleware load balancing server supports load balancing through transaction middleware, improves the utilization efficiency of application servers, and when an abnormality occurs on a single server, the other server can provide services normally.

[0012] The service bus system is used to transmit transaction requests to the core business platform. Standard online service and fast online service are configured on the service bus system. When there is data to read and write, the standard connection service is used, and when there is no data to read and write, the fast online service is used.

[0013] The application server is divided into multiple logical partitions by multiple servers for cluster deployment, which greatly improves the performance of core services while providing high availability; multiple server nodes are added to the application server to expand the business processing capability.

[0014] The database server adopts a dual-machine active-active deployment mode, and uses the DB2 HADR algorithm to achieve near real-time data synchronization between the active and standby machines. All operations in the primary database are transmitted to the standby database through logs. After receiving the logs, the standby database performs a rollforward operation to achieve data consistency.

[0015] The core business platform's core business logic processing, business control, data calculation and data processing application services are installed and deployed on the application server; the core business platform implements read-write separation and automatic abnormality identification at the application layer through the HADR algorithm.

[0016] The application method of service read-write separation and automatic exception processing includes the following steps:

[0017] S1: divide transactions into read-write services and read-only services according to transaction types, connect read-write services to the primary database, connect read-only services to the standby database, and connect the downstream jobs in batch processing to the standby database to avoid idleness of the standby database and waste of resources;

[0018] S2, a read-write separation mechanism is established based on the dual database architecture of the primary and standby databases, so that two DB2 servers are active at the same time, one database supports read-write operations, and the other database supports read-only operations. The databases use the HADR near real-time synchronization mechanism to ensure the consistency of the primary and standby data, so that when the primary server submits to the local database, the standby server can also synchronously receive relevant data information;

[0019] S3, add a self-check reconnection mechanism for effective database connection at the bottom layer of the core business platform to prevent the situation where the service connection application service is connected to an invalid database when the primary and backup databases are abnormal or the roles are switched; the application layer performs special processing of the database connection according to the self-check reconnection mechanism to realize the connection processing between the host and the backup machine, and automatically adapts to the different states of the target scenario for different processing when it is found that the default database state of the connection is incorrect.

[0020] The core business platform can identify all transaction services and classify them into standard online transactions and fast online transactions. Standard online services are used for transactions with data changes, and fast online services are used for transactions without data changes. For some query transactions, the service of updating the main database is split into two-stage transactions, namely a password verification transaction and a query transaction. The peripheral system initiates the query transaction after successfully calling the password verification transaction. When the online main control platform calls various functional components, the fast online transaction simplifies the execution of some functional components and only calls the necessary message reception, message interpretation, security check, application call, output message processing, and error handling components.

[0021] The master database and the standby database are both independent servers with independent storage devices, and log synchronization is achieved between the master database and the standby database through HADR near synchronization technology;

[0022] The standby database receives log records from the primary database and stores and replays transactions. When the primary database server fails, the standby database is upgraded to the primary database to take over the transaction load. After the primary database server fails and recovers, it can reconnect to the HADR network as a standby database and resynchronize logs.

[0023] The specific process of the NEARSYNC mechanism is as follows: transactions on the host can be committed only after the logs are successfully written to the local disk and sent to the standby machine's memory. When the host sends logs to the standby machine, it will wait for the standby machine to return a response that the logs have been received; the host database writes local logs and sends logs to the standby machine in parallel. While writing local logs, it sends logs to the standby machine, so the host processing performance is better than the SYNC mode; when the standby machine crashes, the standby machine's memory data may be lost. The standby machine recovery can roll forward and level the host logs according to the actual disk log records to achieve data consistency between the primary and standby databases.

[0024] The present invention adopts the above structure, receives service requests from the service bus system through the transaction middleware load balancing server, balances the transaction pressure of each application server according to the load balancing strategy, and automatically distributes them to the target application server; installs and deploys core application services through the application server, which is responsible for completing the logical processing, business control, data calculation and data processing of the core business; installs and deploys relational database software through the database server, stores and manages the data information of the core business, so that the main and standby databases can provide services to the outside world at the same time; the main database supports read-write access and provides various databases for application operations; the standby database supports read-only access and provides query operations, which has the advantages of being practical, efficient, stable and safe. Description of the drawings:

[0025] Figure 1 It is a schematic diagram of the structure of the main database server and the backup database server of the present invention.

[0026] Figure 2 It is a schematic diagram of the near real-time synchronization NEARSYNC mechanism process of the present invention.

[0027] Figure 3 It is a flow chart of the self-check reconnection mechanism of the present invention. Specific implementation method:

[0028] In order to clearly illustrate the technical features of the present solution, the present invention is described in detail below through specific implementation methods and in conjunction with the accompanying drawings.

[0029] like Figure 1-3 As shown in, the application system for service read-write separation and automatic exception processing includes a core business platform, which adopts a three-layer deployment mode of transaction middleware load balancing server, application server, and database server to support service read-write separation and automatic exception identification;

[0030] The transaction middleware load balancing server is used to receive service requests from the service bus system, balance the transaction pressure of each application server according to the load balancing strategy, and automatically distribute them to the target application server;

[0031] The application server is used to install and deploy core application services and is responsible for completing the logic processing, business control, data calculation and data processing of core businesses;

[0032] The database server is used to install and deploy relational database software, store and manage data information of core business, so that the main and standby databases can provide services to the outside world at the same time; the main database supports read-write access and provides various databases for application operations; the standby database supports read-only access and provides query operations.

[0033] The transaction middleware load balancing server adopts a dual-machine cluster deployment mode to improve the efficiency of transaction distribution; the transaction middleware load balancing server supports load balancing through transaction middleware, improves the utilization efficiency of application servers, and when an abnormality occurs on a single server, the other server can provide services normally.

[0034] The service bus system is used to transmit transaction requests to the core business platform. Standard online service and fast online service are configured on the service bus system. When there is data to read and write, the standard connection service is used, and when there is no data to read and write, the fast online service is used.

[0035] The application server is divided into multiple logical partitions by multiple servers for cluster deployment, which greatly improves the performance of core services while providing high availability; multiple server nodes are added to the application server to expand the business processing capability.

[0036] The database server adopts a dual-machine active-active deployment mode, and uses the DB2 HADR algorithm to achieve near real-time data synchronization between the active and standby machines. All operations in the primary database are transmitted to the standby database through logs. After receiving the logs, the standby database performs a rollforward operation to achieve data consistency.

[0037] The core business platform's core business logic processing, business control, data calculation and data processing application services are installed and deployed on the application server; the core business platform implements read-write separation and automatic abnormality identification at the application layer through the HADR algorithm.

[0038] The application method of service read-write separation and automatic exception processing includes the following steps:

[0039] S1: divide transactions into read-write services and read-only services according to transaction types, connect read-write services to the primary database, connect read-only services to the standby database, and connect the downstream jobs in batch processing to the standby database to avoid idleness of the standby database and waste of resources;

[0040] S2, a read-write separation mechanism is established based on the dual database architecture of the primary and standby databases, so that two DB2 servers are active at the same time, one database supports read-write operations, and the other database supports read-only operations. The databases use the HADR near real-time synchronization mechanism to ensure the consistency of the primary and standby data, so that when the primary server submits to the local database, the standby server can also synchronously receive relevant data information;

[0041] S3, add a self-check reconnection mechanism for effective database connection at the bottom layer of the core business platform to prevent the situation where the service connection application service is connected to an invalid database when the primary and backup databases are abnormal or the roles are switched; the application layer performs special processing of the database connection according to the self-check reconnection mechanism to realize the connection processing between the host and the backup machine, and automatically adapts to the different states of the target scenario for different processing when it is found that the default database state of the connection is incorrect.

[0042] The core business platform can identify all transaction services and classify them into standard online transactions and fast online transactions. Standard online services are used for transactions with data changes, and fast online services are used for transactions without data changes. For some query transactions, the service of updating the main database is split into two-stage transactions, namely a password verification transaction and a query transaction. The peripheral system initiates the query transaction after successfully calling the password verification transaction. When the online main control platform calls various functional components, the fast online transaction simplifies the execution of some functional components and only calls the necessary message reception, message interpretation, security check, application call, output message processing, and error handling components.

[0043] The master database and the standby database are both independent servers with independent storage devices, and log synchronization is achieved between the master database and the standby database through HADR near synchronization technology;

[0044] The standby database receives log records from the primary database and stores and replays transactions. When the primary database server fails, the standby database is upgraded to the primary database to take over the transaction load. After the primary database server fails and recovers, it can reconnect to the HADR network as a standby database and resynchronize logs.

[0045] The specific process of the NEARSYNC mechanism is as follows: transactions on the host can be committed only after the logs are successfully written to the local disk and sent to the standby machine's memory. When the host sends logs to the standby machine, it will wait for the standby machine to return a response that the logs have been received; the host database writes local logs and sends logs to the standby machine in parallel. While writing local logs, it sends logs to the standby machine, so the host processing performance is better than the SYNC mode; when the standby machine crashes, the standby machine's memory data may be lost. The standby machine recovery can roll forward and level the host logs according to the actual disk log records to achieve data consistency between the primary and standby databases.

[0046] The working principle of the application system and method for service read-write separation and automatic exception processing in the embodiment of the present invention is: a three-layer deployment mode of transaction middleware load balancing server, application server, and database server is adopted to support service read-write separation and automatic exception identification, and all operations of the main database are transmitted to the backup database in real time through logs. After the backup database receives the logs, it performs a forward roll operation to achieve consistency between the main and backup databases; in the event of an abnormality, the main and backup databases are automatically switched through the database's self-check and reconnection mechanism to ensure the high availability of the system itself, and can automatically identify main and backup data anomalies, realize database self-check and reconnection, and make full use of the backup database resources, thereby reducing the pressure on the main database during peak hours and improving the overall efficiency of the system.

[0047] As a peripheral system of the core business platform, the service bus system is used to transmit transaction requests to the core business platform. It supports standard online and fast online services according to registered transaction configurations. Standard online services are used for data changes, and fast online services are used for data changes. The core publishes the correspondence between different transaction interfaces and service names as interface standards to the service bus system. When forwarding the core requests of the peripheral system, the service bus system calls different core application services according to different interfaces.

[0048] For the transaction middleware load balancing server, a dual-machine cluster deployment mode is adopted to improve the efficiency of transaction distribution; load balancing is supported based on the transaction middleware to improve the utilization efficiency of application servers; in the event of an abnormality of a single server, since the load balancing server is deployed in a dual-machine cluster mode, the other server can still provide services, ensuring that the transaction middleware load balancing server is in a high availability stage.

[0049] For application servers, multiple servers are divided into multiple LPARs for cluster deployment, and online load balancing is completed by the transaction middleware server. This cluster deployment architecture can provide high availability while greatly improving the performance of core services through multiple servers in parallel. Business processing capabilities can be expanded by adding application server nodes. In the event of abnormal conditions on some application servers, since the application servers are deployed in a cluster, the tuxedo scheduling server will automatically distribute transaction requests to other normally active application servers, and services can still be provided to the outside world, ensuring 7X24 hours of uninterrupted service.

[0050] Furthermore, application services for core business logic processing, business control, data calculation, data processing and other functions are installed and deployed on application servers.

[0051] The core online transaction service is encapsulated using transaction middleware and displayed to the outside as multiple available application services. When one of the services is abnormal, other online services can provide services normally, and the original abnormal service can be automatically restarted in a short time to continue to provide external services. At the same time, the upper and lower limits of the number of external services are set. During peak trading hours, the transaction middleware can automatically increase the number of core services to ensure a quick response to service requests.

[0052] The core application layer online transaction area adopts a read-write separation strategy to fully utilize the database standby processing performance, improve online service processing efficiency, and shorten processing time.

[0053] The database server adopts a dual-machine active-active deployment mode, and achieves near-real-time data synchronization between the master and the standby through DB2 HADR technology. All operations of the master database are transmitted to the standby database in real time through logs. After the standby database receives the logs and performs a roll-forward operation, data consistency is achieved. The master database supports read-write processing, and the standby database provides read-only processing; batch processing involving data download jobs can also be completed by connecting to the standby database, making full use of the database standby machine, reducing the pressure on the master database server, and improving the performance of daily online accounting transactions. Fast online service shortens the core response time and reduces system resource consumption; in the event of an abnormality in the database master database, the NEARSYNC near-synchronous mode automatically upgrades the standby database to the master database, and all online transaction requests connected to the master database are automatically switched to the standby database, which can ensure its own high availability.

[0054] When an abnormal scenario occurs in the database standby database, the primary database itself can ensure high availability in this abnormal scenario, and all fast online transaction requests connected to the standby database are automatically switched to the primary database.

[0055] It is particularly noted that the core business platform can implement read-write transaction separation strategy and automatic abnormality identification at the application layer through HADR technology, which is the main technical innovation of the present invention; different transaction services are connected to different application services, the database's near real-time synchronization mechanism and the database's automatic connection processing, etc. to implement read-write transaction separation strategy and automatic abnormality identification.

[0056] As for the specific application methods and steps, firstly, the transactions are divided into read-write services and read-only services according to the transaction types, and the read-write services are connected to the main database, the read-only services are connected to the backup database, and the downstream jobs in the batch processing are connected to the backup database to avoid the backup database being idle and causing waste of resources.

[0057] The core business platform's applications identify and categorize all transactions. For transactions with data changes, standard online services are used, while for transactions without data changes, fast online services are used. For some query transactions, there are transaction services that may update the main database, which can be divided into two-stage transactions, namely a password verification transaction and a query transaction. The peripheral system initiates the query transaction after successfully calling the password verification transaction.

[0058] Furthermore, when the fast online service calls various functional components on the online main control platform, it simplifies the execution of some functional components and only calls the necessary message reception, message interpretation, security check, application call, output message processing, error handling and other components. It does not use transaction serial numbers, does not call the accounting engine, does not perform maintenance transactions, does not process accounts, and can only provide query functions.

[0059] In order to prevent omissions in application writing, such as accidental changes to data in programs suitable for fast transactions, the standard online service and fast online service flags should be set in the transaction control master file CMTXPTXP. When the application calls the underlying database access engine DB I to access the database table, DB I will first obtain the type of current transaction (standard online, fast online) based on the transaction type identifier in the SYS area to perform access permission control. If it is determined that the add, delete, or modify operation is being performed for fast online, an error will be reported and the request will be rejected.

[0060] A read-write separation mechanism is established based on the dual database architecture of the primary and standby databases, so that two DB2 servers are active at the same time, one database supports read-write operations, and the other database supports read-only operations. The databases use the HADR near real-time synchronization NEARSYNC mechanism to ensure the consistency of the primary and standby data, so that when the host submits the local database, the standby machine can also synchronously receive relevant data information.

[0061] The primary database and the standby database are independent servers with independent storage devices. Log synchronization is achieved between the primary database and the standby database through HADR near synchronization technology.

[0062] Therefore, the standby database service can be regarded as equivalent to the primary database service, receiving log records from the primary database and storing and replaying transactions. When the primary database server fails, the standby database can be upgraded to the primary database to take over the transaction load. After the failed server is restored, it can reconnect to the HADR network as a standby database and resynchronize logs.

[0063] The principle of the near real-time synchronization NEARSYNC mechanism is as follows: the transaction on the host can be committed only after the log is successfully written to the local disk and sent to the standby machine memory. When the host sends the log to the standby machine, it will wait for the standby machine to return a response that the log has been received.

[0064] The host database writes local logs and sends logs to the standby machine in parallel. While writing local logs, it sends logs to the standby machine. Therefore, the host processing performance is better than that in SYNC mode. When the standby machine crashes, the standby machine memory data may be lost. The standby machine recovery can roll forward and level the host log according to the actual disk log records to achieve data consistency between the primary and standby databases.

[0065] Furthermore, a self-checking and reconnection mechanism for valid database connections is added to the underlying core business platform to prevent the application service from connecting to an invalid database when anomalies occur in the primary and standby databases or when roles are switched.

[0066] Specifically, when read-write is separated, different services access different databases, and the following problems may occur: During the host operation and maintenance window, DDL operations performed will cause the standby machine to not provide access to the database. At this time, the active database connection on the standby machine will be invalidated. If the read-only transaction connected to the StandBy DB continues to use the original database connection Handle ID to read the database, an error will be generated, resulting in transaction failure; when the standby server is abnormal, read-only transactions cannot connect to the standby database, and all read-only transactions will fail; when the host server is abnormal, read-write transactions cannot connect to the primary database, and all read-write transactions will fail; when the HADR synchronization network between the host and standby fails, the host data cannot be synchronized to the standby in time, and the data read by the read-only transaction may not be the latest; if the automatic takeover of the standby machine is enabled, consider the situation where the primary and standby roles change during automatic takeover.

[0067] When the host or backup machine fails, the specific process is as follows:

[0068] When an exception occurs on the standby machine, under the HADR mechanism, there is no impact on the host's database, the host's data remains up to date and complete, and can provide external read and write functions. When an exception occurs on the host, HADR supports the automatic upgrade of the standby machine to the host, and can complete the role switch within seconds, upgrading itself from the R database to the A database. However, to officially provide external read and write functions, it is necessary to wait until the database has landed all the received but unlanded logs. At the same time, the HADR mechanism provides a manual switching mechanism, which implements the role switching between the host and the standby machine by executing commands on the standby machine.

[0069] In order to prevent and control the risk of brain split when the database automatically switches roles, the core business platform uses application transformation to prevent and control it. The specific principles are as follows:

[0070] By using the TMS XA service of Tuxedo middleware, when the application service is started, the API function provided by Tuxedo is used to apply for a database connection, and the connection Handle ID is kept during the service activity. Subsequently, the service receives the application message from the client through the internal queue of tuxedux and performs application processing. When the processing involves database access, the original database connection Handle ID is used, and no new database connection application is made; this method reduces the consumption of database connections required for each transaction and improves application processing efficiency.

[0071] To consider the high availability of services, all services need to support automatic switching between the primary and standby machines. The processing mechanisms for the two types of database connections are as follows: Online services configure long connections to the database through the transaction middleware, and specify the database name, user name, and password for the connection in the configuration file; batch processing connects to the database through the database name, user name, and password configured in the CCBS01 configuration file.

[0072] Online service: The configuration file of the transaction middleware only supports the configuration of one database connection. Therefore, at the application layer, all services of the core business platform are encapsulated in an outer layer for docking with the transaction middleware. The database connection is customized to achieve the master-slave machine switching. That is, a long connection to the database is established at the encapsulation layer. When a message request is received, it is first checked whether it is connected normally. If it is connected normally, the database connection is no longer required. If the connection is abnormal, reconnect. If the database with priority connection is not available, or the number of connection failures exceeds the limit, connect to the backup database connection. After connecting to the backup database connection, it is still necessary to perform regular switchback detection. If the database with priority connection is found to be available, switch back.

[0073] For services such as standard online connection that connect to the database host, priority is given to connecting to the database host, and if it is unavailable, the backup server is connected; for services such as fast online connection, priority is given to connecting to the backup database server, and if it is unavailable, the host is connected.

[0074] To summarize, the application system and method for service read-write separation and automatic exception processing in the embodiment of the present invention adopts a three-layer deployment mode of transaction middleware load balancing server, application server, and database server to support service read-write separation and automatic exception identification, and transmits all operations of the main database to the backup database in real time through logs. After receiving the logs, the backup database performs a rollforward operation to achieve consistency between the main and backup databases; in the event of an abnormality, the main and backup databases are automatically switched through the database's self-check and reconnection mechanism to ensure the high availability of the system itself, and can automatically identify main and backup data anomalies, realize database self-check and reconnection, and make full use of backup database resources, thereby reducing the pressure on the main database during peak periods and improving the overall efficiency of the system.

[0075] The above specific implementation manner cannot be used as a limitation on the protection scope of the present invention. For those skilled in the art, any substitution, improvement or change made to the implementation manner of the present invention falls within the protection scope of the present invention.

[0076] The matters not described in detail in the present invention are all known technologies to those skilled in the art.

Claims

1. Application system for service read-write separation and automatic exception handling, characterized by: The application system includes a core business platform, which adopts a three-layer deployment mode of transaction middleware load balancing server, application server, and database server to support read-write separation and automatic abnormality identification of services; The transaction middleware load balancing server is used to receive service requests from the service bus system, balance the transaction pressure of each application server according to the load balancing strategy, and automatically distribute them to the target application server; The application server is used to install and deploy core application services and is responsible for completing the logic processing, business control, data calculation and data processing of core businesses; The database server is used to install and deploy relational database software, store and manage data information of core business, so that the main and standby databases can provide services to the outside world at the same time; the main database supports read and write access, and provides various databases for application operations; The standby database supports read-only access and provides query operations.

2. The application system for service read-write separation and automatic exception handling according to claim 1 is characterized by: The transaction middleware load balancing server adopts a dual-machine cluster deployment mode to improve the efficiency of transaction distribution; the transaction middleware load balancing server supports load balancing through transaction middleware, improves the utilization efficiency of application servers, and when an abnormality occurs on a single server, the other server can provide services normally.

3. The application system for service read-write separation and automatic exception handling according to claim 1 is characterized by: The service bus system is used to transmit transaction requests to the core business platform. Standard online service and fast online service are configured on the service bus system. When there is data to read and write, the standard connection service is used, and when there is no data to read and write, the fast online service is used.

4. The application system for service read-write separation and automatic exception handling according to claim 1 is characterized in that: The application server is divided into multiple logical partitions by multiple servers for cluster deployment, which greatly improves the performance of core services while providing high availability; multiple server nodes are added to the application server to expand the business processing capability.

5. The application system for service read-write separation and automatic exception handling according to claim 1 is characterized in that: The database server adopts a dual-machine active-active deployment mode, and uses the DB2 HADR algorithm to achieve near real-time data synchronization between the active and standby machines. All operations in the primary database are transmitted to the standby database through logs. After receiving the logs, the standby database performs a rollforward operation to achieve data consistency.

6. The application system for service read-write separation and automatic exception handling according to claim 1 is characterized in that: The core business platform's core business logic processing, business control, data calculation and data processing application services are installed and deployed on the application server; the core business platform implements read-write separation and automatic abnormality identification at the application layer through the HADR algorithm.

7. The application method of service read-write separation and automatic exception processing is characterized by: The application method comprises the following steps: S1: divide transactions into read-write services and read-only services according to transaction types, connect read-write services to the primary database, connect read-only services to the standby database, and connect the downstream jobs in batch processing to the standby database to avoid idleness of the standby database and waste of resources; S2, a read-write separation mechanism is established based on the dual database architecture of the primary and standby databases, so that two DB2 servers are active at the same time, one database supports read-write operations, and the other database supports read-only operations. The databases use the HADR near real-time synchronization mechanism to ensure the consistency of the primary and standby data, so that when the primary server submits to the local database, the standby server can also synchronously receive relevant data information; S3, add a self-check reconnection mechanism for effective database connection at the bottom layer of the core business platform to prevent the situation where the service connection application service is connected to an invalid database when the primary and backup databases are abnormal or the roles are switched; the application layer performs special processing of the database connection according to the self-check reconnection mechanism to realize the connection processing between the host and the backup machine, and automatically adapts to the different states of the target scenario for different processing when it is found that the default database state of the connection is incorrect.

8. The application method of service read-write separation and automatic exception handling according to claim 7 is characterized by: The core business platform can identify all transaction services and classify them into standard online transactions and fast online transactions. Standard online services are used for transactions with data changes, and fast online services are used for transactions without data changes. For some query transactions, the service of updating the main database is split into two-stage transactions, namely a password verification transaction and a query transaction. The peripheral system initiates the query transaction after successfully calling the password verification transaction. When the online main control platform calls various functional components, the fast online transaction simplifies the execution of some functional components and only calls the necessary message reception, message interpretation, security check, application call, output message processing, and error handling components.

9. The application method of service read-write separation and automatic exception handling according to claim 7 is characterized by: The master database and the standby database are both independent servers with independent storage devices, and log synchronization is achieved between the master database and the standby database through HADR near synchronization technology; The standby database receives log records from the primary database and stores and replays transactions. When the primary database server fails, the standby database is upgraded to the primary database to take over the transaction load. After the primary database server fails and recovers, it can reconnect to the HADR network as a standby database and resynchronize logs.

10. The application method of service read-write separation and automatic exception handling according to claim 7 is characterized in that: The specific process of the NEARSYNC mechanism is as follows: transactions on the host can be committed only after the logs are successfully written to the local disk and sent to the standby machine's memory. When the host sends logs to the standby machine, it will wait for the standby machine to return a response that the logs have been received; the host database writes local logs and sends logs to the standby machine in parallel. While writing local logs, it sends logs to the standby machine, so the host processing performance is better than the SYNC mode; when the standby machine crashes, the standby machine's memory data may be lost. The standby machine recovery can roll forward and level the host logs according to the actual disk log records to achieve data consistency between the primary and standby databases.