Database proxy method and device based on data set
Through the database proxy method based on data set, the problems of high difficulty in using traditional database proxy and inconvenient management are solved, the database is high performance, high availability and security are achieved, and the interaction process between users and databases is simplified.
Patent Information
- Application Number
- CN202111371924.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-18
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2041-11-18
AI Technical Summary
The existing traditional relational database agents have problems such as high difficulty in using, lack of account management and secure encryption, and do not support data set management and aggregation operations, which are difficult to meet the database storage needs in the context of big data.
Provide a database proxy method based on data set, which can receive database access requests from the user, preprocess SQL statements and add main library flag bits, perform data routing and data positioning, realize read and write separation and load balancing, and maintain long links of database instances.
It reduces the difficulty of interaction between users and databases, improves the performance and availability of databases, enhances the security and management capabilities of databases, and enables users to interact with databases like using single databases and tables.
Smart Images

Figure CN114064694B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a database proxy method and device based on a data set, belonging to the technical field of databases. Background Art
[0002] A database is a collection of files, a collection of data organized according to a certain data model and stored in a secondary storage. A database instance is a program, a layer of data management software located between the user and the operating system. Any operation that a user performs on the data in the database, including data definition, data query, data maintenance, database operation control, etc., is performed under the database instance. The application can only interact with the database through the database instance. The proxy is software that handles the connection and communication between the two parties. In the context of the database, the proxy is located in the middle layer between the application and the database. The application connects to the proxy, and the proxy forwards the connection to the database.
[0003] At present, in the context of big data, more and more data needs to be stored, and more and more data storage solutions have been generated accordingly. Of course, traditional relational databases are an indispensable part, and there are also many proxies for traditional relational databases. Although these component services can also provide database proxy services, they also have corresponding disadvantages: (1) They are difficult to use, and some require intrusion into the original system, which increases the complexity of use; (2) They lack account management and account security encryption; (3) They do not support data set management and aggregation operations. In summary, a new database proxy technology solution is urgently needed. Summary of the invention
[0004] To this end, the present invention provides a database proxy method and device based on a data set, which reduces the difficulty for users to use the database and enhances the high performance and high availability of the database.
[0005] In order to achieve the above object, the present invention provides the following technical solution: a database proxy method based on a data set, comprising the following steps:
[0006] Receive a database access request from a user, wherein the database access request includes an SQL statement, a field value of a database hash table, and parameters of a corresponding data set;
[0007] After receiving the database access request from the user, preprocess the SQL statement according to the SQL parameters and add the main database flag to the preprocessed SQL statement;
[0008] According to the SQL statement in the database access request, the field value of the database hash sub-table and the data set to which it belongs, as well as the pre-processing result of the SQL statement, unified data routing and data positioning are performed in the configuration library cache table management of the sub-library and sub-table information, and the data is positioned on the relevant database instance, and the database instance then performs read-write separation and load balancing between the master and slave libraries;
[0009] The data of the database access request is routed to the processing thread pool of the target database, and the long link of the database instance is maintained through the processing thread pool; the processing thread pool sends the SQL statement to the database instance for execution of the SQL statement;
[0010] The feedback result of the database instance is returned to the requesting user end, and a request response is made to the database access request.
[0011] As a preferred solution of the database proxy method based on data sets, a database proxy server receives a database access request from a user terminal. After receiving the database access request from the user terminal, the database proxy server preprocesses the SQL statement according to the SQL parameters and adds a main database flag to the preprocessed SQL statement.
[0012] As a preferred solution of the database proxy method based on data sets, preprocessing of SQL statements according to SQL parameters includes syntax detection and statement analysis and arrangement.
[0013] As a preferred solution of the database proxy method based on data sets, the database proxy server loads the configuration table of the business party into the cache, and the configuration table includes sub-library and sub-table information and database instance information;
[0014] The configuration library cache of the sub-library and sub-table is detected and updated according to the preset period.
[0015] As a preferred solution of the database proxy method based on data sets, read and write separation is performed between the master and slave libraries according to whether the master library flag is present and the number of master and slave libraries is configured; and read requests are load balanced between the master and slave libraries to determine the target database information.
[0016] As a preferred solution of the database proxy method based on the data set, the feedback result of the database instance also includes error information returned abnormally, and the error information returned abnormally by the database instance is returned to the requesting user end.
[0017] The present invention also provides a database proxy device based on a data set, comprising:
[0018] An access request receiving module, used to receive a database access request from a user, wherein the database access request includes an SQL statement, a field value of a database hash table, and parameters of a corresponding data set;
[0019] The SQL preprocessing module is used to preprocess the SQL statement according to the SQL parameters after receiving the database access request from the user, and add the main database flag to the preprocessed SQL statement;
[0020] The data interaction module is used to perform unified data routing and data positioning in the configuration library cache table management of the sub-library and sub-table information according to the SQL statement in the database access request, the field value of the database hash sub-table and the data set to which it belongs, and the result of the pre-processing of the SQL statement, and locate the data to the relevant database instance, and the database instance then performs read-write separation and load balancing between the master and slave libraries;
[0021] A thread pool wake-up module, used to wake up the data of the database access request and route it to the processing thread pool of the target database, and maintain a long link to the database instance through the processing thread pool;
[0022] The SQL execution module is used for sending the SQL statement to the database instance for execution after the processing thread pool is awakened;
[0023] The access response module is used to return the feedback result of the database instance to the requesting user end and make a request response to the database access request.
[0024] As a preferred solution of the database proxy device based on the data set, in the access request receiving module, a database access request from a user terminal is received through a database proxy server;
[0025] In the SQL preprocessing module, after receiving the database access request from the user, the database proxy server preprocesses the SQL statement according to the SQL parameters, and adds a main database flag to the preprocessed SQL statement;
[0026] In the SQL preprocessing module, the preprocessing of SQL statements according to SQL parameters includes syntax detection and statement analysis and sorting.
[0027] As a preferred solution of the database proxy device based on the data set, it also includes a business party configuration module, which is used for the database proxy server to load the business party's configuration table into the cache, and the configuration table includes sub-library and sub-table information and database instance information.
[0028] As a preferred solution of the database proxy device based on the data set, it also includes a cache update module, which is used to detect and update the configuration library cache of the sub-library and sub-table according to a preset period.
[0029] As a preferred solution of the database proxy device based on the data set, in the data interaction module, read and write separation between the master and slave libraries is performed according to whether the master library flag is present and the number of master and slave libraries is configured; and load balancing is performed on the read request between the master and slave libraries to determine the target database information;
[0030] In the access response module, the feedback result of the database instance also includes error information returned abnormally, and the error information returned abnormally by the database instance is returned to the requesting user end.
[0031] The present invention has the following advantages: by receiving a database access request from a user end, the database access request includes an SQL statement, a field value of a database hash sub-table and a parameter of a corresponding data set; after receiving the database access request from the user end, preprocessing the SQL statement according to the SQL parameter, and adding a master database flag to the preprocessed SQL statement; according to the SQL statement in the database access request, the field value of the database hash sub-table and the corresponding data set, and the result of the preprocessing of the SQL statement, unified data routing and data positioning are performed in the configuration library cache table management of sub-library and sub-table information, and the data is positioned on a related database instance, and the database instance is then read-write separated and load balanced between the master and slave libraries; the data of the awakened database access request is routed to a processing thread pool of a target database, and a long link of the database instance is maintained by the processing thread pool; the processing thread pool sends the SQL statement to the database instance to execute the SQL statement; the feedback result of the database instance is returned to the requesting user end, and a request response to the database access request is made. The present invention allows users to interact with the database more easily, just like using a single database and a single table; maintains a long link to the database and automatically reconnects, reducing database pressure and performance overhead caused by frequent database requests and establishing and closing short links; in a master-slave database configuration, read requests are load balanced between the master and slave libraries; and user management of database instances is unified; the difficulty of users accessing the database is greatly reduced, while also improving the security of the database, enhancing performance, and enhancing the high availability of the database. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.
[0033] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.
[0034] Figure 1 A schematic diagram of a database proxy method based on a data set provided in an embodiment of the present invention;
[0035] Figure 2 The figure is a schematic diagram of a database proxy device based on a data set provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0037] Example 1
[0038] See also Figure 1 Embodiment 1 of the present invention provides a database proxy method based on a data set, comprising the following steps:
[0039] S1. Receive a database access request from a user, where the database access request includes an SQL statement, field values of a database hash table, and parameters of the corresponding data set;
[0040] S2. After receiving the database access request from the user, preprocess the SQL statement according to the SQL parameters, and add the main database flag to the preprocessed SQL statement;
[0041] S3: Based on the SQL statement in the database access request, the field value of the database hash sub-table and the data set to which it belongs, as well as the pre-processing result of the SQL statement, unified data routing and data positioning are performed in the configuration library cache table management of the sub-database and sub-table information, and the data is positioned on the relevant database instance. The database instance then performs read-write separation and load balancing between the master and slave libraries.
[0042] S4. The data of the wake-up database access request is routed to the processing thread pool of the target database, and the long connection of the database instance is maintained through the processing thread pool; the processing thread pool sends the SQL statement to the database instance for execution of the SQL statement;
[0043] S5. Return the feedback result of the database instance to the requesting user end, and make a request response to the database access request.
[0044] In this embodiment, in step S1, a database proxy server receives a database access request from a user terminal. In step S2, after receiving the database access request from the user terminal, the database proxy server preprocesses the SQL statement according to the SQL parameters and adds a main database flag to the preprocessed SQL statement.
[0045] Specifically, the database proxy server receives the database access request from the user. The user needs to pass in three parameters when making the database access request: the field value of the database hash table (hintID), the SQL statement, and the data set to which it belongs. After receiving the database access request from the user, the database proxy server reads the SQL parameters to preprocess the SQL statement, including syntax detection, statement analysis and collation, and adds the main database flag according to the collated SQL statement.
[0046] Specifically, SQL, or Structured Query Language, is a database query and programming language used to access data as well as query, update, and manage relational database systems. The core of SQL is equivalent to relational algebra, but it has many features that relational algebra does not have, such as aggregation and database updates. It is a comprehensive, general, and powerful relational database language.
[0047] Specifically, there are existing detection tools for syntax detection and analysis of SQL statements, such as Inception, which is an automated operation and maintenance system that integrates auditing, execution, and rollback. It can clearly, detailed, and accurately audit SQL statements, and can be directly connected using the MySQL client without the need to verify permissions. It is a server relative to the application (upper-level audit process system, etc.), and when connecting, it is only necessary to specify the server address and the port of the Inception server. It is a client relative to the online MySQL server corresponding to the statement to be audited or executed, and it needs to connect to the database server in real time to obtain the required information, or directly execute the corresponding statement online and obtain the corresponding binary log file, etc.
[0048] Inception can perform syntax analysis on all submitted statements. If there is a syntax problem, the corresponding error message will be returned to the reviewer. It also provides semantic analysis and reports an error when the information of a table, library, column, etc. is incorrect or does not conform to the specification, or when a non-existent object is used. In addition, it also provides functions for SQL standard constraints.
[0049] In this embodiment, the database proxy server loads the business party's configuration table into the cache, where the configuration table includes sub-library and sub-table information and database instance information; the configuration library cache of the sub-library and sub-table is detected and updated according to a preset period.
[0050] Specifically, according to the three-parameter SQL statement passed in step S1, the field value of the database hash sub-table and the corresponding data set, and the preprocessing result of the SQL statement in step S2, unified data routing and data positioning are performed in the configuration library cache Tablemanager (table management) of the sub-library and sub-table information. The configuration library cache of the sub-library and sub-table will be regularly checked and updated to ensure that each request can be routed to the latest data table, so that the database and table information after the sub-library and sub-table can be found for this database access request.
[0051] In this embodiment, read and write separation is performed between the master and slave libraries according to whether there is a master library flag and the number of master and slave libraries; and load balancing is performed on the read request between the master and slave libraries to determine the target database information.
[0052] Specifically, according to whether the master database flag is present and the database information is found, the read and write separation between the master and slave databases is performed according to the master and slave database configuration, and load balancing is performed between the master and slave databases for read requests, the target database information is determined, and then the processing thread pool of the target database to which the request data is routed is awakened. The processing thread pool of the target database will maintain a long link to the database instance to ensure the high performance of the database. After the thread pool is awakened, the processing thread pool sends the SQL statement to the database instance for execution.
[0053] In this embodiment, the feedback result of the database instance also includes the error information returned abnormally, and the error information returned abnormally by the database instance is returned to the requesting user end, so as to facilitate the user to find the problem and adjust the parameters of the database access request in time.
[0054] In summary, the present invention receives a database access request from a user end, wherein the database access request includes an SQL statement, a field value of a database hash sub-table, and a parameter of a corresponding data set; after receiving the database access request from the user end, the SQL statement is preprocessed according to the SQL parameter, and a master database flag is added to the preprocessed SQL statement; according to the SQL statement in the database access request, the field value of the database hash sub-table, and the corresponding data set, as well as the result of the preprocessing of the SQL statement, unified data routing and data positioning are performed in the configuration library cache table management of the sub-library and sub-table information, and the data is positioned on a related database instance, and the database instance then performs read-write separation and load balancing between the master and slave libraries; the data of the awakened database access request is routed to a processing thread pool of a target database, and a long link of the database instance is maintained through the processing thread pool; the processing thread pool sends the SQL statement to the database instance to execute the SQL statement; the feedback result of the database instance is returned to the requesting user end, and a request response to the database access request is made. When the database stores a lot of information, the present invention performs sub-library and sub-table to ensure the security of business data and improve the performance of the database. By adding a layer of database proxy service between the database and the business service, the business service only needs to interact with the database proxy instead of directly interacting with the database. The business party does not need to care about the specific details of the sub-library and sub-table. When the user requests the database, it only needs to request and pass in three parameters to the database proxy server: the field value of the database hash sub-table, the data set to which it belongs, and the SQL statement to complete the access request of this database, which greatly reduces the difficulty of the user requesting the database. The user does not need to care about the details of the sub-library and sub-table inside the database, and ensures the security and high availability of the database, improves the access performance of the database, so that the user can interact with the database more easily, just like using a single library and a single table. The present invention can maintain the long link and automatic reconnection of the database, reduce the database pressure and performance overhead caused by frequent requests to the database, and establish and close short links; under the master-slave library configuration, the read request is load balanced between the master and slave libraries; and the user management of the database instance is unified; the difficulty of the user accessing the database is greatly reduced, and the security and performance of the database are also improved, and the high availability of the database is enhanced.
[0055] Example 2
[0056] See also Figure 2 Embodiment 2 of the present invention further provides a database proxy device based on a data set, comprising:
[0057] The access request receiving module 1 is used to receive a database access request from a user, wherein the database access request includes an SQL statement, a field value of a database hash table, and parameters of the corresponding data set;
[0058] SQL preprocessing module 2 is used to preprocess SQL statements according to SQL parameters after receiving a database access request from a user, and add a main database flag to the preprocessed SQL statements;
[0059] Data interaction module 3 is used to perform unified data routing and data positioning in the configuration library cache table management of sub-library and sub-table information according to the SQL statement in the database access request, the field value of the database hash sub-table and the data set to which it belongs, and the result of the pre-processing of the SQL statement, and locate the data on the relevant database instance. The database instance then performs read-write separation and load balancing between the master and slave libraries;
[0060] The thread pool wake-up module 4 is used to wake up the data of the database access request and route it to the processing thread pool of the target database, and maintain the long connection of the database instance through the processing thread pool;
[0061] SQL execution module 5, used for sending SQL statements to the database instance to execute SQL statements after the processing thread pool is awakened;
[0062] The access response module 6 is used to return the feedback result of the database instance to the requesting user end and make a request response to the database access request.
[0063] In this embodiment, in the access request receiving module 1, a database access request from a user terminal is received through a database proxy server;
[0064] In the SQL preprocessing module 2, after receiving the database access request from the user, the database proxy server preprocesses the SQL statement according to the SQL parameters and adds a main database flag to the preprocessed SQL statement;
[0065] In the SQL preprocessing module 2, SQL statements are preprocessed according to SQL parameters, including syntax detection and statement analysis and sorting.
[0066] In this embodiment, a business party configuration module 7 is also included, which is used for the database proxy server to load the business party's configuration table into the cache, and the configuration table includes sub-library and sub-table information and database instance information.
[0067] In this embodiment, a cache update module 8 is also included, which is used to detect and update the configuration library cache of the sub-library and sub-table according to a preset period.
[0068] In this embodiment, in the data interaction module 3, read and write separation between the master and slave libraries is performed according to whether there is a master library flag and the number of master and slave libraries; and load balancing is performed on the read request between the master and slave libraries to determine the target database information;
[0069] In the access response module 6, the feedback result of the database instance also includes the error information returned abnormally, and the error information returned abnormally by the database instance is returned to the requesting user end.
[0070] It should be noted that the information interaction, execution process, etc. between the modules / units of the above-mentioned system are based on the same concept as the method embodiment in Example 1 of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown in the previous part of the present application, and will not be repeated here.
[0071] Example 3
[0072] Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium, in which program code of a database proxy method based on a data set is stored, and the program code includes instructions for executing the database proxy method based on a data set of Embodiment 1 or any possible implementation thereof.
[0073] The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0074] Example 4
[0075] Embodiment 4 of the present invention provides an electronic device, including: a memory and a processor;
[0076] The processor and the memory communicate with each other via a bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the database proxy method based on a data set in Example 1 or any possible implementation thereof.
[0077] Specifically, the processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor implemented by reading software codes stored in a memory. The memory can be integrated in the processor or can be located outside the processor and exist independently.
[0078] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center.
[0079] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0080] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.
Claims
1. A database proxy method based on a data set, characterized in that: The following steps are involved: Receive a database access request from a user, wherein the database access request includes an SQL statement, a field value of a database hash table, and parameters of a corresponding data set; After receiving the database access request from the user, preprocess the SQL statement according to the SQL parameters and add the main database flag to the preprocessed SQL statement; According to the SQL statement in the database access request, the field value of the database hash sub-table and the data set to which it belongs, as well as the pre-processing result of the SQL statement, unified data routing and data positioning are performed in the configuration library cache table management of the sub-library and sub-table information, and the data is positioned on the relevant database instance, and the database instance then performs read-write separation and load balancing between the master and slave libraries; The data of the database access request is routed to the processing thread pool of the target database, and the long link of the database instance is maintained through the processing thread pool; the processing thread pool sends the SQL statement to the database instance for execution of the SQL statement; Returning the feedback result of the database instance to the requesting user end, and making a request response to the database access request; The database proxy server receives a database access request from a user terminal, and after receiving the database access request from the user terminal, the database proxy server pre-processes the SQL statement according to the SQL parameters, and adds a main database flag to the pre-processed SQL statement; The user needs to pass in three parameters when requesting database access: the field value hintID of the database hash table, the SQL statement, and the corresponding data set; Preprocessing SQL statements based on SQL parameters includes syntax detection and statement analysis and organization; The database proxy server loads the business party's configuration table into the cache, wherein the configuration table includes sub-library and sub-table information and database instance information; The configuration library cache of the sub-library and sub-table is checked and updated according to the preset period; According to the three parameter SQL statements passed in, the field values of the database hash table and the data set to which it belongs, as well as the preprocessing results of the SQL statements, unified data routing and data positioning are performed in the configuration library cache Table manager of the database and table information; Perform read-write separation between the master and slave libraries according to whether the master library flag is present and the number of master and slave libraries; and perform load balancing between the master and slave libraries for read requests to determine target database information; The feedback result of the database instance also includes error information returned abnormally, and the error information returned abnormally by the database instance is returned to the requesting user end.
2. A database proxy device based on a data set, characterized in that: include: An access request receiving module, used to receive a database access request from a user, wherein the database access request includes an SQL statement, a field value of a database hash table, and parameters of a corresponding data set; The SQL preprocessing module is used to preprocess the SQL statement according to the SQL parameters after receiving the database access request from the user, and add the main database flag to the preprocessed SQL statement; The data interaction module is used to perform unified data routing and data positioning in the configuration library cache table management of the sub-library and sub-table information according to the SQL statement in the database access request, the field value of the database hash sub-table and the data set to which it belongs, and the result of the pre-processing of the SQL statement, and locate the data to the relevant database instance, and the database instance then performs read-write separation and load balancing between the master and slave libraries; A thread pool wake-up module, used to wake up the data of the database access request and route it to the processing thread pool of the target database, and maintain a long link to the database instance through the processing thread pool; The SQL execution module is used for sending the SQL statement to the database instance for execution after the processing thread pool is awakened; An access response module is used to return the feedback result of the database instance to the requesting user end and make a request response to the database access request; In the access request receiving module, a database access request from a user terminal is received through a database proxy server; In the SQL preprocessing module, after receiving the database access request from the user, the database proxy server preprocesses the SQL statement according to the SQL parameters, and adds a main database flag to the preprocessed SQL statement; The user needs to pass in three parameters when requesting database access: the field value hintID of the database hash table, the SQL statement, and the corresponding data set; In the SQL preprocessing module, the preprocessing of SQL statements according to SQL parameters includes syntax detection and statement analysis and sorting; It also includes a business party configuration module, which is used for the database proxy server to load the business party's configuration table into the cache, wherein the configuration table includes sub-library and sub-table information and database instance information; It also includes a cache update module, which is used to detect and update the configuration library cache of the sub-library and sub-table according to the preset period; based on the three parameter SQL statements passed in, the field values of the database hash sub-table and the data set to which they belong, as well as the pre-processing results of the SQL statements, unified data routing and data positioning are performed in the configuration library cache Table manager of the sub-library and sub-table information; In the data interaction module, read and write separation between the master and slave libraries is performed according to whether the master library flag is present and the number of master and slave libraries is configured; and load balancing is performed on the read request between the master and slave libraries to determine the target database information; In the access response module, the feedback result of the database instance also includes error information returned abnormally, and the error information returned abnormally by the database instance is returned to the requesting user end.
Citation Information
Patent Citations
Implementation method and device of Redis universal middleware
CN105933408A
Data access method and system for distributed database
CN111427963A