Distributed database operation separation method and apparatus, database, and electronic device
By collecting target local parameters in a distributed database and determining the storage mechanism, the relative separation and independent storage of each database are achieved, solving the problem of integrated data storage and retrieval methods in existing technologies, and improving the orderliness of data storage and retrieval speed.
Patent Information
- Application Number
- CN202210504301.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-10
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-05-10
AI Technical Summary
Existing distributed databases fail to implement differentiated operations across multiple subsystems, resulting in a unified data storage and retrieval method that cannot effectively improve the orderliness of data storage and retrieval speed.
By collecting the target local parameters of the distributed database, using the current parameters of the local database and the remote database, the respective storage mechanisms are determined, and data is stored and retrieved in the local database and the remote database according to these mechanisms, thereby achieving relative separation of the various databases.
It enables independent storage and differentiated retrieval of each database based on shared data, improving the orderliness of data storage and retrieval speed.
Smart Images

Figure CN117076552B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data storage technology, and in particular to a method, apparatus, database, and electronic device for separating distributed database operations. Background Technology
[0002] Distributed database systems typically use smaller computer systems, with each computer located in a separate place. Each computer may have a complete or partial copy of the DBMS (Database Management System) and its own local database. Many computers located in different locations are interconnected through a network to form a complete, global, logically centralized, but physically distributed large database.
[0003] Existing distributed databases use a sharing mechanism for data sharing, including shared storage mechanisms, meaning that all databases in a distributed database adopt a unified storage model. Thus, during a search, any node entering the distributed database from the query port can read content from any database, and the reading method is the same across all databases. This makes the databases in a unified manner, preventing existing distributed databases from implementing differentiated subsystems and thus hindering the separation of system operations. Summary of the Invention
[0004] This invention provides a distributed database operation separation method, apparatus, database, and electronic device, which can differentiate between various databases in a distributed database based on shared data, and read data from each different database according to different storage mechanisms.
[0005] In a first aspect, embodiments of the present invention provide a method for separating distributed database operations, wherein the distributed database includes a local database and a remote database, and the method includes:
[0006] When obtaining local input data to be stored, the target local parameters of the distributed database are collected, wherein the target local parameters include the current local parameters of the local database and the current local parameters of the remote database.
[0007] The local input data and the target local parameters are input into a predetermined storage model in the local database to output a storage mechanism corresponding to the local input data. The storage mechanism is used to determine the storage location corresponding to the local input data in the local database and the remote database.
[0008] According to the storage mechanism, the local input data is stored in the local database and the remote database.
[0009] Secondly, embodiments of the present invention provide a local database, including: a local data input terminal, a local parameter acquisition terminal, and a storage model, wherein the local database can be connected to a remote database, wherein:
[0010] The local data input terminal is used to receive local input data and input the local input data into the storage model;
[0011] The local parameter acquisition terminal is used to obtain the target local parameters of the distributed database and input the target local parameters into the storage model; wherein, the target local parameters include the current local parameters of the local database and the current local parameters of the remote database;
[0012] The storage model is used to determine the storage mechanism corresponding to the local input data based on the local input data and the target local parameters, and to store the local input data in the local database and the remote database according to the storage mechanism; wherein, the storage mechanism is used to determine the storage location corresponding to the local input data in the local database and the remote database.
[0013] Thirdly, embodiments of the present invention provide an electronic device, including:
[0014] Processor; and
[0015] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the following steps:
[0016] When obtaining local input data to be stored, the target local parameters of the distributed database are collected, wherein the target local parameters include the current local parameters of the local database and the current local parameters of the remote database.
[0017] The local input data and the target local parameters are input into a predetermined storage model in the local database to output a storage mechanism corresponding to the local input data. The storage mechanism is used to determine the storage location corresponding to the local input data in the local database and the remote database.
[0018] According to the storage mechanism, the local input data is stored in the local database and the remote database.
[0019] The embodiments of the present invention adopt the following technical solutions:
[0020] When obtaining local input data to be stored, the target local parameters of the distributed database are collected, wherein the target local parameters include the current local parameters of the local database and the current local parameters of the remote database.
[0021] The local input data and the target local parameters are input into a predetermined storage model in the local database to output a storage mechanism corresponding to the local input data. The storage mechanism is used to determine the storage location corresponding to the local input data in the local database and the remote database.
[0022] According to the storage mechanism, the local input data is stored in the local database and the remote database.
[0023] The above-described at least one technical solution adopted in the embodiments of the present invention can achieve the following beneficial effects:
[0024] This invention, based on the different content of the local input data to be stored, collects different target local parameters from the distributed database when obtaining the local input data. By inputting different target local parameters and different local input data into a predetermined storage model in the local database, a storage mechanism conforming to the local data storage mode can be obtained. The local input data is then stored according to this storage mechanism, enabling the local input data stored in the distributed database to possess the characteristics of the local database storage mode. This achieves the solidification of the local database storage mode, formally making each database in the distributed database independent and distinct, and achieving relative separation of each database in the distributed database while sharing data. Each database in the distributed database of this invention has its own predetermined storage model, and each piece of data stored in the distributed database is stored based on a storage mechanism determined by different storage models, thus improving the orderliness of data storage. When reading data, different databases can be read according to different storage modes, effectively improving the data reading speed. Attached Figure Description
[0025] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0026] Figure 1 This is a flowchart illustrating the steps of the distributed database operation separation method according to an embodiment of the present invention.
[0027] Figure 2 This is a schematic diagram of some functional modules of a local database according to an embodiment of the present invention;
[0028] Figure 3 This is a schematic diagram showing the connection of the functional modules of a local database according to an embodiment of the present invention;
[0029] Figure 4 This is a schematic diagram of the structure of a distributed database according to an embodiment of the present invention;
[0030] Figure 5 This is a schematic diagram of a method for generating or updating system parameters according to an embodiment of the present invention;
[0031] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention;
[0032] Explanation of reference numerals in the attached figures:
[0033] 201-Local data input terminal, 202-Local parameter acquisition terminal, 203-Storage model, 204-Model building system, 205-Local information source, 206-System parameter input terminal, 207-Sub-database cluster, 208-Local data copy, 209-Parameter fusion system. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0035] The technical solutions provided by the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0036] Example 1:
[0037] refer to Figure 1 , Figure 1 The flowchart of the distributed database operation separation method according to an embodiment of the present invention is shown. The distributed database may include a local database and a remote database.
[0038] In various embodiments of this invention, the distributed database may contain multiple databases, with local database and remote database being just any one of these databases. Specifically, a local database refers to the database currently accessed by a user and undergoing a query operation, such as the database currently receiving local input parameters to be stored. A remote database refers to any database in the distributed database other than the local database. Any database in the distributed database can be either a local database or a remote database; the terms "local database" and "remote database" are relative. For example, at any given time, a database may be considered a local database for one user, but a remote database may be considered a database being operated on by other users.
[0039] like Figure 1 As shown, the method may include the following steps:
[0040] Step S102: When obtaining the local input data to be stored, collect the target local parameters of the distributed database, wherein the target local parameters include the current local parameters of the local database and the current local parameters of the remote database.
[0041] Local input data refers to the data currently received by the local database. Specifically, it can be the attribute data of the local information source accessed by the local database, the data generated during operation, and the data received or sent. The local information source is the data acquisition endpoint where the local database is located. For example, if the local information source is a motor, the local input data can be the motor's own attribute parameters; if the local information source is a sensor, the local input data can be the parameters collected by the sensor; if the local information source is a counter, the local input data can be the data collected by the counter. The specific data content is not limited in this embodiment of the invention.
[0042] The local parameters of the local database can be parameters specific to the local database itself, such as its address and storage space. The local parameters of the remote database can also be parameters specific to the remote database itself, such as its address and storage space. Due to various factors, the local parameters of the database may differ at different times. Therefore, in this embodiment of the invention, the local database can collect both the current local parameters of the local database and the current local parameters of the remote database upon receiving local input data.
[0043] Step S104: Input the local input data and target local parameters into a predetermined storage model in the local database to output a storage mechanism corresponding to the local input data. The storage mechanism is used to determine the storage location of the local input data in the local database and the remote database.
[0044] In this embodiment of the invention, the storage model refers to a model used to determine the storage strategy. After obtaining local input data and target local parameters, the storage model obtains information such as the data volume and importance of the local input data, and learns information such as the storage address and current storage space of the local database from the current local parameters of the local database in the target local parameters, and learns information such as the storage address and current storage space of the remote database from the current local parameters of the remote database in the target local parameters. Then, based on the information such as the data volume and importance of the local input data, the storage address and current storage space of the local database, and the storage address and current storage space of the remote database, the storage model can determine the storage location in the local database and the storage location in the remote database where the local input data is stored, and then store the local input data in the local database and the remote database respectively according to the storage location.
[0045] Step S106: According to the storage mechanism, the local input data is stored in the local database and the remote database.
[0046] Based on the storage locations of the local input data in the local database and the remote database determined in step S104, in step S106, this embodiment of the invention specifically performs the storage of the local input data, that is, stores the local input data in the storage locations of the local database and the remote database.
[0047] In summary, based on the different content of the local input data to be stored and the different target local parameters collected from the distributed database when obtaining the local input data, different target local parameters and different local input data are input into a predetermined storage model in the local database. This allows for the determination of a storage mechanism that conforms to the local data storage mode for the local input data. Storing the local input data according to this mechanism enables the local input data stored in the distributed database to possess the characteristics of the local database storage mode, thus solidifying the local database storage mode. This formally distinguishes and separates the various databases within the distributed database, achieving relative separation of the databases while maintaining shared data. In this invention, each database in the distributed database has its own predetermined storage model, and the data stored in the distributed database is stored based on the storage mechanism determined by different storage models, thereby improving the orderliness of data storage. When reading data, different databases can be read according to different storage modes, effectively improving the data reading speed.
[0048] In one or more embodiments of the present invention, the following method is also provided:
[0049] Step 11: Before inputting the target local parameters into the predetermined storage model in the local database, determine whether the target local parameters need to be compensated by introducing system parameters.
[0050] Normally, the storage location of the local input data can be determined based on the local input data and the target local parameters as described above, which satisfy the storage model in the local database. However, if the collected target local parameters do not contain relevant parameters for determining the storage location of the data to be stored, or if the relevant parameters are not accurate, this embodiment of the invention proposes to use system parameters for compensation.
[0051] Step 12: If the target local parameters need to be compensated by introducing system parameters, obtain the system parameters from the local database;
[0052] The system parameters can be sourced from the following sources:
[0053] Collect the initial local parameters of the local database and the initial local parameters of the remote database;
[0054] System parameters are generated based on the initial local parameters of the local database and / or the initial local parameters of the remote database.
[0055] Specifically, the initial local parameters of the local database can refer to the local parameters collected in the last time or the local parameters collected in the very first time. Which local parameters to use depends on whether they contain parameters related to determining the storage location of the data to be stored. Similarly, the initial local parameters of the remote database can refer to the local parameters received from the remote database in the last time or the local parameters received from the remote database in the very first time. Which remote parameters to use depends on whether they contain parameters related to determining the storage location of the data to be stored. This embodiment of the invention can generate system parameters based solely on the initial local parameters of the local database, or solely on the initial local parameters of the remote database, or by combining the initial local parameters of both the local and remote databases.
[0056] The generated system parameters can be stored in a local database or a remote database in advance.
[0057] Step 13: Merge the target local parameters and system parameters to generate adjusted parameters with the target local parameters as the main component and the system parameters as the auxiliary component.
[0058] When the target local parameters need to be compensated by introducing system parameters, the implementation steps of step S104 may include: inputting the local input data and the adjusted parameters into a predetermined storage model in the local database, so as to output a storage mechanism corresponding to the local input data.
[0059] In this embodiment of the invention, after receiving the target local parameters and system parameters, the local database uses the current local parameters of the local database and the current local parameters of the remote database as the primary parameter and the system parameters as the secondary parameter to form complete parameter data, namely the adjusted parameters. Then, based on the adjusted parameters and the local input data, the storage model in the local database is input, thus obtaining a storage mechanism corresponding to the local input data that conforms to the local data storage mode.
[0060] In one embodiment of the present invention, a method for updating system parameters is further provided:
[0061] Step 21: When a new database is added as a remote database and connected to the distributed database, obtain the relevant parameters of the new database.
[0062] Step 22: Update system parameters based on the relevant parameters of the newly added database.
[0063] In this embodiment of the invention, when a new database is added to the shared network of the distributed database, the local database can send a request to the new database to obtain relevant parameters. The new database will collect its own local parameters as relevant parameters and return them to the local database. After receiving the relevant parameters from the new database, the local database re-analyzes and calculates the new system parameters, thus updating the system parameters. Compared with the method of updating system parameters at a fixed frequency, this embodiment of the invention can reduce the number and frequency of system parameter calculations, thereby reducing the system's computational load.
[0064] In one embodiment of the present invention, another method for updating system parameters is further provided:
[0065] Step 31: When the target local parameters are collected, compare the target local parameters with the historical local parameters of the distributed database collected in the previous step.
[0066] Step 32: If there is a difference between the target local parameters and the historical local parameters, update the system parameters according to the target local parameters.
[0067] Due to factors such as database performance, environment, and other influences, the local parameters collected each time may not be the same as those collected previously. Therefore, after collecting the target local parameters, these parameters can be compared with the historical local parameters of the previously collected distributed database. Specifically, the current local parameters of the local database are compared with its historical parameters, and the current local parameters of the remote database are compared with its historical parameters to determine if at least one of them differs. That is, if there is a difference between the current local parameters and their historical values, the current local parameters of the local database can be re-analyzed to obtain new system parameters; similarly, if there is a difference between the current local parameters and their historical values of the remote database, the current local parameters of the remote database can be re-analyzed to obtain new system parameters; and if both the local and remote local parameters differ from their historical values, the current local parameters of both databases can be combined to calculate new system parameters. Compared with the method of updating system parameters at a fixed frequency, the embodiments of the present invention can reduce the number and frequency of system parameter calculations and reduce the amount of system computation.
[0068] Example 2:
[0069] Based on the same inventive concept, in order to realize the aforementioned distributed database operation separation method, this embodiment of the invention also provides a local database.
[0070] refer to Figure 2 , Figure 2 A schematic diagram of some functional modules of a local database 1 according to an embodiment of the present invention is shown, including: a local data input terminal 201, a local parameter acquisition terminal 202, and a storage model 203. The local database 1 can connect to a remote database, wherein:
[0071] Local data input terminal 201 is used to receive local input data and input the local input data into storage model 203;
[0072] The local parameter acquisition terminal 202 is used to obtain the target local parameters of the distributed database and input the target local parameters into the storage model 203; wherein, the target local parameters include the current local parameters of the local database 1 and the current local parameters of the remote database;
[0073] Storage model 203 is used to determine the storage mechanism corresponding to the local input data based on the local input data and the target local parameters, and to store the local input data in the local database 1 and the remote database according to the storage mechanism; wherein, the storage mechanism is used to determine the storage location corresponding to the local input data in the local database 1 and the remote database.
[0074] In this embodiment of the invention, the local data input terminal 201 can be understood as the data access port of the local database 1, such as an external USB flash drive or related transmission interface. In one embodiment of the invention, a method is provided for the local data input terminal 201 to obtain local input data. Specifically:
[0075] A local information source is defined as the data acquisition endpoint located at the location of local database 1. Local input data includes the local information source's own attribute data, operationally generated data, and received or transmitted data. The local information source is connected to local data input terminal 201 and is used to send its own attribute data, operationally generated data, and received or transmitted data as local input data to local data input terminal 201. The data acquisition endpoint can be the entire device or a portion of its components located at the location of local database 1; for example, a portion of the components could be a sensor, counter, motor, etc.
[0076] The local parameter acquisition terminal 202 is used to acquire local parameters from the local database 1 or receive local parameters from a remote database. For details on the specific structure of the local parameter acquisition terminal 202 and how it can receive local parameters from a remote database, please refer to the following text.
[0077] In this embodiment of the invention, the communication relationship between the local data input terminal 201, the local parameter acquisition terminal 202, and the storage model 203 can be specifically implemented in the following ways: 1) The local data input terminal 201 and the local parameter acquisition terminal 202 are directly connected to the storage model 203 to input local input data and target local parameters into the storage model 203 respectively; 2) The local data input terminal 201 is connected to the local parameter acquisition terminal 202, and the local parameter acquisition terminal 202 is directly connected to the storage model 203, so that the local data input terminal 201 indirectly inputs local input data into the storage model 203 through the local parameter acquisition terminal 202; 3) The local data input terminal 201 is connected to the local parameter acquisition terminal 202, and the local data input terminal 201 is directly connected to the storage model 203, so that the local parameter acquisition terminal 202 indirectly inputs the target local parameters into the storage model 203 through the local data input terminal 201; 4) Preferably, the local database 1 in this embodiment of the invention may further include a model building system. (See reference...) Figure 3 This diagram illustrates the connection of functional modules of a local database 1 according to an embodiment of the present invention. Figure 3In this system, the model building system 204 is connected to the storage model 203, while the local parameter acquisition terminal 202 is directly connected to the model building system 204. The local data input terminal 201 is directly connected to the local parameter acquisition terminal 202, and the local information source 205 is connected to the local data input terminal 201. Thus, the local input data received by the local data input terminal 201 is indirectly input into the storage model 203 through the local parameter acquisition terminal 202 and the model building system 204. The target local parameters obtained by the local parameter acquisition terminal 202 are indirectly input into the storage model 203 through the model building system 204.
[0078] In this embodiment of the invention, after obtaining local input data and target local parameters, storage model 203 obtains information such as the data volume and importance of the local input data, and learns the storage address and current storage space of local database 1 from the current local parameters of local database 1 in the target local parameters, and learns the storage address and current storage space of remote database from the current local parameters of remote database in the target local parameters. Then, storage model 203 can determine the storage location in local database 1 and remote database where the local input data is stored, based on the data volume and importance of the local input data, the storage address and current storage space of local database 1, and the storage address and current storage space of remote database. Then, the local input data is stored in local database 1 and remote database respectively according to the storage location determined by the storage mechanism. Finally, the local input data is stored in local database 1 and remote database according to the storage location determined by the storage mechanism.
[0079] In summary, based on the different content of the local input data to be stored and the different target local parameters collected from the distributed database when obtaining the local input data, different target local parameters and different local input data are input into the predetermined storage model 203 in local database 1. This allows for the acquisition of a storage mechanism that conforms to the local data storage mode for the local input data. By storing the local input data according to this storage mechanism, the local input data stored in the distributed database can be made to carry the characteristics of the local database 1 storage mode, thus solidifying the local database 1 storage mode. This formally distinguishes and separates the various databases in the distributed database, achieving relative separation of the various databases in the distributed database while maintaining shared data. In this invention, each database in the distributed database has its own predetermined storage model 203, and the data stored in the distributed database is stored based on the storage mechanism determined by different storage models 203, thereby improving the orderliness of data storage. When reading data, different databases can be read according to different storage modes, effectively improving the data reading speed.
[0080] refer to Figure 4 The diagram illustrates the structure of a distributed database according to an embodiment of the present invention, as shown below. Figure 4 As shown, the local database 1 can connect to the remote database 2 in the following ways:
[0081] Local database 1 is equipped with a local network interface and a remote network interface. When the local network interface of local database 1 is connected to the local network interface of remote database 2, a local network node is formed at the connection point. When the remote network interface of local database 1 is connected to the remote network interface of remote database 2, a remote network node is formed at the connection point.
[0082] In this embodiment of the invention, local database 1 can obtain local parameters from remote database 2 through the same-domain network node and the different-domain network node. Possible ways for the local parameter acquisition terminal 202 to receive local parameters from remote database 2 include: 1) the local parameter acquisition terminal 202 can be directly connected to the same-domain network node and the different-domain network node, thus directly obtaining the local parameters of remote database 2 through the same-domain network node and the different-domain network node; 2) the local parameter acquisition terminal 202 connects to the same-domain network node and the different-domain network node through other media, and then the other media sends the local parameters of remote database 2 from the same-domain network node and the different-domain network node to the local parameter acquisition terminal 202; such as the parameter fusion system described later. The parameter fusion system can be directly connected to network nodes in the same domain and network nodes in different domains. The local parameter acquisition terminal 202 can send the command to collect the current local parameters of the remote database 2 to the network nodes in the same domain and network nodes in different domains through the parameter fusion system. The network nodes in the same domain and network nodes in different domains will then transmit the command to the remote database 2. The remote database 2 will then collect its current local parameters and transmit them to the network nodes in the same domain and network nodes in different domains. In this way, the parameter fusion system can obtain the current local parameters of the remote database 2 from the network nodes in the same domain and network nodes in different domains and send them to the local parameter acquisition terminal 202.
[0083] In one embodiment of the present invention, the optional specific structure of the local parameter acquisition terminal 202 is improved:
[0084] The local parameter acquisition terminal 202 may include: an input unit, a recognition unit connected to the input unit, and a deletion unit and a classification unit respectively connected to the recognition unit, wherein:
[0085] The input unit is used to receive local parameters from local database 1;
[0086] The identification unit is used to distinguish whether the local parameters of local database 1 are valid or invalid data. If the local parameters of local database 1 are valid data, the local parameters of local database 1 are sent to the classification unit. If the local parameters of local database 1 are invalid data, the local parameters of local database 1 are sent to the deletion unit.
[0087] The deletion unit is used to delete the local parameters received from local database 1;
[0088] The classification unit can be connected to the model building system 204 to classify the local parameters of the local database 1 and send the classified local parameters of the local database 1 to the model building system 204 so that the model building system 204 can input the local parameters of the local database 1 into the storage model 203.
[0089] Through the specific structure of the local parameter acquisition terminal 202 in this embodiment of the invention, useless data can be filtered out and the data can be screened to obtain effective local parameters.
[0090] In this embodiment of the invention, the classification unit can also be connected to the parameter fusion system 209, so that the local parameters of the local database 1 can be sent to other remote databases 2 through the parameter fusion system 209 to realize the distributed database operation separation method as described in this embodiment of the invention; similarly, the classification unit can also obtain the local parameters of the remote database 2 from the local parameter acquisition terminal 202 as described in this embodiment of the invention through the parameter fusion system.
[0091] In one embodiment of the present invention, when system parameters need to be introduced for compensation corresponding to the target local parameters, the local database 1 can be implemented according to the following functional modules, which can be further referred to. Figure 3 The local database 1 also includes: a system parameter input terminal 206 and a model building system 204. The model building system 204 is connected to the local parameter acquisition terminal 202, the system parameter input terminal 206, and the model storage terminal 203, respectively.
[0092] System parameter input terminal 206 is used to receive system parameters;
[0093] The model building system 204 is used to receive the target local parameters sent by the local parameter acquisition terminal 202 and the system parameters sent by the system parameter input terminal 206. When the target local parameters need to be compensated by introducing system parameters, the system system parameters are fused to generate adjusted parameters with the target local parameters as the main parameter and the system parameters as the auxiliary parameter. The local input data and the adjusted parameters are then input into the storage model 203 to output a storage mechanism corresponding to the local input data.
[0094] In this embodiment of the invention, when the target local parameters need to be compensated by introducing system parameters, adjusted parameters are obtained, with the target local parameters as the primary component and the system parameters as secondary components. This can be achieved by the model building system 204 communicating with the local parameter acquisition terminal 202 and the system parameter input terminal, respectively. These adjusted parameters provide more complete parameter data, fundamentally distinguishing and differentiating the various databases in the distributed database, thereby obtaining a storage mechanism corresponding to the local input data that conforms to the local data storage mode.
[0095] In one embodiment of the present invention, reference is made to... Figure 5 , Figure 5 This diagram illustrates a method for generating or updating system parameters according to an embodiment of the present invention. The local database 1 may further include:
[0096] The parameter fusion system 209 is connected to the local parameter acquisition terminal 202 and the system parameter input terminal 206 respectively, and the parameter fusion system 209 can also be connected to the remote database 2.
[0097] The parameter fusion system 209 is used to receive local parameters from local database 1 sent by local parameter acquisition terminal 202 and remote parameters sent by remote database 2, and to generate or update system parameters for local or remote parameters, and send the system parameters to system parameter input terminal 206.
[0098] The remote parameter can be a parameter related to the newly added database or the current local parameter of remote database 2. Thus, the parameter fusion system 209 can generate system parameters based on the specific content of the remote parameter and the specific content of the local parameter, or update the system parameters according to steps 21-22, or steps 31-32. The specific generation and updating steps of the system parameters will not be elaborated upon here. After generating or updating the system parameters, the parameter fusion system 209 can send the system parameters to the system parameter input terminal 206.
[0099] In one embodiment of the present invention, reference is made to... Figure 3 Storage model 203 executes the process of storing local input data into local database 1 and remote database 2 according to this storage mechanism, as well as the process of sharing data with remote database 2, as follows:
[0100] Local database 1 also includes: a sub-database set 207 and a local data replica 208, each connected to storage model 203. The sub-database cluster 207 can connect to the remote database 2, wherein:
[0101] Storage model 203 is used to process local input data and, according to the storage mechanism, store the processed local input data as local data packets in the storage locations corresponding to the local input data in sub-database cluster 207 and local data replica 208 respectively; and store remote data packets input from sub-database cluster 207 in local data replica 208.
[0102] Sub-database cluster 207 is used to store local data packets at the storage location corresponding to the local input data, back up the local data packets and share them to the remote database 2, and receive remote data packets from the remote database 2 and input the remote data packets into the storage model 203;
[0103] Local data copy 208 is used to store local data packets and remote data packets stored in storage model 203, and to generate shared data packets containing local data packets and remote data packets, and to share the shared data packets to remote database 2.
[0104] In this embodiment of the invention, the sub-database cluster serves as the storage core of the local database 1. The sub-database cluster contains multiple sub-databases used for categorizing and storing local data information, and for sharing this local data information with nodes in the same and different domain networks, establishing a data sharing mechanism. The storage location corresponding to the local input data in the sub-database cluster can be one or more sub-databases specified within that sub-database cluster. The categorization of the sub-database cluster is not the focus of this invention and will not be elaborated upon here.
[0105] refer to Figure 4 The distributed database structure shown allows the sub-database cluster to connect to both local and remote network nodes of the local database 1. This allows the sub-database cluster to share local data packets (i.e., local data information) stored in storage model 203 with both local and remote network nodes, thereby sharing these local data packets with the remote database 2. Similarly, the sub-database cluster can receive remote data packets from local network nodes and / or remote network nodes in the remote database 2 and send them to storage model 203 of the local database 1. Storage model 203 then distributes the remote data packets to local data replicas, achieving data backup for the remote database 2. During this backup process, since the backup of the remote data packets also undergoes processing by storage model 203 of the local database 1, the backup of the remote data packets is more consistent with the storage mode of the local database 1.
[0106] In this embodiment of the invention, the local data copy can be directly connected to both the same-domain network node and the different-domain network node, thereby enabling the generation of shared data packets containing local and different-domain data packets to be sent to the remote database 2 through the same-domain network node and the different-domain network node. Alternatively, it can be done as follows: Figure 6 As shown, the local data copy is connected to the sub-database cluster. In this way, the local data copy shares the shared data packets to the same-domain network node and the different-domain network node through the sub-database cluster, thereby realizing the sharing of shared data packets to the remote database 2.
[0107] In this embodiment of the invention, the local database 1 may be equipped with a search module and a display module;
[0108] The search module is used to read the target stored data in the distributed database when the content to be queried is obtained, according to the target storage mechanism corresponding to the target stored data related to the content to be queried, with the local database 1 as the base point and along the same domain network nodes and different domain network nodes as the search path; wherein, different stored data correspond to different storage mechanisms, and the storage mechanism is determined according to the storage model 203 in the local database 1.
[0109] The display module is used to display the target stored data.
[0110] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0111] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Please refer to it. Figure 6 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0112] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0113] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0114] The processor reads the corresponding computer program from non-volatile memory into memory and then runs it. The processor executes the program stored in memory and specifically performs the following operations:
[0115] When obtaining local input data to be stored, the target local parameters of the distributed database are collected. The target local parameters include the current local parameters of the local database and the current local parameters of the remote database.
[0116] The local input data and target local parameters are input into a predetermined storage model in the local database to output a storage mechanism corresponding to the local input data. The storage mechanism is used to determine the storage location of the local input data in the local database and the remote database.
[0117] According to the storage mechanism, local input data is stored in both the local database and the remote database.
[0118] Of course, in addition to the software implementation, the electronic device of the present invention does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0119] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0120] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0121] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0122] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
Claims
1. A method for separating distributed database operations, characterized in that, The distributed database includes a local database and a remote database, and the method includes: When obtaining local input data to be stored, the target local parameters of the distributed database are collected, wherein the target local parameters include the current local parameters of the local database and the current local parameters of the remote database. Determine whether the target local parameters need to be compensated by introducing system parameters; If the target local parameters need to be compensated by introducing system parameters, obtain the system parameters of the local database; The target local parameters and the system parameters are fused to generate adjusted parameters with the target local parameters as the main component and the system parameters as the auxiliary component. The local input data and the target local parameters are input into a predetermined storage model in the local database to output a storage mechanism corresponding to the local input data. Specifically, this includes: inputting the local input data and the adjusted parameters into a predetermined storage model in the local database to output a storage mechanism corresponding to the local input data, wherein the storage mechanism is used to determine the storage location corresponding to the local input data in the local database and the remote database. According to the storage mechanism, the local input data is stored in the local database and the remote database.
2. The method according to claim 1, characterized in that, The method further includes: Collect the initial local parameters of the local database and the initial local parameters of the remote database; The system parameters are generated based on the initial local parameters of the local database and / or the initial local parameters of the remote database.
3. The method according to claim 2, characterized in that, The method further includes: When a new database is added and connected to the distributed database as a remote database, relevant parameters of the new database are obtained; Update the system parameters based on the relevant parameters of the newly added database.
4. The method according to claim 2, characterized in that, The method further includes: When the target local parameters are collected, the target local parameters are compared with the historical local parameters of the distributed database collected in the previous collection. If there is a difference between the target local parameter and the historical local parameter, the system parameter is updated based on the target local parameter.
5. A local database, characterized in that, include: The system includes a local data input terminal, a local parameter acquisition terminal, a storage model, a system parameter input terminal, and a model building system. The model building system is connected to the local parameter acquisition terminal, the system parameter input terminal, and the storage model, respectively. The local database can connect to a remote database. The local data input terminal is used to receive local input data and input the local input data into the storage model; The local parameter acquisition terminal is used to obtain the target local parameters of the distributed database and input the target local parameters into the storage model; wherein, the target local parameters include the current local parameters of the local database and the current local parameters of the remote database; The storage model is used to determine the storage mechanism corresponding to the local input data based on the local input data and the target local parameters, and to store the local input data into the local database and the remote database according to the storage mechanism; wherein, the storage mechanism is used to determine the storage location corresponding to the local input data in the local database and the remote database; The system parameter input terminal is used to receive system parameters; The model building system is used to receive the target local parameters sent by the local parameter acquisition terminal and the system parameters sent by the system parameter input terminal. When the target local parameters need to be compensated by introducing system parameters, the system system integrates the target local parameters and the system parameters to generate adjusted parameters with the target local parameters as the main parameter and the system parameters as the auxiliary parameter. The system system then inputs the local input data and the adjusted parameters into the storage model to output a storage mechanism corresponding to the local input data.
6. The local database according to claim 5, characterized in that, The local database further includes: a sub-database cluster and a local data replica, each connected to the storage model. The sub-database cluster can connect to a remote database, wherein: The storage model, used to store the local input data into the local database and the remote database according to the storage mechanism, includes: The storage model is used to process the local input data and, according to the storage mechanism, store the processed local input data as local data packets in the storage location corresponding to the local input data in the sub-database cluster and the storage location corresponding to the local input data in the local data replica, respectively; and store the remote data packets input from the sub-database cluster into the local data replica. The sub-database cluster is used to store the local data packet at the storage location corresponding to the local input data, back up the local data packet and share it to the remote database, and receive remote data packets from the remote database and input the remote data packets into the storage model. The local data copy is used to store the local data packets and the remote data packets stored in the storage model, and to generate a shared data packet containing the local data packets and the remote data packets, and to share the shared data packet to the remote database.
7. The local database according to claim 5, characterized in that, The local database is equipped with both a local network interface and a cross-domain network interface. When the local database's same-domain network interface and the remote database's same-domain network interface are connected, a same-domain network node is formed at the connection point. When the local database's foreign network interface and the remote database's foreign network interface are connected, a foreign network node is formed at the connection point.
8. An electronic device, characterized in that, include: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the distributed database operation separation method as described in any one of claims 1-4.
Citation Information
Patent Citations
System and method for managing integrity in a distributed database
CN103119590A
Electric power industry monitoring system, method and device
CN110598051A