Data processing system

By deploying multiple master-slave databases in the data processing system and using a proxy server for data sharding and request separation, the slow response and crash issues of centralized databases in high-concurrency scenarios are solved, achieving efficient data processing and stability.

CN116483904BActive Publication Date: 2026-01-30SHENZHEN JIUNIU YIMAO INTELLIGENT IOT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310460220.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-20
Publication Date
2026-01-30
Estimated Expiration
2043-04-20

AI Technical Summary

Technical Problem

Existing centralized databases are slow to respond and prone to crashing when faced with a large number of data processing requests, and cannot efficiently handle data access requests in high-concurrency scenarios.

Method used

By deploying multiple master and slave databases in the data processing system, a master-slave replication relationship is established. A proxy server is used for data sharding and request separation, prioritizing the reading of data from the nearest slave database, reducing network latency and improving data processing efficiency.

Benefits of technology

It improves the response speed and efficiency of the data processing system in high-concurrency scenarios, reduces database load, avoids network latency, and ensures the stability and availability of the data processing system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116483904B_ABST
    Figure CN116483904B_ABST
Patent Text Reader

Abstract

This application relates to the field of database technology, specifically to a data processing system, including a first data center and multiple business centers. The first data center includes multiple master databases, and each business center includes a proxy server and multiple slave databases. Each master database establishes a master-slave replication relationship with at least one slave database in each business center. The proxy server is used to receive data processing requests. When the data processing request is a data write request, the data to be written in the data write request is split into multiple data fragments and written to each master database. The data fragments stored in each master database are copied to the slave databases with which it has a master-slave replication relationship. When the data processing request is a data read request, data is preferentially read from the data fragments stored in the slave databases of the business centers where the proxy server that received the data processing request is located.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of database, in particular to a data processing system. BACKGROUND

[0002] With the continuous development of information technology, the number of users is growing, and the corresponding data processing requests and data storage volume will grow exponentially. The storage volume and processing capacity of the database are limited, and when facing a large number of data processing requests, the database response is slow, and a large number of concurrent data processing requests accessing the database at the same time will also cause the database to run high load, which is easy to cause the risk of database crash. SUMMARY

[0003] In view of the above problems, embodiments of the present application provide a data processing system to improve the efficiency of processing data processing requests.

[0004] According to an aspect of the present application, a data processing system is provided, the data processing system comprising a first data center and a plurality of business centers, the first data center comprising a plurality of master databases, each business center comprising a proxy server and a plurality of slave databases, each master database establishing a master-slave replication relationship with at least one slave database of each business center; the proxy server is configured to receive a data processing request; when the data processing request is a data write request, splitting the to-be-written data in the data write request into a plurality of data shards; writing each data shard after splitting into each master database, wherein each master database stores one data shard; copying the data shard stored by each master database into the slave database establishing a master-slave replication relationship with it; when the data processing request is a data read request, obtaining a query statement in the data read request; determining a plurality of slave databases where the data shard matching the query statement is located; preferentially reading data from the data shard stored in the slave database of the business center where the proxy server receiving the data processing request is located.

[0005] The data processing system provided by the embodiments of the present application has the following advantages. In a first aspect, by deploying a plurality of master databases in the first data center, the number of parallel responses of the first data center to data processing requests is increased, and the speed of responding to user access in a high concurrency scenario is improved. In a second aspect, by means of the proxy server, data is divided into data shards, each data shard is stored in a different master database, the data amount of each master database is reduced, and the efficiency of writing data into each master database and the efficiency of synchronizing data to a plurality of slave databases in a master-slave replication relationship with the master database are higher. The proxy server separates data read requests and data write requests, the master database only responds to data write requests, and the slave database only responds to data read requests, thereby improving the data processing efficiency of the data processing system. In a third aspect, a plurality of slave databases are arranged in each business center, each master database has a master-slave replication relationship with the slave databases in each business center, and the master database synchronizes the stored data shards to the slave databases in each business center, so that when the proxy server in each business center receives a data read request, the proxy server can preferentially read data from the slave database in the business center where the proxy server is located, thereby realizing local reading, avoiding network delay caused by reading data from the master database or other slave databases, and improving the efficiency of processing data read requests.

[0006] In an optional manner, the proxy server is configured to perform the step of preferentially reading data from a data shard stored in a slave database in a business center where the proxy server receiving the data processing request is located, including: determining whether there is a database tag matching the server tag of the proxy server receiving the data processing request; if so, reading data from the slave database corresponding to the database tag.

[0007] In an optional manner, each business center includes a load balancing server, a plurality of proxy servers, and a plurality of clients; the load balancing server is configured with a routing address of each proxy server in the business center where the load balancing server is located; the load balancing server is configured to generate a polling list according to the routing address of each proxy server; receive a plurality of data processing requests sent by the clients in the business center where the load balancing server is located; and send the plurality of data processing requests to the plurality of proxy servers in the business center where the load balancing server is located one by one according to the polling list.

[0008] In an optional manner, the load balancing server is configured to determine the working state of the proxy server, and delete the proxy server in a fault state from the polling list.

[0009] In an optional manner, the data processing system further includes a configuration maintenance server, and the configuration maintenance server is configured to store first configuration information of the proxy server in each business center, and synchronize the changed first configuration information to each proxy server when the first configuration information is changed.

[0010] In an alternative mode, the load balancing server is configured to configure addresses of a plurality of proxy servers of other business centers to the load balancing server and generate a new round-robin list when it is determined that the working states of all proxy servers of the business center where the load balancing server is located are failure states.

[0011] In an alternative mode, the data processing system further comprises a plurality of first intermediate slave databases, each master database has a master-slave replication relationship with the plurality of first intermediate slave databases, and each first intermediate slave database has a master-slave replication relationship with the slave databases of the plurality of business centers.

[0012] In an alternative mode, the first data center further comprises a standby slave database corresponding to each master database in a one-to-one manner and having a master-slave replication relationship; each master database has a master-slave replication relationship with at most two first intermediate slave databases, and each first intermediate slave database has a master-slave replication relationship with at most three slave databases of business centers; the data processing system further comprises a second data center, the second data center comprises a plurality of second intermediate slave databases, and the plurality of second intermediate slave databases have a master-slave replication relationship with the plurality of master databases in a one-to-one manner; the data processing system comprises a replication topology management server; the replication topology management server is configured to acquire the master-slave replication relationships between databases and monitor the working states of the databases; a graphical interface is used to uniformly display each master-slave replication topology relationship and the states of the databases; when the working state of a master database is a failure state, a standby slave database having a master-slave replication relationship with the master database is switched to replace the master database in the failure state; when the working states of both the master database and the standby slave database having a master-slave replication relationship with the master database are failure states, a second intermediate slave database having a master-slave replication relationship with the master database is switched to replace the master database in the failure state.

[0013] In an alternative mode, the replication topology management server is configured to, when the working state of a first intermediate slave database is a failure state, switch a standby slave database having a master-slave replication relationship with the same master database as the first intermediate database to replace the first intermediate slave database in the failure state; and when the working state of a second intermediate slave database is a failure state, switch a standby slave database having a master-slave replication relationship with the same master database as the second intermediate database to replace the second intermediate slave database in the failure state.

[0014] In an alternative mode, the replication topology management server is configured to, when the working state of a slave database of a certain business center is a failure state, switch a slave database of another business center to replace the slave database in the failure state.

[0015] The above description is only a summary of the technical solutions of the present application. In order to make the technical means of the present application more clearly understood and implemented according to the content of the specification, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following specific embodiments of the present application are described. BRIEF DESCRIPTION OF DRAWINGS

[0016] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a description of the preferred embodiments and are not meant to limit the present application. Moreover, the same reference numerals in the attached drawings refer to the same or similar components. In the drawings:

[0017] Figure 1 Structure schematic diagram of a data processing system provided for an embodiment of the present application;

[0018] Figure 2 Internal structure schematic diagram of a service center provided for an embodiment of the present application;

[0019] Figure 3 Structure schematic diagram of a master database and a slave database provided for an embodiment of the present application;

[0020] Figure 4 Information interaction schematic diagram of a data processing system provided for an embodiment of the present application;

[0021] Figure 5 Priority schematic diagram of data read by a proxy server provided for an embodiment of the present application.

[0022] Reference numerals in the detailed description are as follows:

[0023] 100, data processing system;

[0024] 110, service center; 111, client; 112, proxy server; 113, slave database; 114, load balancing server; 115, configuration maintenance server; 116, domain name server;

[0025] 120, first data center; 121, master database; 122, standby slave database; 140, first intermediate slave database; 150, second data center; 151, second intermediate slave database; 160, replication topology management server. DETAILED DESCRIPTION

[0026] The embodiments of the technical solutions of the present application will be described in detail below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present application, and therefore only serve as examples, and cannot limit the protection scope of the present application.

[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of this application; the use of the terms "including," "comprising," or "having" and variations thereof herein is intended to be broad and encompass the terms "consisting of" and "consisting essentially of" and variations thereof. Unless otherwise required by context, singular terms shall include pluralities and vice versa. Unless otherwise required by context, the use herein of the singular is also to be construed as a reference to the plural and vice versa.

[0028] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "a plurality of" is two or more (including two), unless otherwise explicitly and specifically limited.

[0029] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearance of the phrase in various places in the specification is not necessarily all referring to the same embodiment, or to a particular embodiment, or to a particular set of embodiments, and is not necessarily mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0030] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A existing, A and B existing, and B existing. In addition, the character " / " in this paper generally represents that the front and rear associated objects are a "or" relationship.

[0031] In the description of the embodiments of the present application, the term "a plurality of" refers to two or more (including two), and similarly, "a plurality of groups" refers to two or more groups (including two groups), and "a plurality of pieces" refers to two or more pieces (including two pieces).

[0032] In the description of the embodiments of the present application, the technical terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the embodiments of the present application and simplifying the description, and therefore cannot be understood as limiting the embodiments of the present application, which do not indicate or imply that the indicated devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the embodiments of the present application.

[0033] In the description of the embodiments of the present application, unless otherwise explicitly specified and limited, the technical terms "mount", "connect", "connect", "fix", and other terms should be understood in a broad sense, for example, can be fixedly connected, or can be detachably connected, or integrated; can be mechanically connected, or can be electrically connected; can be directly connected, or can be indirectly connected through an intermediate medium, can be the internal communication of two elements or the interaction relationship between two elements. For those skilled in the art, the specific meaning of the above terms in the embodiments of the present application can be understood according to the specific circumstances.

[0034] With the prevalence of Internet technology, the demand for data storage and management in various industries is rapidly growing. As a core technology for storing and managing data, centralized database can provide simultaneous data writing and reading services for multiple business centers, and can also provide services for business centers to add, delete, modify and other operations on stored data, and is favored by various industries. With the increasing complexity of database application scenarios and the rapid growth of data to be managed, the more data the existing centralized database stores, the slower the response to user reading requests, and the number of parallel data requests that the database can handle is limited. At the same time, when a large number of data processing requests are sent, multiple data processing requests will be accumulated, and the response to user data processing requests will also be slower.

[0035] Therefore, the embodiments of the present application provide a data processing system, which deploys multiple databases, and the multiple databases work together to increase the number of parallel data requests and improve response efficiency. Furthermore, the data to be stored is split into multiple data shards, so that multiple databases store part of the data, reducing the data storage of each database, thereby improving query efficiency when processing data reading requests. Further, the multiple databases are configured to respond to different data processing requests, specifically, a master database and multiple slave databases are determined, the master database only responds to data writing requests, and the slave databases only respond to data reading requests. The stored data of the master database and the multiple slave databases corresponding thereto is consistent, and the multiple slave databases can share the pressure of data reading requests, improving data read-write efficiency.

[0036] Please refer to Figure 1 、 Figure 2 and Figure 3 , Figure 1 the structure diagram of the data processing system provided by the embodiments of the present application; Figure 2 the internal structure diagram of the business center provided by the embodiments of the present application, Figure 3 the structure diagram of the master database and the slave database provided by the embodiments of the present application. As Figure 1 、 Figure 2 and Figure 3As shown, the data processing system 100 comprises a first data center 120 and a plurality of business centers 110, the first data center 120 comprises a plurality of master databases 121, each business center 110 comprises a proxy server 112 and a plurality of slave databases 113, and each master database 121 has a master-slave replication relationship with at least one slave database 113 of each business center 110.

[0037] The proxy server 112 is configured to perform the following steps:

[0038] receiving a data processing request;

[0039] when the data processing request is a data write request, splitting the data to be written in the data write request into a plurality of data shards;

[0040] writing each data shard after splitting into each master database 121, wherein each master database 121 stores one data shard;

[0041] replicating the data shard stored in each master database 121 to the slave database 113 having a master-slave replication relationship with it;

[0042] when the data processing request is a data read request, obtaining a query statement in the data read request;

[0043] determining a plurality of slave databases 113 where the data shards matching the query statement are located;

[0044] preferentially reading data from the data shard stored in the slave database 113 of the business center 110 where the proxy server 112 receiving the data processing request is located.

[0045] The first data center 120 comprises a plurality of master databases 121, and the plurality of master databases 121 are configured to simultaneously provide data write and add, delete and modify services to a plurality of business centers 110. Considering that the MySQL database has the characteristics of small size, fast response speed, low cost and open source, deploying a plurality of master databases 121 in the first data center 120 can be a MySQL database, and each master database 121 divides a plurality of slave databases 113 according to its own master-slave replication function of the MySQL, and the plurality of slave databases 113 are respectively deployed in the plurality of business centers 110 to form a distributed database, and ensure that the number of slave databases 113 created by each master database 121 in each business center 110 is not less than one. The distributed database improves the processing capacity of the first data center 120 compared with the centralized database, and can meet the high concurrency demand.

[0046] Each service center 110 includes a plurality of proxy servers 112, which can be DBLE proxy servers, a high-scalable distributed middleware developed based on a MySQL database, Figure 2 An internal structure diagram of one service center in an embodiment of the present application is shown in FIG. 1. Figure 2 As shown, the proxy server 112 has a function of being able to horizontally split data, and when receiving a data write data request of the client 111, splits the data to be written into a plurality of data shards DB1-DBn according to a preset rule, and stores each data shard to each master database 121 of the first data center 120, and each master database 121 in the first data center 120 only stores one data shard, so that each master database 121 only stores a small part of data, and since the amount of data stored by each master database 121 is small, the running speed of each master database 121 is improved, and in a high-concurrency scenario, the response speed of data processing requests can also be ensured. The data shards include a plurality of replicas for redundancy backup and disaster recovery to prevent data loss and disaster recovery switching.

[0047] Figure 3 A distribution diagram of one data shard in a data processing system in an embodiment of the present application is shown in FIG. 2. Figure 3 As shown, after the proxy server 112 writes one data shard to one master database 121 of the first data center 120, the master database 121 synchronizes the stored data shard to the slave database 113 of each service center 110(A)-110(H) along the solid arrow direction. Similarly, other data shards are also sequentially synchronized to the slave database 113 of each service center 110(A)-110(H) through the master database 121 where the data shard is written, so that each service center 110(A)-110(H) has a complete set of data.

[0048] The DBLE proxy server also has a read-write separation function, which can separate data write requests and data read requests to different database operations. Specifically, the data shards of the data to be written in the data write request are uniformly written to the master database 121, and the reading of data is performed in the slave database 113. Compared with the centralized database which needs to perform both write data operation and read data operation, the read pressure of the master database 121 is shared, the load of the master database 121 is reduced, and the efficiency of user data reading and writing is improved.

[0049] When the proxy server 112 of each business center 110 receives a data read request, the proxy server 112 finds the corresponding slave database 113 according to the query statement, and since each data shard is synchronized from the master database 121 to the slave database 113 of each business center 110, in order to further improve the response speed of the data processing system 100, the proxy server 112 preferentially selects to read data from the slave database 113 in the business center 110 where the proxy server 112 is located, which is equivalent to the proxy server 112 reading data locally, avoiding reading data from the master database 121 of the first data center 120 that is far away and avoiding reading data from the slave database 113 in other business centers 110 that are far away, thereby avoiding the data read delay problem caused by distance and improving the efficiency of processing data read requests.

[0050] In the data processing system 100 provided by the embodiments of the present application, in a first aspect, by deploying a plurality of master databases 121 in the first data center 120, the number of parallel responses of the first data center 120 to data processing requests is improved, and the speed of responding to user access in a high concurrency scenario is improved. In a second aspect, by the proxy server 112 performing data sharding and storing each data shard in different master databases 121, the data amount of each master database 121 is reduced, so that the efficiency of writing data into each master database 121 and the efficiency of synchronizing data to a plurality of slave databases 113 in a master-slave replication relationship with the master database 121 are higher. Moreover, the proxy server 112 separates data read requests and data write requests, the master database 121 only responds to data write requests, and the slave database 113 only responds to data read requests, thereby improving the data processing efficiency of the data processing system 100. In a third aspect, a plurality of slave databases 113 are arranged in each business center 110, and each master database 121 and each slave database 113 of each business center 110 are in a master-slave replication relationship, and the master database 121 synchronizes the stored data shards to the slave databases 113 of each business center 110, so that when the proxy server 112 of each business center 110 receives a data read request, the proxy server 112 can preferentially read data from the slave database 113 in the business center 110 where the proxy server 112 is located, realizing local reading and avoiding network delay caused by the proxy server 112 reading data from the master database 121 or other slave databases 113, thereby improving the efficiency of processing data read requests.

[0051] Please refer to Figure 3 and Figure 4 , Figure 4The data processing system provided by the embodiments of the present application has an information interaction schematic structural diagram. In order to ensure that the proxy server 112 can read data from the slave database 113 closest to the proxy server 112 when receiving a data reading request, the proxy server 112 can read data more quickly and return the data to the client 111. In some embodiments of the present application, the proxy server 112 is configured to perform the step of reading data from the data shard stored in the slave database 113 of the business center 110 where the proxy server 112 is located, including:

[0052] determining whether the database tag L matches the server tag T of the proxy server 112 receiving the data processing request;

[0053] if so, reading data from the data shard stored in the slave database 113 corresponding to the database tag T.

[0054] As shown in Figure 4 , each database is provided with a database tag L, which is used to mark the information of the location of each database. For example, the main database 121 located in the first data center 120 is provided with a database tag L of primary, and each slave database 113 of each business center 110 is provided with a database tag L corresponding to the business center. For example, the database tag L of the slave database 113 located in the business center 110(A) is A, the database tag L of the slave database 113 located in the business center B is B, and so on. Each proxy server 112 is also provided with a server tag T, which is used to mark the business center where each proxy server 112 is located. For example, the proxy server 112 of the business center 110(A) is provided with a server tag A, and the proxy server of the business center 110(B) is provided with a server tag B.

[0055] Taking a user located in the business center A as an example, the server tag T of the proxy server 112(A) located in the business center 110(A) is A. When the proxy server 112(A) finds a plurality of slave databases 113, since each slave database 113 is located in a different business center 110, the database tags L of the plurality of slave databases 113 found are different. For example, the database tag L of the slave database 113(A) is A, and the database tag L of the slave database 113(B) is B. Therefore, the proxy server 112(A) will first determine whether the plurality of slave databases 113 have a database tag L that is also A, as shown by the solid arrow in Figure 4 , if so, the proxy server 112(A) reads data from the slave database 113(A) with the same database tag L of A.

[0056] If multiple databases in database 113 do not have a database label L that matches the server label T of proxy server 112, proxy server 112 can read data from other databases in database 113. For example, proxy server 112(A) located in business center 110(A) reads data from database 113(B) with database label L as B.

[0057] In this way, it is ensured that the proxy server 112 of each business center 110 can first read data from the database 113 located in the same business center 110 as the proxy server 112, thereby reducing network latency, improving reading efficiency, and enabling faster return of the read data to the user.

[0058] To ensure a fast response to data read requests even when proxy server 112 cannot read data from slave database 113 located in the same business center 110, and can choose to read data from other slave databases 113, this application embodiment also provides another method for proxy server to read data. Please refer to... Figure 4 and Figure 5 , Figure 5 This diagram illustrates the priority of data reading by the proxy server provided in an embodiment of this application. Figure 5 As shown, each database label set for a slave database 113 can include a primary database label L1 and a secondary database label L2. The primary database label L1 displays the location information of each slave database 113, and the secondary database label L2 displays the region information of the business center 110 where each slave database 113 is located. Correspondingly, the proxy server label for each proxy server 112 can also include a primary server label T1 and a secondary server label T2, representing the business center where the proxy server is located and the region where the business center is located, respectively. Assume that there are two business centers 110(A) and 110(B) in the Shanghai region X. The primary server label T1 of the proxy server 112(A) located in business center 110(A) is A, and the secondary server label T2 is B. The primary database label L1 of the slave database 113(A) located in business center 110(A) is A, and the secondary database label L2 is X. The primary database label L1 of the slave database 113(B) located in business center 110(B) is B, and the secondary database label L2 is X.

[0059] The proxy server 112(A) of the business center 110(A) preferentially reads data from the slave database 113 with the database first-level label L1 as A and the database second-level label L2 as X in the plurality of slave databases 113, i.e., the database first-level label L1 and the database second-level label L2 are both the same as the server first-level label T1 and the server second-level label T2; if there is no slave database 113 with L1 as A and L2 as X in the plurality of slave databases 113, the proxy server 112(A) of the business center 110(A) reads data from the slave database 113 with the database first-level label L1 different from the server first-level label T1 but the database second-level label L2 same as the server second-level label T2 in the plurality of slave databases 113, i.e. Figure 5 Finally, if there is no slave database 113 with L1 as B and L2 as X in the plurality of slave databases 113, the proxy server 112(A) reads data from the slave database 113 of the business center 110(H) in the other region Y. It is ensured that the proxy server 112 of each business center 110 preferentially reads data from the slave database 113 in the business center 110 where the proxy server 112 is located, and secondarily reads data from the slave database 113 of the other business center 110 in the same region as the business center 110 where the proxy server 112 is located, so that the proxy server 112 can preferentially read data from the slave database 113 closest to the proxy server 112, thereby improving the efficiency of responding to data read requests.

[0060] Please continue to refer to Figure 3 and Figure 4 Each business center 110 includes a load balancing server 114, a plurality of proxy servers 112 and a plurality of clients 111; the load balancing server 114 is configured with the routing address of each proxy server 112 in the business center 110 where the load balancing server 114 is located;

[0061] The load balancing server 114 is configured to perform the following steps:

[0062] Generating a round-robin list according to the routing address of each proxy server 112 configured;

[0063] Receiving a plurality of data processing requests sent by the clients 111 in the business center where the load balancing server 114 is located;

[0064] According to the round-robin list, the plurality of data processing requests are sent to the plurality of proxy servers 112 in the business center 110 where the load balancing server 114 is located one by one.

[0065] As Figure 2 and Figure 4As shown, the data processing system 100 can also include a DNS domain name server 116, which is configured to receive the domain name resolution requests sent by each business center client 111, and return the resolved virtual routing address VIP, so that each business center client 111 can send data processing requests to the load balancing server 114 (linux virtual server) of the business center through the virtual routing address VIP.

[0066] The load balancing server 114 is configured to manage the proxy servers 112 in the same business center 110, specifically, configure the routing addresses IP of the proxy servers 112 in the business center for the load balancing server, and after receiving the data processing requests sent by the multiple clients 111, distribute the data processing requests to the proxy servers 112 in a reasonable and balanced manner. By setting the load balancing server 114, multiple data processing requests can be received at the same time, and a large number of concurrent data processing requests can be distributed to each proxy server 112, preventing only one proxy server 112 from running and causing excessive pressure and long user response time.

[0067] The load balancing server 114 distributes the data processing requests to the multiple proxy servers 112 in the same business center 110 through a polling method, generates a polling list according to the routing addresses of each proxy server 112, and sends the multiple data processing requests to each proxy server 112 in the order of the routing addresses in the polling list until all proxy servers 112 in the polling list are traversed, and the data processing requests are distributed to each proxy server 112 in the order of the polling list again; or, according to the processing performance of each proxy server 112 in the same business center 110, set a weight ratio for each proxy server 112, and sort each proxy server 112 from large to small according to the weight ratio to generate a polling list, for example, Figure 2 In one business center 110, there are three proxy servers 112, and according to the processing performance of the three proxy servers 112, a weight ratio is set for each proxy server 112, for example, the weight ratio of the three proxy servers is 5:2:1, and the load balancing server 114 distributes the multiple data processing requests according to the polling list, first distributes 5 data processing requests to the proxy server 112 ranked first in the polling list, then distributes 2 data processing requests to the proxy server 112 ranked second in the polling list, and distributes 1 data processing request to the proxy server 112 ranked third in the polling list, completing one polling.

[0068] For example, Figure 4As shown, the number of load balancing servers 114 of each business center 110 can be multiple, and the multiple load balancing servers 114 back up each other to prevent only the load balancing server 114 as the master to run while the load balancing server 114 as the backup is idle, causing resource waste, and the multiple load balancing servers 114 backing up each other can all provide services at the same time to share access pressure, such as Figure 4 The business center 110(A) has two load balancing servers 114 backing up each other, which are bound to two routing addresses vip1 and vip2 respectively, and the client 111(A) of the business center 110(A) accesses the load balancing server 114 of the business center 110(A) through the domain name server 116 to poll the virtual routing address vip1 or vip2 of the load balancing server 114 of the business center 110(A); the multiple load balancing servers 114 backing up each other are realized by setting the Keepalived module in the load balancing server 114, and keepalived is a special tool for LVS load balancing server 114, which is used to bind the virtual routing address vip and detect the working state of the load balancing server 114, and when one of the load balancing servers 114 fails, the virtual routing address VIP bound to the failed load balancing server 114 is switched to the backup load balancing server 114, such as Figure 4 The client 111(A) of the business center 110(A) originally sends data processing requests to the load balancing server 114(A) bound to the virtual routing address vip1 through the virtual routing address vip1, and when the load balancing server 111(A) can continue to access the load balancing server 111(A) through the virtual routing address vip1 to execute the above-mentioned load balancing server 114(A) fails, the virtual routing address vip1 of the load balancing server 114(A) is switched to its backup load balancing server, i.e. the load balancing server 114(A) bound to the virtual routing address Vip2, at this time, the load balancing server 114(A) bound to the virtual routing address vip2 also binds the virtual routing address vip1, so that the client 111 of the business center 110(A) polls the multiple proxy servers 112 of the business center where it is located, so that the data processing system 100 can continue to work, realizing the high availability of the load balancing server 114 in the data processing system 100.

[0069] By setting the load balancing server 114 in each business center 110, the load of each proxy server 112 of the business center 110 is balanced, the pressure of each proxy server 112 in the high concurrency scenario is balanced, the working efficiency of each proxy server 112 is improved, the pressure of each proxy server 112 is reduced, and the processing response speed of each proxy server 112 is improved.

[0070] Since the load balancing server 114 of each business center 110 polls to send data processing requests to multiple proxy servers 112 in the same business center 110, if one of the proxy servers 112 fails, the proxy server 112 will still receive data processing requests, but since the proxy server 112 fails, it cannot run, which will result in being unable to respond to the client 111.

[0071] Therefore, in some embodiments of the present application, the load balancing server 114 is used to determine the working state of the proxy server 112, and the proxy server 112 in the fault state is deleted from the polling list.

[0072] If the load balancing server 114 determines that one of the proxy servers 112 in the same business center 110 fails, the load balancing server 114 will kick the routing address of the proxy server 112 out of the polling list. The load balancing server 114 ensures that it only sends data processing requests to the proxy servers 112 in the normal state in the business center 110, achieving high availability of the proxy server layer in the data processing system 100 and ensuring the stability of data processing.

[0073] Please continue to refer to Figure 4 In some embodiments of the present application, the data processing system 100 further comprises a configuration maintenance server 115, which is used to store the first configuration information of the proxy server 112 of each business center 110, and synchronize the changed first configuration information to each of the proxy servers 112 when the first configuration information changes.

[0074] The proxy servers 112 of the multiple business centers 110 form a proxy service cluster, and the multiple proxy servers 112 in the proxy service cluster are distributed in different business centers 110, so that each business center can access the proxy server 112 nearby. The proxy server has the ability to expand, and the number of proxy servers 112 can be increased according to the number of business centers 110 and the number of data processing requests of each business center 110, so as to improve the number and speed of data processing requests.

[0075] Zookeeper is a configuration maintenance server 115 for a plurality of proxy service clusters, and the zookeeper cluster includes a plurality of configuration maintenance servers 115 for storing configuration information, i.e., first configuration information, that needs to be consistent among a plurality of proxy servers 112 in the proxy service cluster. Specifically, the first configuration information between each proxy server 112 includes username and password configuration information (user.xml) of each connected proxy server 112, configuration information (db.xml) of a plurality of databases, and configuration information (sharding.xml) of a sharding rule for data, and the configuration maintenance server 115 is used to maintain consistency of the above-mentioned first configuration information in each proxy server 112, and when the above-mentioned certain first configuration information is changed, the changed consistent configuration information is synchronized to each proxy server 112 to ensure that the first configuration information of the entire proxy service cluster is consistent.

[0076] In the above embodiment, the CPU, memory, and system parameter configuration file (bootstrap.cnf) of each proxy server 112 itself, such as the server tag T, do not need to be consistent with other proxy servers 112, so that each proxy server 112 can first read data from the slave database 113 of the business center 110 where the proxy server 112 is located when receiving a data read request, and if the slave database 113 of the business center where the proxy server 112 is located fails, data is read from the slave database 113 of another business center closest to the proxy server 112, thereby realizing fast response of the data processing system 100 to the data read request.

[0077] By setting the configuration maintenance server 115, it can be ensured that each proxy server 112 in the proxy service cluster processes the received data processing request in the same way, such as the rule of data sharding, the number of data shards split out, and writing data to the master database 121 when writing data, and the master-slave replication relationship between the backend databases of each proxy server 112, i.e., a plurality of databases, is consistent, thereby ensuring the ease of maintenance, running stability, and reliability of the data processing system 100.

[0078] Please continue to refer to Figure 3 and Figure 4 In some embodiments of the present application, the load balancing server 114 is configured to configure the routing addresses of a plurality of proxy servers 112 of other business centers 110 to the load balancing server 114 and generate a new round-robin list when it is determined that the working states of all proxy servers 112 in the business center 110 where the load balancing server 114 is located are in a failure state.

[0079] Since the first configuration information is consistent among the multiple proxy servers 112, and the load balancing server 114 is configured with the routing addresses of the multiple proxy servers 112 of its business center, when the load balancing server 114 discovers that the multiple proxy servers 112 in the same business center 110 as it are all down, it can delete the routing addresses of the proxy servers 112 originally configured in the load balancing server 114 and reconfigure the routing addresses of the multiple proxy servers 112 of other business centers for the load balancing server 114. For example, when the multiple proxy servers 112 in business center 110(A) are all down, the load balancing server 114(A) in business center 110(A) is reconfigured with the routing addresses of the multiple proxy servers 112 in other business centers 110, such as business center 110(B), to replace the routing addresses of the failed multiple proxy servers 112(A), and a new round-robin list is generated according to the reconfigured routing addresses of the proxy servers 112, so that the load balancing server 114(A) in business center 110(A) sends data processing requests to the multiple proxy servers 112(B) in business center 110(B) in turn. This allows the data processing system 100 to continue to provide services when all the proxy servers 112 in a business center 110 are down, ensuring the stability and high availability of the data processing system 100.

[0080] Please continue to refer to Figure 3 In some embodiments of the present application, the data processing system 100 further comprises a plurality of first intermediate slave databases 140, each master database 121 has a master-slave replication relationship with the plurality of first intermediate slave databases 140, and each first intermediate slave database 140 has a master-slave replication relationship with the slave databases 113 of the plurality of business centers 110.

[0081] There is also a first intermediate slave database 140 between each master database 121 and the multiple slave databases 113 in master-slave replication with it, and the first intermediate slave database 140 further serves as a redundant backup. Since all business centers 110 write data to the master database 121 uniformly, and the data stored in the slave database 113 of each business center 110 is synchronized and replicated through the master database 121, if the master database 121 fails, the entire data processing system 100 will fail or can only provide data reading services. By setting the first intermediate slave database 140, it can take over the position of the master database 121 when it fails, so that data can still be normally written and synchronized to the slave databases 113 of each business center 110, allowing the data processing system 100 to continue to provide services.

[0082] Furthermore, after performing a write operation, the master database 121 also needs to synchronize the data to the slave databases 113 of multiple business centers 110. Each data transfer from the master database 121 to a slave database 113 consumes network resources. If there are too many business centers 110, the master database 121 needs to transmit data across more links, consuming excessive network resources and increasing the I / O (Input / Output) pressure on the master database 121, leading to a decrease in its performance. Therefore, each master database 121 establishes a master-slave replication relationship with multiple first intermediate slave databases 140, and each first intermediate slave database 140 establishes a master-slave replication relationship with the slave databases 113 of multiple business centers 110. This allows the master database 121 to only need to transmit data to the first intermediate slave database 140 for data synchronization, and then use the first intermediate slave database 140 to transmit data to the multiple slave databases 113 of the multiple business centers 110 to achieve data synchronization.

[0083] More specifically, to ensure efficient data synchronization by transmitting data from each first intermediate slave database 140 to the slave databases 113 of the multiple business centers 110 with which it has established master-slave replication relationships, the first intermediate slave database 140 is deployed in the middle business center among the multiple business centers 110. For example... Figure 3 As shown, the first intermediate slave database 140, which establishes a master-slave replication relationship with the slave databases 113 of business centers 110(A), 110(B), and 110(C), is deployed in business center (B). In this way, the distance of data transmission from the first intermediate slave database 140 to the slave databases 113 located in business centers 110(A), 110(B), and 110(C) is relatively short, and the data synchronization efficiency is faster.

[0084] like Figure 3 As shown, if the data processing system 100 does not have a first intermediate slave database 140, the master database 121 needs to synchronize data with the slave databases 113 of multiple business centers 110, in order to Figure 3 Taking eight business centers 110 as an example, the master database 121 needs to synchronize data with at least eight slave databases 113. However, after setting up a first intermediate slave database 140, the master database 121 only needs to synchronize data with two first intermediate slave databases 140, and then synchronize data with the slave databases 113 of multiple business centers 110 through the first intermediate slave databases 140. This reduces the I / O pressure on the master database 121, reduces the network resource consumption of the master database 121, improves the operating performance of the master database 121, and thus improves the efficiency of responding to data processing requests.

[0085] Please continue to refer to this. Figure 3 and Figure 4In some embodiments of the application, the first data center 120 further comprises a plurality of standby slave databases 122 corresponding to the plurality of master databases 121, each master database 121 is in a master-slave replication relationship with at most two first intermediate slave databases 140, and each first intermediate slave database 140 is in a master-slave replication relationship with at most three slave databases 113 of the plurality of business centers 110. The data processing system 100 further comprises a second data center 150, the second data center 150 comprises a plurality of second intermediate slave databases 151, and the plurality of second intermediate slave databases 151 are in a master-slave replication relationship with the plurality of master databases 121. The data processing system 100 comprises a replication topology management server 160, taking the eight business centers in the figure as an example, the replication topology management server 160 is configured to perform the following steps:

[0086] Obtaining the master-slave replication relationship between each database and monitoring the working state of each database;

[0087] Displaying each master-slave replication topology relationship and the state of each database through a graphical interface;

[0088] When the working state of the master database 121 is in a fault state, switching the standby slave database 122 corresponding to the master database 121 to replace the master database 121 in the fault state;

[0089] When the working state of both the master database 121 and the standby slave database 122 corresponding to the master database 121 is in a fault state, switching the second intermediate slave database 151 corresponding to the master database 121 to replace the master database 121 in the fault state.

[0090] To further realize the high availability of the data processing system 100, ensure that the data write and data read services are normally provided to the user when the master database 121 fails, and minimize the impact of the failure recovery, the master database 121 has a standby slave database 122 corresponding thereto in the first data center 120 and in a master-slave replication relationship, the standby slave database 122 has no slave database 113 directly in a master-slave replication relationship with it when it is in normal operation, when the master database 121 fails, the standby slave database 122 takes its place to become a new master database 121, so that the master database 121 is still in the first data center 120 after the failure recovery, and the number of links for the new master database 121 to synchronize data does not increase, and the master-slave replication relationship of the databases in other centers does not change, so that the failure recovery is more stable and reliable.

[0091] The second data center 150 is a backup data center of the first data center 120, and the second intermediate slave database 151 has a master-slave replication relationship with the plurality of master databases 121 one by one. When both the master database 121 and the standby slave database 122 of the first data center 120 fail, the second intermediate slave database 151 in the second data center 150 takes over to become a new master database 121, so that the data processing system 100 can normally provide data write and data read services. The first data center 120 and the second data center 150 can respectively provide data synchronization for the slave databases 113 of different plurality of business centers 110, such as Figure 3 Taking eight business centers 110 as an example, the first data center 120 is used to respond to the business center 110(A) to the business center 110(F), and the second data center 150 is used to respond to the business center 110(G) and the business center 110(H). The slave databases 113 of the business center 110(G) and the business center 110(H) have a master-slave replication relationship with the second intermediate slave database 151. The data processing system 100 can increase the carrying capacity of parallel data replication and data read services, and improve the operation efficiency of the data processing system 100.

[0092] In addition, since the second data center 150 is a backup data center of the first data center 120, it needs to synchronize the data of the first data center 120 in real time. When the first data center 120 fails, it can quickly switch to the second data center 150 to ensure that the data processing system 100 can continue to operate normally, prevent data loss, and realize cross-center disaster recovery of the data processing system 100.

[0093] As shown in Figure 3 The cascading replication mode is established between the master database 121, the first intermediate slave database 140 and the slave database 113 in a group of master-slave replication relationship. In order to ensure that the I / O pressure and network resources of each database are not overloaded, so that each database can quickly respond to data processing requests, the number of next level databases established with the master-slave replication relationship for each database is not more than 5, that is, the total number of the first intermediate slave database 140, the standby slave database 122 and the second intermediate slave database 151 established with the master-slave replication relationship for each master database 121 is not more than 5, the number of slave databases 113 of each business center 110 established with the master-slave replication relationship for the first intermediate slave database 140 is not more than 5, and the number of slave databases 113 of each business center 110 established with the master-slave replication relationship for the second intermediate slave database 151 is also not more than 5.

[0094] When the master database 121 fails, the standby slave database 122 and the second intermediate slave database 151 which are in master-slave replication with the master database 121 can replace the master database 121 to implement the fault tolerance solution. It needs to be considered which database can replace the master database 121 to achieve faster recovery and minimal change in the master-slave replication topology, and after replacement, the number of next-level slave data of all databases is still not more than 5, so as to ensure that the processing performance of each database will not be overloaded.

[0095] Therefore, with continuous reference to Figure 3 and Figure 4 , the replication topology management server 160 is also provided in the data processing system 100. The replication topology management server 160 (Orchestrator) is an open source management server supporting adjustment of the master-slave replication topology of the MySQL database and automatic switching of the MySQL database failure. The replication topology management server 160 obtains the master-slave replication relationship between all databases and monitors the state of each database, and is in communication connection with each database. When one of the master databases 121 is disconnected from the replication topology management server 160, it indicates that the master database 121 fails, and the standby slave database 122 which has a master-slave replication relationship with the master database 121 is preferentially switched to serve as a new master database 121, and the first intermediate slave database 140 and the second intermediate slave database 151 which have a master-slave replication relationship with the master database 121 are also established to have a master-slave replication relationship. If the standby slave database 122 of the master database 121 also fails, it indicates that all databases in the first data center 120 fail, and the second data center 150 which is a backup data center of the first data center 120 is automatically replaced by the first data center 120, that is, the second intermediate slave database 151 which has a master-slave replication relationship with the master database 121 replaces the master database 121 in the failure state.

[0096] Further, the replication topology management server 160 also supports manual master-slave switching of the MYSQL database. After obtaining the master-slave replication relationship between all databases, it is displayed to the client page for users and management personnel to manually adjust or switch the master-slave replication relationship of each database according to needs.

[0097] Further, to avoid the number of next-level databases which have a master-slave replication relationship with the switched second intermediate slave database 151 exceeding 5 after the failure switching of the second intermediate slave database 151 replacing the master database 121 in the failure state, the switched second intermediate slave database 151 will be overloaded, and therefore the second intermediate slave database 151 is set as a database with the minimum number of next-level slave data.

[0098] The replication topology management server 160 can automatically detect the failure of the primary database 121 and automatically switch when the primary database 121 fails to ensure that the data processing system 100 service does not interrupt and improves the disaster recovery capability of the data processing system 100. By preferentially switching the standby slave database 122 under the master-slave replication relationship of the primary database 121 in the failure state, and secondarily switching the second intermediate slave database 151, that is, switching the databases in the same data center first and then switching the databases in another data center, the failed primary database 121 is switched under the condition that the network resources and I / O resources are small, the switching speed of the primary database 121 in the failure state is improved, and the data processing system 100 can quickly recover and run. Further, the position of the new primary database 121 after switching and the master-slave replication relationship with other databases remain unchanged to minimize the impact on the entire replication topology after switching, making the failure recovery more stable and reliable. Moreover, before and after the primary database 121 switches, the number of next-level slave databases of each database is not more than 5, and after the primary database 121 in the failure state is switched, the stability, running performance, and response data processing request efficiency of each database in the data processing system 100 will not be reduced.

[0099] In some embodiments of the present application, the replication topology management server 160 is used to perform the following steps when the working state of the first intermediate slave database 140 is in the failure state:

[0100] Switching the standby slave database 122 in the master-slave replication relationship with the same primary database 121 as the first intermediate database to replace the first intermediate slave database 140 in the failure state;

[0101] When the working state of the second intermediate slave database 151 is in the failure state, the standby slave database 122 in the master-slave replication relationship with the same primary database 121 as the second intermediate database replaces the second intermediate slave database 151 in the failure state.

[0102] Generally, when the intermediate-level database fails, the switching mode is to switch to its brother database to take over his position, that is, the database at the same level and with the same upper-level database as the database. However, as Figure 3As shown, taking a group of databases that have a master-slave replication relationship and are in a cascading replication mode as an example, the sibling databases of the first intermediate slave database 140 located between the business center 110(A), the business center 110(B) and the business center 110(C) include the standby slave database 122, the second intermediate slave database 151 and the first intermediate slave database 140 located between the business center 110(D), the business center 110(E) and the business center 110(F). If the first intermediate slave database 140 located between the business center 110(A), the business center 110(B) and the business center 110(C) fails, the first intermediate slave database 140 is replaced by the first intermediate slave database 140 located between the business center 110(D), the business center 110(E) and the business center 110(F), and the number of slave databases 113 that have a master-slave replication relationship with the first intermediate slave database 140 after the switching is greater than 5, which causes the running efficiency of the first intermediate slave database 140 after the switching to be slower. If the first intermediate slave database 140 is replaced by the second intermediate slave database 151, the recovery effect of the first intermediate slave database is poor, the data synchronization efficiency is slow and the topology relationship of the master-slave replication changes greatly due to the long distance between the second intermediate slave database 151 and the business center and the fact that the second intermediate slave database 151 also has a slave database 113 connected.

[0103] Therefore, when the first intermediate slave database 140 fails, the replication topology management server 160 monitors the failure of the first intermediate slave database 140, and according to the master-slave replication relationship of the first intermediate slave database 140, the first intermediate slave database 140 in the failure state is switched to the standby slave database 122 having the same master database 121 as the first intermediate slave database 140. Similarly, when the failure management server 160 monitors the failure of the second intermediate slave database 151, according to the master-slave replication relationship of the second intermediate slave database 151, the standby slave database 122 having the same master database 121 as the second intermediate slave database 151 is replaced.

[0104] This failure switching and recovery mode is convenient to maintain, improves the failure recovery efficiency, and at the same time ensures that after the replication topology management server 160 automatically switches the failed first intermediate slave database 140, the running performance of each database in the data processing system 100 will not be reduced, and the entire master-slave replication topology relationship changes little, ensuring the reliability of the data processing system 100.

[0105] In some embodiments of the present application, the replication topology management server 160 is configured to switch a slave database 113 of another business center 110 to replace a slave database 113 in a failure state when the working state of the slave database 113 of a certain business center 110 is in a failure state.

[0106] When the replication topology management server 160 detects that a slave database 113 of a certain business center 110 has failed, it switches from the slave database 113 to its sibling database, i.e. switches another slave database 113 of another business center 110 that has the same first intermediate slave database 140 as the failed slave database 113 to replace the failed slave database.

[0107] As shown in Figure 3 and Figure 4 , an example is taken that a business center 110 has two slave databases 113, in which the slave database 113 close to the first intermediate slave database 140 is the next level database of the first intermediate slave database 140, and the other slave database 113 close to the proxy server 112 is the lowest level database in the group of databases that have a master-slave replication relationship. When the replication topology management server 160 detects that the slave database 113(A) in the business center 110(A) has failed, and the slave database 113(A) is the next level database of the first intermediate slave database 140, it switches the failed slave database 113(A) to the slave database 113 of another business center 110, and the slave database 113 of the other business center 110 is also the next level database of the first intermediate slave database 140, as shown in the slave databases 113 close to the first intermediate slave database 140 in the business center 110(B) and the business center 110(C) in Figure 3 , i.e. Figure 4 the slave database 113(B) and the slave database 113(C) in .

[0108] In addition, after switching the failed database, the replication topology management server 160 also adjusts the master-slave replication relationship of each database, and sends the adjusted master-slave replication relationship of each database to each proxy server 112 to change the configuration information of each proxy server 112, so that the proxy server 112 knows the change of the topology and knows which is the master database 121 for writing data. For the above embodiment of the configuration maintenance server 115, since the plurality of proxy servers 112 in the data processing system 100 are a proxy service cluster, the replication topology management server 160 sends the adjusted master-slave replication relationship of each database after the failure switching to the proxy server 112, and the configuration information (db.xml) of the database in the back end of the proxy server 112 will be changed, and the configuration maintenance server 115 will synchronize the changed configuration information (db.xml) to the entire proxy service cluster, so that the configuration information (db.xml) of each proxy server 112 is consistent, and the data processing system 100 is easy to maintain and has stable and reliable operation.

[0109] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than limit them. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some or all of the technical features can be replaced equivalently. Such modifications or replacements do not change the essence of the corresponding technical solutions, which should be covered in the scope of the claims and the specification of the present application. In particular, the technical features mentioned in each embodiment can be combined in any manner as long as there is no structural conflict. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. A data processing system, characterized by The data processing system comprises a first data center and a plurality of business centers, the first data center comprises a plurality of master databases, each of the business centers comprises a load balancing server, a plurality of proxy servers, a plurality of slave databases and a plurality of clients, each of the master databases has a master-slave replication relationship with at least one of the slave databases of each of the business centers; the load balancing server is configured with the routing address of each of the proxy servers of the business center where the load balancing server is located; The load balancing server is configured to generate a polling list according to the routing address of each of the proxy servers; The load balancing server is configured to receive a plurality of data processing requests sent by the clients of the business center where the load balancing server is located; and send the plurality of data processing requests to the plurality of proxy servers of the business center where the load balancing server is located one by one according to the polling list; The proxy server is configured to receive a data processing request; When the data processing request is a data write request, the data to be written in the data write request is split into a plurality of data shards; Each of the split data shards is written into each of the master databases respectively, wherein each of the master databases stores one data shard; The data shard stored by each of the master databases is replicated to the slave databases having a master-slave replication relationship with the master database; When the data processing request is a data read request, a query statement in the data read request is obtained; A plurality of slave databases where the data shard matching the query statement is located are determined; Data is preferentially read from the data shard stored in the slave database of the business center where the proxy server receiving the data processing request is located; The preferential reading of data from the data shard stored in the slave database of the business center where the proxy server receiving the data processing request is located comprises: Determining whether there is a database tag matching the server tag of the proxy server receiving the data processing request; if there is, reading data from the slave database corresponding to the database tag.

2. The data processing system of claim 1, wherein, The load balancing server is configured to determine the working state of the proxy server, and delete the proxy server in a fault state from the polling list.

3. The data processing system of claim 1, wherein, The data processing system further comprises a configuration maintenance server, the configuration maintenance server is configured to store first configuration information of the proxy server of each of the business centers, and synchronize the changed first configuration information to each of the proxy servers when the first configuration information is changed.

4. The data processing system of claim 3, wherein, The load balancing server is configured to configure the addresses of a plurality of proxy servers of other business centers to the load balancing server and generate a new polling list when it is determined that the working state of all the proxy servers of the business center where the load balancing server is located is in a fault state.

5. The data processing system according to any one of claims 1-4, characterized in that, The data processing system further comprises a plurality of first intermediate slave databases, each of the master databases has a master-slave replication relationship with a plurality of first intermediate slave databases, and each of the first intermediate slave databases has a master-slave replication relationship with the slave databases of a plurality of business centers.

6. The data processing system of claim 5, wherein, The first data center further comprises a standby slave database corresponding to each of the master databases and having a master-slave replication relationship; Each of the master databases has a master-slave replication relationship with at most two of the first intermediate slave databases, and each of the first intermediate slave databases has a master-slave replication relationship with at most three of the slave databases of the business centers; The data processing system further comprises a second data center, which comprises a plurality of second intermediate slave databases having a master-slave replication relationship with the plurality of master databases one by one; The data processing system comprises a replication topology management server; The replication topology management server is configured to acquire the master-slave replication relationship between each of the databases and monitor the working state of each of the databases; Each of the master-slave replication topology relationships and the state of each of the databases is uniformly displayed through a graphical interface; When the working state of the master database is a failure state, the standby slave database having a master-slave replication relationship with the master database is switched to replace the master database in the failure state; When the working state of both the master database and the standby slave database having a master-slave replication relationship with the master database is a failure state, the second intermediate slave database having a master-slave replication relationship with the master database is switched to replace the master database in the failure state.

7. The data processing system of claim 6, wherein, The replication topology management server is configured to, when the working state of the first intermediate slave database is a failure state, switch the standby slave database having a master-slave replication relationship with the same master database as the first intermediate database to replace the first intermediate slave database in the failure state; When the working state of the second intermediate slave database is a failure state, the standby slave database having a master-slave replication relationship with the same master database as the second intermediate database is switched to replace the second intermediate slave database in the failure state.

8. The data processing system of claim 6, wherein, The replication topology management server is configured to, when the working state of the slave database of a certain business center is a failure state, switch the slave database of another business center to replace the slave database in the failure state.

Citation Information

Patent Citations

  • System and method for realizing distributed database

    CN102158540A

  • Proxy server and data processing method and system of database

    CN104219085A