Database scheduling method and device, equipment, storage medium and program product
Through the middleware system, the database access request is proxyed and forwarded in a heterogeneous database environment, smooth switching of the database is achieved, the problems of high costs and service interruptions in the existing technology are solved, and the availability and continuity of the system are improved.
Patent Information
- Application Number
- CN202411977568.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-16
AI Technical Summary
The prior art cannot achieve smooth switching in a heterogeneous database environment, resulting in high costs of system transformation, data migration and verification, and the risk of user service interruption.
Through the middleware system proxying and forwarding user's database access requests, smooth switching of heterogeneous databases is achieved. The middleware system receives requests through a unified interface, parses the requests to obtain database mapping information, and dynamically forwards the requests to the database to be accessed.
This avoids the costs of system transformation and data migration, reduces the risk of service interruption, and improves the system's high availability and business continuity.
Smart Images

Figure CN120011433A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a database scheduling method, device, equipment, storage medium and program product. Background Art
[0002] In large-scale enterprise information systems, as data volume grows and business needs diversify, enterprises gradually deploy multiple heterogeneous databases to meet different application scenarios. However, in the face of database switching requirements caused by scenarios such as system upgrades, data center relocations, computer room relocations, and primary and standby link disaster recovery, existing technical solutions and database tools cannot avoid problems and risks such as upstream and downstream application system transformation, massive data migration and verification costs, and user service interruptions caused by database switching. Therefore, how to achieve smooth switching in a heterogeneous database environment has become an urgent problem to be solved. Summary of the invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a database scheduling method, which implements the smooth switching of heterogeneous databases by proxying and forwarding user access requests to the database through a middleware system, avoids system transformation, reduces data migration and verification costs, reduces the risk of service interruption, and improves the high availability and business continuity of the system.
[0004] The present invention also provides a database scheduling device, an electronic device, a non-transitory computer-readable storage medium and a computer program product.
[0005] The database scheduling method according to the first embodiment of the present invention includes: Receiving a database access request sent by a user terminal through a unified interface; the database access request is generated based on an access link provided by the middleware system; Parsing the database access request to obtain pre-stored database mapping information corresponding to the access link; Based on the database mapping information, the database access request is dynamically forwarded to a database to be accessed; the database to be accessed is a database requested to be accessed by the database access request.
[0006] According to one embodiment of the present invention, the database mapping information is updated in the following manner: In the case of monitoring database switching requirement information, monitoring the switching status of the source database and the target database included in the database switching requirement information; the source database is the sending end of the data switching; the target database is the receiving end of the data switching; If the switching status of the source database and the target database meets the set switching condition, the database mapping information is changed based on the target database.
[0007] According to an embodiment of the present invention, dynamically forwarding the database access request to the database to be accessed based on the database mapping information includes: If the access link is mapped to a database in the database mapping information, then based on the database mapping information, determining one of the databases to be accessed, and dynamically forwarding the database access request to the database to be accessed; If the access link is mapped to multiple databases in the database mapping information, then determining multiple candidate databases to be accessed based on the database mapping information; Based on the user request diversion solution, the database to be accessed is determined from a plurality of candidate databases to be accessed, and the database access request is dynamically forwarded to the database to be accessed.
[0008] According to an embodiment of the present invention, the user request diversion scheme is determined based on the following method: Monitoring the load information of each candidate database to be accessed; Detecting health information of each candidate database to be accessed; the health information is used to indicate whether the candidate database to be accessed is working normally; The user request diversion scheme is determined based on a preset load balancing strategy, the load information and the health information of each of the candidate databases to be accessed.
[0009] According to one embodiment of the present invention, the middleware system is connected to a plurality of scheduling databases, the plurality of scheduling databases include the database to be accessed, and the method further comprises: Obtaining a data synchronization strategy and a data synchronization list of the scheduling database; Based on the data synchronization strategy and the data synchronization list, generate a data synchronization task; Based on the data synchronization task, generate a data verification task; Using a message queue to asynchronously process the data synchronization task; In the process of asynchronously processing the data synchronization task, the data verification task is synchronously executed to perform a database scheduling operation on the scheduling database that passes the data verification task.
[0010] According to an embodiment of the present invention, the receiving, through the unified interface, a database access request sent by a user terminal includes: The gateway center of the middleware system provides a unified data access interface to the outside world and receives the database access request sent by the user end.
[0011] A database scheduling device according to an embodiment of the second aspect of the present invention includes: A receiving module, used to receive a database access request sent by a user terminal through a unified interface; the database access request is generated based on an access link provided by the middleware system; A parsing module, used to parse the database access request to obtain pre-stored database mapping information corresponding to the access link; The forwarding module is used to dynamically forward the database access request to a database to be accessed based on the database mapping information; the database to be accessed is the database requested to be accessed by the database access request.
[0012] According to an embodiment of the third aspect of the present invention, the electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the database scheduling method described above is implemented.
[0013] According to the non-transitory computer-readable storage medium of the fourth aspect of the present invention, a computer program is stored thereon, and when the computer program is executed by a processor, the database scheduling method as described in any one of the above is implemented.
[0014] A computer program product according to an embodiment of the fifth aspect of the present invention includes a computer program, and when the computer program is executed by a processor, it implements any of the database scheduling methods described above.
[0015] The above one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects: Users do not need to establish a direct access connection with the database. Instead, the middleware system proxies and forwards the user's access request to the database. Therefore, when the database information changes, only the middleware system needs to make corresponding adjustments without any operation or change on the user side, thus shielding the impact of changes on the database side on the user; It achieves smooth switching of heterogeneous databases, avoids system transformation, reduces data migration and verification costs, reduces the risk of service interruption, and improves system high availability and business continuity.
[0016] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is a flowchart of a database scheduling method provided by an embodiment of the present invention.
[0019] Figure 2 It is a flow chart of a heterogeneous multi-database unified agent and cross-database data intelligent management method provided by an embodiment of the present invention.
[0020] Figure 3 It is a schematic diagram of the architecture of a heterogeneous multi-database unified agent and cross-database data intelligent management system provided by an embodiment of the present invention.
[0021] Figure 4 It is a schematic diagram of the core process of user request forwarding provided by an embodiment of the present invention.
[0022] Figure 5 It is a schematic diagram of the core process of seamless database switching provided by an embodiment of the present invention.
[0023] Figure 6 It is a schematic diagram of the core process of cross-database synchronization and verification provided by an embodiment of the present invention.
[0024] Figure 7 It is a schematic diagram of the core process of intelligent diversion of user requests provided by an embodiment of the present invention.
[0025] Figure 8 It is a structural diagram of a database scheduling device provided in an embodiment of the present invention.
[0026] Fig. 9 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following embodiments of the present invention are described in further detail in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0028] In the description of the embodiments of the present invention, it should be noted that the terms “first”, “second” and “third” are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0029] In the embodiments of the present invention, unless otherwise clearly specified and limited, the first feature being "above" or "below" the second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, the first feature being "above", "above" and "above" the second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. The first feature being "below", "below" and "below" the second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0030] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0031] In the related art, the use of databases is usually done by directly establishing a link with the database. After a database is built, a database connection address, namely the database URL (Uniform Resource Locator), database service port and database access API (Application Programming Interface) is usually provided. Users use the database URL and database service port to write corresponding codes according to the database access API to connect to the database, access the database and perform various operations. Since different databases usually correspond to different URLs, database service ports and database access APIs, when users need to access different databases, they need to write different database connection codes, which results in database migration or replacement due to system upgrades, computer room migration and data migration (such as replacing database A with database B). The related art needs to complete the following work steps: 1) Build database B; 2) Develop a database migration program to transfer all the data in database A to database B, and repeatedly check to ensure that the data in databases A and B are completely consistent; 3) All systems and users using database A need to rewrite a code to access database B (hereinafter referred to as CB, and the code to access database A is referred to as CA); 4) When the data in databases A and B are consistent, choose a suitable time (such as a low-peak business period), stop running code CA, and enable code CB; 5) Wait for all users and systems to complete the switch of CA and CB, and the database switch is completed.
[0032] The main problems with the above technical solutions are: high migration costs: a) Each time the database is switched, a huge amount of manpower is required to develop the database migration program and check the data; b) Each time the database is switched, all users and systems upstream and downstream of the database need to rewrite the database access code; c) Each time the database is switched, it is necessary to sort out the upstream and downstream systems and users of the database and promote the upstream and downstream to complete the transformation work, which has high communication and coordination costs. High risk of switching databases: There is a risk of user service interruption during the database switching process.
[0033] Based on the above problems, the present invention proposes a database scheduling method, specifically a heterogeneous multi-database unified agent and cross-database data intelligent management method.
[0034] Figure 1 Schematic diagram of the flow of the database scheduling method provided by the embodiment of the present invention. Figure 1 , an embodiment of the present invention provides a database scheduling method, comprising: Step 101: receiving a database access request sent by a user terminal through a unified interface.
[0035] The executor of the present invention is a middleware system, wherein the middleware system can be understood as a bridge between the user end and the database. The user end does not need to directly establish an access connection with the database, but the middleware system proxies and forwards the user's access request to the database.
[0036] The middleware system uses the gateway center to provide a unified data access interface for users to establish a connection with the system and initiate access requests to the database. Specifically, the middleware system provides a unified data access interface through the gateway center to receive database access requests sent by the user. Among them, the data access interface can include HTTP (Hypertext Transfer Protocol) interface and JDBC (Java Database Connectivity) interface.
[0037] The database access request is generated based on the access link provided by the middleware system. The access link can be a URL created by the administrator in the system management interface, which acts as a "virtual entrance" or "abstract interface" through which the user can interact with the database. The database access request can contain the URL and other parameters of the request (such as query parameters, path parameters, etc.); the database access request can be a RESTful API request, a GraphQL request, and an RPC (Remote Procedure Call) request, etc.
[0038] For example, the administrator creates an access link URL_A through the system management interface and configures the mapping relationship between the access link and the database: URL_A—>DB_A. The user uses URL_A obtained from the system management interface to establish a connection with the gateway center. It can be understood that URL_A is a virtual access path, which is a bridge between the user and the database. The user does not directly connect to a specific database (such as DB_A), but initiates a connection request through URL_A.
[0039] Step 102: Parse the database access request to obtain pre-stored database mapping information corresponding to the access link.
[0040] After receiving the database access request, the gateway center of the middleware system parses the database access request to obtain the pre-stored database mapping information corresponding to the access link. For example, the gateway center needs to extract the URL information from the database access request. For example, for the RESTful request http: / / example.com / api / v1 / data, the extracted URL path can be / api / v1 / data. Then, based on the URL information, the database mapping information corresponding to the URL is searched in the configuration of the middleware system, such as URL_A—>DB_A, indicating that a mapping relationship is established between URL_A and database DB_A. The database mapping information can be stored in the form of a database mapping table or a configuration file.
[0041] Step 103: Dynamically forward the database access request to the database to be accessed based on the database mapping information.
[0042] The gateway center of the middleware system will select the corresponding database connection based on the database mapping information, which can include two situations: If there is only one database mapping, the gateway center directly establishes a connection to the database. If the mapping contains multiple databases, the gateway center will select a database instance for access, or dynamically select it based on the load balancing strategy. After establishing the database connection, the gateway center forwards the parsed database access request (including request parameters, query conditions, etc.) to the database to be accessed, and performs corresponding database operations, such as query, update, delete, etc. Among them, the database to be accessed is the database requested to be accessed by the database access request.
[0043] In one embodiment, if the access link is mapped to a database in the database mapping information, a database to be accessed is determined based on the database mapping information, and the database access request is dynamically forwarded to the database to be accessed; if the access link is mapped to multiple databases in the database mapping information, multiple candidate databases to be accessed are determined based on the database mapping information; based on the user request diversion scheme, the database to be accessed is determined from the multiple candidate databases to be accessed, and the database access request is dynamically forwarded to the database to be accessed.
[0044] It is understandable that the gateway center dynamically determines the database to be accessed based on the URL path of the user's request, and forwards the database access request according to the configured diversion rules. First, the gateway center determines the database to be accessed based on the requested access link (URL) and the pre-configured database mapping information, including the following two situations: Single database mapping: If the requested access link matches a database in the database mapping information (such as URL_A->DB_A), the gateway center will directly route the request to the database DB_A mapped to the URL. In this case, the gateway center directly finds the only target database based on the access link and then performs the database operation.
[0045] Multiple database mappings: If there are multiple database mappings in the requested access link and database mapping information (such as URL_A->DB_A and URL_A->DB_B), the gateway center will find multiple candidate databases to be accessed (such as DB_A and DB_B), and then select one or more of the candidate databases to be accessed to process the request. In the case of multiple candidate databases to be accessed, the gateway center determines the database to be accessed from multiple candidate databases to be accessed based on the user request diversion plan, and then dynamically forwards the database access request to the database to be accessed. Based on this, the user request diversion plan will ensure that the request is routed to a reasonable database to avoid overload, excessive latency or unreasonable access.
[0046] Optionally, the user request diversion solution can be implemented based on a variety of strategies, including: load balancing, such as selecting the currently most idle database based on the database load; request type diversion, such as determining the database to be accessed based on the content or type of the request (such as query, write, etc.); geographic location diversion, such as selecting the closest database instance based on the user's geographic location; polling, such as forwarding requests to multiple databases in turn according to a certain polling strategy.
[0047] The embodiment of the present invention provides a solution for horizontally expanding the database of the business system and improving the overall performance of the system database, for example, by diverting user requests to multiple database instances and achieving load balancing among multiple database instances, namely, the user request intelligent diversion service. By dynamically selecting a database to achieve load balancing, optimize performance, improve scalability and fault tolerance, the flexibility, stability and processing power of the system are improved.
[0048] The database scheduling method provided by the embodiment of the present invention receives a database access request sent by a user terminal through a unified interface; the database access request is generated based on an access link provided by a middleware system; the database access request is parsed to obtain pre-stored database mapping information corresponding to the access link; based on the database mapping information, the database access request is dynamically forwarded to the database to be accessed; the database to be accessed is the database requested to be accessed by the database access request. Based on the above scheme, the user does not need to directly establish an access connection with the database, but the middleware system proxies and forwards the user's access request to the database. Therefore, when the information in the database changes, only the middleware system needs to make corresponding adjustments, and the user terminal does not need to perform any operations or changes, thereby shielding the impact of changes on the user on the database side. Based on this, smooth switching of heterogeneous databases is achieved, avoiding system transformation, reducing data migration and verification costs, reducing the risk of service interruption, and improving the high availability and business continuity of the system.
[0049] Based on the above embodiment, the database mapping information is updated in the following manner: Step 110, in the case of monitoring database switching requirement information, monitoring the switching status of the source database and the target database included in the database switching requirement information; the source database is the sending end of the data switching; the target database is the receiving end of the data switching; Step 111: If the switching status of the source database and the target database meets the set switching condition, the database mapping information is changed based on the target database.
[0050] The administrator can initiate a database switching requirement through the system configuration interface: DB_A—>DB_B. For example, the administrator enters a switching requirement through the system configuration interface (such as the operation panel, management tool, or command line tool), indicating that the currently used source database (DB_A) will be switched to the target database (DB_B), and the switching requirement will be sent to the background control system.
[0051] The middleware system monitors the switching requirements in real time through the database seamless switching service. The database seamless switching service can be a daemon or background service that monitors the database switching requirements. Once the administrator initiates a switching request, the service will capture the switching request and start the switching process. The database seamless switching service starts to monitor the switching status of DB_A and DB_B. The switching status of DB_A is monitored to ensure system rollback in case of switching failure; the switching status of DB_B is monitored to confirm whether the target database is ready.
[0052] If the switching status of the source database DB_A and the target database DB_B meets the set switching conditions, it means that both DB_A and DB_B are healthy, that is, DB_A is in a healthy state and can be rolled back; DB_A is also in a healthy state and can carry new requests and loads. Further, a command to modify the database mapping relationship is initiated through the switching control module, and the command can be initiated through a management platform, a configuration management system, an API interface, etc. Based on the command, the database mapping information is changed, such as changing URL_A—>DB_A to URL_A—>DB_B. For example, the system will update the configuration file or other related database connection configurations, such as modifying the connection string: jdbc:mysql: / / hostA:3306 / dbA→jdbc:mysql: / / hostB:3306 / dbB, and update the load balancer, routing table, or DNS configuration information so that the access request points to the new database. After the configuration is changed, the application or service will start sending requests to DB_B.
[0053] The embodiment of the present invention ensures that both the source database and the target database are running healthily and modifies the database mapping relationship, so as to minimize the impact on users and applications during the switching process.
[0054] Based on the above embodiment, the user request diversion solution is determined based on the following method: Step 120, monitoring the load information of each candidate database to be accessed; Step 121, detecting health information of each candidate database to be accessed; the health information is used to indicate whether the candidate database to be accessed is working normally; Step 122: Determine the user request diversion solution based on a preset load balancing strategy, the load information and the health information of each candidate database to be accessed.
[0055] The load information of each candidate database to be accessed is monitored in real time through the statistics and monitoring module in the middleware system. The load information can be the current workload, resource usage (such as CPU usage, memory usage, disk I / O, etc.) and number of concurrent requests of each candidate database to be accessed. The purpose of monitoring the load information is to ensure that the database is not overloaded. For example, assuming that the CPU usage of a candidate database to be accessed is close to 100%, it means that the load of the candidate database to be accessed is very high, which may cause slow response or timeout. The system can choose to distribute the request to a database with a lower load.
[0056] The health information of each candidate database to be accessed is detected in real time through the health check module in the middleware system. Among them, the health information is used to detect whether the candidate database to be accessed is operating normally. The health information may include whether the candidate database to be accessed is available, whether it can respond to requests correctly, and whether there are abnormalities (such as connection timeouts, database crashes, etc.). For example, the health information of the database can be judged through regular "health checks", such as through heartbeat detection, Ping checks, or executing simple SQL queries to confirm whether the database is still available. If a candidate database to be accessed does not respond or returns an error, the system will consider the candidate database to be unhealthy and temporarily remove it from the candidate list.
[0057] The load balancing strategy can be understood as intelligently distributing user requests based on real-time load information and health information. Load balancing strategies can include: weighted polling, such as distributing requests to nodes with lower load or better performance based on the load or performance of the node; least connection strategy, such as selecting the database node with the least current connections to avoid nodes with excessive load; minimum delay, such as selecting the database node with the shortest response time.
[0058] Based on the preset load balancing strategy, the load information and health information of each candidate database to be accessed, the user request diversion plan is determined. For example, combined with the load balancing strategy, the middleware system will distribute requests to databases with low load and good health status; if a database is overloaded or abnormally healthy, the system will automatically adjust and divert requests to other more suitable databases. During the diversion process, the middleware system will monitor the status of each database in real time. If the load of a database increases or the health check fails, the system will avoid the database when a new request arrives, and direct the request to a database with low load and better health status. For example, suppose there are three databases A, B, and C. Among them, A and B are running normally, but the load of node A is very high. The system will choose to distribute the request to node B with lower load, or give the request to node C according to the load balancing strategy.
[0059] The embodiment of the present invention monitors load information and health information, combines load balancing strategy, and dynamically selects the most suitable database node to process user requests, which can not only avoid overloading of a single node, but also ensure the stability and high availability of the system. Through this diversion mechanism, the system can respond to user requests more intelligently and efficiently, and improve performance and fault tolerance.
[0060] Based on the above embodiment, the middleware system is connected to a plurality of scheduling databases, the plurality of scheduling databases include the database to be accessed, and the method further includes: Step 130, obtaining a data synchronization strategy and a data synchronization list of the scheduling database; Step 131, generating a data synchronization task based on the data synchronization strategy and the data synchronization list; Step 132, generating a data verification task based on the data synchronization task; Step 133, using a message queue to asynchronously process the data synchronization task; Step 134: during the asynchronous processing of the data synchronization task, synchronously execute the data verification task to perform a database scheduling operation on the scheduling database that passes the data verification task.
[0061] From the configuration information of the middleware system, obtain the data synchronization strategy and data synchronization list of the scheduling database. It is understandable that in a multi-database system or a distributed system, there is a need for data synchronization between databases. For example, the master database and the slave database, or different data centers may need to synchronize data regularly. Data synchronization strategy and data synchronization list are the key to achieving synchronization operations. Among them, the data synchronization strategy may include rules and methods for data synchronization, such as the frequency of synchronization (real-time, scheduled, incremental synchronization, etc.), synchronization mode (full synchronization, incremental synchronization, synchronization conditions, etc.), and synchronization priority. The data synchronization list is a list of specific data tables or data sets that need to be synchronized. For example, table A needs real-time synchronization, and table B only needs periodic synchronization. The data synchronization list lists these tables and their corresponding synchronization requirements.
[0062] According to the data synchronization strategy and data synchronization list obtained in the previous step, the system needs to generate specific data synchronization tasks, and each task will perform the corresponding database synchronization operation. Among them, the data synchronization task can be a specific execution unit, which is responsible for synchronizing the changes of the source database to the target database, and can contain detailed information about data synchronization, such as synchronization source, synchronization target, synchronization mode (full or incremental), synchronization time window, data verification requirements, etc. For example, the middleware system generates a set of tasks based on the data synchronization strategy and data synchronization list. These tasks can be scheduled tasks, batch tasks, or event-driven tasks. Each task will be associated with a specific synchronization source and synchronization target to ensure that the tasks are synchronized according to the set strategy.
[0063] Data synchronization is not only about transferring data from one database to another, it is also very important to ensure the correctness and consistency of the data. Therefore, the middleware system needs to perform data verification during data synchronization to ensure that the synchronized data is not lost, erroneous or inconsistent. Among them, the data verification task is to check and verify the synchronized data. The verification task can include multiple verification methods, such as verifying whether the synchronized data is complete, verifying the correctness of the data in the target database (such as data type consistency, data field matching, etc.), and verifying the synchronization timeliness of the data to ensure that there is no delay or data loss.
[0064] For each data synchronization task, the middleware system needs to generate a corresponding verification task. The verification task is executed synchronously during the execution of the synchronization task to check whether the synchronization result meets expectations. Data synchronization tasks can process a large amount of data, so efficient and reliable task scheduling and execution methods are required. Using message queues, data synchronization tasks can be processed asynchronously to avoid synchronization tasks blocking the main thread of the system or affecting other business processes. Among them, the message queue is used to asynchronously process each generated data synchronization task. Specifically, when a data synchronization task is generated, it will be pushed to the message queue; the message queue will asynchronously distribute these tasks to the execution queue for processing according to the scheduling rules and resource conditions; when the generated data synchronization task is pushed to the message queue, the consumer of the asynchronous task (for example, the background execution service) will take the task out of the queue and perform the synchronization operation; the message queue can ensure the order of task execution. After processing one task, the consumer can continue to process the next task.
[0065] Data verification can be part of the synchronization operation. During the execution of the data synchronization task, not only the data needs to be synchronized, but also it is necessary to ensure that there are no problems with the synchronized data. In order to improve efficiency, the data verification task can be directly executed synchronously during the execution of the data synchronization task. For example, in the message queue, whenever a data synchronization task is taken out and starts to execute, the system can immediately start the data verification task, so that the verification task can be carried out in parallel while the data synchronization is completed. This means that when the data synchronization task is executed, the system will perform verification operations in parallel, such as quickly verifying the synchronized data to ensure the correctness of the synchronization.
[0066] The execution result of the data verification task determines whether to perform the database scheduling operation. If the data synchronization is successful and the verification passes, the system can continue to perform the scheduling operation, such as updating the application, adjusting the database load, switching the database, etc. Among them, the scheduling database operation can be to adjust the database state according to the verification result or perform further database operations, such as switching the master database, switching the read / write database, and applying configuration changes. The database scheduling operation will only be performed after the data synchronization and verification are successful, which can avoid inconsistent database states caused by data synchronization errors.
[0067] When the data verification task passes, the middleware system can trigger subsequent scheduling operations, which may include updating the database configuration, switching the application's database connection, and triggering data backup or logging operations.
[0068] The embodiment of the present invention utilizes the asynchronous processing mechanism of the message queue to efficiently execute data synchronization and verification tasks. By decoupling the data synchronization task and the data verification task, the system can improve efficiency and avoid blocking the system due to the execution of the synchronization task. Through asynchronous processing, the system can flexibly schedule multiple data synchronization tasks to ensure that the verification tasks can be processed in parallel during the task execution process, ultimately ensuring the correctness and consistency of the data. Once the verification is passed, the subsequent database scheduling operation will be triggered, so that the entire process is automated and efficiently executed. The above scheme implements an efficient data synchronization and verification mechanism. For complex database operations and large-scale distributed systems, it can ensure data consistency, integrity and high availability of the system, while reducing verification costs.
[0069] On the other hand, database switching is usually caused by database migration room or data center, database version change, system upgrade, and is usually accompanied by data migration. Therefore, the middleware system provides cross-database data synchronization and verification services to provide a complete solution for the above scenarios.
[0070] In order to further analyze and explain the database scheduling method proposed in the present invention, the embodiment of the present invention specifically proposes a heterogeneous multi-database unified agent and cross-database data intelligent management system.
[0071] refer to Figure 2 The user writes code to establish a connection with the middleware system through the link address and interface provided by the middleware system. The database of the specific route of the link address is configured by the administrator through the management interface. The middleware system is responsible for establishing a connection with the database and forwarding the user's access request to the database to the corresponding database. The middleware system can mainly achieve the following functions: 2.1. When database migration occurs: For example, database A needs to be migrated to database B. The administrator only needs to configure the source database (A) and target database (B) to be migrated, as well as the data range and data synchronization strategy to be migrated in the system. The system's cross-database data automatic synchronization and verification function will automatically complete the data synchronization and verification work from database A to B. Once the data synchronization and verification are completed and the database switching conditions are ready, the administrator can choose to manually / automatically route the user's access request for database A to database B, which is user-friendly and cost-free.
[0072] 2.2. When you need to switch databases: for example, switch the user's access to database A to database B. The administrator only needs to change the user's access to database A to be routed to database B in the system. No changes are required on the user side.
[0073] 2.3. When the database access information changes: For example, when a user accesses database A through a middleware system and the connection address of database A changes, the user does not need to make any changes. The middleware system administrator only needs to modify the connection configuration for database A in the system. The middleware system shields the impact of database changes on users.
[0074] 2.4. Dual-link high availability scenario: In dual-link high availability scenarios, such as active-standby links, the traditional solution is for users to develop two links at the same time to achieve simultaneous reading and writing of the active and standby databases (such as active A and standby B). When database A fails, database B is manually enabled, and the switching process will cause data service interruption. With this middleware system, users only need to develop the connection code with the middleware system, and through administrator configuration, the connection can be directly routed to both databases A and B (or N databases at the same time) to achieve simultaneous operation of both databases A and B. At the same time, the system's seamless switching service function will monitor the status of the two databases in real time, and automatically implement seamless switching of the active and standby links and load balancing according to user configuration policies.
[0075] The core of the embodiment of the present invention is to use the unified proxy function for database access, whereby the middleware system uniformly receives, processes and forwards user access requests to the database, thereby shielding the impact of database changes on the user side. Combined with functions such as cross-database data synchronization and verification, intelligent diversion of user requests, seamless database switching, and a visual management configuration interface, it realizes scenarios such as database migration, switching, multi-link intelligent diversion, high-availability disaster recovery, database horizontal expansion, and high-performance load balancing, thereby achieving seamless and zero-cost for database users.
[0076] Further, refer to Figure 3 The main components and functions of the heterogeneous multi-database unified agent and cross-database data intelligent management system can include: 3.1. Gateway Center: The API Gateway Center is the entry point for all requests to enter the system and is the connection entry point between services.
[0077] 3.11) Security strategy: mainly to protect backend services from malicious access. Specific responsibilities may include traffic control, IP control, encrypted transmission, etc. 3.12) Access authentication: Complete the authentication of the identity and permissions of users or applications to ensure that only verified and authorized users can access the system; 3.13) API GateWay: Responsible for distributing user requests to the correct backend service and aggregating responses from multiple services to return to the frontend.
[0078] 3.2. Basic services: Provide the system with public services such as monitoring and logging, configuration management, database connection and message queue required by each application.
[0079] 3.21) Monitoring and log services: Provide public monitoring and alarm capabilities and log recording and analysis capabilities for system applications and services to call. This system integrates Prometheus as a monitoring component and ELK Stack (Elasticsearch, Logstash, Kibana) as a log management component. The same effect can be achieved by using other monitoring components and log management components. 3.22) Configuration management service: Provides public configuration information management capabilities for system applications and services to call. This system integrates Zookeeper as a public configuration information management component, and other configuration information management components can also achieve the same effect; 3.23) Database connection service: Provides the necessary Connector drivers for connecting to multiple databases; provides the Connector drivers required to obtain log data from multiple databases in real time; provides the ability to manage the configuration information for connecting to multiple specific database instances; 3.24) Message queue service: The integrated message queue middleware is used as the public message queue service of the system, providing public message queue services for asynchronous communication between components, real-time data synchronization and other functions. This system uses Kafka as the message queue, and other message queue systems can also achieve the same effect.
[0080] 3.3. Database unified access proxy service: Receive user access requests to the database through a unified HTTP / JDBC interface, and use the user-database mapping relationship stored in the system to dynamically route user access requests to the database to the corresponding back-end database, thereby realizing the proxy and isolation of user access to the database.
[0081] 3.4. Seamless database switching service: monitor the status and data of the source database and target database in real time through the monitoring service, and dynamically adjust the user's request target through the routing manager.
[0082] 3.5、User request intelligent diversion service: By real-time monitoring of the health status and load of each database, the user's request for the database is forwarded to the corresponding database instance according to the load balancing strategy configured by the user.
[0083] 3.6. Cross-database data synchronization and verification service: Generate data synchronization tasks through data configuration data synchronization strategy and data synchronization list, and use data real-time synchronization function to complete data synchronization from source database to target database. At the same time, data verification tasks are generated based on data synchronization tasks. When data synchronization is completed and data verification passes, that is, the target data is consistent with the source data, the entire data synchronization work is completed.
[0084] 3.7. User management interface: Interaction with and control of the system is achieved through a unified background management interface, enabling users to manage, control, monitor and analyze various system functions and modules.
[0085] Further, refer to Figure 4 , the core process of user request forwarding can include: 4.1. The administrator creates the access link URL_A through the "System Management Interface"; 4.2. The administrator configures the mapping relationship between URL_A and DB_A; 4.3. The user uses URL_A obtained from the "System Management Interface" to establish a connection with the gateway center; 4.4. The gateway center forwards the user's connection to URL_A and related requests to the "Database Access Unified Proxy Service" for processing; 4.5. "Database access unified proxy service" obtains the mapping relationship between URL_A and the database from the configuration information; 4.6. "Database access unified proxy service" establishes a connection with a specific database (DB_A or DB_B) according to the mapping relationship; 4.7. The "Database Access Unified Proxy Service" forwards all database requests to URL_A to the corresponding database based on the mapping relationship.
[0086] Furthermore, from the above "Core Process of User Request Forwarding", it can be seen that to complete the seamless database switch, it is only necessary to modify the database mapping relationship corresponding to the access link. Figure 5 , the core process of database seamless switching can include: 5.1. The administrator initiates a database switching request through the system configuration interface: DB_A—>DB_B; 5.2. "Database seamless switching service" monitors the switching requirements in real time; 5.3. "Database seamless switching service" starts to monitor the status of DB_A and DB_B; 5.4. When the switching conditions are ready, that is, DB_A and DB_B are both healthy; 5.5. The "Switch Control Module" initiates the command of "Modify Database Mapping Relationship"; 5.6. Database mapping relationship configuration information change is completed: URL_A—>DB_A is changed to URL_A—>DB_B; 5.7. Database switching is completed.
[0087] Further, refer to Figure 6 The core process of cross-database data synchronization and verification services can include: 6.1. The administrator configures the data synchronization strategy and data synchronization list through the system configuration interface; 6.2. "Cross-database data synchronization and verification service" reads configuration information and obtains data synchronization strategy and data synchronization list; 6.3. The data synchronization module of the "cross-database data synchronization and verification service" generates data synchronization tasks based on the acquired data synchronization strategy and data synchronization list; 6.4. At the same time, the data verification module generates data verification tasks according to the data synchronization tasks; 6.5. Data synchronization starts, and the data verification task also starts; 6.6. Generate data verification results in real time; 6.7. The system and administrator can decide subsequent actions based on the data verification results.
[0088] Further, refer to Figure 7 ,The core process of user request intelligent diversion can include: 7.1. The administrator configures the load balancing strategy of the relevant database nodes through the system configuration interface; 7.2. "User Request Intelligent Diversion Service" reads the system configuration information and obtains the database node information and load balancing strategy that need to be load balanced; 7.3. The health check module, statistics and monitoring module monitor the load and health of the target database in real time, and input the monitoring results to the load balancer; 7.4. The load balancer integrates the load balancing strategy and the input information of the health check module and the statistics and monitoring module to formulate a specific user request diversion plan; 7.5. Distribute user request traffic to different database nodes based on the generated user request diversion plan.
[0089] The main components of the above system and the specific implementation of their main functions may include: 8.1. Functional description of the gateway center: The API gateway center is the entrance for all requests to enter the system, responsible for processing all external requests and routing them to backend services. Specific technical implementation plans may include: 8.11. Security Policy: Implement flow control (Rate Limiting), use the token bucket algorithm to limit the request rate of each user; manage IP greylists and whitelists, and dynamically update the trusted IP address list; use TLS (Transport Layer Security) / SSL (Secure Sockets Layer) for encrypted transmission to ensure the security of data transmission; 8.12. Access authentication: Use OAuth2 or JWT (JSON Web Token) for user authentication; define role-based permission control (RBAC) to limit access to different services; 8.13. API Gateway: Use Nginx or Kong as the API gateway and configure the reverse proxy to distribute requests; support request aggregation and aggregate the responses of multiple backend services and return them to the front end.
[0090] 8.2. Functional description of basic services: Provide the system with public services such as monitoring and logging, configuration management, database connection and message queue required by various applications. Specific technical implementation plans may include: 8.21. Monitoring and log services: Integrate Prometheus for system performance monitoring and set alarm rules; use ELK Stack for log collection, analysis and visualization; 8.22. Configuration management service: Integrate Zookeeper for centralized configuration management and support dynamic configuration updates; use the configuration center API for each service to dynamically obtain configuration information; 8.23. Database connection service: Provides Connector drivers for connecting to various databases (such as MySQL, PostgreSQL, MongoDB, etc.); implements the function of dynamically obtaining database logs and monitoring the operating status of the database; uses CDC (Change Data Capture) technology to capture data changes and implements the function of obtaining database data through database logs; 8.24. Message Queue Service: Integrate Kafka as a message queue to support asynchronous communication and real-time data synchronization; provide message publishing and subscription mechanisms to ensure high reliability and scalability of data.
[0091] 8.3. Functional description of unified database access proxy service: Receive user database access requests through a unified HTTP / JDBC interface and dynamically route the requests to the backend database. Specific technical implementation plans may include: implement a proxy service (such as Spring Cloud Gateway) to receive requests from users; implement a request parser to parse user requests, including SQL statements and parameter extraction; JDBC interface proxy class: all user database requests are processed through this proxy class; use middleware (such as Redis) to quickly query and route through the stored user and database mapping relationship; record each request log for subsequent analysis and debugging; encapsulate the database response results in the form of an interface and return them to the user.
[0092] 8.4. Functional description of the seamless database switching service: Real-time monitoring of the status and data of the source database and the target database, and dynamic adjustment of the user request target through the routing manager. Specific technical implementation plans may include: using the health check service to regularly check the availability and performance of the database; automatically updating the request routing table when the database status changes to achieve seamless switching; using the state machine model to manage the different states of database switching.
[0093] 8.5. Functional description of the user request intelligent diversion service: By monitoring the health status and load of each database, the request forwarding target is determined according to the configured load balancing strategy. Specific technical implementation plans may include: integrating load balancing algorithms (such as polling, weighted polling, least connection, etc.); real-time monitoring of the load of each database, and dynamically adjusting the request allocation strategy; using middleware (such as Zookeeper or Consul) to maintain service registration and discovery to ensure the flexibility of request routing.
[0094] 8.6. Functional description of cross-database data synchronization and verification service: Generate data synchronization tasks according to the configured synchronization strategy to complete real-time synchronization and verification of data. Specific technical implementation plans may include: Asynchronous task queue: Use Kafka message queue to asynchronously process data synchronization tasks; Data change monitoring: Use CDC technology to capture data changes and achieve real-time synchronization; Data migration strategy: implements data migration strategy configuration, allowing administrators to select migration tables and conditions; Data verification: Check data consistency through data hashing, timestamp, etc. Data consistency guarantee: Implement consistency checks and conflict resolution strategies to ensure that data arrives within a certain time, and implement transactions to ensure the atomicity of data operations.
[0095] 8.7. Functional description of the user management interface: The interaction and control of the system are realized through a unified backend management interface. The specific technical implementation plan may include: using a front-end framework (such as React or Vue.js) to build a user-friendly management interface; providing an intuitive dashboard to display system status, database load, data synchronization status, etc.; realizing RESTful API communication with backend services to support the management, monitoring and analysis of various functional modules of the system.
[0096] The core contents of the embodiments of the present invention may include: Unified interface: The gateway center provides a unified HTTP and JDBC interface for users to connect, simplifying the database access process. Access proxy: The database unified access proxy service parses and forwards user requests, hiding the underlying database details. Seamless switching: The seamless database switching service ensures that users do not need to perform operations when the database changes. Data synchronization: Cross-database data synchronization and verification services provide data consistency guarantees and support scenarios such as database migration. The system is generally deployed in a microservice architecture, and the components communicate asynchronously through message queue services. The above content constitutes the core technical solution of the embodiments of the present invention, ensuring efficient and reliable database management and user experience in a multi-database environment.
[0097] The heterogeneous multi-database unified agent and cross-database data intelligent management system provided by the embodiments of the present invention takes the user database access service unified agent as the core, and through functions such as intelligent multi-database data management, automatic database synchronization, and seamless switching of database access, avoids the labor costs such as system transformation, data migration and verification caused by database switching in scenarios such as database migration, computer room relocation, and database upgrade, thereby maintaining service continuity and user's imperceptible experience.
[0098] The following is a description of a database scheduling device provided by an embodiment of the present invention. The database scheduling device described below and the database scheduling method described above can be referenced to each other.
[0099] refer to Figure 8 The database scheduling device provided in the embodiment of the present invention includes a receiving module 801, a parsing module 802 and a forwarding module 803.
[0100] The receiving module 801 is used to receive a database access request sent by a user terminal through a unified interface; the database access request is generated based on an access link provided by the middleware system; A parsing module 802, configured to parse the database access request to obtain pre-stored database mapping information corresponding to the access link; The forwarding module 803 is used to dynamically forward the database access request to a database to be accessed based on the database mapping information; the database to be accessed is the database requested to be accessed by the database access request.
[0101] The database scheduling device provided by the embodiment of the present invention receives a database access request sent by a user terminal through a unified interface; the database access request is generated based on an access link provided by a middleware system; the database access request is parsed to obtain pre-stored database mapping information corresponding to the access link; based on the database mapping information, the database access request is dynamically forwarded to the database to be accessed; the database to be accessed is the database requested to be accessed by the database access request. Based on the above scheme, the user does not need to directly establish an access connection with the database, but the middleware system proxies and forwards the user's access request to the database. Therefore, when the information in the database changes, only the middleware system needs to make corresponding adjustments, and the user terminal does not need to perform any operations or changes, thereby shielding the impact of changes on the database side on the user. Based on this, smooth switching of heterogeneous databases is achieved, avoiding system transformation, reducing data migration and verification costs, reducing the risk of service interruption, and improving the high availability and business continuity of the system.
[0102] In one embodiment, the database scheduling device further includes an updating module, which is specifically used to: In the case of monitoring database switching requirement information, the switching status of the source database and the target database included in the database switching requirement information is monitored; the source database is the sending end of the data switching; the target database is the receiving end of the data switching; if the switching status of the source database and the target database meets the set switching conditions, the database mapping information is changed based on the target database.
[0103] In one embodiment, the forwarding module 803 is specifically configured to: If the access link is mapped to a database in the database mapping information, then based on the database mapping information, one of the databases to be accessed is determined, and the database access request is dynamically forwarded to the database to be accessed; if the access link is mapped to multiple databases in the database mapping information, then based on the database mapping information, multiple candidate databases to be accessed are determined; based on the user request diversion scheme, the database to be accessed is determined from the multiple candidate databases to be accessed, and the database access request is dynamically forwarded to the database to be accessed.
[0104] In one embodiment, the forwarding module 803 is further configured to: Monitor the load information of each candidate database to be accessed; detect the health information of each candidate database to be accessed; the health information is used to indicate whether the candidate database to be accessed is working normally; based on a preset load balancing strategy, the load information and the health information of each candidate database to be accessed, determine the user request diversion plan.
[0105] In one embodiment, the middleware system is connected to a plurality of scheduling databases, the plurality of scheduling databases include the database to be accessed, and the database scheduling device further includes a synchronization verification module, which is specifically used to: Obtain the data synchronization strategy and data synchronization list of the scheduling database; generate a data synchronization task based on the data synchronization strategy and the data synchronization list; generate a data verification task based on the data synchronization task; use a message queue to asynchronously process the data synchronization task; in the process of asynchronously processing the data synchronization task, synchronously execute the data verification task to perform a database scheduling operation on the scheduling database that has passed the data verification task.
[0106] In one embodiment, the receiving module 801 is specifically configured to: The gateway center of the middleware system provides a unified data access interface to the outside world and receives the database access request sent by the user end.
[0107] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 communicate with each other through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the following method: receiving a database access request sent by a user terminal through a unified interface; the database access request is generated based on an access link provided by the middleware system; parsing the database access request to obtain pre-stored database mapping information corresponding to the access link; based on the database mapping information, dynamically forwarding the database access request to a database to be accessed; the database to be accessed is a database requested to be accessed by the database access request.
[0108] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0109] On the other hand, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the database scheduling method provided by the above embodiments, for example, including: receiving a database access request sent by a user terminal through a unified interface; the database access request is generated based on an access link provided by the middleware system; the database access request is parsed to obtain pre-stored database mapping information corresponding to the access link; based on the database mapping information, the database access request is dynamically forwarded to a database to be accessed; the database to be accessed is a database requested to be accessed by the database access request.
[0110] On the other hand, an embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the database scheduling method provided by the above-mentioned method embodiments, for example, including: receiving a database access request sent by a user terminal through a unified interface; the database access request is generated based on an access link provided by the middleware system; parsing the database access request to obtain pre-stored database mapping information corresponding to the access link; based on the database mapping information, dynamically forwarding the database access request to a database to be accessed; the database to be accessed is the database requested to be accessed by the database access request.
[0111] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
[0114] The above embodiments are only used to illustrate the present invention, but not to limit the present invention. Although the present invention is described in detail with reference to the embodiments, it should be understood by those skilled in the art that various combinations, modifications or equivalent substitutions of the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention, and should be included in the scope of the claims of the present invention.
Claims
1. A database scheduling method, characterized in that: Applied to middleware systems, including: Receiving a database access request sent by a user terminal through a unified interface; the database access request is generated based on an access link provided by the middleware system; Parsing the database access request to obtain pre-stored database mapping information corresponding to the access link; Based on the database mapping information, the database access request is dynamically forwarded to a database to be accessed; the database to be accessed is a database requested to be accessed by the database access request.
2. The database scheduling method according to claim 1, characterized in that: The database mapping information is updated in the following way: In the case of monitoring database switching requirement information, monitoring the switching status of the source database and the target database included in the database switching requirement information; the source database is the sending end of the data switching; the target database is the receiving end of the data switching; If the switching status of the source database and the target database meets the set switching condition, the database mapping information is changed based on the target database.
3. The database scheduling method according to claim 1 or 2, characterized in that: The dynamically forwarding the database access request to the database to be accessed based on the database mapping information includes: If the access link is mapped to a database in the database mapping information, then based on the database mapping information, determining one of the databases to be accessed, and dynamically forwarding the database access request to the database to be accessed; If the access link is mapped to multiple databases in the database mapping information, then determining multiple candidate databases to be accessed based on the database mapping information; Based on the user request diversion solution, the database to be accessed is determined from a plurality of candidate databases to be accessed, and the database access request is dynamically forwarded to the database to be accessed.
4. The database scheduling method according to claim 3, characterized in that: The user request diversion scheme is determined based on the following method: Monitoring the load information of each candidate database to be accessed; Detecting health information of each candidate database to be accessed; the health information is used to indicate whether the candidate database to be accessed is working normally; The user request diversion scheme is determined based on a preset load balancing strategy, the load information and the health information of each of the candidate databases to be accessed.
5. The database scheduling method according to claim 1, characterized in that: The middleware system is connected to a plurality of scheduling databases, the plurality of scheduling databases including the database to be accessed, and the method further comprises: Obtaining a data synchronization strategy and a data synchronization list of the scheduling database; Based on the data synchronization strategy and the data synchronization list, generate a data synchronization task; Based on the data synchronization task, generate a data verification task; Using a message queue to asynchronously process the data synchronization task; In the process of asynchronously processing the data synchronization task, the data verification task is synchronously executed to perform a database scheduling operation on the scheduling database that passes the data verification task.
6. The database scheduling method according to claim 1, characterized in that: The receiving of a database access request sent by a user terminal through a unified interface includes: The gateway center of the middleware system provides a unified data access interface to the outside world and receives the database access request sent by the user end.
7. A database scheduling device, characterized in that: include: A receiving module, used to receive a database access request sent by a user terminal through a unified interface; The database access request is generated based on the access link provided by the middleware system; A parsing module, used to parse the database access request to obtain pre-stored database mapping information corresponding to the access link; A forwarding module, used for dynamically forwarding the database access request to a database to be accessed based on the database mapping information; The database to be accessed is the database requested to be accessed by the database access request.
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 computer program, the database scheduling method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the database scheduling method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the database scheduling method according to any one of claims 1 to 6 is implemented.