CN114553894B - Data synchronization method, device, system and storage medium - Google Patents

Data synchronization method, device, system and storage medium Download PDF

Info

Publication number
CN114553894B
CN114553894B CN202210173455.8A CN202210173455A CN114553894B CN 114553894 B CN114553894 B CN 114553894B CN 202210173455 A CN202210173455 A CN 202210173455A CN 114553894 B CN114553894 B CN 114553894B
Authority
CN
China
Prior art keywords
data
node
database cluster
caching device
node data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210173455.8A
Other languages
Chinese (zh)
Other versions
CN114553894A (en
Inventor
陶晓宝
庄建伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Fengzhiding Information Technology Co ltd
Original Assignee
Suzhou Fengzhiding Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Fengzhiding Information Technology Co ltd filed Critical Suzhou Fengzhiding Information Technology Co ltd
Priority to CN202210173455.8A priority Critical patent/CN114553894B/en
Publication of CN114553894A publication Critical patent/CN114553894A/en
Application granted granted Critical
Publication of CN114553894B publication Critical patent/CN114553894B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a data synchronization method, a device, a system and a storage medium. The method is applied to a first HTTP server which is obtained based on the first database cluster registration, and comprises the following steps: receiving a data synchronization request sent by a first HTTP client in a first database cluster, wherein the first HTTP client is obtained based on data node registration in the first database cluster; retrieving node data from the data nodes of the first database cluster based on the data synchronization request, and sending the node data to a data caching device; the data caching device is used for caching the node data and sending the node data to a second database cluster, and the first database cluster, the data caching device and the second database cluster conform to a hypertext transfer protocol. Through the technical scheme, the first database cluster and the second database cluster are subjected to data synchronization based on the hypertext transfer protocol, and the data synchronization efficiency is improved.

Description

Data synchronization method, device, system and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data synchronization method, apparatus, system, and storage medium.
Background
With the increasing of technical teams for exploring databases, the types of databases which are opened on the internet are also continuously enriched, and meanwhile, the data storage cost facing each industry is also higher and higher.
When the industry is upgraded and the production scale is enlarged, the throughput of the old database storage system is far from bearing the current data traffic, so that a new database needs to be accessed to meet the industry requirement; after accessing the new database, the history data needs to be synchronized to the new database.
In the prior art, data synchronization is usually carried out in the form of Copy and Gpfdist, but the method is complex in steps, needs manual verification, is low in synchronization efficiency and is difficult to meet the data synchronization requirement of users.
Disclosure of Invention
The invention provides a data synchronization method, a device, a system and a storage medium, which are used for solving the problem of low data synchronization efficiency of a database at present and improving the data synchronization efficiency.
According to an aspect of the present invention, there is provided a data synchronization method applied to a first HTTP server obtained based on a first database cluster registration, including:
receiving a data synchronization request sent by a first HTTP client in a first database cluster, wherein the first HTTP client is obtained based on data node registration in the first database cluster;
Retrieving node data from the data nodes of the first database cluster based on the data synchronization request, and sending the node data to a data caching device;
the data caching device is used for caching the node data and sending the node data to a second database cluster, and the first database cluster, the data caching device and the second database cluster conform to a hypertext transfer protocol.
According to another aspect of the present invention, a data synchronization method is provided, and the data synchronization method is applied to a second HTTP server obtained by registration based on a second database cluster, where a data node in the second database cluster is registered as a second HTTP client when cached node data in a data caching device meets a preset level condition, and the second HTTP server and the second HTTP client conform to a hypertext transfer protocol;
the method comprises the following steps:
receiving node data exceeding the preset magnitude condition sent by the data caching device, wherein the data caching device is used for caching the node data in the data nodes of the first database cluster;
and sending the node data exceeding the preset magnitude condition to the second HTTP client.
According to another aspect of the present invention, there is provided a data synchronization system including: the data transmission among the first HTTP client, the first HTTP server, the data caching device, the second HTTP client and the second HTTP server complies with the hypertext transfer protocol;
the first HTTP client is in communication connection with the first HTTP server and is used for sending a data synchronization request of a first database cluster, and the first HTTP client is obtained based on the registration of data nodes in the first database cluster;
the first HTTP server is in communication connection with the data caching device and is used for receiving a data synchronization request of a first database cluster and sending node data corresponding to the data synchronization request to the data caching device;
the data caching device is in communication connection with the second HTTP server and is used for caching the node data, triggering the second database cluster to register the second HTTP client under the condition that the cached node data meets the preset level condition, and sending the node data which meets the level condition to the second HTTP server;
The second HTTP server is in communication connection with the second HTTP client and is used for receiving the node data exceeding the preset level condition sent by the data caching device and sending the node data exceeding the preset level condition to the second HTTP client;
the second HTTP client is configured to receive the node data that exceeds the preset level condition.
According to another aspect of the present invention, there is provided a data synchronization apparatus applied to a first HTTP server obtained based on a first database cluster registration, including:
the request receiving module is used for receiving a data synchronization request sent by a first HTTP client in a first database cluster, wherein the first HTTP client is obtained based on the registration of data nodes in the first database cluster;
the data retrieving module is used for retrieving node data from the data nodes of the first database cluster based on the data synchronization request and sending the node data to the data caching device;
the data caching device is used for caching the node data and sending the node data to a second database cluster, and the first database cluster, the data caching device and the second database cluster conform to a hypertext transfer protocol.
According to another aspect of the present invention, there is provided a data synchronization device, applied to a second HTTP server obtained by registration based on a second database cluster, where a data node in the second database cluster is registered as a second HTTP client when cached node data in a data caching device meets a preset level condition, and the second HTTP server and the second HTTP client conform to a hypertext transfer protocol;
the method comprises the following steps:
the node data receiving module is used for receiving the node data exceeding the preset magnitude condition sent by the data caching device, wherein the data caching device is used for caching the node data in the data nodes of the first database cluster;
and the node data sending module is used for sending the node data exceeding the preset magnitude condition to the second HTTP client.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data synchronization method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a data synchronization method according to any one of the embodiments of the present invention.
According to the technical scheme, the first HTTP server side obtained through registration receives the data synchronization request sent by the first HTTP client side in the first database cluster, so that the data synchronization request is received; furthermore, the first HTTP server side retrieves node data from the data nodes of the first database cluster according to the data synchronization request and directly sends the node data to the data caching device, namely the first HTTP server side does not need to receive and send the data, so that the data transmission flow is reduced, and the data synchronization efficiency is improved. The first database cluster, the data caching device and the second database cluster follow the hypertext transfer protocol, and node data is sent to the second database cluster according to the hypertext transfer protocol, so that automatic synchronization of the node data is realized, manual operation is not needed, and therefore efficiency of data synchronization is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a data synchronization method according to an embodiment of the invention;
fig. 2 is a flow chart of a data synchronization method according to a second embodiment of the invention;
fig. 3 is a schematic structural diagram of a data synchronization system according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a data synchronization device according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a data synchronization device according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a data synchronization method provided in a first embodiment of the present invention, where the method may be applicable to a case where a database performs data synchronization, and the method may be performed by a data synchronization device provided in the embodiment of the present invention, where the device may be implemented by software and/or hardware, and the device may be configured on an electronic computing device, for example, a first HTTP server obtained based on a first database cluster registration. The method specifically comprises the following steps:
S110, receiving a data synchronization request sent by a first HTTP client in a first database cluster, wherein the first HTTP client is obtained based on the registration of a data node in the first database cluster.
And S120, calling node data from the data nodes of the first database cluster based on the data synchronization request, and sending the node data to a data caching device.
In this embodiment, the first database cluster may include two or more data nodes, where each data node may form a virtual single logical image of the database to provide data services to the outside. The data node refers to a database server, node data needing to be synchronized can be stored, and the node data can be stored in a form of a database table. It should be noted that, in this embodiment, on the basis of the first database cluster, the data node in the first database cluster is registered as a client having an HTTP communication function, and a server having an HTTP communication function is obtained by registering according to an HTTP communication rule, that is, the first HTTP server and the first HTTP client obey an HTTP communication protocol, and HTTP communication is an efficient data transmission manner, and data synchronization of the database is performed through HTTP communication, so that efficiency of data synchronization can be improved.
Specifically, the first HTTP client obtained by registration has a data synchronization request sending function, and the data synchronization request is automatically generated according to the condition of node data storage, for example, after the current data node data storage amount exceeds a certain level, the first HTTP client corresponding to the current data node triggers to generate the data synchronization request, or the first HTTP client can be configured by a user, that is, the data synchronization request can be formulated according to the data synchronization requirement of the user. The first HTTP server side can receive the data synchronization request sent by the first HTTP client side, can call node data from the data nodes of the first database cluster according to the data synchronization request, and can directly send the node data to the data caching device, namely, the node data in the data nodes are directly sent to the data caching device.
In this embodiment, the data caching device may be a separately configured data caching device, for example, a server middleware, or may be a memory of a data node in the first database cluster, which is not limited in this embodiment. The size of the memory of the data caching device can be set according to the data synchronization requirement, for example, when the node data to be synchronized is larger, the memory of the data caching device can be adjusted to a large memory. The data caching device can be used for caching node data and sending the node data to the second database cluster, and the second database cluster can receive the node data sent by the data caching device to complete data synchronization. The second database cluster is different from the first database cluster in type, it can be understood that the database is different in type, and in the data synchronization process, problems such as complicated setting, manual verification errors and the like exist.
On the basis of the above embodiment, the data synchronization request includes a data upload request, and the data upload request is received in parallel; correspondingly, the node data is called from the data nodes of the first database cluster based on the data synchronization request, and the node data is sent to a data caching device, which comprises the following steps: and based on the data uploading request, node data are parallelly called from the data nodes of the first database cluster, and the node data are parallelly sent to a data caching device.
Wherein, the data uploading request refers to a unidirectional request of the first database cluster to upload data to the second database cluster. For example, the first database cluster may be a database cluster that is put into use earlier, and the second database cluster may be a database cluster that is put into use later, and the user need only upload data in the first database cluster to the second database cluster, and need not send data in the second database cluster to the second database cluster.
Specifically, the first HTTP server may receive the data upload request in parallel, and according to the received data upload request, retrieve node data in parallel from the data nodes of the first database cluster, and send the node data in parallel to the data caching device, so that automatic data transmission is realized, and no manual operation is required, thereby improving data transmission efficiency.
On the basis of the embodiment, the data synchronization request comprises the node connection number and the node binding number.
The data synchronization request may include, but is not limited to, HTTP header information, which includes, but is not limited to, information such as node connection number, node binding number, and the like. The node connection number refers to the number of connections established between the data nodes in the first database cluster and the first HTTP server. The node binding number refers to the number of data nodes currently bound by the first HTTP client. It will be appreciated that the number of node connections and the number of node bindings are statistical parameters that may be used to analyze the state of the data nodes in the first database cluster in order to retrieve the data in the data nodes.
On the basis of the embodiment, the data caching device sends the node data exceeding the preset level condition to the second database cluster under the condition that the cached node data meets the preset level condition; and triggering the data caching device to send the cached node data which does not exceed the preset order condition to a second database cluster after the first HTTP server receives the data uploading completion identification sent by the first HTTP client and under the condition that the preset time interval is met.
The preset level condition may refer to a data buffering amount.
In some embodiments, the data caching device sends the node data exceeding the preset level condition to the second database cluster when the cached node data meets the preset level condition, that is, sends the overflowed node data to the second database cluster, so that the node data can be guaranteed to be completely synchronous, and the situation that the data is lost is avoided. In some embodiments, after receiving the data upload completion identifier sent by the first HTTP client, the first HTTP server triggers the data caching device to send the cached node data which does not exceed the preset level condition to the second database cluster under the condition that the preset time interval is met, so that the situation that the data is not transmitted completely can be avoided, and the second database cluster receives complete node data. The preset time interval can be adaptively set according to the size of the data transmission amount.
The embodiment of the invention provides a data synchronization method, which is characterized in that a first HTTP server end obtained through registration receives a data synchronization request sent by a first HTTP client end in a first database cluster, so that the data synchronization request is received; furthermore, the first HTTP server side retrieves node data from the data nodes of the first database cluster according to the data synchronization request and directly sends the node data to the data caching device, namely the first HTTP server side does not need to receive and send the data, so that the data transmission flow is reduced, and the data synchronization efficiency is improved. The first database cluster, the data caching device and the second database cluster follow the hypertext transfer protocol, and node data is sent to the second database cluster according to the hypertext transfer protocol, so that automatic synchronization of the node data is realized, manual operation is not needed, and therefore efficiency of data synchronization is improved.
Example two
Fig. 2 is a flowchart illustrating a data synchronization method according to a second embodiment of the present invention, where the method may be applicable to a case of performing data synchronization between database clusters, and the method may be performed by a data synchronization device according to the second embodiment of the present invention, where the device may be implemented by software and/or hardware, and the device may be configured on an electronic computing device, for example, based on a second HTTP server obtained by registration of a second database cluster. As shown in fig. 2, the method in the embodiment of the present invention specifically includes the following steps:
and S210, receiving node data which exceeds the preset magnitude condition and is sent by the data caching device, wherein the data caching device is used for caching the node data in the data nodes of the first database cluster.
And S220, sending the node data exceeding the preset magnitude condition to a second HTTP client.
The second HTTP server may be obtained by registering the second database cluster, where when the node data cached in the data caching device by the data node in the second database cluster meets a preset level condition, the data node is registered as a second HTTP client, that is, a data node available in the second database cluster is registered as the second HTTP client, so that the second HTTP client enters a state of waiting for data reception. The second HTTP server and the second HTTP client follow the hypertext transfer protocol, and data synchronization of the database cluster is performed through HTTP communication, so that rapid synchronization of node data can be realized, and the efficiency of data synchronization is improved.
Specifically, the second HTTP server receives node data exceeding a preset level condition sent by the data caching device, and sends the node data exceeding the preset level condition to the second HTTP client, so that synchronization of the data is completed.
On the basis of the foregoing embodiment, after sending the node data exceeding the preset level condition to the second HTTP client, the method further includes: and receiving the node data which does not exceed the preset magnitude condition in the data caching device, and sending the node data which does not exceed the preset magnitude condition in the data caching device to the second HTTP client.
Specifically, after receiving the data uploading completion identifier sent by the first HTTP client, the first HTTP server triggers the data caching device to send the cached node data which does not exceed the preset level condition to the second database cluster under the condition that the preset time interval is met, so that the situation that the data is not transmitted completely can be avoided, and the second database cluster receives complete node data.
The embodiment of the invention provides a data synchronization method, which is characterized in that a first HTTP server end obtained through registration receives a data synchronization request sent by a first HTTP client end in a first database cluster, so that the data synchronization request is received; furthermore, the first HTTP server side retrieves node data from the data nodes of the first database cluster according to the data synchronization request and directly sends the node data to the data caching device, namely the first HTTP server side does not need to receive and send the data, so that the data transmission flow is reduced, and the data synchronization efficiency is improved. The first database cluster, the data caching device and the second database cluster follow the hypertext transfer protocol, and node data is sent to the second database cluster according to the hypertext transfer protocol, so that automatic synchronization of the node data is realized, manual operation is not needed, and therefore efficiency of data synchronization is improved.
Example III
Fig. 3 is a schematic structural diagram of a data synchronization system according to a third embodiment of the present invention, where the data synchronization system may implement a data synchronization method according to the embodiment of the present invention, and the system includes: comprising the following steps: the data transmission among the first HTTP client, the first HTTP server, the data caching device, the second HTTP client and the second HTTP server complies with the hypertext transfer protocol. The first HTTP client and the second HTTP client in fig. 3 are only examples, and are not limiting on the number of the first HTTP client and the second HTTP client.
The first HTTP client is in communication connection with the first HTTP server and is used for sending a data synchronization request of the first database cluster, and the first HTTP client is obtained based on the registration of the data nodes in the first database cluster.
Further, the first HTTP server is communicatively connected to the data caching device, and is configured to receive a data synchronization request of the first database cluster and send node data corresponding to the data synchronization request to the data caching device.
Further, the data caching device is in communication connection with the second HTTP server, and is configured to cache node data, trigger the second database cluster to register the second HTTP client when the cached node data meets a preset level condition, and send the node data that meets the level condition to the second HTTP server.
Further, the second HTTP server is in communication connection with the second HTTP client, and is configured to receive the node data exceeding the preset level condition sent by the data caching device, and send the node data exceeding the preset level condition to the second HTTP client.
Further, the second HTTP client is configured to receive the node data exceeding the preset level condition.
Further, after receiving the data uploading completion identifier sent by the first HTTP client, the first HTTP server triggers the data caching device to send the cached node data which does not exceed the preset level condition to the second database cluster under the condition that the preset time interval is met, so that the situation that the data is not transmitted completely can be avoided, and the second database cluster receives complete node data.
The embodiment of the invention provides a data synchronization system, which is used for receiving a data synchronization request sent by a first HTTP client in a first database cluster through a first HTTP server obtained by registration, so that the data synchronization request is received; furthermore, the first HTTP server side retrieves node data from the data nodes of the first database cluster according to the data synchronization request and directly sends the node data to the data caching device, namely the first HTTP server side does not need to receive and send the data, so that the data transmission flow is reduced, and the data synchronization efficiency is improved. The first database cluster, the data caching device and the second database cluster follow the hypertext transfer protocol, and node data is sent to the second database cluster according to the hypertext transfer protocol, so that automatic synchronization of the node data is realized, manual operation is not needed, and therefore efficiency of data synchronization is improved.
Example IV
Fig. 4 is a schematic structural diagram of a data synchronization device according to a fourth embodiment of the present invention, where the data synchronization device provided by the present embodiment may be implemented by software and/or hardware, and may be configured to implement a data synchronization method according to the embodiment of the present invention in a first HTTP server obtained based on a first database cluster registration. The device specifically can include: request receiving module 410 and data retrieving module 420.
The request receiving module 410 is configured to receive a data synchronization request sent by a first HTTP client in a first database cluster, where the first HTTP client is obtained based on a registration of a data node in the first database cluster; a data retrieving module 420, configured to retrieve node data from the data nodes of the first database cluster based on the data synchronization request, and send the node data to a data caching device; the data caching device is used for caching the node data and sending the node data to a second database cluster, and the first database cluster, the data caching device and the second database cluster conform to a hypertext transfer protocol.
The embodiment of the invention provides a data synchronization device, which receives a data synchronization request sent by a first HTTP client in a first database cluster through a first HTTP server obtained by registration, so that the data synchronization request is received; furthermore, the first HTTP server side retrieves node data from the data nodes of the first database cluster according to the data synchronization request and directly sends the node data to the data caching device, namely the first HTTP server side does not need to receive and send the data, so that the data transmission flow is reduced, and the data synchronization efficiency is improved. The first database cluster, the data caching device and the second database cluster follow the hypertext transfer protocol, and node data is sent to the second database cluster according to the hypertext transfer protocol, so that automatic synchronization of the node data is realized, manual operation is not needed, and therefore efficiency of data synchronization is improved.
Optionally, on the basis of any optional technical solution in the embodiment of the present invention, the data synchronization request includes a data upload request, where the data upload request is received in parallel;
accordingly, the data retrieval module 420 may also be configured to: and based on the data uploading request, node data are parallelly called from the data nodes of the first database cluster, and the node data are parallelly sent to a data caching device.
On the basis of any optional technical scheme in the embodiment of the invention, optionally, the data synchronization request comprises a node connection number and a node binding number.
On the basis of any optional technical scheme in the embodiment of the invention, optionally, the data caching device sends the node data exceeding the preset level condition to a second database cluster under the condition that the cached node data meets the preset level condition;
and triggering the data caching device to send the cached node data which does not exceed the preset order condition to a second database cluster after the first HTTP server receives the data uploading completion identification sent by the first HTTP client and under the condition that the preset time interval is met.
The data synchronization device provided by the embodiment of the invention can execute the data synchronization method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example five
Fig. 5 is a schematic structural diagram of a data synchronization device provided in a fifth embodiment of the present invention, where the data synchronization device provided in the present embodiment may be implemented by software and/or hardware, and may be configured to implement a data synchronization method in the embodiment of the present invention in a second HTTP server obtained based on registration of a second database cluster. When the cached node data in the data caching device meets the preset level condition, the data nodes in the second database cluster are registered as second HTTP clients, and the second HTTP server and the second HTTP clients conform to the hypertext transfer protocol. The device specifically can include: the node data receiving module 510 and the node data transmitting module 520.
The node data receiving module 510 is configured to receive node data that exceeds the preset level condition and is sent by the data caching device, where the data caching device is configured to cache node data in a data node of a first database cluster; and the node data sending module 520 is configured to send the node data exceeding the preset level condition to the second HTTP client.
The embodiment of the invention provides a data synchronization device, which receives a data synchronization request sent by a first HTTP client in a first database cluster through a first HTTP server obtained by registration, so that the data synchronization request is received; furthermore, the first HTTP server side retrieves node data from the data nodes of the first database cluster according to the data synchronization request and directly sends the node data to the data caching device, namely the first HTTP server side does not need to receive and send the data, so that the data transmission flow is reduced, and the data synchronization efficiency is improved. The first database cluster, the data caching device and the second database cluster follow the hypertext transfer protocol, and node data is sent to the second database cluster according to the hypertext transfer protocol, so that automatic synchronization of the node data is realized, manual operation is not needed, and therefore efficiency of data synchronization is improved.
On the basis of any optional technical scheme of the embodiment of the invention, optionally, the device can also be used for:
and receiving the node data which does not exceed the preset magnitude condition in the data caching device, and sending the node data which does not exceed the preset magnitude condition in the data caching device to the second HTTP client.
The data synchronization device provided by the embodiment of the invention can execute the data synchronization method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example six
Fig. 6 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the data synchronization method.
In some embodiments, the data synchronization method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. One or more of the steps of method XXX described above may be performed when the computer program is loaded into RAM 13 and executed by processor 11. Alternatively, in other embodiments, the processor 11 may be configured to perform the data synchronization method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. The data synchronization method is characterized by being applied to a first HTTP server which is obtained based on the first database cluster registration, and comprising the following steps:
receiving a data synchronization request sent by a first HTTP client in a first database cluster, wherein the first HTTP client is obtained based on data node registration in the first database cluster; wherein, the data synchronization request is automatically generated according to the condition of node data storage;
Retrieving node data from the data nodes of the first database cluster based on the data synchronization request, and sending the node data to a data caching device;
the data caching device is used for caching the node data and sending the node data to a second database cluster, and the first database cluster, the data caching device and the second database cluster conform to a hypertext transfer protocol.
2. The method of claim 1, wherein the data synchronization request comprises a data upload request, the data upload request received in parallel;
correspondingly, the node data is called from the data nodes of the first database cluster based on the data synchronization request, and the node data is sent to a data caching device, which comprises the following steps:
and based on the data uploading request, node data are parallelly called from the data nodes of the first database cluster, and the node data are parallelly sent to a data caching device.
3. The method of claim 1, wherein the data synchronization request includes a node connection number and a node binding number.
4. The method according to claim 1, wherein the data caching device sends the node data exceeding the preset level condition to the second database cluster in case the cached node data meets the preset level condition;
And triggering the data caching device to send the cached node data which does not exceed the preset order condition to a second database cluster after the first HTTP server receives the data uploading completion identification sent by the first HTTP client and under the condition that the preset time interval is met.
5. The data synchronization method is characterized by being applied to a second HTTP server which is obtained based on registration of a second database cluster, wherein when node data cached in a data caching device of a data node in the second database cluster meet a preset level condition, the data node is registered as a second HTTP client, and the second HTTP server and the second HTTP client conform to a hypertext transfer protocol;
the method comprises the following steps:
receiving node data exceeding the preset magnitude condition sent by the data caching device, wherein the data caching device is used for caching the node data in the data nodes of the first database cluster;
and sending the node data exceeding the preset magnitude condition to the second HTTP client.
6. The method of claim 5, wherein after sending the node data exceeding the preset level condition to the second HTTP client, the method further comprises:
And receiving the node data which does not exceed the preset magnitude condition in the data caching device, and sending the node data which does not exceed the preset magnitude condition in the data caching device to the second HTTP client.
7. A data synchronization system, comprising: the data transmission among the first HTTP client, the first HTTP server, the data caching device, the second HTTP client and the second HTTP server complies with the hypertext transfer protocol;
the first HTTP client is in communication connection with the first HTTP server and is used for sending a data synchronization request of a first database cluster, and the first HTTP client is obtained based on the registration of data nodes in the first database cluster; wherein, the data synchronization request is automatically generated according to the condition of node data storage;
the first HTTP server is in communication connection with the data caching device and is used for receiving a data synchronization request of a first database cluster and sending node data corresponding to the data synchronization request to the data caching device;
The data caching device is in communication connection with the second HTTP server and is used for caching the node data, triggering the second database cluster to register the second HTTP client under the condition that the cached node data meets the preset level condition, and sending the node data which meets the level condition to the second HTTP server;
the second HTTP server is in communication connection with the second HTTP client and is used for receiving the node data exceeding the preset level condition sent by the data caching device and sending the node data exceeding the preset level condition to the second HTTP client;
the second HTTP client is configured to receive the node data that exceeds the preset level condition.
8. The data synchronization device is characterized by being applied to a first HTTP server which is obtained based on first database cluster registration, and comprising the following components:
the request receiving module is used for receiving a data synchronization request sent by a first HTTP client in a first database cluster, wherein the first HTTP client is obtained based on the registration of data nodes in the first database cluster; wherein, the data synchronization request is automatically generated according to the condition of node data storage;
The data retrieving module is used for retrieving node data from the data nodes of the first database cluster based on the data synchronization request and sending the node data to the data caching device;
the data caching device is used for caching the node data and sending the node data to a second database cluster, and the first database cluster, the data caching device and the second database cluster conform to a hypertext transfer protocol.
9. The data synchronization device is characterized by being applied to a second HTTP server which is obtained based on registration of a second database cluster, wherein when node data cached in a data caching device of data nodes in the second database cluster meet a preset level condition, the data nodes are registered as a second HTTP client, and the second HTTP server and the second HTTP client conform to a hypertext transfer protocol;
the data synchronization device includes:
the node data receiving module is used for receiving the node data exceeding the preset magnitude condition sent by the data caching device, wherein the data caching device is used for caching the node data in the data nodes of the first database cluster;
And the node data sending module is used for sending the node data exceeding the preset magnitude condition to the second HTTP client.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the data synchronization method of any one of claims 1-4 or the data synchronization method of any one of claims 5-6 when executed.
CN202210173455.8A 2022-02-24 2022-02-24 Data synchronization method, device, system and storage medium Active CN114553894B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210173455.8A CN114553894B (en) 2022-02-24 2022-02-24 Data synchronization method, device, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210173455.8A CN114553894B (en) 2022-02-24 2022-02-24 Data synchronization method, device, system and storage medium

Publications (2)

Publication Number Publication Date
CN114553894A CN114553894A (en) 2022-05-27
CN114553894B true CN114553894B (en) 2024-04-09

Family

ID=81677672

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210173455.8A Active CN114553894B (en) 2022-02-24 2022-02-24 Data synchronization method, device, system and storage medium

Country Status (1)

Country Link
CN (1) CN114553894B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1682215A (en) * 2002-07-19 2005-10-12 阿克萨尔托股份有限公司 Databases synchronization
JP2014016953A (en) * 2012-07-11 2014-01-30 Nippon Telegr & Teleph Corp <Ntt> Unshared type database system, synchronizing device, database server, its synchronizing method, and synchronizing program
CN109840166A (en) * 2019-01-14 2019-06-04 京东数字科技控股有限公司 Across the cluster object storage async backup methods, devices and systems of one kind
CN112597173A (en) * 2021-03-08 2021-04-02 成都虚谷伟业科技有限公司 Distributed database cluster system peer-to-peer processing system and processing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1682215A (en) * 2002-07-19 2005-10-12 阿克萨尔托股份有限公司 Databases synchronization
JP2014016953A (en) * 2012-07-11 2014-01-30 Nippon Telegr & Teleph Corp <Ntt> Unshared type database system, synchronizing device, database server, its synchronizing method, and synchronizing program
CN109840166A (en) * 2019-01-14 2019-06-04 京东数字科技控股有限公司 Across the cluster object storage async backup methods, devices and systems of one kind
CN112597173A (en) * 2021-03-08 2021-04-02 成都虚谷伟业科技有限公司 Distributed database cluster system peer-to-peer processing system and processing method

Also Published As

Publication number Publication date
CN114553894A (en) 2022-05-27

Similar Documents

Publication Publication Date Title
CN113760982A (en) Data processing method and device
CN115567589A (en) Compression transmission method, device, equipment and storage medium of JSON data
CN116661960A (en) Batch task processing method, device, equipment and storage medium
CN114553894B (en) Data synchronization method, device, system and storage medium
CN114564149B (en) Data storage method, device, equipment and storage medium
CN115599571A (en) Data processing method and device, electronic equipment and storage medium
CN115543416A (en) Configuration updating method and device, electronic equipment and storage medium
CN115587119A (en) Database query method and device, electronic equipment and storage medium
CN114064803A (en) Data synchronization method and device
CN115840604B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN117979210B (en) Audio transmission method, device, electronic equipment and storage medium
CN118673321A (en) Embedded table model training method, device, equipment and storage medium
CN117651078A (en) Data transmission method and device, electronic equipment and storage medium
CN117472913A (en) Data processing method, device, equipment and storage medium
CN117556075A (en) Data processing method, device, equipment and medium applied to PACS system
CN115269055A (en) Nginx request data acquisition method, device, equipment and storage medium
CN117608794A (en) Multi-copy cache refreshing method, device, equipment and medium based on timing task
CN117931805A (en) Data processing method and device, electronic equipment and storage medium
CN116339745A (en) Method, device, equipment and storage medium for analyzing communication data between equipment
CN117294597A (en) Network card binding configuration method, device, equipment and medium
CN116628065A (en) Data storage method and device, electronic equipment and storage medium
CN118484497A (en) Data synchronization method, device, equipment and medium applied to distributed system
CN112527782A (en) Data processing method and device
CN116932623A (en) Conversion method, device and equipment of cloud container scheduling data and storage medium
CN115705326A (en) Real-time data storage method and device and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant