CN110851290A - Data synchronization method and device, electronic equipment and storage medium - Google Patents

Data synchronization method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110851290A
CN110851290A CN201911061813.0A CN201911061813A CN110851290A CN 110851290 A CN110851290 A CN 110851290A CN 201911061813 A CN201911061813 A CN 201911061813A CN 110851290 A CN110851290 A CN 110851290A
Authority
CN
China
Prior art keywords
data
server
synchronized
storage space
stored
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.)
Pending
Application number
CN201911061813.0A
Other languages
Chinese (zh)
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.)
Zhuomi Private Ltd
Original Assignee
Hong Kong Lemi 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 Hong Kong Lemi Co Ltd filed Critical Hong Kong Lemi Co Ltd
Priority to CN201911061813.0A priority Critical patent/CN110851290A/en
Publication of CN110851290A publication Critical patent/CN110851290A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • 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

Abstract

The embodiment of the invention provides a data synchronization method, a data synchronization device, electronic equipment and a storage medium. The scheme is as follows: the first server can monitor whether the storage space of the first server has the data to be synchronized, if so, the data to be synchronized is obtained from the storage space, a second server in the global interconnection system is called based on a remote calling technology, and the data to be synchronized is sent to the second server, so that the second server receives and stores the data to be synchronized. According to the technical scheme provided by the embodiment of the invention, when the first server synchronizes the data to be synchronized in the storage space to the second server in the global Internet system, the second server is directly called to receive the data to be synchronized sent by the first service, so that the network request frequency between the first server and the second server is effectively reduced, the network request duration is shortened, the data transmission delay is further reduced, and the data synchronization efficiency is improved.

Description

Data synchronization method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of database application technologies, and in particular, to a data synchronization method and apparatus, an electronic device, and a storage medium.
Background
At present, in a global audio/video interconnection system, servers in different areas need to complete synchronization of audio/video data through a long network request when audio/video data interaction is performed. However, the network request time is long, so that the audio and video data transmission delay is high, and the audio and video data synchronization efficiency is low.
Disclosure of Invention
Embodiments of the present invention provide a data synchronization method, an apparatus, an electronic device, and a storage medium, so as to reduce a time delay of data transmission and improve data synchronization efficiency. The specific technical scheme is as follows:
the embodiment of the invention provides a data synchronization method, which is applied to a first server for managing a first area in a global interconnection system, wherein the global interconnection system comprises servers corresponding to a plurality of areas, and the method comprises the following steps:
monitoring whether the storage space of the first server has data to be synchronized;
if yes, acquiring the data to be synchronized from the storage space;
and calling a second server in the global Internet system based on a remote calling technology, and sending the data to be synchronized to the second server so that the second server receives and stores the data to be synchronized.
Optionally, the step of monitoring whether there is data to be synchronized in the storage space of the first server includes:
judging whether the storage duration of each data stored in the storage space of the first server is less than a preset storage duration or not;
and if so, determining the data as the data to be synchronized.
Optionally, the method further includes:
receiving data to be stored sent by the user equipment in the first area;
determining identification information corresponding to the data to be stored;
and storing the data to be stored into the storage space based on the corresponding relation between the data to be stored and the identification information.
Optionally, the first server is long-linked with the second server.
Optionally, the step of invoking a second server in the global internet system based on a remote invocation technology and sending the data to be synchronized to the second server includes:
and calling a second server in the global Internet system based on a Remote Procedure Call (RPC) protocol, and sending the data to be synchronized to the second server.
Optionally, the method further includes:
detecting whether a data retransmission request sent by the second server for lost data is received within a timeout duration, wherein the data retransmission request is sent to the first server by the second server when the received data to be synchronized is determined to be lost;
and if so, sending the lost data to the second server.
An embodiment of the present invention further provides a data synchronization apparatus, which is applied to a first server managing a first area in a global interconnection system, where the global interconnection system includes servers corresponding to a plurality of areas, and the apparatus includes:
the monitoring unit is used for monitoring whether the storage space of the first server has data to be synchronized;
the acquisition unit is used for acquiring the data to be synchronized from the storage space when the monitoring result of the monitoring unit is positive;
and the synchronization unit is used for calling a second server in the global Internet system based on a remote calling technology and sending the data to be synchronized to the second server so that the second server receives and stores the data to be synchronized.
Optionally, the monitoring unit is specifically configured to determine, for each data stored in the storage space of the first server, whether a storage duration of the data is less than a preset storage duration; and if so, determining the data as the data to be synchronized.
Optionally, the apparatus further comprises:
a receiving unit, configured to receive data to be stored sent by the ue in the first area;
the determining unit is used for determining the identification information corresponding to the data to be stored;
and the storage unit is used for storing the data to be stored into the storage space based on the corresponding relation between the data to be stored and the identification information.
Optionally, the first server is long-linked with the second server.
Optionally, the synchronization unit is specifically configured to call a second server in the global interconnection system based on an RPC protocol, and send the data to be synchronized to the second server.
Optionally, the apparatus further comprises:
a detecting unit, configured to detect whether a data retransmission request sent by the second server for lost data is received within a timeout duration, where the data retransmission request is sent to the first server by the second server when it is determined that the received data to be synchronized is lost;
a sending unit, configured to send the missing data to the second server.
The embodiment of the invention also provides electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the steps of the data synchronization method when executing the program stored in the memory.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the method implements any of the above steps of the data synchronization method.
Embodiments of the present invention also provide a computer program product containing instructions, which when run on a computer, cause the computer to perform any of the above-mentioned data synchronization methods.
The embodiment of the invention has the following beneficial effects:
according to the data synchronization method, the data synchronization device, the electronic equipment and the storage medium provided by the embodiment of the invention, the first server can monitor whether the data to be synchronized exists in the storage space of the first server, if so, the data to be synchronized is obtained from the storage space, the second server in the global Internet system is called based on a remote calling technology, and the data to be synchronized is sent to the second server, so that the second server receives and stores the data to be synchronized. According to the technical scheme provided by the embodiment of the invention, when the first server synchronizes the data to be synchronized in the storage space to the second server in the global Internet system, the second server is directly called to receive the data to be synchronized sent by the first service, so that the network request frequency between the first server and the second server is effectively reduced, the network request duration is shortened, the data transmission delay is further reduced, and the data synchronization efficiency is improved.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a global interconnection system according to an embodiment of the present invention;
FIG. 2 is a first flowchart illustrating a data synchronization method according to an embodiment of the present invention;
fig. 3 is a second flowchart of a data synchronization method according to an embodiment of the present invention;
fig. 4 is a schematic flow chart of a data synchronization method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a data synchronization apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problems of high data transmission delay and low data synchronization efficiency in the existing data synchronization process, embodiments of the present invention provide a data synchronization method, an apparatus, an electronic device, and a storage medium. The method is applied to a first server for managing a first area in the global interconnection system. The first server may be any server in the global system for interconnection, and is not intended to be limiting. The first server can monitor whether the storage space of the first server has the data to be synchronized, if so, the data to be synchronized is obtained from the storage space, a second server in the global interconnection system is called based on a remote calling technology, and the data to be synchronized is sent to the second server, so that the second server receives and stores the data to be synchronized.
By the method provided by the embodiment of the invention, when the first server synchronizes the data to be synchronized in the storage space to the second server in the global Internet system, the second server is directly called to receive the data to be synchronized sent by the first service, so that the network request frequency between the first server and the second server is effectively reduced, the network request duration is shortened, the data transmission delay is further reduced, and the data synchronization efficiency is improved.
In the embodiment of the present invention, the global interconnection system may be constructed based on a Remote Dictionary service (Remote Dictionary service) Cache provided by amazon cloud computing Services (AWS). Fig. 1 is a schematic structural diagram of a global interconnection system according to an embodiment of the present invention. The server 1, the server 2, and the server 3 together constitute a global interconnection system. Each server may manage data within a certain area. That is, each server can uniformly associate data transmitted or requested by the user equipment in the area managed by the server. For example, server 1, server 2, and server 3 may manage data in the asian region, the american region, and the european region, respectively. In the global interconnection system shown in fig. 1, a data sending module and a data receiving module are respectively deployed on each server, such as the data receiving module 1 and the data receiving module 1 in the server 1. A data receiving module 2 and a data receiving module 2 in the server 2. A data receiving module 3 and a data receiving module 3 in the server 3. When different servers carry out data synchronization, the data synchronization is carried out by using the data sending module and the data receiving module in each server. The server 1 is long-linked with the server 3 and the server 3, respectively, and the server 2 is long-linked with the server 3.
In the embodiment of the present invention, for each server in the global interconnection system, the server may further include other components. E.g. a storage space (not shown in fig. 1), etc. Here, the server in the global interconnection system is not particularly limited. In addition, each server in the global interconnection system is in communication connection with the user equipment in the area managed by the server.
The following examples illustrate the present invention.
As shown in fig. 2, fig. 2 is a first flowchart illustrating a data synchronization method according to an embodiment of the present invention. The method is applied to a first server for managing a first area in a global interconnection system, and specifically comprises the following steps.
Step S201, monitoring whether the storage space of the first server has data to be synchronized. If yes, go to step S202.
In this step, a plurality of data are stored in the storage space of the first server, and the data sending module of the first server may monitor the data stored in the storage space in real time to determine whether the data to be synchronized exists in the storage space. For the monitoring of the data to be synchronized, reference is made to the following description, which is not specifically described here. For convenience of description, the first server is taken as an execution subject, and is not limited herein.
In the embodiment of the present invention, the data to be synchronized includes, but is not limited to, data uploaded by different user equipments in a first area managed by a first server and data obtained by synchronizing with other servers in the global interconnection system. In addition, the data to be synchronized includes, but is not limited to, audio data and video data.
Step S202, obtaining the data to be synchronized from the storage space.
In this step, after determining that the data to be synchronized exists in the storage space of the first server, the first server may directly acquire the data to be synchronized from the storage space. The number of the data to be synchronized in the storage space may be one or multiple, and the number of the data to be synchronized in the storage space is not particularly limited.
In an optional embodiment, when it is determined that the data to be synchronized does not exist in the storage space of the first server, the first server may not perform synchronization, that is, the first server does not synchronize the data in the storage space to other servers.
Step S203, based on the remote calling technology, calling a second server in the global Internet system, and sending the data to be synchronized to the second server, so that the second server receives and stores the data to be synchronized.
In this step, the first server may synchronize the acquired data to be synchronized to a storage space of the second server. Specifically, in the synchronization process, the first server may send the acquired data to be synchronized to the second server based on a remote invocation technology, and at the same time, the first server may invoke the second server to receive the sent data to be synchronized. After receiving the data to be synchronized sent by the first server, the second server may store the data to be synchronized in a storage space of the second server.
In the foregoing embodiment, when the first server performs data synchronization with the second server, it is specifically indicated that the data sending module in the first server calls the data receiving module of the second server, and receives the data to be synchronized sent by the data sending module of the first server. And after receiving the data to be synchronized, the data receiving module of the second server stores the received data to be synchronized into the storage space of the second server.
In an embodiment of the present invention, the second server may be any server in the global internet system, which is in communication connection with the first server. Here, the second server is not particularly limited.
In an alternative embodiment, the first server is linked to the second server. That is, the second server may be all servers that are long-linked with the first server in the global internet system. Still taking the above fig. 1 as an example, if the first server is server 2, the second server includes server 1 and server 3.
In the embodiment of the invention, by long-linking the first server and the second server, the first server can call the data receiving module of the second server to receive the data sent by the data receiving module in time during data synchronization, so that the calling time of the data receiving module of the second server is shortened, the time delay of data transmission is reduced, the data synchronization time is shortened, and the data synchronization efficiency is improved.
In an alternative embodiment, there may be servers in the global interconnection system that are not directly connected to the first server, i.e. servers that are indirectly connected to the first server through other servers, such as a third server, which is indirectly connected to the first server through the second server. When the data synchronization is performed, the first server synchronizes the data to be synchronized to the second server, and when the second server receives the data to be synchronized sent by the first server, the second server may synchronize the received data to be synchronized to the third server by using the data synchronization method, so that the data synchronization between the servers used in the global interconnection system is realized. The specific synchronization process may refer to the above data synchronization process, and is not specifically described herein.
In an optional embodiment, in the step S201, monitoring whether the data to be synchronized exists in the storage space of the first server may specifically include the following steps.
In step S2011, it is determined whether the storage duration of each data stored in the storage space of the first server is less than a preset storage duration. If yes, go to step S2012.
In this step, for each data stored in the storage space of the first server, the first server may compare the storage duration of the data with a preset storage duration according to the storage duration corresponding to each data, and determine whether the storage duration is less than the preset storage duration. Namely, whether the storage time corresponding to each data in the storage space of the first server is less than the preset storage time is determined.
In step S2012, the data is determined as data to be synchronized.
In this step, when the storage duration of a certain data stored in the storage space of the first server is less than the preset storage duration, the first server may determine that the data to be synchronized exists in the storage space. At this time, the first server may determine each data with a storage duration smaller than a preset storage duration in the storage space as the data to be synchronized.
In an optional embodiment, when the storage duration of a certain data stored in the storage space of the first server is not less than the preset storage duration, the first server may determine that the data is not the data to be synchronized. If the first server determines that the storage duration of each data stored in the storage space is not less than the preset storage duration, at this time, the first server may determine that the data to be synchronized does not exist in the storage space.
In the embodiment of the present invention, the preset storage duration may be determined according to a user requirement, a data update rate in each area, and the like. In addition, the preset storage time lengths corresponding to different servers may be the same or different. Here, the preset storage time period is not particularly limited.
By comparing the storage time of each data in the storage space of the first server with the preset storage time, whether the data to be synchronized exists in the storage space of the first server can be timely and accurately judged, the accuracy and the timeliness of determining the data to be synchronized are improved, and the accuracy and the timeliness of data synchronization are improved.
In another optional embodiment, the data to be synchronized is that after the data receiving module in the first server receives the data to be stored and stores the received data to be stored in the storage space, the data sending module of the first server monitors whether the data to be synchronized exists in the storage space. In addition, the data receiving module of the first server may also monitor whether the data receiving module of the first server receives the data to be stored in real time, if so, the data receiving module may determine whether the storage space includes the data to be stored, and if not, determine the received data to be stored as the data to be synchronized, and store the data to be synchronized in the storage space.
In an optional embodiment, in step S203, based on a remote invocation technology, the second server in the global internet is invoked, and the data to be synchronized is sent to the second server, which may specifically be represented as: the first server calls a second server in the global Internet system based on the RPC protocol, and sends the data to be synchronized to the second server.
The RPC protocol is a computer communication protocol. The protocol allows a program running on one computer to invoke a subroutine on another computer. With the embodiment of the present invention, the call of the RPC protocol is represented as: and the data sending module of the first server sends the data to be synchronized to the data receiving module of the second server, and calls the data receiving module of the second server to receive the sent data to be synchronized.
Based on the RPC protocol, the first server can directly call the data receiving module of the second server to receive the data to be synchronized, so that the time length of a network request is effectively shortened, the data can be synchronously written in the second server while the data is written in the first server, and the efficiency of data synchronization is improved.
In summary, with the method provided by the embodiment of the present invention, when the first server synchronizes the data to be synchronized in the storage space to the second server in the global interconnection system, the second server is directly called to receive the data to be synchronized sent by the first service, thereby effectively reducing the number of network requests between the first server and the second server, shortening the duration of the network requests, further reducing the time delay of data transmission, and improving the efficiency of data synchronization.
In an alternative embodiment, according to the method shown in fig. 2, an embodiment of the present invention further provides a data synchronization method. As shown in fig. 3, fig. 3 is a second flowchart of a data synchronization method according to an embodiment of the present invention.
Step S301, monitoring whether the storage space of the first server has data to be synchronized. If yes, go to step S302.
Step S302, obtaining the data to be synchronized from the storage space.
Step S303, based on the remote invocation technology, invokes a second server in the global internet system, and sends the data to be synchronized to the second server, so that the second server receives and stores the data to be synchronized.
The above steps S301 to S303 are the same as the above steps S201 to S203.
Step S304, receiving the data to be stored sent by the user equipment in the first area.
In this step, for each user equipment in the first area, the user equipment may send data to be stored to the first server. The data receiving module in the first server may receive data to be stored sent by the user equipment in the first area.
In step S305, identification information corresponding to data to be stored is determined.
In this step, for the received data to be stored, the first server may determine the identification information corresponding to the data to be stored.
In this embodiment of the present invention, the identification information of the data to be stored may be a serial number or a tag corresponding to the data to be stored.
Taking the identification information as a serial number as an example, when the identification information of the data to be stored is determined, the first server may determine the identification information of the data to be stored according to the number of the data stored in the current storage space. For example, the number of data stored in the current storage space is 100, and the first server may determine that the sequence number of the data to be stored is 101, that is, the identification information of the data to be stored is 100.
And S306, storing the data to be stored into a storage space based on the corresponding relation between the data to be stored and the identification information.
In this step, the electronic device may store the data to be stored and the identification information of the data to be stored in the storage space of the first server, respectively, based on the correspondence between the data to be stored and the identification information.
In an optional embodiment, when the first server stores the data to be stored and the identification information of the data to be stored, the identification information corresponding to the data to be stored may be stored in a Redis ordered set (sortedset), and the data to be stored is stored in a Redis database in the storage space.
In the embodiment of the present invention, the execution sequence of the steps S301 and S304 is not particularly limited.
By the data synchronization method shown in fig. 3, the data to be stored is stored in the storage space according to the corresponding relationship between the data to be stored and the identification information, so that the ordering of the data stored in the storage space is effectively improved, and the data in the storage database can be conveniently acquired or managed at a later stage.
In an alternative embodiment, according to the method shown in fig. 2, an embodiment of the present invention further provides a data synchronization method. As shown in fig. 4, fig. 4 is a third flowchart of a data synchronization method according to an embodiment of the present invention. The method comprises the following steps.
Step S401, monitoring whether there is data to be synchronized in the storage space of the first server. If yes, go to step S402.
Step S402, acquiring the data to be synchronized from the storage space.
Step S403, based on the remote invocation technology, invokes a second server in the global internet system, and sends the data to be synchronized to the second server, so that the second server receives and stores the data to be synchronized.
The above-described steps S401 to S403 are the same as the above-described steps S201 to S203.
Step S404, detecting whether a data retransmission request sent by the second server for the lost data is received within the timeout period, where the data retransmission request is sent to the first server by the second server when it is determined that the received data to be synchronized is lost. If yes, go to step S405.
In this step, in the data synchronization process, due to the number of the data to be synchronized sent by the first server, the data size of each data to be synchronized, the network environment of the transmission network, and other factors, a part of the data to be synchronized may be lost in the transmission process. At this time, after the second server receives the data to be synchronized, the received data to be synchronized may be detected to determine whether transmission is lost. And if so, sending a data retransmission request for the lost data to the first server. The data retransmission request includes identification information of the lost data. And the first server detects whether a data retransmission request sent by the second server for the lost data is received within the timeout duration for sending the data to be synchronized to the second server.
In an optional embodiment, when the first server sends the data to be synchronized to the second server, the identification information of the data to be synchronized is also sent to the second server. After receiving the data to be synchronized, the second server may detect whether the data to be synchronized is lost according to the received identification information of each data to be synchronized. For example, the first server sends the data to be synchronized with the identification information of 100 to 110 to the second server. But the data to be synchronized received by the second server does not include the data with the identification information of 105. At this time, the second server may determine that the data to be synchronized with the identification information 105 is lost, that is, the lost data is the data to be synchronized with the identification information 105. The second server may send a data retransmission request containing identification information of the missing data to the first server.
In an embodiment of the present invention, the timeout duration is set for each data to be synchronized by the first server. The transmission can be performed specifically according to the data transmission time, the user requirement and the like. Here, the timeout period is not particularly limited.
Step S405, the lost data is sent to the second server.
In this step, when receiving the data retransmission request, the first server may obtain the missing data from the storage space according to the identification information in the received data retransmission request, and resend the obtained missing data to the second server.
When the lost data is sent to the second server, the data synchronization may be performed based on the remote invocation technology, or may be performed based on a network request. Here, the synchronization method of the missing data is not particularly limited.
In an optional embodiment, since there is a certain randomness in data loss in network transmission, in order to improve the integrity of data and the accuracy of data synchronization, when the second server determines that the received data to be synchronized is lost, the second server may send a data retransmission request for the data to be synchronized to the first server. After receiving the data retransmission request, the first server may resend the data to be synchronized to the second server. The second server may complete the data to be synchronized received at the previous time according to the received data to be synchronized.
According to the method shown in fig. 4, the second server sends a data retransmission request to the first server, so that the first server can retransmit the lost data in time, and the reliability of data synchronization and the integrity of the data are improved.
In another alternative embodiment, after receiving the data to be synchronized, the second server may send an acknowledgement message for the received data to be synchronized to the first server, where the acknowledgement message includes identification information of the data to be synchronized. The first server receives the confirmation message. The first server compares the identification information in the received confirmation message with the identification information of the data to be synchronized sent by the first server, so that whether the data to be synchronized has lost data or not can be determined, and if yes, the lost data is sent to the second server again based on the remote calling technology.
Based on the same inventive concept, according to the data synchronization method provided by the embodiment of the invention, the embodiment of the invention also provides a data synchronization device. As shown in fig. 5, fig. 5 is a schematic structural diagram of a data synchronization apparatus according to an embodiment of the present invention. The device comprises the following units.
A monitoring unit 501, configured to monitor whether there is data to be synchronized in a storage space of a first server;
the acquiring unit 502 is configured to acquire data to be synchronized from the storage space when the monitoring result of the monitoring unit 501 is yes;
the synchronization unit 503 is configured to invoke a second server in the global internet system based on a remote invocation technology, and send data to be synchronized to the second server, so that the second server receives and stores the data to be synchronized.
Optionally, the monitoring unit 501 may be specifically configured to, for each data stored in the storage space of the first server, determine whether a storage duration of the data is less than a preset storage duration; and if so, determining the data as the data to be synchronized.
Optionally, the data synchronization apparatus may further include:
the receiving unit is used for receiving data to be stored sent by user equipment in a first area;
the device comprises a determining unit, a storage unit and a processing unit, wherein the determining unit is used for determining identification information corresponding to data to be stored;
and the storage unit is used for storing the data to be stored into the storage space based on the corresponding relation between the data to be stored and the identification information.
Optionally, the first server is long-linked with the second server.
Optionally, the synchronization unit 503 may be specifically configured to call a second server in the global interconnection system based on an RPC protocol, and send data to be synchronized to the second server.
The data synchronization apparatus may further include:
the device comprises a detection unit, a synchronization unit and a synchronization unit, wherein the detection unit is used for detecting whether a data retransmission request sent by a second server aiming at lost data is received within a timeout duration, and the data retransmission request is sent to a first server by the second server when the received data to be synchronized is determined to be lost;
and the sending unit is used for sending the lost data to the second server.
By the device provided by the embodiment of the invention, when the first server synchronizes the data to be synchronized in the storage space to the second server in the global interconnection system, the second server is directly called to receive the data to be synchronized sent by the first service, so that the network request times between the first server and the second server are effectively reduced, the network request duration is shortened, the data transmission delay is further reduced, and the data synchronization efficiency is improved.
Based on the same inventive concept, according to the data synchronization method provided by the above embodiment of the present invention, an embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604;
a memory 603 for storing a computer program;
the processor 601 is configured to implement the following steps when executing the program stored in the memory 603:
monitoring whether the storage space of the first server has data to be synchronized;
if yes, acquiring data to be synchronized from the storage space;
and based on a remote calling technology, calling a second server in the global Internet system, and sending the data to be synchronized to the second server so that the second server receives and stores the data to be synchronized.
According to the electronic device provided by the embodiment of the invention, when the first server synchronizes the data to be synchronized in the storage space to the second server in the global Internet system, the second server is directly called to receive the data to be synchronized sent by the first service, so that the network request frequency between the first server and the second server is effectively reduced, the network request duration is shortened, the data transmission delay is further reduced, and the data synchronization efficiency is improved.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program realizes the steps of any one of the above data synchronization methods when executed by a processor.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the data synchronization methods of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for embodiments such as the apparatus, the electronic device, the computer-readable storage medium, and the computer program product, since they are substantially similar to the method embodiments, the description is relatively simple, and for relevant points, reference may be made to part of the description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A data synchronization method is applied to a first server for managing a first area in a global interconnection system, wherein the global interconnection system comprises servers corresponding to a plurality of areas, and the method comprises the following steps:
monitoring whether the storage space of the first server has data to be synchronized;
if yes, acquiring the data to be synchronized from the storage space;
and calling a second server in the global Internet system based on a remote calling technology, and sending the data to be synchronized to the second server so that the second server receives and stores the data to be synchronized.
2. The method of claim 1, wherein the step of monitoring whether the data to be synchronized exists in the storage space of the first server comprises:
judging whether the storage duration of each data stored in the storage space of the first server is less than a preset storage duration or not;
and if so, determining the data as the data to be synchronized.
3. The method of claim 1, further comprising:
receiving data to be stored sent by the user equipment in the first area;
determining identification information corresponding to the data to be stored;
and storing the data to be stored into the storage space based on the corresponding relation between the data to be stored and the identification information.
4. The method of claim 1, wherein the first server is long-linked to the second server.
5. The method according to any one of claims 1-4, wherein the step of invoking a second server in the global interconnection system based on a remote invocation technique and sending the data to be synchronized to the second server comprises:
and calling a second server in the global Internet system based on a Remote Procedure Call (RPC) protocol, and sending the data to be synchronized to the second server.
6. The method of claim 5, further comprising:
detecting whether a data retransmission request sent by the second server for lost data is received within a timeout duration, wherein the data retransmission request is sent to the first server by the second server when the received data to be synchronized is determined to be lost;
and if so, sending the lost data to the second server.
7. A data synchronization apparatus applied to a first server for managing a first area in a global interconnection system including servers corresponding to a plurality of areas, the apparatus comprising:
the monitoring unit is used for monitoring whether the storage space of the first server has data to be synchronized;
the acquisition unit is used for acquiring the data to be synchronized from the storage space when the monitoring result of the monitoring unit is positive;
and the synchronization unit is used for calling a second server in the global Internet system based on a remote calling technology and sending the data to be synchronized to the second server so that the second server receives and stores the data to be synchronized.
8. The apparatus according to claim 7, wherein the monitoring unit is specifically configured to determine, for each data stored in the storage space of the first server, whether a storage duration of the data is less than a preset storage duration; and if so, determining the data as the data to be synchronized.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-6 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 6.
CN201911061813.0A 2019-11-01 2019-11-01 Data synchronization method and device, electronic equipment and storage medium Pending CN110851290A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911061813.0A CN110851290A (en) 2019-11-01 2019-11-01 Data synchronization method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911061813.0A CN110851290A (en) 2019-11-01 2019-11-01 Data synchronization method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110851290A true CN110851290A (en) 2020-02-28

Family

ID=69599646

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911061813.0A Pending CN110851290A (en) 2019-11-01 2019-11-01 Data synchronization method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110851290A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112417033A (en) * 2020-10-19 2021-02-26 中国科学院计算机网络信息中心 Method and system for realizing multi-node data consistency of distributed graph database
CN112561449A (en) * 2020-12-25 2021-03-26 云汉芯城(上海)互联网科技股份有限公司 Method and system for synchronizing inventory information
CN114553895A (en) * 2022-04-24 2022-05-27 浙江中控技术股份有限公司 Data synchronization method, system, storage medium and electronic equipment
CN115052003A (en) * 2022-04-29 2022-09-13 钉钉(中国)信息技术有限公司 Data synchronization method, related device and medium
CN115080311A (en) * 2022-07-01 2022-09-20 深圳美克拉网络技术有限公司 Informatization remote control method and device for big data
CN115348272A (en) * 2022-08-15 2022-11-15 四川虹美智能科技有限公司 Automatic synchronization method and device for server output
US11928948B2 (en) * 2020-10-19 2024-03-12 Changxin Memory Technologies, Inc. Environmental data monitoring method and monitoring system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150304417A1 (en) * 2012-12-31 2015-10-22 Huawei Technologies Co., Ltd. Data synchronization method, and device
CN107087038A (en) * 2017-06-29 2017-08-22 珠海市魅族科技有限公司 A kind of method of data syn-chronization, synchronizer, device and storage medium
CN109788027A (en) * 2018-12-13 2019-05-21 平安科技(深圳)有限公司 Method of data synchronization, device, server and computer storage medium
CN110035132A (en) * 2019-04-30 2019-07-19 深圳市网心科技有限公司 Method of data synchronization, computer installation and storage medium
CN110188118A (en) * 2019-04-25 2019-08-30 广州至真信息科技有限公司 A kind of method of data synchronization, device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150304417A1 (en) * 2012-12-31 2015-10-22 Huawei Technologies Co., Ltd. Data synchronization method, and device
CN107087038A (en) * 2017-06-29 2017-08-22 珠海市魅族科技有限公司 A kind of method of data syn-chronization, synchronizer, device and storage medium
CN109788027A (en) * 2018-12-13 2019-05-21 平安科技(深圳)有限公司 Method of data synchronization, device, server and computer storage medium
CN110188118A (en) * 2019-04-25 2019-08-30 广州至真信息科技有限公司 A kind of method of data synchronization, device
CN110035132A (en) * 2019-04-30 2019-07-19 深圳市网心科技有限公司 Method of data synchronization, computer installation and storage medium

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112417033A (en) * 2020-10-19 2021-02-26 中国科学院计算机网络信息中心 Method and system for realizing multi-node data consistency of distributed graph database
US11928948B2 (en) * 2020-10-19 2024-03-12 Changxin Memory Technologies, Inc. Environmental data monitoring method and monitoring system
CN112561449A (en) * 2020-12-25 2021-03-26 云汉芯城(上海)互联网科技股份有限公司 Method and system for synchronizing inventory information
CN112561449B (en) * 2020-12-25 2022-05-10 云汉芯城(上海)互联网科技股份有限公司 Method and system for synchronizing inventory information
CN114553895A (en) * 2022-04-24 2022-05-27 浙江中控技术股份有限公司 Data synchronization method, system, storage medium and electronic equipment
CN114553895B (en) * 2022-04-24 2022-07-22 浙江中控技术股份有限公司 Data synchronization method, system, storage medium and electronic equipment
CN115052003A (en) * 2022-04-29 2022-09-13 钉钉(中国)信息技术有限公司 Data synchronization method, related device and medium
CN115052003B (en) * 2022-04-29 2024-03-22 钉钉(中国)信息技术有限公司 Data synchronization method, related device and medium
CN115080311A (en) * 2022-07-01 2022-09-20 深圳美克拉网络技术有限公司 Informatization remote control method and device for big data
CN115080311B (en) * 2022-07-01 2023-01-24 深圳美克拉网络技术有限公司 Informatization remote control method and device for big data
CN115348272A (en) * 2022-08-15 2022-11-15 四川虹美智能科技有限公司 Automatic synchronization method and device for server output

Similar Documents

Publication Publication Date Title
CN110851290A (en) Data synchronization method and device, electronic equipment and storage medium
CN111585867B (en) Message processing method and device, electronic equipment and readable storage medium
CN112087644B (en) Pull stream request processing method, device and system, electronic equipment and storage medium
CN109614439B (en) Data synchronization method, device, electronic equipment and storage medium
CN107315825B (en) Index updating system, method and device
CN108718347B (en) Domain name resolution method, system, device and storage medium
CN108156252B (en) Data access method and device, server and client
CN111147310A (en) Log tracking processing method, device, server and medium
CN111212135A (en) Message subscription method, device, system, electronic equipment and storage medium
CN107493486B (en) Method, system and terminal equipment for video playing termination
CN115080272A (en) Business data processing method, electronic device and storage medium
CN110430070B (en) Service state analysis method, device, server, data analysis equipment and medium
CN112653736B (en) Parallel source returning method and device and electronic equipment
CN112468585B (en) Data transmission method and device, electronic equipment and storage medium
CN110222034A (en) A kind of database maintenance method and device
CN110795495A (en) Data processing method and device, electronic equipment and computer readable medium
CN109471713B (en) Method and device for inquiring information
CN113360815A (en) Request retry method and device
CN108234658B (en) Method and device for sensing health condition of server cluster and server
WO2023273576A1 (en) Abnormal request processing method and apparatus, electronic device and storage medium
KR20210044281A (en) Method and apparatus for ensuring continuous device operation stability in cloud degraded mode
CN113553206B (en) Data event execution method and device, electronic equipment and computer readable medium
CN113364887B (en) File downloading method based on FTP, proxy server and system
CN110113187B (en) Configuration updating method and device, configuration server and configuration system
CN113014456A (en) Monitoring data transmission system, method, device, equipment and storage medium

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
TA01 Transfer of patent application right

Effective date of registration: 20210527

Address after: 25, 5th floor, shuangjingfang office building, 3 frisha street, Singapore

Applicant after: Zhuomi Private Ltd.

Address before: Room 1101, Santai Commercial Building, 139 Connaught Road, Hong Kong, China

Applicant before: HONG KONG LIVE.ME Corp.,Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20200228