Distributed database, message processing method and device and electronic equipment
By introducing the main service component control unit into the distributed database, message diversion is realized, and the performance bottleneck problem caused by message interaction of database management nodes is solved, processing performance and capacity are improved, and capacity is facilitated.
Patent Information
- Application Number
- CN202310793030.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2025-01-07
AI Technical Summary
In distributed databases, as the data scale grows, the CPU consumption caused by database management nodes due to message interaction becomes a bottleneck, limiting the database capacity and processing performance.
By introducing the main service component control unit, the distributed database networking framework is hierarchical and message diversion is realized, the processing pressure of database management nodes is reduced, performance bottlenecks are avoided, and processing performance is improved.
It effectively solves the performance bottleneck problem of database management nodes, improves the processing performance of distributed databases, facilitates capacity expansion, and improves capacity.
Smart Images

Figure CN119271737A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of databases, and in particular to a distributed database, a message processing method, a device and an electronic device. Background Art
[0002] The database supports multi-tenancy, and the data access and data storage of different tenants are isolated to ensure data security. Each tenant needs to have a corresponding tenant configuration, and the configuration information of the tenant configuration is used to specify the tenant ID, tenant name, primary and backup bureaus, and other information of the tenant. The power-on and message interaction of each module of the database depends on the correctness of the configuration information.
[0003] Distributed databases need to back up data, so there are multiple copies of data. Each tenant has a corresponding primary or backup office (for example, the primary and backup offices can be set up in different locations). The current networking mode is generally: the database has two offices, the primary office and the backup office, and each office has two tenants who back up data to each other. The business accesses the database through the client.
[0004] When the client executes the power-on process, it needs to obtain the configuration message from the database management node of the active station, and then obtain the distribution information and status information of the corresponding tenant's data node based on the tenant ID, tenant name, active and standby station information contained in the obtained configuration message, and finally reach the power-on success state.
[0005] Assuming there are 1,000 clients, when a single node of the database data switches state, the management node needs to send 1,000 notification messages to the client to notify it. If the state of the shards within 50 nodes switches, the management node needs to send 1,000*50 messages to the client in a short period of time.
[0006] It can be seen that there are always a lot of interactive messages between the database management node and other modules. When the database scale reaches a certain level, the CPU consumption of the database management node due to message interaction will become a bottleneck, which greatly limits the capacity and processing performance of the database. Summary of the invention
[0007] In order to solve the technical problem of reduced database capacity and processing performance caused by excessive message interactions in a traditional networking framework or at least partially solve the above technical problem, the present application provides a distributed database, a message processing method, a device and an electronic device.
[0008] In a first aspect, the present application provides a distributed database, including: a database management node, a main service component control unit, and multiple service components;
[0009] The database management node is in communication connection with the main service component control unit, and is used to send a first message to the main service component control unit, or receive a second message from the main service component control unit;
[0010] The main service component control unit is in communication connection with a plurality of service components, and is used to forward the first message to each of the service components, or forward the second message from each of the service components to the database management node;
[0011] The service component is used to receive the first message from the main service component control unit, or send the second message to the main service component control unit.
[0012] In a second aspect, the present application provides a message processing method, which is applied to a main service component control unit, comprising:
[0013] Receiving a first message from a database management node;
[0014] Forwarding the first message to each of the service components;
[0015] or,
[0016] receiving a second message from each of the service components;
[0017] The second message from each of the service components is forwarded to the database management node.
[0018] In a third aspect, the present application provides a message processing method, which is applied to a service component, including:
[0019] receiving the first message from the main service component control unit, where the first message is received by the main service component control unit from a database management node;
[0020] or,
[0021] The second message is sent to the main service component control unit so that the main service component control unit forwards the second message to the database management node.
[0022] In a fourth aspect, the present application provides a message processing device, which is applied to a main service component control unit, including:
[0023] A first receiving module, used to receive a first message from a database management node;
[0024] A first forwarding module, configured to forward the first message to each of the service components;
[0025] or,
[0026] A second receiving module, used for receiving a second message from each of the service components;
[0027] The second forwarding module is used to forward the second message from each of the service components to the database management node.
[0028] In a fifth aspect, the present application provides a message processing device, applied to a service component, including:
[0029] A third receiving module, configured to receive the first message from the main service component control unit, where the first message is received by the main service component control unit from a database management node;
[0030] or,
[0031] The first sending module is used to send the second message to the main service component control unit, so that the main service component control unit forwards the second message to the database management node.
[0032] In a sixth aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0033] Memory, used to store computer programs;
[0034] The processor is used to implement any message processing method described in the second aspect, or any message processing method described in the third aspect when executing the program stored in the memory.
[0035] In the seventh aspect, the present application provides a computer-readable storage medium, on which a program of a message processing method is stored. When the program of the message processing method is executed by a processor, the message processing method described in any one of the second aspects, or the steps of the message processing method described in any one of the third aspects, is implemented.
[0036] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:
[0037] The embodiment of the present application realizes the layering of the networking framework of the distributed database by using the main service component control unit, realizes the message diversion through the main service component control unit, reduces the processing pressure of the database management node due to message interaction, effectively solves the performance bottleneck problem of the database management node, improves the processing performance of the distributed database, and, since the occurrence of performance bottlenecks is avoided, it can be more convenient to expand the distributed capacity and increase the capacity of the distributed database. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0040] Figure 1 A physical networking architecture of a distributed database provided in an embodiment of the present application;
[0041] Figure 2 A logical architecture within a service component provided in an embodiment of the present application;
[0042] Figure 3 A flowchart of a message processing method provided in an embodiment of the present application;
[0043] Figure 4 A flowchart of another message processing method provided in an embodiment of the present application;
[0044] Figure 5 A schematic diagram of a combination of multiple service components provided in an embodiment of the present application;
[0045] Figure 6 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0047] When the database scale reaches a certain level, the CPU consumption of the database management node due to message interaction will become a bottleneck, which greatly limits the capacity and processing performance of the database. To this end, the embodiment of the present application provides a distributed database, message processing method, device and electronic device under the architecture of large-capacity networking, which solves the problem that the number of message interactions increases sharply due to distribution changes caused by state changes or expansion and contraction of database management nodes, and the performance reaches a bottleneck.
[0048] The embodiment of the present application provides a distributed database, which includes: a main office and a backup office, etc. In actual networking, there may be a network of multiple offices. Taking only the main office and the backup office as an example, the network architecture of the main office and the backup office is the same, wherein the main office or the backup office can be respectively as follows Figure 1 As shown, it includes: a database management node 11, a main service component control unit 12 and multiple service components 13, and the service component 13 includes a client;
[0049] The database management node 11 is in communication connection with the main service component control unit 12, and is used to send a first message to the main service component control unit 12, or receive a second message from the main service component control unit 12;
[0050] The main service component control unit 12 is in communication connection with the plurality of service components 13, and is used to forward the first message to each of the service components 13, or forward the second message from each of the service components 13 to the database management node 11;
[0051] The service component 13 is used to receive the first message from the main service component control unit 12, or send the second message to the main service component control unit 12.
[0052] In an embodiment of the present application, the service component is managed by the main service component control unit. The first message of the database management node is not sent directly to the service component, but is sent to the main service component control unit, and then forwarded to the service component by the main service component control unit; similarly, the second message of the service component is not sent directly to the database management node, but is sent to the main service component control unit, and then forwarded to the database management node by the main service component control unit, so that messages from different bureaus can be isolated.
[0053] The embodiment of the present application realizes physical layering of the networking framework of the distributed database by using the main service component control unit, realizes message diversion through the main service component control unit, reduces the processing pressure of the database management node caused by message interaction, effectively solves the performance bottleneck problem of the database management node, improves the processing performance of the distributed database, and, since the occurrence of performance bottlenecks is avoided, it can be more convenient to expand the distributed capacity and increase the capacity of the distributed database.
[0054] In one implementation of the present application, in order to facilitate data backup, each bureau has a primary service component control unit 12 and a backup service component control unit 14, that is, based on the aforementioned embodiment, the distributed database further includes: a backup service component control unit 14;
[0055] The backup service component control unit 14 is communicatively connected to multiple service components 13, and is used to forward the first message to each service component 13 when the main service component control unit 12 is not working, or forward the second message from each service component 13 to the database management node 11.
[0056] In order to make the data in the backup service component control unit 14 consistent with the data in the main service component control unit 12, when the main service component control unit 12 is working, the main service component control unit 12 can automatically synchronize the received first message or second message to the backup service component control unit 14.
[0057] Based on the scheme of the aforementioned embodiment, since the performance load of the main service component control unit 12 may increase as an "intermediate role", the service components 13 need to be grouped immediately. Therefore, in one embodiment of the present application, multiple service components 13 are divided into at least one service component combination 15. Exemplarily, every 20 (adjustable) service components 13 are grouped together, and a group leader, i.e., the main service component, is logically elected, and the remaining service components 13 are slave service components. That is to say, each service component combination 15 includes: a main service component and several slave service components, and the main service component is responsible for interacting with the main service component control unit 12 and forwarding messages to the remaining slave service components in the group.
[0058] The master service component is used to forward the first message to each of the slave service components, or forward the second message from each of the slave service components to the master service component control unit 12;
[0059] The slave service component is used to receive the first message from the master service component, or to send the second message to the master service component.
[0060] In order to further logically layer the networking framework of the distributed database, a multi-threaded mode can be adopted in the service component 13. In the multi-threaded mode, the main thread is responsible for external message interaction, and other auxiliary threads interact with the main thread message. Figure 2 As shown, in one embodiment of the present application, each of the service components 13 includes: a main process and multiple auxiliary processes;
[0061] The main process is used to forward the first message to each of the auxiliary processes, or forward the second message from each of the auxiliary processes to the main service component control unit 12;
[0062] The auxiliary process is used to receive the first message from the main process, or to send the second message to the main process.
[0063] In order to further logically layer the networking framework of the distributed database, a multi-threaded mode can be adopted in the service component 13. In the case of multiple processes, the main process is responsible for external message interaction, and the status information of the auxiliary process is provided by the main process. Figure 2 As shown, in one embodiment of the present application, the main process includes: an external interaction thread, a first main thread and a plurality of first auxiliary threads;
[0064] The external interaction thread is used to forward the first message to the first main thread and each of the auxiliary processes, or to forward the second message from the first main thread or each of the auxiliary processes to the auxiliary thread;
[0065] The first main thread is used to forward the first message to each of the first auxiliary threads, or forward the second message from each of the first auxiliary threads to the main service component control unit 12;
[0066] The first auxiliary thread is used to receive the first message from the first main thread, or to send the second message to the first main thread.
[0067] like Figure 2 As shown, the auxiliary process may include only one main thread. In one embodiment of the present application, the auxiliary process includes: a second main thread;
[0068] The second main thread is used to receive the first message from the external interaction thread, or send the second message to the external interaction thread.
[0069] like Figure 2 As shown, the auxiliary process includes not only a main thread but also auxiliary threads. In one embodiment of the present application, the auxiliary process also includes: a second auxiliary thread;
[0070] The second main thread is further used to forward the first message from the external interaction thread to the second auxiliary thread, or send the second message to the external interaction thread.
[0071] The second auxiliary thread is used to receive the first message from the second main thread, or send the second message to the second main thread.
[0072] After the above physical and logical layering, the message interaction pressure of each role in the distributed database networking framework is not high, which effectively solves the performance bottleneck problem of the database management node.
[0073] In another embodiment of the present application, Figure 3 and Figure 4 As shown, a message processing method is also provided, which is applied to the main service component control unit, including:
[0074] Step S101, receiving a first message from a database management node;
[0075] Step S102, forwarding the first message to each of the service components;
[0076] or,
[0077] Step S202, receiving a second message from each of the service components;
[0078] Step S203: forwarding the second message from each of the service components to the database management node.
[0079] Each time the main service component control unit sends a second message, it carries the grouping information (starting component identifier and terminating component identifier), and the service component does not need to store the grouping information. The second messages sent by the main service component control unit to all service components are the same, which can avoid repeated encoding and compression of messages. This requires that all grouping information needs to be carried in the second message. The second message carries the starting component identifier and terminating component identifier of each service component combination, but does not carry the component identifier of each service component. Therefore, the memory occupied by the grouping information needs to be as small as possible.
[0080] The embodiment of the present application uses the main service component control unit as an intermediate role to realize the diversion of the first message or the second message, reduce the processing pressure of the database management node due to message interaction, effectively solve the performance bottleneck problem of the database management node, and improve the processing performance of the distributed database. In addition, since the occurrence of performance bottlenecks is avoided, it can be more convenient to expand the distributed capacity and increase the capacity of the distributed database.
[0081] In another embodiment of the present application, the method further includes:
[0082] Obtaining a first quantity of the service components registered on itself;
[0083] In the case where the first number exceeds a minimum group number threshold, determining the number of groups according to the first number, the minimum group number threshold and the maximum group number threshold;
[0084] Further, the number of packets = min (maximum number of packets threshold, max (minimum number of packets threshold, sqrt (first number))).
[0085] The first number of service components are grouped according to the grouping quantity to obtain a plurality of service component combinations.
[0086] As an example, when the number of service components registered on the main service component control unit exceeds 20, grouping is required, and the number of groupings is min(33, max(20, sqrt(SC number))), that is, at least 20 groups and at most 33 groups, so that the number of service components in each group is basically balanced.
[0087] Further, the first number of the service components are grouped according to the number of groups to obtain a plurality of service component combinations, including:
[0088] Obtaining a component identifier of each of the service components;
[0089] sorting the first number of the service components according to the component identifiers;
[0090] The sorted identification sequences are grouped to obtain multiple service component combinations.
[0091] That is, all registered service components are sorted and grouped according to the globally unique identifier, that is, the component identifier.
[0092] In another embodiment of the present application, the method further includes:
[0093] For each service component combination, obtaining a state parameter of each service component in the service component combination;
[0094] A master service component and a slave service component in the service component combination are determined based on the state parameter of each of the service components.
[0095] Because when the main service component selected by the main service component control unit is unreachable, all slave service components in this group cannot receive the second message. In order to reduce this risk, the main service component control unit can only select a service component in normal status in the service component list as the group leader, that is, the main service component.
[0096] In another embodiment of the present application, the method further includes:
[0097] In the case that any of the service component combinations has a service component to be added or deleted, obtaining the time interval between the current moment and the moment when the second message was last received from the service component combination or the first message was last forwarded to the service component combination;
[0098] In the case that the time interval exceeds the preset time interval, it is allowed to add the service component to be added to the service component combination, or to delete the service component to be deleted from the service component combination.
[0099] When the service component composition changes, the two second messages will be sent through different paths, which may cause the messages to be out of order. To avoid this situation, the change of the service component composition is restricted:
[0100] If the time interval from the last message exceeds the preset time interval (eg, 5 seconds), the preset time interval is a safety interval and it can be considered that there is no notification message in transit, then the service component joining and exiting can be regrouped without restriction.
[0101] In another embodiment of the present application, the method further includes:
[0102] When the time interval does not exceed the preset time interval, determine whether the service component to be deleted is the main service component; the service component to be deleted refers to a service component that needs to exit the service component combination when it is deregistered due to timeout or the service component status is abnormal.
[0103] In the case where the service component to be deleted is a main service component, adjusting the starting component identifier of the service component combination, and determining the service component corresponding to the starting component identifier as a new main service component;
[0104] When the service component to be deleted is not the main service component, the service component is directly deleted.
[0105] If the exiting service component is not the group leader, for example Figure 5 ( Figure 5 The gray box in the middle is the service component that actually exists in the corresponding service component combination. If 4 or 5 exits group 1, there is no need to adjust the grouping immediately. The grouping can be adjusted to balance the group size when the time interval condition is met later. The exited service component is the group leader. For example, if 1 exits in the figure below, the starting component identifier of group 1 can be adjusted (4 becomes the new group leader), and other groups will not be adjusted. The grouping can be adjusted to balance the group size when the time interval condition is met later.
[0106] In another embodiment of the present application, the method further includes:
[0107] In the case that the time interval does not exceed the preset time interval, determining whether the service component to be added is located between the start component identifier and the end component identifier of the service component combination;
[0108] In the case where the service component to be added is located between the start component identifier and the end component identifier of the service component combination, directly adding the service component to be added to the service component combination;
[0109] When the service component to be added is not located between the starting component identifier and the ending component identifier of the service component combination, the starting component identifier or the ending component identifier is adjusted based on the component identifier of the service component to be added, and the service component to be added is added to the service component combination.
[0110] If the newly added service component is already within the scope of a service component combination, for example Figure 5 If 2 or 3 in the figure is added to group 1, there is no need to adjust the grouping immediately. The grouping can be adjusted to balance the group size when the time interval condition is met later. If the newly added service component is not within the scope of a group, for example, 6 or 7 in the figure below is added to group 1, the termination component identifier of group 1 can be adjusted (group 1 is expanded but the group leader of group 1 remains unchanged), and other groups are not adjusted. The grouping can be adjusted to balance the group size when the time interval condition is met later.
[0111] In another embodiment of the present application, Figure 3 and Figure 4 As shown, a message processing method is also provided, which is applied to a service component, including:
[0112] Step S103, receiving the first message from the main service component control unit, where the first message is received by the main service component control unit from a database management node;
[0113] or,
[0114] Step S201: Send the second message to the main service component control unit so that the main service component control unit forwards the second message to the database management node.
[0115] The embodiment of the present application realizes the main service component control unit as an intermediate role through message interaction between the service component and the main service component control unit, thereby diverting the first message or the second message, reducing the processing pressure of the database management node due to the message interaction, and effectively solving the performance bottleneck problem of the database management node, improving the processing performance of the distributed database, and because the occurrence of performance bottlenecks is avoided, it can be more convenient to expand the distributed capacity and increase the capacity of the distributed database.
[0116] In another embodiment of the present application, the method further includes:
[0117] Upon receiving the first message, extracting grouping information about at least one service component combination from the first message, the grouping information including: a start component identifier and an end component identifier;
[0118] Comparing the component identification of the self with the identification of each starting component;
[0119] When its component identifier is the same as any of the starting component identifiers, it determines itself as the main service component of the service component combination to which the starting component identifier belongs;
[0120] The first message is forwarded to slave service components corresponding to each component identifier between the start component identifier and the end component identifier.
[0121] When a service component receives a notification message, if its component ID matches the start component ID of a service component combination, then as the group leader, the main service component needs to forward the message to all members in the group, that is, the slave service components. The group leader obtains the component ID of the slave service component from the service component list. By default, all instantiated service components within the start component ID and end component ID range have been registered with the main service component control unit.
[0122] The main service component as the group leader does not forward messages depending on the power-on status of the job, the tenant, and the validity status of the configuration information. If a group has only one service component, the grouping information of the group does not need to be included in the second message.
[0123] In another embodiment of the present application, a message processing device is further provided, which is applied to a main service component control unit, including:
[0124] A first receiving module, used to receive a first message from a database management node;
[0125] A first forwarding module, configured to forward the first message to each of the service components;
[0126] or,
[0127] A second receiving module, used for receiving a second message from each of the service components;
[0128] The second forwarding module is used to forward the second message from each of the service components to the database management node.
[0129] In another embodiment of the present application, a message processing device is also provided, which is applied to a service component, including:
[0130] A third receiving module, configured to receive the first message from the main service component control unit, where the first message is received by the main service component control unit from a database management node;
[0131] or,
[0132] The first sending module is used to send the second message to the main service component control unit, so that the main service component control unit forwards the second message to the database management node.
[0133] In another embodiment of the present application, an electronic device is provided, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
[0134] Memory, used to store computer programs;
[0135] The processor is used to implement the message processing method described in any of the above method embodiments when executing the program stored in the memory.
[0136] In the electronic device provided by the embodiment of the present invention, the processor realizes the diversion of the first message or the second message through the main service component control unit as an intermediate role by executing the program stored in the memory, thereby reducing the processing pressure of the database management node caused by message interaction, effectively solving the performance bottleneck problem of the database management node, and improving the processing performance of the distributed database. In addition, since the occurrence of performance bottlenecks is avoided, it is easier to expand the distributed capacity and increase the capacity of the distributed database.
[0137] The communication bus 1140 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0138] The communication interface 1120 is used for communication between the above electronic device and other devices.
[0139] The memory 1130 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0140] The above-mentioned processor 1110 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0141] In another embodiment of the present application, a computer-readable storage medium is further provided, on which a program of a message processing method is stored. When the program of the message processing method is executed by a processor, the steps of the message processing method described in any of the aforementioned method embodiments are implemented.
[0142] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0143] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A distributed database, characterized in that: include: A database management node, a main service component control unit and multiple service components; The database management node is in communication connection with the main service component control unit, and is used to send a first message to the main service component control unit, or receive a second message from the main service component control unit; The main service component control unit is in communication connection with a plurality of service components, and is used to forward the first message to each of the service components, or forward the second message from each of the service components to the database management node; The service component is used to receive the first message from the main service component control unit, or send the second message to the main service component control unit.
2. The distributed database according to claim 1, characterized in that: Also includes: A standby service component control unit; The backup service component control unit is communicatively connected to multiple service components, and is used to forward the first message to each service component when the main service component control unit is not working, or forward the second message from each service component to the database management node.
3. The distributed database according to claim 1, characterized in that: The plurality of service components are divided into at least one service component combination, each service component combination comprising: a main service component and a plurality of slave service components; The master service component is configured to forward the first message to each of the slave service components, or forward the second message from each of the slave service components to the master service component control unit; The slave service component is used to receive the first message from the master service component, or to send the second message to the master service component.
4. The distributed database according to claim 1, characterized in that: Each of the service components includes: a main process and multiple auxiliary processes; The main process is used to forward the first message to each of the auxiliary processes, or to forward the second message from each of the auxiliary processes to the main service component control unit; The auxiliary process is used to receive the first message from the main process, or to send the second message to the main process.
5. The distributed database according to claim 4, characterized in that: The main process includes: an external interaction thread, a first main thread and a plurality of first auxiliary threads; The external interaction thread is used to forward the first message to the first main thread and each of the auxiliary processes, or to forward the second message from the first main thread or each of the auxiliary processes to the auxiliary thread; The first main thread is used to forward the first message to each of the first auxiliary threads, or to forward the second message from each of the first auxiliary threads to the main service component control unit; The first auxiliary thread is used to receive the first message from the first main thread, or to send the second message to the first main thread.
6. The distributed database according to claim 5, characterized in that: The auxiliary process includes: a second main thread; The second main thread is used to receive the first message from the external interaction thread, or send the second message to the external interaction thread.
7. The distributed database according to claim 6, characterized in that: The auxiliary process also includes: a second auxiliary thread; The second main thread is further used to forward the first message from the external interaction thread to the second auxiliary thread, or send the second message to the external interaction thread; The second auxiliary thread is used to receive the first message from the second main thread, or send the second message to the second main thread.
8. A message processing method, characterized in that: Applicable to the main service component control unit, including: Receiving a first message from a database management node; Forwarding the first message to each of the service components; or, receiving a second message from each of the service components; The second message from each of the service components is forwarded to the database management node.
9. The message processing method according to claim 8, characterized in that: The method further comprises: Obtaining a first quantity of the service components registered on itself; In the case where the first number exceeds a minimum group number threshold, determining the number of groups according to the first number, the minimum group number threshold and the maximum group number threshold; The first number of service components are grouped according to the grouping quantity to obtain a plurality of service component combinations.
10. The message processing method according to claim 9, characterized in that: The first number of service components are grouped according to the number of groups to obtain multiple service component combinations, including: Obtaining a component identifier of each of the service components; sorting the first number of the service components according to the component identifiers; The sorted identification sequences are grouped to obtain multiple service component combinations.
11. The message processing method according to claim 9, characterized in that: The method further comprises: For each service component combination, obtaining a state parameter of each service component in the service component combination; A master service component and a slave service component in the service component combination are determined based on the state parameter of each of the service components.
12. The message processing method according to claim 9, characterized in that: The method further comprises: In the case that any of the service component combinations has a service component to be added or deleted, obtaining the time interval between the current moment and the moment when the second message was last received from the service component combination or the first message was last forwarded to the service component combination; In the case that the time interval exceeds the preset time interval, it is allowed to add the service component to be added to the service component combination, or to delete the service component to be deleted from the service component combination.
13. The message processing method according to claim 12, characterized in that: The method further comprises: If the time interval does not exceed the preset time interval, determining whether the service component to be deleted is a main service component; In the case where the service component to be deleted is a main service component, adjusting the starting component identifier of the service component combination, and determining the service component corresponding to the starting component identifier as a new main service component; When the service component to be deleted is not the main service component, the service component is directly deleted.
14. The message processing method according to claim 12, characterized in that: The method further comprises: In the case that the time interval does not exceed the preset time interval, determining whether the service component to be added is located between the start component identifier and the end component identifier of the service component combination; In the case where the service component to be added is located between the start component identifier and the end component identifier of the service component combination, directly adding the service component to be added to the service component combination; When the service component to be added is not located between the starting component identifier and the ending component identifier of the service component combination, the starting component identifier or the ending component identifier is adjusted based on the component identifier of the service component to be added, and the service component to be added is added to the service component combination.
15. A message processing method, characterized in that: Applies to service components, including: Receiving a first message from a primary service component control unit, where the first message is received by the primary service component control unit from a database management node; or, A second message is sent to the main service component control unit so that the main service component control unit forwards the second message to the database management node.
16. The message processing method according to claim 15, characterized in that: The method further comprises: Upon receiving the first message, extracting grouping information about at least one service component combination from the first message, the grouping information including: a start component identifier and an end component identifier; Comparing the component identification of the self with the identification of each starting component; When its component identifier is the same as any of the starting component identifiers, it determines itself as the main service component of the service component combination to which the starting component identifier belongs; The first message is forwarded to slave service components corresponding to each component identifier between the start component identifier and the end component identifier.
17. A message processing device, characterized in that: Applicable to the main service component control unit, including: A first receiving module, used to receive a first message from a database management node; A first forwarding module, configured to forward the first message to each of the service components; or, A second receiving module, used for receiving a second message from each of the service components; The second forwarding module is used to forward the second message from each of the service components to the database management node.
18. A message processing device, characterized in that: Applies to service components, including: A third receiving module, configured to receive a first message from a primary service component control unit, where the first message is received by the primary service component control unit from a database management node; or, The first sending module is used to send a second message to the main service component control unit, so that the main service component control unit forwards the second message to the database management node.
19. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the message processing method described in any one of claims 8 to 14, or the message processing method described in any one of claims 15 to 16 when executing the program stored in the memory.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program of a message processing method, and when the program of the message processing method is executed by a processor, the message processing method described in any one of claims 8 to 14, or the steps of the message processing method described in any one of claims 15 to 16 is implemented.