Database processing method, device, storage medium and electronic device
By sharding database data and allocating different processing CPUs, the problems of CPU resource waste and delay in traditional multi-thread concurrency control are solved, and efficient business processing capabilities and performance expansion are achieved.
Patent Information
- Application Number
- CN201810179726.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-03-05
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2038-03-05
AI Technical Summary
In multi-threaded concurrency control of traditional OLTP databases, due to the complexity of lock resources and shared data structures, CPU resources are wasted and transaction processing delays occur. As the number of CPUs increases, the problem intensifies, affecting business processing capabilities.
By sharding database data and allocating different processing CPUs, we avoid the increase in logical structure complexity and operating costs caused by multiple CPUs accessing database data in a multi-core system. We use correspondence management between data sharding and processing CPUs to dynamically adjust the distribution. Chip and CPU configurations to optimize load balancing.
It reduces the complexity of multi-thread concurrency control, reduces transaction request response delays, improves business processing capabilities, and achieves efficient utilization of CPU resources and linear expansion of performance.
Smart Images

Figure CN110231977B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to a database processing method, device, storage medium and electronic device. Background Art
[0002] In modern databases, transactions can be processed in parallel. For example, general OLTP (On-Line Transaction Processing, also known as transaction-oriented processing) databases include the following standard features: a series of data structures based on disk storage (such as heap files, B-trees, etc.), lock-based concurrency control to support concurrent execution of multiple statements, log-based recovery mechanism, and efficient cache management mechanism. All modern databases widely support multi-threading mechanisms, including a series of transaction concurrency control protocols and mutual exclusion control of shared data structures (such as cache pools, index pages, etc.) widely present in the code. The motivation for traditional multi-threading is to allow a transaction to execute another transaction while waiting for the disk to return data or to prevent long transactions from blocking the execution of short transactions.
[0003] Therefore, with the rapid development of business applications, the shortcomings of this multi-threaded concurrency control scheme of traditional OLTP databases have gradually become prominent: 1. Access to user data needs to be controlled through a lock mechanism, especially when the complete ACID (atomicity, consistency, isolation, and durability) characteristics of the transaction are met, both reading and writing need to be locked. When the concurrency of business requests increases, lock resources, control logic complexity, deadlock detection and other mechanisms all need to consume a lot of CPU resources, which has a great impact on performance. 2. There are a large number of shared data structures in the database, such as lock managers, index pages, log managers, cache pools, etc., which must be accessed through Latch or Mutex when accessed by multiple threads concurrently. This will consume more CPU resources and increase transaction processing latency when the number of concurrent requests is high, especially when the total number of server CPUs is large.
[0004] There is no effective solution to the problem in the related art that in the multi-threaded concurrent control of the database, as the number of CPUs increases, access conflicts become more and more serious, resulting in a large waste of CPU resources, increased transaction processing delays, and thus reduced business processing capabilities. Summary of the invention
[0005] The embodiments of the present invention provide a database processing method, device, storage medium and electronic device to at least solve the problem existing in the related art that in the multi-threaded concurrent control of the database, as the number of CPUs increases, access conflicts become more and more serious, thereby causing a large amount of CPU resource waste, increasing the delay of transaction processing, and thus reducing business processing capabilities.
[0006] According to one embodiment of the present invention, a method for processing a database is provided, comprising: receiving a processing request for requesting processing of predetermined data in a database; determining a predetermined central processing unit CPU for processing the predetermined data, wherein the database includes more than two data shards, different data shards include different data, and different data shards correspond to different processing CPUs for processing the data in the data shards; and instructing the predetermined CPU to process the predetermined data according to the processing request.
[0007] Optionally, before determining the predetermined CPU for processing the predetermined data, the method further includes: obtaining the correspondence between the data shard and the processing CPU; determining the predetermined CPU for processing the predetermined data includes: determining the data shard to which the predetermined data belongs; and determining the predetermined CPU corresponding to the data shard to which the predetermined data belongs based on the correspondence.
[0008] Optionally, obtaining the correspondence between data shards and processing CPUs includes a first acquisition method or a second acquisition method, wherein the first acquisition method includes: sharding the data in the database, wherein there is no dependency between the sharded data shards; assigning a corresponding processing CPU to each data shard; establishing a correspondence between the data shards and the assigned processing CPUs; and the second acquisition method includes: receiving the correspondence from the management CPU.
[0009] Optionally, after establishing the correspondence between the data shards and the assigned processing CPUs, the method further includes: performing at least one of the following operations under predetermined conditions, and re-establishing the correspondence between the data shards and the assigned processing CPUs based on the executed operations: re-sharding the data in the database, and re-configuring corresponding processing CPUs for each of the sharded data shards; reallocating corresponding processing CPUs for the data shards in the database; wherein the reallocated processing CPUs include the original processing CPUs and / or the newly added processing CPUs, and the predetermined conditions include at least one of the following: determining that there is an imbalance in the processing CPU load based on the collected load information of each processing CPU and the processing information of the data in each data shard, and receiving a reallocation instruction.
[0010] Optionally, the total number of data shards after resharding the data in the database is less than the total number of data shards before resharding; or, the total number of data shards after resharding the data in the database is equal to the total number of data shards before resharding; or, the total number of data shards after resharding the data in the database is greater than the total number of data shards before resharding.
[0011] Optionally, when obtaining the correspondence between the data slice and the processing CPU includes the first acquisition method, receiving a processing request for requesting processing of predetermined data in the database includes: receiving the processing request from an application APP.
[0012] Optionally, instructing the predetermined CPU to process the predetermined data according to the processing request includes: placing the processing request in a request queue corresponding to the predetermined CPU to instruct the predetermined CPU to obtain the processing request from the request queue and process the predetermined data according to the processing request.
[0013] Optionally, after receiving a processing request for requesting processing of predetermined data in a database, the method further comprises: returning an error response when it is determined that the predetermined data does not exist in the database or there is no processing CPU for processing the predetermined data.
[0014] According to another embodiment of the present invention, a database processing device is provided, including: a receiving module for receiving a processing request for requesting processing of predetermined data in a database; a determining module for determining a predetermined central processing unit CPU for processing the predetermined data; and an instructing module for instructing the predetermined CPU to process the predetermined data according to the processing request.
[0015] Optionally, the device also includes: an acquisition module, used to acquire the correspondence between the data slice and the processing CPU before determining the predetermined CPU used to process the predetermined data; the determination module includes: a first determination unit, used to determine the data slice to which the predetermined data belongs; and a second determination unit, used to determine the predetermined CPU corresponding to the data slice to which the predetermined data belongs based on the correspondence.
[0016] According to another embodiment of the present invention, a database processing system is provided, comprising: a processor, two or more processing CPUs, and a database, wherein the processor is used to perform the following processing: receiving a processing request for requesting processing of predetermined data in the database; determining a predetermined central processing unit CPU for processing the predetermined data from the two or more processing CPUs; instructing the predetermined CPU to process the predetermined data according to the processing request; and the two or more processing CPUs are used to process the data in the database according to the request from the processor.
[0017] Optionally, the two or more processing CPUs are divided into two or more processing server groups, wherein each processing server group has the ability to expand or shrink the processing CPU within the group and to perform business scheduling between the processing CPUs within the group, and different processing server groups have the ability to schedule business.
[0018] According to yet another embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
[0019] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0020] Through the present invention, since the database includes multiple data slices, different data slices correspond to different processing CPUs, and the data in the data slices are processed by the corresponding processing CPUs. It avoids the problem in traditional multi-threaded concurrent control that when the number of CPUs increases, the logical structure of the data in the database increases exponentially due to the common access of multiple CPUs in a multi-core system to the data in the database, thereby increasing more operating costs. It can solve the problem in the related art that in the multi-threaded concurrent control of the database, as the number of CPUs increases, the access conflict becomes more and more serious, thereby causing a large amount of CPU resource waste, increasing the transaction processing delay, and then reducing the business processing capability, thereby achieving the effect of reducing the complexity of the multi-threaded concurrent control of the database, reducing the request response delay of the database transaction, and improving the business processing capability. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0022] Figure 1 is a traditional multi-threaded concurrent control model diagram according to an embodiment of the present invention;
[0023] Figure 2 is a sharded multi-threaded concurrent control model diagram according to an embodiment of the present invention;
[0024] Figure 3 is a hardware structure block diagram of a mobile terminal according to a database processing method of an embodiment of the present invention;
[0025] Figure 4 is a flowchart of a database processing method according to an embodiment of the present invention;
[0026] Figure 5 is an example diagram of user data sharding according to an embodiment of the present invention;
[0027] Figure 6 is a diagram of a CPU work queue for user request processing according to an embodiment of the present invention;
[0028] Figure 7 is a diagram of a sharded concurrent processing example according to an embodiment of the present invention;
[0029] Figure 8 This is a diagram of a first sharded concurrent processing example according to an embodiment of the present invention;
[0030] Fig. 9 This is a business process diagram under the first sharded concurrent processing framework according to an embodiment of the present invention;
[0031] Fig.10 is a diagram of a second sharded concurrent processing example according to an optional embodiment of the present invention;
[0032] Fig.11 This is a flowchart of obtaining APP shard metadata information under the second shard-based concurrent processing framework according to an optional embodiment of the present invention;
[0033] Fig.12 is a business process diagram under a second sharded concurrent processing framework according to an optional embodiment of the present invention;
[0034] Fig.13 is an example diagram of a dynamically scalable sharded concurrent processing framework according to an optional embodiment of the present invention;
[0035] Fig.14 is a diagram of an example of a sharded concurrent processing framework in a distributed environment according to an optional embodiment of the present invention;
[0036] Fig.15 It is a structural block diagram of a database processing device according to an optional embodiment of the present invention. DETAILED DESCRIPTION
[0037] First, the relevant technologies are described:
[0038] Figure 1 This describes the traditional multi-threaded concurrency control model, which is described as follows: Two parts of data are maintained in memory: the first part is the user data from the business application; the second part is the shared data structure, including the lock manager, index page, log manager, cache pool, etc. In a multi-core system, each CPU shares access to the above two parts of data. Because multiple CPUs operate together to access the same data, the maintenance of the second part of the shared data structure is introduced. Figure 1 It can be seen that in order to correctly manage the user data of business applications, in addition to the management of the user data itself, a large amount of shared structure data maintenance is also required, which will undoubtedly increase a lot of additional costs. When the number of CPUs increases, the logic complexity will increase exponentially, and the cost of such operations will also increase accordingly.
[0039] The article "OLTP Through the Looking Glass, and What We Found There" shows that HP Labs, Yale University, and MIT jointly conducted an experiment to analyze OLTP databases. The article points out that through experimental decomposition, the four largest components that affect database performance were found, namely: log, Lock, Latch, and cache management. They selected a typical relational database SHORE and conducted experiments with a standard TPCC business model (testing the new order transaction under TPCC, and counting the number of CPU instructions running the transaction), and recorded the performance changes corresponding to the removal or optimization of the above features one by one. The final test data shows that in the case of a single CPU, removing all the above features can produce a throughput improvement of more than two orders of magnitude. The number of CPU instructions spent on Lock and Latch accounted for 16.3% and 14.2% of the total CPU instructions, respectively.
[0040] According to the above analysis, the total number of CPU instructions spent on Lock and Latch accounts for 30.5% of the total number of CPU instructions. This test data is still the test result under a single CPU. When the number of CPUs increases, the proportion of Lock and Latch CPU instructions in the total number of CPU instructions will increase significantly due to multiple CPUs competing for shared resources. Figure 2 What is described is a sharded multi-threaded concurrency control model in an embodiment of the present invention. The sharded multi-threaded concurrency control model of the present invention is intended to eliminate the costs brought by the above-mentioned Lock and Latch.
[0041] The solution in the embodiment of the present invention is mainly aimed at improving the concurrency control method under high concurrency conditions, aiming to improve the throughput of OLTP business in a multi-core system while reducing business response latency, and can achieve linear performance expansion with the increase of CPU resources.
[0042] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0043] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0044] Example 1
[0045] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 3 FIG. 1 is a hardware structure block diagram of a mobile terminal of a database processing method according to an embodiment of the present invention. Figure 3 As shown, the mobile terminal 30 may include one or more ( Figure 3 Only one is shown in the figure) processor 302 (processor 302 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 304 for storing data. Optionally, the mobile terminal may also include a transmission device 306 and an input / output device 308 for communication functions. It can be understood by those skilled in the art that Figure 3 The structure shown is for illustration only and does not limit the structure of the mobile terminal. Figure 3 More or fewer components as shown, or with Figure 3 Different configurations shown.
[0046] The memory 304 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a database processing method in an embodiment of the present invention. The processor 302 executes various functional applications and data processing by running the computer program stored in the memory 304, that is, to implement the above method. The memory 304 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 304 may further include a memory remotely arranged relative to the processor 302, and these remote memories may be connected to the mobile terminal 30 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0047] The transmission device 306 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal 30. In one example, the transmission device 306 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 306 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0048] In this embodiment, a database processing method that can be run on the above mobile terminal is provided. Figure 4 is a flowchart of a database processing method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0049] Step S402, receiving a processing request for requesting to process predetermined data in a database;
[0050] Step S404, determining a predetermined central processing unit CPU for processing the predetermined data, wherein the database includes more than two data shards, different data shards include different data, and different data shards correspond to different processing CPUs for processing the data in the data shards;
[0051] Step S406: instructing the predetermined CPU to process the predetermined data according to the processing request.
[0052] In the above embodiment, the database may be an OLTP database, and the data in the database is sharded. The principle of sharding is to eliminate the dependency between the data in each shard.
[0053] Through the above steps, since the database includes multiple data shards, different data shards correspond to different processing CPUs, and the corresponding processing CPUs process the data in the data shards, and the corresponding processing CPUs are independently responsible for processing all operation access requests for the data on the corresponding shards, and the corresponding processing CPUs can only be responsible for the corresponding shard data. It avoids the problem in traditional multi-threaded concurrent control that when the number of CPUs increases, the logical structure of the data in the database that is accessed together increases exponentially, thereby increasing more operating costs. It can solve the problem that in the multi-threaded concurrent control of the database, as the number of CPUs increases, the access conflict becomes more and more serious, thereby causing a large amount of CPU resource waste, increasing the delay of transaction processing, and then reducing the business processing capability. It can achieve the effect of reducing the complexity of the multi-threaded concurrent control of the database, reducing the request response delay of the database transaction, and improving the business processing capability.
[0054] In an optional embodiment, before determining the predetermined CPU for processing the above predetermined data, the method further includes: obtaining the correspondence between the data slice and the processing CPU; determining the predetermined CPU for processing the predetermined data includes: determining the data slice to which the predetermined data belongs; determining the predetermined CPU corresponding to the data slice to which the predetermined data belongs according to the corresponding relationship. In this embodiment, a corresponding processing CPU is assigned to each user data slice, and the CPU independently processes all operation access requests of the user data on the slice, and the CPU is only responsible for the slice data. Through this architecture, each CPU is corresponded to the user data slice, so that each CPU has exclusive access to the corresponding user data. The concurrent control method allows each CPU to process the user requests of each corresponding slice in parallel. Since there is no dependency between user data, only one CPU processes the access to a single user data slice, so the control of locking the user data can be removed. Further, since there is no need to lock the user data, there is no intersection between the CPUs, so there is no need to maintain the shared data structure, thereby completely removing Lock and Latch.
[0055] In an optional embodiment, obtaining the correspondence between data shards and processing CPUs includes a first acquisition method or a second acquisition method, wherein the first acquisition method includes: sharding the data in the database, wherein there is no dependency between the sharded data shards; assigning a corresponding processing CPU to each data shard; establishing a correspondence between the data shards and the assigned processing CPUs; the second acquisition method includes: receiving the correspondence from the management CPU. In this embodiment, the first acquisition method can be executed by the management CPU, and the second acquisition method can be executed by the application APP. Sharding methods and principles for user data, Figure 5 An example is given, which is described as follows: First, the general principle of sharding is to remove the dependencies between shards. There is no access dependency between shards, which needs to be considered in combination with business logic. Second, user data is sharded according to the distribution key. The distribution key can be one or more columns in the table, or expressions, functions, and custom functions on multiple columns. Third, the sharding rule can be one-level sharding or multi-level sharding, such as Figure 5 The figure shows a two-level sharding method. Multi-level sharding allows the shard processing unit to dynamically expand and shrink according to the actual load. When the amount of data in user shard 1 in the figure is getting larger or there is too much hot data, the shard processing CPU can be expanded. n+1 And migrate part of the data of user shard 1 to form user shard n+1, so as to realize the dynamic expansion of processing capacity. Fourth, dictionary data (data that is frequently accessed but rarely updated, usually with a small amount of data, such as department information) can be saved in full in each processing unit without sharding, thus breaking data dependency. Furthermore, when the same user transaction or operation involves multiple shards, the sharding strategy can dispatch multiple secondary shards that frequently appear in the same transaction or operation to the same processing unit based on statistics, thereby reducing the implementation complexity of the upper-level middleware or application APP and further improving performance.
[0056] In an optional embodiment, after establishing the correspondence between the data slices and the allocated processing CPUs, it also includes: performing at least one of the following operations under predetermined conditions, and re-establishing the correspondence between the data slices and the allocated processing CPUs based on the operations after execution: re-slicing the data in the database, and re-configuring the corresponding processing CPUs for each of the sliced data slices; re-allocating the corresponding processing CPUs for the data slices in the database; wherein the re-allocated processing CPUs include the original processing CPUs and / or the newly added processing CPUs, and the predetermined conditions include at least one of the following: determining that there is an unbalanced processing CPU load based on the collected load information of each processing CPU and the processing information of the data in each data slice, and receiving a re-allocation instruction. In this embodiment, when it is detected that the processing CPU load is unbalanced, that is, when the processing CPU processing the slice data is unevenly distributed (for example, some processing CPUs process too much data, and some processing CPUs process too little slice data), the data can be re-sliced, and then the processing CPUs can be re-allocated for the re-sliced data slices, and the re-allocated processing CPUs can include the original processing CPUs or add new processing CPUs. In addition, redistribution may also be initiated manually (such as by a DBA (Database Administrator)). For example, when the data structure in the database changes, or the business being processed changes, the data needs to be re-sharded. At this time, the DBA initiates a reallocation instruction to re-shard the data in the database and reallocate the processing CPU.
[0057] In an optional embodiment, the total number of data shards after resharding the data in the above database is less than the total number of data shards before resharding; or, the total number of data shards after resharding the data in the above database is equal to the total number of data shards before resharding; or, the total number of data shards after resharding the data in the above database is greater than the total number of data shards before resharding. In this embodiment, when the amount of data in the user data shards decreases, or the access hotspots of the user data shards decrease, the total number of resharded data shards can be dynamically adjusted to be less than the total number of shards before resharding; similarly, when the amount of data in the user data shards increases, or the access hotspots of the user data shards increase, the total number of resharded data shards can be dynamically adjusted to be greater than the total number of shards before resharding. In addition, when the internal data of a data shard changes or the access hotspot changes, such as the internal data access volume of data shard 1 increases, while the internal data access volume of data shard 2 decreases, the data inside data shard 1 and data shard 2 are adjusted while the total number of user data (corresponding to the above-mentioned database) shards remains unchanged. For example, part of the data in data shard 1 is adjusted to data shard 2. In this way, the amount of data in each data shard can be dynamically adjusted while the total number of data shards remains unchanged.
[0058] In an optional embodiment, when the correspondence between the data shard and the processing CPU includes the first acquisition method, receiving a processing request for requesting processing of predetermined data in the database includes: receiving the processing request from the application APP. In this embodiment, the tasks performed by each shard processing CPU are basically 100% actual user requests of the APP, rather than actual work such as system scheduling, lock control, cache control, etc. that does not directly correspond to user requests. This greatly reduces the total number of CPU instructions and improves the effective utilization of the CPU.
[0059] In an optional embodiment, instructing the predetermined CPU to process the predetermined data according to the processing request includes: placing the processing request in a request queue corresponding to the predetermined CPU to instruct the predetermined CPU to obtain the processing request from the request queue and process the predetermined data according to the processing request. Figure 6The figure shows the working principle of a shard processing unit, which is described as follows: first, user requests are placed in a queue, and then a loop is executed to continuously fetch requests from the queue and execute them. It is obvious that this method can fully operate a single processing CPU, of course, there are a few nanoseconds of time cycle for fetching commands from the command queue and putting responses into the response queue. In database applications, user requests are SQL (Stuctured Query Language, referred to as SQL, Structured Query Language) execution plans, execution plans on distributed shards, or stored procedure calls, etc., and the loop corresponds to the request queue on a single user shard.
[0060] In an optional embodiment, after receiving a processing request for requesting processing of predetermined data in a database, the method further includes: returning an error response when it is determined that the predetermined data does not exist in the database or there is no processing CPU for processing the predetermined data.
[0061] The following is an overall description of the sharded concurrent processing method for a database in conjunction with an embodiment:
[0062] Figure 7 The present invention describes a sharded concurrent processing method, including:
[0063] First, the library and table structure of user data is designed according to the business application scenario. When defining the fields of each library and table, the sharding rules need to be defined based on the characteristics of the user data itself and the specific business access scenarios for user data.
[0064] Second, according to the defined sharding rules, user data is divided into multiple different data shards, and the dependencies between user data shards are removed. The number of user data shards needs to take into account the number of available CPUs to ensure that the number of available CPUs can match the actual number of user data shards.
[0065] Third, a corresponding processing CPU is bound to each data shard, which processes all read and write requests on the corresponding user shard data, and each CPU only processes one corresponding user shard.
[0066] The present invention will be described below in conjunction with specific embodiments: Specific embodiment 1
[0068] like Figure 8 As shown, the first sharded concurrent processing example is provided, including the following devices:
[0069] The database processing server, wherein the CPU is divided into two categories, the management / access CPU (corresponding to the above-mentioned management CPU) and the shard processing unit CPU (corresponding to the above-mentioned processing CPU).
[0070] The management / access CPU is responsible for maintaining the user data (corresponding to the above-mentioned database) shards, as well as metadata information management such as the relationship between the shards and the corresponding shard processing unit CPUs. At the same time, it accepts APP user requests, routes each request to the corresponding shard processing CPU, collects the responses of each processing unit CPU and returns them to the APP.
[0071] The shard processing unit CPU is responsible for receiving user requests, processing user requests and completing the reading, writing and calculation of the user shard data it is responsible for.
[0072] Fig. 9 The first business process under the sharded concurrent processing framework is given, including the following steps:
[0073] The first step (corresponding to Fig. 9 In step 92), the APP sends a user request to the database processing server, and the request carries the sharding information.
[0074] The second step (corresponding to Fig. 9 In step 94), the management / access CPU receives the user request, parses the request message, and obtains the distribution key field information therefrom.
[0075] Step 3 (corresponding to Fig. 9 In step 96), the management / access CPU matches the corresponding sharding processing unit CPU according to the distribution key information and metadata sharding rule information in the request. If the match is successful, the process goes to step 4. If the match fails, the management / access CPU directly returns an error response to the APP (corresponding to Fig. 9 Step 914), the process ends.
[0076] Step 4 (corresponding to Fig. 9 In step 910), the shard processing unit CPU sequentially obtains requests from its own user request queue, processes them, and after processing, places the responses in the response queue corresponding to the CPU, and continues to take the next request for processing.
[0077] Step 5 (corresponding to Fig. 9 In step 912), the management / access CPU obtains the response in the response queue of each shard processing unit CPU and replies to the APP. The process ends. Specific embodiment 2
[0079] like Fig.10 As shown, a second sharded concurrent processing example is provided, including the following devices:
[0080] The CPU of the database processing server is also divided into two categories, the metadata management CPU (corresponding to the management CPU mentioned above) and the shard processing unit CPU (corresponding to the processing CPU mentioned above). The management CPU is responsible for maintaining metadata information such as user data (corresponding to the database mentioned above) shards, the relationship between user shards and corresponding shard processing unit CPUs, and accepts metadata user requests from APPs, and returns the maintained metadata information to APPs. The shard processing unit CPU is responsible for receiving actual user data operation requests from APPs, completing the reading, writing and calculation of the user shard data it is responsible for, and returning the response to APP.
[0081] Fig.11 The second sharded concurrent processing framework is used to obtain APP shard metadata information, including the following steps:
[0082] The first step (corresponding to Fig.11 In step 112), in the APP startup mode, the APP sends a request for obtaining shard information to the database processing server.
[0083] The second step (corresponding to Fig.11 In step 114), the management CPU receives the APP's request for obtaining the shard information, and replies with the shard and corresponding processing unit information to the APP.
[0084] Step 3 (corresponding to Fig.11 In step 116), the APP receives the user data (corresponding to the above-mentioned database) returned by the management CPU, loads the corresponding processing unit information into the cache, and then enters the working mode.
[0085] Fig.12 The second business process under the sharded concurrent processing framework is given, including the following steps:
[0086] The first step (corresponding to Fig.12 In step 122), the APP application receives the client input request.
[0087] The second step (corresponding to Fig.12 In step 124), the APP reads the shard metadata information in the local cache to obtain the shard processing unit CPU information corresponding to the request. If successful, proceed to step 3; if unsuccessful, directly return a failure response to the client.
[0088] Step 3 (corresponding to Fig.12 In step 126), the APP calls the database driver to assemble a database request message and sends it to the corresponding shard processing unit CPU request queue.
[0089] Step 4 (corresponding to Fig.12In step 128), each shard processing unit CPU sequentially obtains requests from its own user request queue, processes them, and after processing, places the responses in the response queue corresponding to the CPU, and continues to take the next request for processing.
[0090] Step 5 (corresponding to Fig.12 In step 1210), the APP obtains the response in the response queue of the corresponding shard processing unit CPU.
[0091] Step 6 (corresponding to Fig.12 In step 1211), the APP response is returned to the user and the process ends.
[0092] Compared with the first sharded concurrent processing framework, the second framework reduces the first-level access forwarding in the process of processing real business requests, which is more efficient. However, the disadvantage is that the APP layer driver is more cumbersome and requires increased management and maintenance of shard metadata, which has a certain impact on flexibility. Specific embodiment 3
[0094] In this embodiment, a dynamically scalable sharded concurrent processing example is provided: Fig.13 As shown, an example of a sharded concurrent processing framework in which a CPU processing unit can be dynamically scalable is provided, including the following devices:
[0095] The database processing server, whose CPU includes but is not limited to the following four categories: metadata shard management CPU (corresponding to the above-mentioned management CPU), shard processing unit CPU (corresponding to the above-mentioned processing CPU), monitoring management CPU and space CPU. The metadata shard management CPU is responsible for maintaining metadata information management such as user data (corresponding to the above-mentioned database) shards, the relationship between user shards and corresponding shard processing unit CPUs. The metadata shard management CPU, on the one hand, receives metadata user requests from APPs and returns the maintained metadata information to APPs; on the other hand, it receives monitoring reports from the monitoring management CPU, and realizes dynamic adjustment of sharding rules and elastic scaling of shard processing CPUs according to the monitoring results, thereby realizing dynamic adjustment of database processing capabilities. The shard processing unit CPU is responsible for receiving actual user data operation requests from APPs, completing the reading, writing and calculation of the user shard data it is responsible for, and returning the response to APP. The monitoring management CPU regularly collects the operating load of each shard processing unit and the access status of each user data shard, and provides them to the shard management CPU for dynamic scaling of database processing capabilities on the one hand, and is used for monitoring operation and maintenance and performance reports on the other hand. Idle CPUs reserve shard processing resources to achieve elastic scaling. Specific embodiment 4
[0097] like Fig.14As shown, an example of a sharded concurrent processing framework in a distributed environment is provided, in which:
[0098] First, the distributed environment consists of a database processing server and management / access middleware (corresponding to the management CPU mentioned above).
[0099] Second, the management / access middleware is responsible for the user shard metadata management under the entire distributed cluster. It is also responsible for receiving user requests from each APP and routing them to the corresponding shard processing unit of the corresponding processing server according to the shard information.
[0100] Third, each processing server is composed of a group of shard processing unit CPUs (corresponding to the above-mentioned processing CPUs), and each shard processing unit CPU maintains the corresponding user shard data information. Furthermore, when the amount of user data shard data changes, or when the access hotspot of the user data shard changes, on the one hand, scheduling and scaling between shard processing units can be performed within the processing server, and on the other hand, scheduling and scaling of shard processing units can be performed between processing servers. Furthermore, the management / access middleware can choose a centralized or distributed deployment architecture based on the actual business volume.
[0101] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0102] Example 2
[0103] In the present embodiment, a processing device for a database is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0104] Fig.15 is a structural block diagram of a database processing device according to an embodiment of the present invention, such as Fig.15As shown, the device includes the following modules: a receiving module 152, used to receive a processing request for requesting processing of predetermined data in a database; a determining module 154, connected to the above-mentioned receiving module 152, used to determine a predetermined central processing unit CPU for processing the predetermined data; an indicating module 156, connected to the above-mentioned determining module 154, used to instruct the predetermined CPU to process the predetermined data according to the processing request.
[0105] In an optional embodiment, the above-mentioned device also includes: an acquisition module, which is used to obtain the correspondence between the data slice and the processing CPU before determining the predetermined CPU used to process the above-mentioned predetermined data; the above-mentioned determination module 154 includes: a first determination unit, which is used to determine the data slice to which the above-mentioned predetermined data belongs; and a second determination unit, which is used to determine the predetermined CPU corresponding to the data slice to which the predetermined data belongs based on the above-mentioned correspondence.
[0106] In an optional embodiment, the above-mentioned acquisition module can obtain the correspondence between the data shards and the processing CPUs through a first acquisition method or a second acquisition method, wherein the first acquisition method includes: sharding the data in the database, wherein there is no dependency between the data shards after sharding; assigning a corresponding processing CPU to each data shard; establishing a correspondence between the data shards and the assigned processing CPUs; the second acquisition method includes: receiving the correspondence from the management CPU.
[0107] In an optional embodiment, the above-mentioned device is also used to: after establishing the correspondence between the data shards and the assigned processing CPUs, perform at least one of the following operations under predetermined conditions, and re-establish the correspondence between the data shards and the assigned processing CPUs based on the executed operations: re-shard the data in the database, and re-configure the corresponding processing CPUs for each of the sharded data shards; reallocate the corresponding processing CPUs for the data shards in the database; wherein the reallocated processing CPUs include the original processing CPUs and / or the newly added processing CPUs, and the predetermined conditions include at least one of the following: determining that there is an imbalance in the processing CPU load based on the collected load information of each processing CPU and the processing information of the data in each data shard, and receiving a reallocation instruction.
[0108] In an optional embodiment, the total number of data shards after resharding the data in the above-mentioned database is less than the total number of data shards before resharding; or, the total number of data shards after resharding the data in the above-mentioned database is equal to the total number of data shards before resharding; or, the total number of data shards after resharding the data in the above-mentioned database is greater than the total number of data shards before resharding.
[0109] In an optional embodiment, when the correspondence between the data slice and the processing CPU includes the first acquisition method, the above-mentioned receiving module 152 can receive a processing request for requesting processing of predetermined data in the database in the following manner: receiving the processing request from the application APP.
[0110] In an optional embodiment, the above-mentioned indication module 156 is used to instruct the predetermined CPU to process the predetermined data according to the processing request in the following manner: placing the above-mentioned processing request in the request queue corresponding to the predetermined CPU to instruct the above-mentioned predetermined CPU to obtain the processing request from the request queue and process the predetermined data according to the processing request.
[0111] In an optional embodiment, the above-mentioned device is also used to: after receiving a processing request for requesting processing of predetermined data in a database, when it is determined that the predetermined data does not exist in the database, or there is no processing CPU to process the predetermined data, return an error response.
[0112] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0113] Example 3
[0114] In this embodiment, a database processing system is provided, which includes: a processor, two or more processing CPUs, and a database, wherein the processor is used to perform the following processing: receiving a processing request for requesting processing of predetermined data in the database; determining a predetermined central processing unit CPU for processing the predetermined data from the two or more processing CPUs; instructing the predetermined CPU to process the predetermined data according to the processing request; and the two or more processing CPUs are used to process the data in the database according to the request from the processor.
[0115] In an optional embodiment, the above-mentioned two or more processing CPUs are divided into two or more processing server groups, wherein each processing server group has the ability to expand or shrink the processing CPU within the group and to perform business scheduling between the processing CPUs within the group, and different processing server groups have the ability to schedule business.
[0116] In an optional embodiment, the above-mentioned processor is also used to obtain the correspondence between the data slice and the processing CPU before determining the predetermined CPU for processing the above-mentioned predetermined data; the above-mentioned processor can determine the predetermined CPU for processing the above-mentioned predetermined data in the following manner: determine the data slice to which the above-mentioned predetermined data belongs; determine the predetermined CPU corresponding to the data slice to which the above-mentioned predetermined data belongs according to the above-mentioned correspondence.
[0117] In an optional embodiment, the processor may obtain the correspondence between the data shards and the processing CPUs through a first acquisition method or a second acquisition method, wherein the first acquisition method includes: sharding the data in the database, wherein there is no dependency between the sharded data shards; assigning a corresponding processing CPU to each data shard; establishing a correspondence between the data shards and the assigned processing CPUs; and the second acquisition method includes: receiving the correspondence from the management CPU.
[0118] In an optional embodiment, the processor is further used to: after establishing the correspondence between the data shards and the assigned processing CPUs, perform at least one of the following operations under predetermined conditions, and re-establish the correspondence between the data shards and the assigned processing CPUs based on the executed operations: re-shard the data in the database, and re-configure the corresponding processing CPUs for each of the sharded data shards; reallocate the corresponding processing CPUs for the data shards in the database; wherein the reallocated processing CPUs include the original processing CPUs and / or the newly added processing CPUs, and the predetermined conditions include at least one of the following: determining that there is an imbalance in the processing CPU load based on the collected load information of each processing CPU and the processing information of the data in each data shard, and receiving a reallocation instruction.
[0119] In an optional embodiment, the total number of data shards after resharding the data in the above-mentioned database is less than the total number of data shards before resharding; or, the total number of data shards after resharding the data in the above-mentioned database is equal to the total number of data shards before resharding; or, the total number of data shards after resharding the data in the above-mentioned database is greater than the total number of data shards before resharding.
[0120] In an optional embodiment, when the correspondence between the data slice and the processing CPU includes the first acquisition method, the above-mentioned processor can receive a processing request for requesting processing of predetermined data in the database in the following manner: receiving the processing request from the application APP.
[0121] In an optional embodiment, the above-mentioned processor can instruct the above-mentioned predetermined CPU to process the predetermined data according to the above-mentioned processing request in the following manner: placing the processing request in the request queue corresponding to the predetermined CPU to instruct the predetermined CPU to obtain the processing request from the request queue and process the predetermined data according to the processing request.
[0122] In an optional embodiment, the processor is further used to: after receiving a processing request for requesting processing of predetermined data in a database, return an error response when it is determined that the predetermined data does not exist in the database or there is no processing CPU for processing the predetermined data.
[0123] Example 4
[0124] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0125] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0126] S1, receiving a processing request for requesting to process predetermined data in a database;
[0127] S2, determining a predetermined central processing unit CPU for processing the predetermined data, wherein the database includes more than two data shards, different data shards include different data, and different data shards correspond to different processing CPUs for processing the data in the data shards;
[0128] S3, instructing the predetermined CPU to process the predetermined data according to the processing request.
[0129] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0130] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0131] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0132] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0133] S1, receiving a processing request for requesting to process predetermined data in a database;
[0134] S2, determining a predetermined central processing unit CPU for processing the predetermined data, wherein the database includes more than two data shards, different data shards include different data, and different data shards correspond to different processing CPUs for processing the data in the data shards;
[0135] S3, instructing the predetermined CPU to process the predetermined data according to the processing request.
[0136] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0137] The following is an explanation of the relevant technical terms that may be involved in the present invention:
[0138] OLTP: On-Line Transaction Processing, also known as transaction-oriented processing, is characterized by the fact that a large number of user requests received concurrently by the foreground can be immediately transmitted to the computing center for processing, and the processing results can be given in a very short time. It is one of the ways to quickly respond to user operations.
[0139] ACID: refers to the abbreviation of the four basic elements for the correct execution of database transactions. Including: Atomicity, Consistency, Isolation, Durability. A database that supports transactions must have these four characteristics, otherwise the correctness of the data cannot be guaranteed during the transaction process, and the transaction process is likely to fail to meet the requirements of the transaction parties.
[0140] Lock: In traditional database architecture, multi-threaded concurrent access to the database introduces a control object for user data in order to ensure the ACID characteristics of the database. According to the granularity of the lock, it can be divided into table lock, row lock, column lock, gap lock, etc. According to the type of table, it can be divided into shared lock, exclusive lock, intention lock, etc.
[0141] Mutex: Mutex, in programming, the concept of object mutex is introduced to ensure the integrity of shared data operations. Each object corresponds to a tag called "mutex", which is used to ensure that only one thread can access or operate the object at any time.
[0142] Latch: latch, similar in function to Mutex, is also a mutual exclusion method, but different from Mutex in that it is lighter.
[0143] CPU core: CPU is the central processing unit of a computer. CPU core is the core chip in the middle of CPU, which is used to complete all calculations, receive / store commands, process data, etc. It is a digital processing core. With the development of CPU technology, the number of cores contained in a physical CPU is increasing. At present, a physical CPU includes up to 24 physical cores, and the number of physical cores of a CPU will continue to increase in the future. At present, most servers support hyper-threading technology, which can hyper-thread a CPU physical core into two CPU cores. The number of CPU cores seen in the operating system is twice the actual number of physical cores. The CPU described in the present invention, unless otherwise specified, refers to the CPU core, that is, the CPU core identified in the operating system.
[0144] It can be seen from the above specific embodiments that the present invention allows each CPU to execute user instructions concurrently without interference. Compared with the traditional concurrency control scheme, the present invention removes the lock access control of user data, the mutual exclusion control process of shared data structures and the context switching overhead, and the total number of CPU instructions is greatly reduced, so that the CPU can focus on processing the real requests of users, thereby giving full play to the processing power of each CPU, thereby achieving the following technical effects: the user request throughput of the entire system is improved. The request response delay of database transactions (for example, OLTP transactions) is reduced. The maintenance of Lock and Latch is removed, which greatly simplifies the processing logic of the database and reduces the implementation complexity. The complexity of realizing the complete ACID characteristics of the database is greatly reduced. The processing performance of the system is greatly improved, and the processing capacity of the entire system can be linearly expanded as the number of server CPUs increases. The user's investment cost-effectiveness is improved, that is, higher processing power can be obtained per unit investment.
[0145] 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.
[0146] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for processing a database, characterized in that: include: receiving a processing request for requesting processing of predetermined data in a database; Determining a predetermined CPU for processing the predetermined data, wherein the database includes more than two data shards, different data shards include different data, and different data shards correspond to different processing CPUs for processing the data in the data shards; instructing the predetermined CPU to process the predetermined data according to the processing request; Before determining the predetermined CPU for processing the predetermined data, the method further includes: obtaining a correspondence between the data slices and the processing CPU; The determining of the predetermined CPU for processing the predetermined data comprises: determining the data slice to which the predetermined data belongs; determining the predetermined CPU corresponding to the data slice to which the predetermined data belongs according to the corresponding relationship; The obtaining of the correspondence between the data slices and the processing CPUs includes: Slicing the data in the database, wherein the sliced data slices have no dependency relationship with each other; assigning a corresponding processing CPU to each data slice; and establishing a corresponding relationship between the data slices and the assigned processing CPUs; After the corresponding relationship between the data slices and the allocated processing CPUs is established, the method further includes: Perform at least one of the following operations under predetermined conditions, and re-establish the correspondence between the data shards and the allocated processing CPUs based on the operations after the execution: Re-sharding the data in the database, and re-configuring a corresponding processing CPU for each of the sharded data shards; reallocating corresponding processing CPUs for data slices in the database; The reallocated processing CPUs include the original processing CPUs and / or the newly added processing CPUs, and the predetermined condition includes at least one of the following: determining that there is an unbalanced processing CPU load based on the collected load information of each processing CPU and the processing information of the data in each data slice, and receiving a reallocation instruction; wherein the total number of data shards after resharding the data in the database is less than the total number of data shards before resharding; or, The total number of data shards after resharding the data in the database is equal to the total number of data shards before resharding; or, The total number of data shards after resharding the data in the database is greater than the total number of data shards before resharding.
2. The method according to claim 1, characterized in that: When obtaining the correspondence between the data slice and the processing CPU includes the first obtaining method, receiving a processing request for requesting to process predetermined data in the database includes: The processing request is received from the application APP.
3. The method according to claim 1, characterized in that Instructing the predetermined CPU to process the predetermined data according to the processing request includes: The processing request is placed in a request queue corresponding to the predetermined CPU to instruct the predetermined CPU to obtain the processing request from the request queue and process the predetermined data according to the processing request.
4. The method according to claim 1, characterized in that After receiving a processing request for requesting to process predetermined data in the database, the method further includes: When it is determined that the predetermined data does not exist in the database, or there is no processing CPU for processing the predetermined data, an error response is returned.
5. A database processing device, characterized in that: include: A receiving module, used for receiving a processing request for requesting to process predetermined data in a database; A determination module, used to determine a predetermined CPU for processing the predetermined data; an instruction module, used for instructing the predetermined CPU to process the predetermined data according to the processing request; An acquisition module, used for acquiring a correspondence between data slices and processing CPUs before determining a predetermined CPU for processing the predetermined data; Wherein, the determination module includes: A first determining unit is used to determine the data slice to which the predetermined data belongs; a second determining unit is used to determine the predetermined CPU corresponding to the data slice to which the predetermined data belongs according to the corresponding relationship; The acquisition module is specifically used to slice the data in the database, wherein there is no dependency between the sliced data slices; assign a corresponding processing CPU to each data slice; and establish a corresponding relationship between the data slices and the assigned processing CPUs; The device is further used to: after establishing the correspondence between the data shards and the allocated processing CPUs, perform at least one of the following operations under predetermined conditions, and re-establish the correspondence between the data shards and the allocated processing CPUs based on the executed operations: re-shard the data in the database, and re-configure the corresponding processing CPUs for each of the sharded data shards; re-allocate the corresponding processing CPUs for the data shards in the database; wherein the re-allocated processing CPUs include the original processing CPUs and / or the newly added processing CPUs, and the predetermined conditions include at least one of the following: determining that there is an unbalanced processing CPU load based on the collected load information of each processing CPU and the processing information of the data in each data shard, and receiving a re-allocation instruction; Among them, the total number of data shards after resharding the data in the database is less than the total number of data shards before resharding; or, the total number of data shards after resharding the data in the database is equal to the total number of data shards before resharding; or, the total number of data shards after resharding the data in the database is greater than the total number of data shards before resharding.
6. A database processing system, characterized in that: include: Processor, two or more processing CPU, database, where, The processor is used to perform the following processing: receiving a processing request for requesting to process predetermined data in the database; determining a predetermined CPU for processing the predetermined data from the two or more processing CPUs; instructing the predetermined CPU to process the predetermined data according to the processing request; The two or more processing CPUs are used to process the data in the database according to the request from the processor; The processor is further configured to obtain a correspondence between a data slice and a processing CPU before determining a predetermined CPU for processing the predetermined data; the processor may determine the predetermined CPU for processing the predetermined data in the following manner: determining the data slice to which the predetermined data belongs; determining the predetermined CPU corresponding to the data slice to which the predetermined data belongs according to the correspondence; The processor may obtain the correspondence between the data shards and the processing CPUs in the following manner: sharding the data in the database, wherein the sharded data shards have no dependency relationship with each other; assigning a corresponding processing CPU to each data shard; and establishing a correspondence between the data shards and the assigned processing CPUs; The processor is further used to: after establishing the correspondence between the data shards and the allocated processing CPUs, perform at least one of the following operations under predetermined conditions, and re-establish the correspondence between the data shards and the allocated processing CPUs based on the executed operations: re-shard the data in the database, and re-configure the corresponding processing CPUs for each of the sharded data shards; re-allocate the corresponding processing CPUs for the data shards in the database; wherein the re-allocated processing CPUs include the original processing CPUs and / or the newly added processing CPUs, and the predetermined conditions include at least one of the following: determining that there is an unbalanced processing CPU load based on the collected load information of each processing CPU and the processing information of the data in each data shard, and receiving a re-allocation instruction; Among them, the total number of data shards after resharding the data in the database is less than the total number of data shards before resharding; or, the total number of data shards after resharding the data in the database is equal to the total number of data shards before resharding; or, the total number of data shards after resharding the data in the database is greater than the total number of data shards before resharding.
7. The system according to claim 6, characterized in that The two or more processing CPUs are divided into two or more processing server groups, wherein each processing server group has the ability to expand or shrink the processing CPU within the group and to perform service scheduling between the processing CPUs within the group, and different processing server groups have the ability to schedule services.
8. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 4 when executed.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Load balance calculation method for distributed database adopting cross backups
CN104376087A
Network card data processing method and device in multi-CPU (Central Processing Unit) environment
CN105630731A
Database searching method and device
CN106776848A
Distributed database managing method and composition node thereof supporting dynamic sharding based on the metadata and data transaction quantity
US20140122510A1
Computer server able to support CPU virtualisation
WO2011053002A2
