WO2021027115A1 - 数据同步方法、装置、计算机设备和存储介质 - Google Patents

数据同步方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2021027115A1
WO2021027115A1 PCT/CN2019/116523 CN2019116523W WO2021027115A1 WO 2021027115 A1 WO2021027115 A1 WO 2021027115A1 CN 2019116523 W CN2019116523 W CN 2019116523W WO 2021027115 A1 WO2021027115 A1 WO 2021027115A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
server
primary key
key information
information
Prior art date
Application number
PCT/CN2019/116523
Other languages
English (en)
French (fr)
Inventor
徐从洋
王晓宇
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021027115A1 publication Critical patent/WO2021027115A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • 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

Definitions

  • This application relates to a data synchronization method, device, computer equipment and storage medium.
  • Server and server data synchronization is usually done directly through the network.
  • data providers need to consider server data security when providing data services, and data users must also ensure the security of data in the server. If the server is directly connected for synchronization, there will be a security problem of server data leakage.
  • the data provider usually provides client software to the data user, and the data user installs the client software to synchronize data with the server software installed by the data provider.
  • this method requires the installation of client software and server software, which has the problem of wasting server resources such as running memory.
  • a data synchronization method, device, computer equipment, and storage medium are provided.
  • a data synchronization method includes:
  • the second data synchronization request carrying second authority information, and verifying whether the second authority information is consistent with the first authority information
  • the data corresponding to the first permission information is searched, and the data is synchronized to the second server.
  • a data synchronization device includes:
  • the first synchronization module is configured to receive a first data synchronization request sent by the first server, and synchronize data in the first server according to the first data synchronization request;
  • An information acquisition module configured to acquire first permission information corresponding to the data from the first server
  • the verification module is configured to receive a second data synchronization request sent by the second server, the second data synchronization request carries second authority information, and verifies whether the second authority information is consistent with the first authority information;
  • the second synchronization module is used to search for data corresponding to the first permission information when the verification is passed, and synchronize the data to the second server.
  • a computer device including a memory and one or more processors, the memory stores computer readable instructions, when the computer readable instructions are executed by the processor, the one or more processors execute The following steps:
  • the second data synchronization request carrying second authority information, and verifying whether the second authority information is consistent with the first authority information
  • the data corresponding to the first permission information is searched, and the data is synchronized to the second server.
  • One or more non-volatile storage media storing computer-readable instructions.
  • the computer-readable instructions When executed by one or more processors, the one or more processors perform the following steps:
  • the second data synchronization request carrying second authority information, and verifying whether the second authority information is consistent with the first authority information
  • the data corresponding to the first permission information is searched, and the data is synchronized to the second server.
  • Fig. 1 is an application scenario diagram of a data synchronization method according to one or more embodiments.
  • Fig. 2 is a schematic flowchart of a data synchronization method according to one or more embodiments.
  • Fig. 3 is a schematic flowchart of sending a synchronization request according to one or more embodiments.
  • Fig. 4 is a schematic diagram of a process of synchronizing data with a cloud server according to one or more embodiments.
  • Fig. 5 is a schematic diagram of a process of synchronizing data with a second server according to one or more embodiments.
  • Fig. 6 is a schematic diagram of a process of deleting data by a second server according to one or more embodiments.
  • Fig. 7 is a block diagram of a data synchronization device according to one or more embodiments.
  • Figure 8 is a block diagram of a computer device according to one or more embodiments.
  • the data synchronization method provided in this application can be applied to the application environment shown in FIG. 1.
  • the first server 102 communicates with the cloud server 104 through the network, and the cloud server 104 communicates with the second server 106 through the network.
  • the cloud server 104 receives the first data synchronization request sent by the first server 102, synchronizes the data in the first server 102 according to the first data synchronization request; obtains the first permission information corresponding to the data from the first server 102; receives the second
  • the second data synchronization request sent by the server 106, the second data synchronization request carries the second authority information, and it is verified whether the second authority information is consistent with the first authority information; when the verification is passed, the cloud server 104 searches for the data corresponding to the first authority information , And synchronize the data to the second server 106.
  • the first server 102 or the second server 106 may be implemented by an independent server or a server cluster composed of multiple servers.
  • a data synchronization method is provided. Taking the method applied to the cloud server in FIG. 1 as an example for description, the method includes the following steps:
  • S202 Receive a first data synchronization request sent by the first server, and synchronize data in the first server according to the first data synchronization request.
  • the first server is a data provider server, which is used to synchronize data to a cloud server and provide it to the data user for use.
  • the first data refers to the data to be provided by the first server to the data user.
  • the cloud server receives the first data synchronization request sent by the first server, and the first data synchronization request may carry the data identifier of the data to be synchronized, for example, the data of the data table to be synchronized, the data identifier may be the name of the data table .
  • the data identifier can be the name of the database, etc.
  • the cloud server parses and obtains the data identifier of the data to be synchronized according to the first data synchronization request. According to the data identifier, the data corresponding to the data identifier is synchronized from the first server, and the synchronized data is saved in the database.
  • the first authority information is used to control the data synchronization authority information of the first server in the cloud server. For example, it may be an access password, or an identifier of a data user.
  • the first server sends the first permission information corresponding to the synchronized data to the cloud server, and the cloud server obtains the first permission information sent by the first server, and the first permission The information is stored in the authority information table for preservation.
  • the permission information table stores the permission information and the data identifier corresponding to the permission information.
  • S206 Receive a second data synchronization request sent by the second server, where the second data synchronization request carries second authority information, and verify whether the second authority information is consistent with the first authority information.
  • the second server is a data consumer server, used to synchronize required data from the cloud server.
  • the second authority information refers to the authority information corresponding to the data to be synchronized by the second server, and the authority information may be an access password, may be an identifier of the second server, and so on.
  • the second server when the second server wants to synchronize data in the cloud server, it sends a second data synchronization request to the cloud server, the second data synchronization request carries second authority information, and the cloud server receives the second data sent by the second server The synchronization request is parsed to obtain the second permission information. Then the permission information in the permission information table is matched with the second permission information. When the second permission information is consistent with the first permission information, the verification permission information is passed. When the second permission information matches the permission information in the permission table When the authority information is inconsistent, the cloud server sends the information for obtaining the authority to the second server.
  • the cloud server verifies that the second authority information is consistent with the first authority information
  • the data identifier corresponding to the first authority information is found from the authority information table of the cloud server, and the identified data is found according to the data identifier, and then the cloud The server synchronizes the found data to the second server.
  • the cloud server realizes the data synchronization between the server and the server, which can reduce the waste of the server's running memory resources while ensuring data security, reduce the pressure on the server, and improve the efficiency of the server's business processing capabilities.
  • step S202 that is, before receiving the first data synchronization request sent by the first server, and synchronizing the data in the first server according to the first data synchronization request, the method further includes the following steps:
  • Long connection refers to TCP (Transmission Control Protocol) long connection. Multiple data packets can be sent continuously on one connection. During the connection maintenance period, if no data packets are sent, both parties need to send link detection packets. The user maintains a long-term communication connection between the two parties, which is convenient for data transmission.
  • TCP Transmission Control Protocol
  • the cloud server receives the data synchronization instruction sent by the first server, and according to the data synchronization instruction, the cloud server establishes a long connection with the first server to realize data transmission between the first server and the cloud server.
  • a long connection is established synchronously for data transmission, without the need for data synchronization software, which reduces the consumption of running content resources of the server.
  • step S206 before step S206, that is, before receiving the second data synchronization request sent by the second server, the method further includes the following steps:
  • the second server obtains the cloud server address, and maps the local address to the cloud server address.
  • the local address refers to the local IP address (Internet Protocol Address) of the second server in the local network.
  • the local network refers to a network architecture. In the mobile network protocol, the local network refers to a network device with a fixed IP address. With mobile IP, a mobile node can use a care-of address to ensure that the IP address remains unchanged when the physical location is transferred to other subnets.
  • the second server obtains the cloud server IP address, and maps the local IP address to the cloud server IP address.
  • S304 Send a second data synchronization request to the cloud server through the local address.
  • the second server sends a second data synchronization request to the cloud server through a local address
  • the cloud server receives the second data synchronization request
  • a long connection establishment tool can be used to establish a long connection.
  • the long connection establishment tool can be ETL (Extract-Transform-Load), which is used to describe the extraction, transformation, and load of data from the source. Process to the destination) tool.
  • the cloud server address is acquired through the second server, the local address is mapped to the cloud server address, and the second data synchronization request is sent to the cloud server through the local address to realize the data communication between the second server and the cloud server, and It is convenient and quick to send the second data synchronization request to the cloud server through the local address.
  • step S202 namely synchronizing data in the first server according to the first data synchronization request, includes the steps:
  • S402 Regularly receive incremental data sent by the first server, and obtain new primary key information from the incremental data.
  • Incremental data refers to data to be stored in the cloud server in the first server, and the data is new data generated by the first server and needs to be synchronized to the cloud server.
  • Primary key information refers to the maximum value or all values of the database primary key.
  • the database primary key refers to a column or a combination of multiple columns, and its value can uniquely identify each row in the table.
  • the cloud server regularly receives the incremental data sent by the first server through the TCP long connection, and obtains the primary key value from the incremental data.
  • S404 Acquire the primary key information in the data, and save the incremental data when the primary key information is different from the newly added primary key information.
  • the cloud server obtains the primary key value of the data that the second server has saved in the cloud server, and compares the primary key value of the saved data with the primary key value of the incremental data. When the primary key value of the saved data is When the primary key values of the incremental data are not the same, the cloud server saves the received incremental data.
  • S406 Regularly receive the deleted primary key information sent by the first server, search for the deleted primary key information from the primary key information, and when the deleted primary key information can be queried, delete the data corresponding to the deleted primary key information from the data.
  • the cloud server receives the primary key value of the deleted data sent by the first server at a preset time interval. Search for the deleted primary key value in the saved primary key value, and when the deleted primary key information can be found, the cloud server deletes the data corresponding to the deleted primary key value from the data saved by the second server.
  • the first server encrypts the data to be synchronized by using an encryption algorithm, and synchronizes the encrypted data to the cloud server.
  • the second server synchronizes to the data in the cloud server, it obtains the key information, uses the key information to decrypt the encrypted data to obtain the original data, and then performs data cleaning on the original data. Check data consistency, handle invalid values and missing values, etc.
  • the data corresponding to the deleted primary key information is synchronized with the data in the first server to ensure the accuracy and error-free data synchronization by periodically obtaining the increment, saving and deleting the data corresponding to the deleted primary key information.
  • step S208 which is to synchronize data to the second server, includes the steps:
  • S502 Acquire the synchronized primary key information sent by the second server, and acquire the primary key information of the data.
  • the synchronized primary key information refers to the value of the primary key of the data that the second server has synchronized.
  • the second server when the second server synchronizes data in the cloud server, when the second server synchronizes the data in the cloud server for the first time, the second server directly retrieves all the data corresponding to the permission information from the cloud server, and saves the acquired data .
  • the cloud server obtains the synchronized primary key value of the synchronized data sent by the second server, which may be the largest primary key value or all primary key values. Then the cloud server obtains the updated primary key value of the updated data.
  • S504 Compare the synchronized primary key information with the primary key information to obtain unsynchronized primary key information.
  • the cloud server compares the synchronized primary key value with the updated primary key value to obtain the unsynchronized primary key value.
  • the second server sends the data corresponding to the unsynchronized primary key information.
  • the cloud server obtains the updated data corresponding to the unsynchronized primary key value from the database, and sends the updated data to the second server.
  • the corresponding unsynchronized primary key information is obtained.
  • the corresponding data can be synchronized, and the updated data can be synchronized to the second server, so that the first The second server gets the updated data.
  • step S506 that is, after sending the data corresponding to the unsynchronized primary key information to the second server, the method further includes the following steps:
  • the second server regularly obtains the primary key information of the data from the cloud server, and obtains the local primary key information in the local database.
  • the second server obtains the cloud master key value of the data synchronized by the first server from the cloud server according to the budget time interval, and obtains the local master key value of the synchronized data corresponding to the second server from the local database.
  • S604 Compare the primary key information of the data with the local primary key information in the local database to obtain differential primary key information.
  • Differential primary key information refers to primary key information that exists in the local primary key information but does not exist in the primary key information of the data, and is used to determine the data deleted by the cloud and the data that exists in the local database of the second server.
  • the second server compares the cloud primary key value with the local primary key value, and when the local primary key value and the cloud primary key value are inconsistent, obtain the difference that does not exist in the cloud primary key value and exists in the local primary key value Primary key value. For example, when the maximum value of the local primary key is greater than the maximum value of the cloud primary key, the difference primary key value is obtained according to the maximum value of the local primary key and the maximum cloud primary key.
  • the local primary key value and the cloud primary key value can also be matched one by one to obtain the primary key value that exists in the local primary key value but the cloud primary key value does not exist, and the difference primary key value is obtained.
  • the second server when the second server obtains the difference primary key value, it deletes the data corresponding to the difference primary key value from the local database.
  • the differential primary key information is obtained, and the data corresponding to the differential primary key information is deleted from the local database, so that the data stored in the local database and the data stored in the cloud server Data synchronization improves the accuracy of data synchronization.
  • step S208 that is, synchronizing data to the second server, includes the steps:
  • Cleaning data according to the priority of the data refers to synchronizing the data with the higher priority according to the priority of the data, keeping the data with the lower priority, that is, out of synchronization, and then cleaning the synchronized data, that is, processing invalid data.
  • Invalid data refers to the data predicted by the prediction algorithm, not the data actually generated.
  • the timeliness of the data provider to obtain the fund's net value is sometimes not as fast as the fund manager provides the net value, so some algorithms are used to form a virtual net value to calculate the performance increase, which ensures that the fund product's increase data will be available after each trading day , But this increase calculated by the virtual net value has not been uniformly recognized by the market, so this type of increase data will be washed out during use.
  • the second server sets the priority of the data corresponding to the data source according to the trust level of the data source.
  • the data of the second server such as the data of the National Data Center
  • the data of other servers such as the data of Internet websites
  • the grade is low.
  • the second server synchronizes data from the cloud server, it first obtains the priority level of the data, determines the data corresponding to the high priority level according to the priority level of the data, cleans the data corresponding to the high priority level, that is, deletes invalid data, and then The cleaned data is synchronized to the second server, and the second server saves the synchronized data.
  • the second server when the second server finishes synchronizing data from the cloud server, it extracts the synchronized data to obtain the data corresponding to the preset data field, and saves the extracted data to the service corresponding to the preset data field
  • the corresponding data can be directly obtained from the business data to improve the efficiency of business processing.
  • a data synchronization device 700 including: a first synchronization module 702, an information acquisition module 704, a verification module 706, and a second synchronization module 708, wherein:
  • the first synchronization module 702 is configured to receive a first data synchronization request sent by a first server, and synchronize data in the first server according to the first data synchronization request;
  • the information obtaining module 704 is configured to obtain the first permission information corresponding to the data from the first server;
  • the verification module 706 is configured to receive a second data synchronization request sent by the second server, where the second data synchronization request carries second authority information, and verifies whether the second authority information is consistent with the first authority information;
  • the second synchronization module 708 is configured to find data corresponding to the first permission information when the verification is passed, and synchronize the data to the second server.
  • the data synchronization device 700 further includes:
  • the connection establishment module is used to receive the data synchronization instruction sent by the first server, and establish a long connection with the first server according to the data synchronization instruction.
  • the data synchronization device 700 further includes:
  • the mapping module is used for the second server to obtain the cloud server address and map the local address to the cloud server address;
  • the request sending module is configured to send the second data synchronization request to the cloud server through the local address.
  • the first synchronization module 702 includes:
  • the data receiving module is used to periodically receive the incremental data sent by the first server, and obtain the new primary key information from the incremental data;
  • the data saving module is used to obtain the primary key information in the data. When the primary key information is different from the newly added primary key information, the incremental data is saved;
  • the data deletion module is used to periodically receive the deleted primary key information sent by the first server, find the deleted primary key information from the primary key information, and delete the data corresponding to the deleted primary key information from the data when the deleted primary key information can be queried.
  • the second synchronization module 708 includes:
  • the primary key acquisition module is used to acquire the synchronized primary key information sent by the second server and acquire the primary key information of the data;
  • the comparison module is used to compare the synchronized primary key information with the primary key information to obtain the unsynchronized primary key information
  • the data sending module is used to send the data corresponding to the unsynchronized master key information to the second server.
  • the second synchronization module 708 further includes:
  • the local primary key acquisition module is used for the second server to periodically acquire the primary key information of the data from the cloud server and acquire the local primary key information in the local database;
  • the difference obtaining module is used to compare the primary key information of the data with the local primary key information in the local database to obtain the difference primary key information;
  • the delete module is used to delete the data corresponding to the differential primary key information from the local database.
  • the second synchronization module 708 includes:
  • the data cleaning module is used to obtain the priority of the data, clean the data according to the priority of the data, and synchronize the cleaned data to the second server.
  • Each module in the above-mentioned data synchronization device can be implemented in whole or in part by software, hardware and a combination thereof.
  • the foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 8.
  • the computer equipment includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer readable instructions, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium.
  • the computer equipment database is used to store synchronized data.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer-readable instructions are executed by the processor to realize a data synchronization method.
  • FIG. 8 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
  • a computer device includes a memory and one or more processors.
  • the memory stores computer readable instructions.
  • the steps of the data synchronization method provided in any embodiment of the present application are implemented.
  • One or more non-volatile storage media storing computer-readable instructions.
  • the computer-readable instructions are executed by one or more processors, the one or more processors realize the data provided in any embodiment of the present application Steps of the synchronization method.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • ROM read only memory
  • PROM programmable ROM
  • EPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种数据同步方法,包括:接收第一服务器发送的第一数据同步请求,根据第一数据同步请求同步第一服务器中的数据;从第一服务器中获取到数据对应的第一权限信息;接收第二服务器发送的第二数据同步请求,第二数据同步请求携带第二权限信息,验证第二权限信息是否与第一权限信息一致;当验证通过时,查找第一权限信息对应的数据,并将数据同步到第二服务器。

Description

数据同步方法、装置、计算机设备和存储介质
相关申请的交叉引用
本申请要求于2019年08月13日提交中国专利局,申请号为2019107442208,申请名称为“数据同步方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及一种数据同步方法、装置、计算机设备和存储介质。
背景技术
服务器与服务器数据同步通常是通过网络直接进行数据同步。然而数据提供方在进行数据提供服务时,需要考虑服务器数据安全性,而数据使用方也要保障服务器中数据的安全性,如果服务器直接相连进行同步就存在服务器数据泄露的安全问题。目前,为了保障数据安全性,通常数据提供方会提供客户端软件给数据使用方,数据使用方安装客户端软件之后与数据提供方安装的服务器端软件进行数据的同步。然而这种方法需要安装客户端软件和服务端软件,存在浪费运行内存等服务器资源的问题。
发明内容
根据本申请公开的各种实施例,提供一种数据同步方法、装置、计算机设备和存储介质。
一种数据同步方法,包括:
接收第一服务器发送的第一数据同步请求,根据第一数据同步请求同步第一服务器中的数据;
从第一服务器中获取到数据对应的第一权限信息;
接收第二服务器发送的第二数据同步请求,第二数据同步请求携带第二权限信息,验证第二权限信息是否与第一权限信息一致;及
当验证通过时,查找第一权限信息对应的数据,并将数据同步到第二服务器。
一种数据同步装置,包括:
第一同步模块,用于接收第一服务器发送的第一数据同步请求,根据第一数据同步请求同步第一服务器中的数据;
信息获取模块,用于从第一服务器中获取到数据对应的第一权限信息;
验证模块,用于接收第二服务器发送的第二数据同步请求,第二数据同步请求携带第二权限信息,验证第二权限信息是否与第一权限信息一致;及
第二同步模块,用于当验证通过时,查找第一权限信息对应的数据,并将数据同步到第二服务器。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:
接收第一服务器发送的第一数据同步请求,根据第一数据同步请求同步第一服务器中的数据;
从第一服务器中获取到数据对应的第一权限信息;
接收第二服务器发送的第二数据同步请求,第二数据同步请求携带第二权限信息,验证第二权限信息是否与第一权限信息一致;及
当验证通过时,查找第一权限信息对应的数据,并将数据同步到第二服务器。
一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
接收第一服务器发送的第一数据同步请求,根据第一数据同步请求同步第一服务器中的数据;
从第一服务器中获取到数据对应的第一权限信息;
接收第二服务器发送的第二数据同步请求,第二数据同步请求携带第二权限信息,验证第二权限信息是否与第一权限信息一致;及
当验证通过时,查找第一权限信息对应的数据,并将数据同步到第二服务器。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为根据一个或多个实施例中数据同步方法的应用场景图。
图2为根据一个或多个实施例中数据同步方法的流程示意图。
图3为根据一个或多个实施例中发送同步请求的流程示意图。
图4为根据一个或多个实施例中云服务器同步数据的流程示意图。
图5为根据一个或多个实施例中第二服务器同步数据的流程示意图。
图6为根据一个或多个实施例中第二服务器删除数据的流程示意图。
图7为根据一个或多个实施例中数据同步装置的框图。
图8为根据一个或多个实施例中计算机设备的框图。
具体实施方式
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供的数据同步方法,可以应用于如图1所示的应用环境中。第一服务器102通过网络与云服务器104进行通信,云服务器104通过网络与 第二服务器106进行通信。云服务器104接收第一服务器102发送的第一数据同步请求,根据第一数据同步请求同步第一服务器102中的数据;从第一服务器102中获取到数据对应的第一权限信息;接收第二服务器106发送的第二数据同步请求,第二数据同步请求携带第二权限信息,验证第二权限信息是否与第一权限信息一致;当验证通过时,云服务器104查找第一权限信息对应的数据,并将数据同步到第二服务器106。第一服务器102或者第二服务器106可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在其中一个实施例中,如图2所示,提供了一种数据同步方法,以该方法应用于图1中的云服务器为例进行说明,包括以下步骤:
S202,接收第一服务器发送的第一数据同步请求,根据第一数据同步请求同步第一服务器中的数据。
第一服务器是数据提供方服务器,用于将数据同步到云服务器中,提供给数据使用方进行使用。数据提供方可以有多个即可以有不同的数据源。第一数据是指第一服务器要提供给数据使用方的数据。
具体地,云服务器接收第一服务器发送的第一数据同步请求,该第一数据同步请求中可以携带有要同步数据的数据标识,比如要同步数据表的数据,数据标识可以是数据表的名称。要同步数据库的数据,数据标识可以是数据库的名称等。云服务器根据第一数据同步请求解析得到要同步数据的数据标识。并根据该数据标识从第一服务器中同步数据标识对应的数据,并将同步到的数据保存到数据库中。
S204,从第一服务器中获取到数据对应的第一权限信息。
第一权限信息用于控制云服务器中第一服务器数据同步权限的信息,比如,可以是访问密码,也可是数据使用方标识等等。
具体地,当从第一服务器中同步数据完成时,第一服务器向云服务器发送同步的数据对应的第一权限信息,云服务器获取到第一服务器发送的第一权限信息,将该第一权限信息存储到权限信息表中进行保存。该权限信息表 中存储权限信息和权限信息对应的数据标识。
S206,接收第二服务器发送的第二数据同步请求,第二数据同步请求携带第二权限信息,验证第二权限信息是否与第一权限信息一致。
第二服务器是数据使用方服务器,用于从云服务器中同步所需要的数据。第二权限信息是指第二服务器要同步的数据对应的权限信息,该权限信息可以是访问密码,可以是第二服务器标识等等。
具体地,当第二服务器要同步云服务器中数据时,向云服务器发送第二数据同步请求,该第二数据同步请求携带有第二权限信息,云服务器接收到第二服务器发送的第二数据同步请求,解析该第二数据同步请求得到第二权限信息。然后将权限信息表中的权限信息与该第二权限信息进行匹配,当该第二权限信息与第一权限信息一致时,验证权限信息通过,当第二权限信息与权限嘻嘻你表中的权限信息都不一致时,云服务器向第二服务器发送获取权限的信息。
S208,当验证通过时,查找第一权限信息对应的数据,并将数据同步到第二服务器。
具体地,当云服务器验证第二权限信息与第一权限信息一致时,从云服务器的权限信息表中查找到第一权限信息对应的数据标识,根据该数据标识查找到标识的数据,然后云服务器将查找到的数据同步的到第二服务器中。
在上述数据同步方法中,通过接收第一服务器发送的第一数据同步请求,根据第一数据同步请求同步第一服务器中的数据;从第一服务器中获取到数据对应的第一权限信息;接收第二服务器发送的第二数据同步请求,第二数据同步请求携带第二权限信息,验证第二权限信息是否与第一权限信息一致;当验证通过时,查找第一权限信息对应的数据,并将数据同步到第二服务器。通过云服务器实现了服务器与服务器之间的数据同步,保证数据安全性的同时能够减少服务器运行内存资源的浪费,减轻服务器的压力,提高服务器处理业务能力的效率。
在其中一个实施例中,在步骤S202之前,即在接收第一服务器发送的第 一数据同步请求,根据第一数据同步请求同步第一服务器中的数据之前,还包括步骤:
接收第一服务器发送的数据同步指令,根据数据同步指令与第一服务器建立长连接。
长连接是指TCP(Transmission Control Protocol传输控制协议)长连接,可以在一个连接上可以连续发送多个数据包,在连接保持期间,如果没有数据包发送,需要双方发链路检测包。用户保持通信双方的长时间通信连接,便于进行数据传输等。
具体地,云服务器接收到第一服务器发送的数据同步指令,根据数据同步指令云服务器与第一服务器建立长连接,实现第一服务器与云服务器的数据传输。并且同步建立长连接来进行数据传输,无需使用数据同步软件,减少了服务器的运行内容资源消耗。
在其中一个实施例中,如图3所示,在步骤S206之前,即在接收第二服务器发送的第二数据同步请求之前,还包括步骤:
S302,第二服务器获取云服务器地址,将本地地址映射为云服务器地址。
本地地址是指第二服务器在本地网络中的本地IP地址(Internet Protocol Address,互联网协议地址)。本地网络是指一种网络构架,在移动网络协议中,本地网络指拥有固定IP地址的网络设备。利用移动IP,移动节点可以通过转交地址,在物理位置转移到其他子网中时仍然保证IP地址不变。
具体地,第二服务器获取云服务器IP地址,并将本地IP地址映射为云服务器IP地址。
S304,通过本地地址向云服务器发送第二数据同步请求。
具体地,第二服务器通过本地地址向云服务器发送第二数据同步请求,云服务器接收到第二数据同步请求,根据该第二数据同步请求云服务器与第二服务器建立长连接。比如,可以使用长连接建立工具建立长连接,长连接建立工具可以是ETL(Extract-Transform-Load,用来描述将数据从来源端经过萃取(extract)、转置(transform)、加载(load)至目的端的过程)工具。
上述实施例中,通过第二服务器获取云服务器地址,将本地地址映射为云服务器地址,通过本地地址向云服务器发送第二数据同步请求实现了第二服务器与云服务器之间的数据通信,并通过本地地址向云服务器发送第二数据同步请求,方便快捷。
在其中一个实施例中,如图4所示,步骤S202,即根据第一数据同步请求同步第一服务器中的数据,包括步骤:
S402,定时接收第一服务器发送的增量数据,从增量数据中得到新增主键信息。
增量数据是指在第一服务器中要存储的到云服务器中的数据,该数据是第一服务器产生的新数据并且需要同步到云服务器中。主键信息是指数据库主键的最大值或者所有值,数据库主键指的是一个列或多列的组合,其值能唯一地标识表中的每一行。
具体地,云服务器定时通过TCP长连接接收到第一服务器发送的增量数据,从增量数据中得到主键值。
S404,获取数据中的主键信息,当主键信息与新增主键信息不相同时,将增量数据保存。
具体地,云服务器获取到该第二服务器已保存在云服务器中的数据的主键的值,比较已保存数据的主键值和增量数据的主键值,当已保存数据的主键值和增量数据的主键值不相同时,云服务器将接收到的增量数据保存。
S406,定时接收第一服务器发送的已删除主键信息,从主键信息中查找已删除主键信息,当能够查询到已删除主键信息时,从数据中删除已删除主键信息对应的数据。
具体地,当第一服务器删除保存的数据时,得到删除数据的主键值,将删除数据的主键值通过长连接发送到云服务器中。云服务器按照预设的时间间隔接收第一服务器发送的已删除数据的主键值。在已保存的主键值中查找已删除的主键值,当能够查找到已删除主键信息时,云服务器从第二服务器已保存的数据中删除已删除主键值对应的数据。
在一个具体地实施例中,第一服务器使用加密算法将需要同步的数据进行加密,将加密之后的数据同步到云服务器中。当第二服务器同步到云服务器中的数据时,获取到密钥信息,使用密钥信息解密加密的数据,得到原始数据,然后在对原始数据进行数据清洗。检查数据一致性,处理无效值和缺失值等。
在上述实施例中,通过定时获取到增量进行保存并删除已删除主键信息对应的数据,实现了将第一服务器中的数据同步到云服务器中,保证数据同步的准确和无误。
在其中一个实施例中,如图5所示,步骤S208,即将数据同步到第二服务器,包括步骤:
S502,获取第二服务器发送的已同步主键信息,并获取数据的主键信息。
已同步主键信息是指第二服务器已经同步完成数据的主键的值,
具体地,当第二服务器同步云服务器中数据时,当第二服务器是首次同步云服务器中的数据时,第二服务器直接从云服务器重获取权限信息对应的全部数据,并将获取的数据保存。当第二服务器同步云服务器中更新的数据时,云服务器获取第二服务器发送的已同步数据的已同步主键值,可以是最大的主键值,也可以是所有的主键值。然后云服务器获取到更新后的数据的更新主键值。
S504,比较已同步主键信息和主键信息,得到未同步主键信息。
具体地,云服务器比较已同步主键值和更新主键值,得到未同步主键值。
S506,将未同步主键信息对应的数据发送的第二服务器。
具体地,云服务器从数据库中获取到未同步主键值对应的更新的数据,将更新的数据发送到第二服务器中。
在上述实施例中,通过比较已同步的主键信息和更新主键信息,得到对应的未同步主键信息,根据未同步主键信息同步对应的数据,能够将更新的数据同步到第二服务器中,使第二服务器得到更新后的数据。
在其中一个实施例中,在步骤S506,即在将未同步主键信息对应的数据 发送的第二服务器之后,还包括步骤:
S602,第二服务器定时从云服务器中获取数据的主键信息,并获取本地数据库中的本地主键信息。
具体地,第二服务器按照预算时间间隔从云服务器中获取第一服务器同步的数据的云端主键值,并从本地数据库中获取到已同步第二服务器对应数据的本地主键值。
S604,比较数据的主键信息与本地数据库中的本地主键信息,得到差异主键信息。
差异主键信息是指在本地主键信息中存在而在数据的主键信息中未存在的主键信息,用于确定云端删除的数据而在第二服务器本地数据库中存在的数据。
具体地,第二服务器比较云端主键值与本地主键值,当本地主键值和云端主键值不一致时,得到在云端主键值中未存在的且在本地主键值中存在的差异主键值。比如,本地主键最大值比云端主键最大值大时时,根据本地主键最大值和云端主键最大值得到差异主键值。也可将本地主键值和云端主键值一一进行匹配,得到本地主键值中存在而云端主键值未存在的主键值,得到差异主键值。
S606,从本地数据库中删除差异主键信息对应的数据。
具体地,第二服务器得到差异主键值时,从本地数据库中删除差异主键值对应的数据。
在上述实施例中,通过比较数据的主键信息与本地数据库中的本地主键信息,得到差异主键信息,从本地数据库中删除差异主键信息对应的数据,使得本地数据库存储的数据与云服务器中存储的数据同步,提高数据同步的准确性。
在其中一个实施例中,步骤S208,即将数据同步到第二服务器,包括步骤:
获取数据的优先等级,根据数据的优先等级清洗数据,将清洗后的数据 同步到第二服务器。
根据数据的优先等级清洗数据是指根据数据的优先等级将优先等级高的数据进行同步,将优先等级低的数据保留即不同步,然后将进行同步的数据进行数据清洗,即处理无效数据等。无效数据是指根据预测算法预测的数据,不是实际产生的数据。比如数据提供方获取基金净值的及时性有时不及基金管理人提供净值的及时,因此通过一些算法形成一个虚拟净值进行业绩涨幅的计算,这样保证了每个交易日后就会有该基金产品的涨幅数据,但是这个通过虚拟净值计算的涨幅并未得到市场的统一认可,因此在使用过程中会将该类涨幅数据清洗掉。
具体地,第二服务器根据数据源的信任度来设置数据源对应数据的优先等级,比如第二服务器的数据如国家数据中心的数据的优先等级高,其他服务器的数据如互联网网站的数据的优先等级低。当第二服务器从云服务器中同步数据时,先获取到数据的优先等级,根据数据的优先等级确定高优先等级对应的数据,将高优先等级对应的数据进行数据清洗即删除无效的数据,然后将清洗后的数据同步到第二服务器,第二服务器将同步的数据进行保存。
在上述实施例中,通过获取数据的优先等级,根据数据的优先等级清洗数据,将清洗后的数据同步到第二服务器,可以获取到高信任度和更加准确的数据。
在其中一个实施例中,第二服务器从云服务器中同步完数据时,将同步的数据进行数据提取,得到预设数据字段对应的数据,将提取到的数据保存到预设数据字段对应的业务数据库中,在进行业务处理时,可以直接从业务数据获取相应的数据,提高业务处理的效率。
应该理解的是,虽然图2-6的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-6中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以 在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在其中一个实施例中,如图7所示,提供了一种数据同步装置700,包括:第一同步模块702、信息获取模块704、验证模块706和第二同步模块708,其中:
第一同步模块702,用于接收第一服务器发送的第一数据同步请求,根据第一数据同步请求同步第一服务器中的数据;
信息获取模块704,用于从第一服务器中获取到数据对应的第一权限信息;
验证模块706,用于接收第二服务器发送的第二数据同步请求,第二数据同步请求携带第二权限信息,验证第二权限信息是否与第一权限信息一致;
第二同步模块708,用于当验证通过时,查找第一权限信息对应的数据,并将数据同步到第二服务器。
在其中一个实施例中,数据同步装置700,还包括:
连接建立模块,用于接收第一服务器发送的数据同步指令,根据数据同步指令与第一服务器建立长连接。
在其中一个实施例中,数据同步装置700,还包括:
映射模块,用于第二服务器获取云服务器地址,将本地地址映射为云服务器地址;
请求发送模块,用于通过本地地址向云服务器发送第二数据同步请求。
在其中一个实施例中,第一同步模块702,包括:
数据接收模块,用于定时接收第一服务器发送的增量数据,从增量数据中得到新增主键信息;
数据保存模块,用于获取数据中的主键信息,当主键信息与新增主键信息不相同时,将增量数据保存;
数据删除模块,用于定时接收第一服务器发送的已删除主键信息,从主 键信息中查找已删除主键信息,当能够查询到已删除主键信息时,从数据中删除已删除主键信息对应的数据。
在其中一个实施例中,第二同步模块708,包括:
主键获取模块,用于获取第二服务器发送的已同步主键信息,并获取数据的主键信息;
比较模块,用于比较已同步主键信息和主键信息,得到未同步主键信息;
数据发送模块,用于将未同步主键信息对应的数据发送的第二服务器。
在其中一个实施例中,第二同步模块708,还包括:
本地主键获取模块,用于第二服务器定时从云服务器中获取数据的主键信息,并获取本地数据库中的本地主键信息;
差异得到模块,用于比较数据的主键信息与本地数据库中的本地主键信息,得到差异主键信息;
删除模块,用于从本地数据库中删除差异主键信息对应的数据。
在其中一个实施例中,第二同步模块708,包括:
数据清洗模块,用于获取数据的优先等级,根据数据的优先等级清洗数据,将清洗后的数据同步到第二服务器。
关于数据同步装置的具体限定可以参见上文中对于数据同步方法的限定,在此不再赘述。上述数据同步装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在其中一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图8所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环 境。该计算机设备的数据库用于存储同步的数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种数据同步方法。
本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
一种计算机设备,包括存储器和一个或多个处理器,存储器中存储有计算机可读指令,计算机可读指令被处理器执行时实现本申请任意一个实施例中提供的数据同步方法的步骤。
一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的数据同步方法的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上 述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种数据同步方法,包括:
    接收第一服务器发送的第一数据同步请求,根据所述第一数据同步请求同步所述第一服务器中的数据;
    从所述第一服务器中获取到所述数据对应的第一权限信息;
    接收第二服务器发送的第二数据同步请求,所述第二数据同步请求携带第二权限信息,验证所述第二权限信息是否与第一权限信息一致;及
    当验证通过时,查找所述第一权限信息对应的所述数据,并将所述数据同步到所述第二服务器。
  2. 根据权利要求1所述的方法,其特征在于,在所述接收第一服务器发送的第一数据同步请求,根据所述第一数据同步请求同步所述第一服务器中的数据之前,还包括:
    接收所述第一服务器发送的数据同步指令,根据所述数据同步指令与所述第一服务器建立长连接。
  3. 根据权利要求1所述的方法,其特征在于,在所述接收第二服务器发送的第二数据同步请求之前,还包括:
    所述第二服务器获取云服务器地址,将本地地址映射为所述云服务器地址;及
    通过所述本地地址向云服务器发送第二数据同步请求。
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述第一数据同步请求同步所述第一服务器中的数据,包括:
    定时接收所述第一服务器发送的增量数据,从所述增量数据中得到新增主键信息;
    获取所述数据中的主键信息,当所述主键信息与所述新增主键信息不相同时,将所述增量数据保存;及
    定时接收所述第一服务器发送的已删除主键信息,从所述主键信息中查找所述已删除主键信息,当能够查询到所述已删除主键信息时,从所述数据 中删除所述已删除主键信息对应的数据。
  5. 根据权利要求1所述的方法,其特征在于,所述将所述数据同步到所述第二服务器,包括:
    获取所述第二服务器发送的已同步主键信息,并获取所述数据的主键信息;
    比较所述已同步主键信息和所述主键信息,得到未同步主键信息;及
    将所述未同步主键信息对应的数据发送的所述第二服务器。
  6. 根据权利要求1所述的方法,其特征在于,在所述将所述未同步主键信息对应的数据发送的所述第二服务器之后,还包括:
    所述第二服务器定时从云服务器中获取所述数据的主键信息,并获取本地数据库中的本地主键信息;
    比较所述数据的主键信息与所述本地数据库中的本地主键信息,得到差异主键信息;及
    从所述本地数据库中删除所述差异主键信息对应的数据。
  7. 根据权利要求1所述的方法,其特征在于,所述将所述数据同步到所述第二服务器,包括:
    获取所述数据的优先等级,根据所述数据的优先等级清洗所述数据,将清洗后的数据同步到所述第二服务器。
  8. 根据权利要求1所述的方法,其特征在于,在所述当验证通过时,查找所述第一权限信息对应的所述数据,并将所述数据同步到所述第二服务器之后,还包括:
    所述第二服务器将同步的数据进行数据提取,得到预设数据字段对应的数据,并保存到业务数据库中。
  9. 一种数据同步装置,包括:
    第一同步模块,用于接收第一服务器发送的第一数据同步请求,根据所述第一数据同步请求同步所述第一服务器中的数据;
    信息获取模块,用于从所述第一服务器中获取到所述数据对应的第一权 限信息;
    验证模块,用于接收第二服务器发送的第二数据同步请求,所述第二数据同步请求携带第二权限信息,验证所述第二权限信息是否与第一权限信息一致;及
    第二同步模块,用于当验证通过时,查找所述第一权限信息对应的所述数据,并将所述数据同步到所述第二服务器。
  10. 根据权利要求8所述的装置,其特征在于,还包括:
    映射模块,用于第二服务器获取云服务器地址,将本地地址映射为云服务器地址;及
    请求发送模块,用于通过本地地址向云服务器发送第二数据同步请求。
  11. 根据权利要求8所述的装置,其特征在于,第一同步模块,包括:
    数据接收模块,用于定时接收第一服务器发送的增量数据,从增量数据中得到新增主键信息;
    数据保存模块,用于获取数据中的主键信息,当主键信息与新增主键信息不相同时,将增量数据保存;及
    数据删除模块,用于定时接收第一服务器发送的已删除主键信息,从主键信息中查找已删除主键信息,当能够查询到已删除主键信息时,从数据中删除已删除主键信息对应的数据。
  12. 根据权利要求8所述的装置,其特征在于,第二同步模块,包括:
    主键获取模块,用于获取第二服务器发送的已同步主键信息,并获取数据的主键信息;
    比较模块,用于比较已同步主键信息和主键信息,得到未同步主键信息;及
    数据发送模块,用于将未同步主键信息对应的数据发送的第二服务器。
  13. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    接收第一服务器发送的第一数据同步请求,根据所述第一数据同步请求同步所述第一服务器中的数据;
    从所述第一服务器中获取到所述数据对应的第一权限信息;
    接收第二服务器发送的第二数据同步请求,所述第二数据同步请求携带第二权限信息,验证所述第二权限信息是否与第一权限信息一致;及
    当验证通过时,查找所述第一权限信息对应的所述数据,并将所述数据同步到所述第二服务器。
  14. 根据权利要求13所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    所述第二服务器获取云服务器地址,将本地地址映射为所述云服务器地址;及
    通过所述本地地址向云服务器发送第二数据同步请求。
  15. 根据权利要求13所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    定时接收所述第一服务器发送的增量数据,从所述增量数据中得到新增主键信息;
    获取所述数据中的主键信息,当所述主键信息与所述新增主键信息不相同时,将所述增量数据保存;及
    定时接收所述第一服务器发送的已删除主键信息,从所述主键信息中查找所述已删除主键信息,当能够查询到所述已删除主键信息时,从所述数据中删除所述已删除主键信息对应的数据。
  16. 根据权利要求11所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    获取所述第二服务器发送的已同步主键信息,并获取所述数据的主键信息;
    比较所述已同步主键信息和所述主键信息,得到未同步主键信息;及
    将所述未同步主键信息对应的数据发送的所述第二服务器。
  17. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    接收第一服务器发送的第一数据同步请求,根据所述第一数据同步请求同步所述第一服务器中的数据;
    从所述第一服务器中获取到所述数据对应的第一权限信息;
    接收第二服务器发送的第二数据同步请求,所述第二数据同步请求携带第二权限信息,验证所述第二权限信息是否与第一权限信息一致;及
    当验证通过时,查找所述第一权限信息对应的所述数据,并将所述数据同步到所述第二服务器。
  18. 根据权利要求17所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    所述第二服务器获取云服务器地址,将本地地址映射为所述云服务器地址;及
    通过所述本地地址向云服务器发送第二数据同步请求。
  19. 根据权利要求17所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    定时接收所述第一服务器发送的增量数据,从所述增量数据中得到新增主键信息;
    获取所述数据中的主键信息,当所述主键信息与所述新增主键信息不相同时,将所述增量数据保存;及
    定时接收所述第一服务器发送的已删除主键信息,从所述主键信息中查找所述已删除主键信息,当能够查询到所述已删除主键信息时,从所述数据中删除所述已删除主键信息对应的数据。
  20. 根据权利要求17所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    获取所述第二服务器发送的已同步主键信息,并获取所述数据的主键信 息;
    比较所述已同步主键信息和所述主键信息,得到未同步主键信息;及
    将所述未同步主键信息对应的数据发送的所述第二服务器。
PCT/CN2019/116523 2019-08-13 2019-11-08 数据同步方法、装置、计算机设备和存储介质 WO2021027115A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910744220.8A CN110602168B (zh) 2019-08-13 2019-08-13 数据同步方法、装置、计算机设备和存储介质
CN201910744220.8 2019-08-13

Publications (1)

Publication Number Publication Date
WO2021027115A1 true WO2021027115A1 (zh) 2021-02-18

Family

ID=68854090

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/116523 WO2021027115A1 (zh) 2019-08-13 2019-11-08 数据同步方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN110602168B (zh)
WO (1) WO2021027115A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115022346A (zh) * 2022-08-08 2022-09-06 湖南涉外经济学院 一种基于区块链的在线数据同步方法

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021168800A1 (zh) * 2020-02-28 2021-09-02 深圳市欢太科技有限公司 数据同步方法及相关产品
CN112256484A (zh) * 2020-10-30 2021-01-22 新华三技术有限公司成都分公司 一种数据备份的方法、装置和系统
CN112685501A (zh) * 2020-12-30 2021-04-20 杭州雾联科技有限公司 一种中心节点与边缘节点的数据同步方法、装置及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120095974A1 (en) * 2010-10-18 2012-04-19 Verisign, Inc. Database synchronization and validation
CN104079623A (zh) * 2014-05-08 2014-10-01 深圳市中博科创信息技术有限公司 多级云存储同步控制方法及系统
CN106708911A (zh) * 2015-11-18 2017-05-24 阿里巴巴集团控股有限公司 一种云环境下数据文件同步的方法和装置
CN106921735A (zh) * 2017-02-21 2017-07-04 惠州Tcl移动通信有限公司 基于指纹云备份的移动终端数据信息同步方法及系统
CN108337303A (zh) * 2018-01-24 2018-07-27 中国银联股份有限公司 一种数据同步方法和分布式系统
CN108769212A (zh) * 2018-05-31 2018-11-06 康键信息技术(深圳)有限公司 数据同步方法、装置、计算机设备和存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102841897B (zh) * 2011-06-23 2016-03-02 阿里巴巴集团控股有限公司 一种实现增量数据抽取的方法、装置及系统
CN103929450B (zh) * 2013-01-14 2017-11-03 联想(北京)有限公司 数据同步方法及数据同步装置
CN105446824B (zh) * 2014-05-28 2019-11-05 无锡华润微电子有限公司 表增量获取方法及异地数据备份方法
US20180367644A1 (en) * 2017-06-16 2018-12-20 Gary Howard Mckay High availability solution for file sharing involving a client and multiple servers
CN107181770B (zh) * 2017-07-31 2019-02-15 北京深思数盾科技股份有限公司 数据同步方法及系统
CN108134789B (zh) * 2017-12-21 2020-03-17 北京深思数盾科技股份有限公司 通过云进行设备间数据同步的方法和云服务器
CN109788027B (zh) * 2018-12-13 2022-04-15 平安科技(深圳)有限公司 数据同步方法、装置、服务器及计算机存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120095974A1 (en) * 2010-10-18 2012-04-19 Verisign, Inc. Database synchronization and validation
CN104079623A (zh) * 2014-05-08 2014-10-01 深圳市中博科创信息技术有限公司 多级云存储同步控制方法及系统
CN106708911A (zh) * 2015-11-18 2017-05-24 阿里巴巴集团控股有限公司 一种云环境下数据文件同步的方法和装置
CN106921735A (zh) * 2017-02-21 2017-07-04 惠州Tcl移动通信有限公司 基于指纹云备份的移动终端数据信息同步方法及系统
CN108337303A (zh) * 2018-01-24 2018-07-27 中国银联股份有限公司 一种数据同步方法和分布式系统
CN108769212A (zh) * 2018-05-31 2018-11-06 康键信息技术(深圳)有限公司 数据同步方法、装置、计算机设备和存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115022346A (zh) * 2022-08-08 2022-09-06 湖南涉外经济学院 一种基于区块链的在线数据同步方法

Also Published As

Publication number Publication date
CN110602168B (zh) 2022-03-01
CN110602168A (zh) 2019-12-20

Similar Documents

Publication Publication Date Title
WO2021027115A1 (zh) 数据同步方法、装置、计算机设备和存储介质
CN108123800B (zh) 密钥管理方法、装置、计算机设备及存储介质
JP7165653B2 (ja) 特定の識別情報を開示することのない識別子間のリンクの確立
WO2019095577A1 (zh) 数据请求处理方法、装置、计算机设备和存储介质
WO2018130066A1 (zh) 数据的迁移方法、计算机设备和存储介质
WO2020140679A1 (zh) 接口对接方法、装置、计算机设备和存储介质
WO2019075978A1 (zh) 数据传输方法、装置、计算机设备和存储介质
CN110727499A (zh) 资源数据获取的方法、装置、计算机设备和存储介质
US11271726B2 (en) Key encryption methods, apparatuses, and systems
CN109040337B (zh) 一种信息查询方法、边缘服务器及信息查询系统
CN104735164A (zh) 一种保存文件信息的方法和装置
WO2017092351A1 (zh) 缓存数据的更新方法及装置
WO2019075773A1 (zh) 数据处理方法、装置、计算机设备和存储介质
CN110955721B (zh) 区块链节点状态维护方法、装置、计算机设备和存储介质
US9794360B1 (en) Estimating unique viewers of media content without cookies
WO2022222438A1 (zh) 配置文件状态同步方法、装置、终端、服务器和存储介质
CN115189913B (zh) 数据报文的传输方法和装置
CN107844488B (zh) 数据查询方法和装置
US11843675B2 (en) Method and system for synchronizing user identities
US20150365439A1 (en) Synchronization of security-related data
CN116633701B (zh) 信息传输方法、装置、计算机设备和存储介质
US20200220804A1 (en) IP-Based Matching System
WO2020035137A1 (en) Lightweight certificate status checking system for large number of certificates
US10178191B1 (en) Using multiple cookies
CN108768994B (zh) 数据匹配方法、装置及计算机可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19941677

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19941677

Country of ref document: EP

Kind code of ref document: A1