WO2018019029A1 - 一种数据同步方法及设备 - Google Patents

一种数据同步方法及设备 Download PDF

Info

Publication number
WO2018019029A1
WO2018019029A1 PCT/CN2017/087239 CN2017087239W WO2018019029A1 WO 2018019029 A1 WO2018019029 A1 WO 2018019029A1 CN 2017087239 W CN2017087239 W CN 2017087239W WO 2018019029 A1 WO2018019029 A1 WO 2018019029A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
synchronized
service
record
synchronization
Prior art date
Application number
PCT/CN2017/087239
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 WO2018019029A1 publication Critical patent/WO2018019029A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/03Protecting confidentiality, e.g. by encryption
    • H04W12/033Protecting confidentiality, e.g. by encryption of the user plane, e.g. user's traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/02Protecting privacy or anonymity, e.g. protecting personally identifiable information [PII]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/04Arrangements for maintaining operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements

Definitions

  • the present invention relates to the field of computers, and in particular, to a data synchronization method and device.
  • Wireless Fidelity (WiFi)-based voice services (Voice over WiFi, VoWiFi) are widely used.
  • the system architecture of the VoWiFi voice service needs to be deployed with an entitlement server (ES).
  • the ES device stores user data such as user status information, and can allocate service parameters related to the VoWiFi voice service to the user equipment.
  • a plurality of user equipments are connected to the ES device through the Internet, and the service parameters of the VoWiFi voice service are obtained through the ES to implement the VoWiFi voice service.
  • the ES device needs to perform a 1+1 geographic disaster recovery deployment.
  • the 1+1 geographic disaster recovery deployment refers to setting up the primary ES device and the standby ES device to enable ES device disaster recovery switching.
  • the VoWiFi voice service can be switched from the primary ES device to the standby ES device.
  • the shared user data and the standby ES device must maintain consistent data synchronization.
  • a direct synchronization method is usually adopted, for example, a log-based database synchronization mechanism can be adopted.
  • the implementation process of the database synchronization mechanism based on the log mode is as follows: When the primary database is updated, the structured query language (SQL) of the update operation is written into the binary log file, and the index of a binary log file is maintained.
  • SQL structured query language
  • the standby database is asynchronously replicated, the changed portion of the binary log of the primary database is obtained and executed in the standby database to ensure data synchronization between the primary and secondary databases.
  • the binary log file synchronized in the primary database must be able to be read by the standby database.
  • it is generally required to encrypt and store the user data stored in the local database of the ES device, and the encrypted stored data cannot be simply copied to the remote database for decryption, that is, in the primary ES device.
  • the encrypted data cannot be decrypted on the alternate ES device. Therefore, synchronization of encrypted data cannot be achieved between the primary ES device and the standby ES device.
  • Embodiments of the present invention provide a data synchronization method and apparatus for synchronizing encrypted data between ES devices.
  • Embodiments of the present invention provide a data synchronization method and apparatus for implementing synchronization of encrypted data between ES devices.
  • a data synchronization method in which a first ES device determines data to be synchronized, the data to be synchronized is data encrypted and stored in a database of the first ES device, and the data to be synchronized is to be synchronized.
  • the key may be shared between the device and the second ES device, so after the second ES device receives the data re-encrypted by the first ES device, the re-encrypted data may be decrypted according to the
  • the decrypted data to be synchronized is data synchronized in a database of the second ES device to implement synchronization of encrypted data between the ES devices.
  • the first ES device determines a data synchronization priority order according to a user-initiated data change request, a network-side initiated data change request, and a system-timed full synchronization request, and then synchronizes according to the determined data.
  • the priority order determines the data to be synchronized in turn.
  • the data synchronization priority sequence of the synchronization data of the data change request initiated by the user, the synchronization data of the data change request initiated by the network side, and the synchronization data of the system timing full synchronization request are sequentially sorted in descending order.
  • the data synchronization priority order sequentially determines the data to be synchronized, and the data may be synchronized according to the data priority order. Further, since the synchronization data of the data change request initiated by the user has the highest priority, it is ensured that the change data initiated by the user side can be preferentially synchronized.
  • the first ES device may allocate an ID for a local service record sent by the first ES device, and when the data synchronization is performed, the first ES device determines that the change occurs.
  • An ES device service ID record, the service data corresponding to the changed first ES device service ID record is determined as the data to be synchronized, and then the changed first ES device service ID record is transmitted to the second ES device. Without the need to transmit changed data, it is possible to reduce the amount of transmission during data synchronization in the case of large data volumes.
  • the second ES device acquires the changed first ES device service ID record sent by the first ES device, and performs data synchronization on the changed service data according to the ID record.
  • the second ES device may perform data synchronization on the changed service data according to the ID record in the following manner: according to the changed first ES device service ID record, in the database of the second ES device Searching for the existence of the same service ID record as the changed first ES device service ID record, and if so, updating the data corresponding to the searched service ID record to the decrypted data to be synchronized, If not, the decrypted data to be synchronized is saved in a database of the second ES device.
  • the method for implementing data synchronization by using the ID record in the embodiment of the present invention is to find in the local database whether there is a service ID record that is the same as the changed first ES device service ID record, and only needs to find the same ID record corresponding to the same ID record.
  • the data is compared with the data to be synchronized after the decryption, so that it is not necessary to compare and match the decrypted data to be synchronized with all the data in the second ES device database in the embodiment of the present invention. It reduces the retrieval time of data records, improves the data synchronization efficiency, and realizes real-time synchronization under large data volume.
  • the timestamp when the first ES device issues the service data, the timestamp may be allocated to the issued service data, and the data is sent to the second ES device after determining the data to be synchronized.
  • the timestamp of the sync data After receiving the timestamp of the data to be synchronized sent by the first ES device, the second ES device may compare the timestamp of the decrypted data to be synchronized with the data stored in the database of the second ES device. Whether the timestamps are the same, if the same, the data stored in the database of the second ES device is kept unchanged, and if not, the search stored in the database of the second ES device is updated with the decrypted data to be synchronized.
  • the obtained business ID records the corresponding data.
  • the data synchronization process according to the timestamp does not need to gradually compare each field of the data to be synchronized with each field of data corresponding to the same ID record stored in the second ES device data, and only needs to be compared. Compare their timestamps to the same, thus reducing the amount of calculations, improving synchronization efficiency, and real-time synchronization.
  • a first ES device having the function of implementing the first ES device in the above method design.
  • the functions may be implemented by hardware or by corresponding software implemented by hardware.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • the modules can be software and/or hardware.
  • the first ES device may include a determining unit and a processing unit, the processing unit is configured to determine data to be synchronized, and the data to be synchronized is encrypted and stored in the first ES device database.
  • the processing unit is configured to decrypt the to-be-synchronized data determined by the determining unit to obtain decrypted data, and then re-execute the decrypted data according to a shared key obtained by performing key negotiation with the second ES device. Encrypting and transmitting the re-encrypted data to the second ES device.
  • the first ES device may include a memory, a processor, and a transmitter, wherein the memory stores a computer readable program, and the processor runs the program in the memory, Performing a corresponding function of the first ES device in the synchronization method related to the first aspect, and transmitting re-encrypted data to the second ES device through the transmitter, and performing data synchronization with the second ES device.
  • a second ES device having the function of implementing the second ES device in the above method design.
  • the functions may be implemented by hardware or by corresponding software implemented by hardware.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • the modules can be software and/or hardware.
  • the second ES device includes a receiving unit and a processing unit, and the receiving unit is configured to receive data to be synchronized transmitted by the first ES device, where the processing unit is configured to a shared key obtained by performing key negotiation by the first ES device, decrypting the to-be-synchronized data received by the receiving unit, and according to the decrypted data to be synchronized in a database of the second ES device Data synchronization is performed.
  • the second ES device may include a memory, a processor, and a receiver, wherein the memory stores a computer readable program, and the processor runs the program in the memory, The corresponding function of the second ES device in the synchronization method related to the first aspect is performed, and the re-encrypted data sent by the first ES device is received by the receiver to implement synchronization of the encrypted data with the first ES device.
  • FIG. 1 is a system architecture diagram of an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a data synchronization process according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of another data synchronization process according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of a method for determining, by an ES device, data to be synchronized according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of information interaction between ES devices according to an embodiment of the present disclosure.
  • FIG. 6 is a flowchart of a method for performing data synchronization on an ES device according to an embodiment of the present invention
  • FIG. 7 is a flowchart of a method for performing data synchronization on another ES device according to an embodiment of the present disclosure
  • FIG. 8 is a flowchart of a method for implementing an ES device update data according to an embodiment of the present disclosure
  • FIG. 9 is a schematic structural diagram of an ES device according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of an ES device according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of another ES device according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram of another ES device according to an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of still another ES device according to an embodiment of the present invention.
  • the data synchronization method provided by the embodiment of the present invention can be applied to the network architecture shown in FIG. 1.
  • data is stored in both the first ES device and the second ES device, and can communicate with the user side and the network side.
  • the first ES device and the second ES device can be used to process the user side and the network side.
  • the data sent by the user side and the network side also acquires data from the first ES device or the second ES device and stores it.
  • the first ES device and the second ES device in the network architecture shown in FIG. 1 generally need to separately store and store data stored in the local database, and the encrypted stored data cannot be simply copied.
  • Decryption to the remote database for example, the encrypted data stored in the first ES device database cannot be copied to the second ES device for decryption, and the encrypted data stored in the second ES device database cannot be copied to the first ES.
  • the device performs decryption. Therefore, according to the current data synchronization method, encrypted data synchronization cannot be performed between the first ES device and the second ES device.
  • the embodiment of the present invention provides a data synchronization method.
  • the first ES device decrypts and re-encrypts the data to be synchronized stored in the database to be sent to the second ES device, so that the second ES device can receive the received data.
  • the data to be synchronized is decrypted, thereby enabling data synchronization of the encrypted data between the first ES device and the second ES device.
  • first ES device and the second ES device involved in FIG. 1 are only for illustrative purposes, and are not limited thereto.
  • the processing unit including the processing function may also include a sending unit having a transmitting function, and the combination of the processing unit and the sending unit may be regarded as an independent network function entity, which is not illustrated in FIG.
  • the specific configuration of the first ES device and the second ES device is not limited in the embodiment of the present invention, but generally refers to two ES devices that need to perform data synchronization, for example, 1+1 geographic disaster tolerance in the VoWiFi voice service. Two ES devices deployed and configured for each other.
  • first, second and the like in the specification and claims of the embodiments of the present invention and the drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or
  • the sequence, for example, the first ES device and the second ES device involved in the foregoing embodiments of the present invention are only for convenience of description and distinguishing between different ES devices, and do not constitute a limitation on the ES device. It is to be understood that the terms so used are interchangeable, as appropriate, such that the embodiments of the invention described herein can be carried out in a sequence other than those illustrated or described herein.
  • FIG. 2 is a schematic diagram of a data synchronization process according to an embodiment of the present invention, which may include the following steps:
  • the first ES device determines data to be synchronized.
  • a large amount of data is stored in the first ES device local database, and in order to ensure data security, usually the data is encrypted, before the first ES device transmits the synchronization data to the second ES device, An ES device needs to determine the data to be synchronized from a large amount of data stored in the database.
  • the first ES device decrypts the to-be-synchronized data to obtain decrypted data.
  • the data stored in the local database of the first ES device is encrypted data. Since the first ES device has the function of local decryption, the decryption of the data to be synchronized can be implemented.
  • the first ES device re-encrypts the decrypted data according to a shared key obtained by performing key negotiation with the second ES device.
  • an encryption channel may be set between the first ES device and the second ES device, where the encrypted channel is a dedicated channel shared by the first ES device and the second ES device, and after the data to be synchronized is decrypted, the encrypted channel is used.
  • the first ES device and the second ES device may perform key negotiation in the encrypted channel, and obtain a common key through key negotiation, according to the common The key re-encrypts the data to be synchronized.
  • the first ES device transmits the re-encrypted data to the second ES device.
  • the second ES device receives the to-be-synchronized data transmitted by the first ES device, and decrypts the to-be-synchronized data according to the shared key obtained by performing key negotiation with the first ES device.
  • the second ES device receives the data to be synchronized transmitted by the first ES device, the data to be synchronized is re-encrypted.
  • the second ES device utilizes the local device that it has.
  • the decryption function implements decryption of the re-encrypted data.
  • the second ES device performs data synchronization in a database of the second ES device according to the decrypted data to be synchronized.
  • the encrypted data stored in the first ES device database is decrypted and then re-encrypted, and the re-encrypted data is transmitted to the second ES device.
  • the first ES device and the second ES device perform key negotiation in the shared encrypted channel, a common key is obtained, and the second ES device can re-encrypt the second ES device according to the common key.
  • the data is decrypted so that synchronization of the encrypted data between the first ES device and the second ES device can be achieved.
  • step S17 the first An ES device determines a data synchronization priority order according to a data change request initiated by the user, a data change request initiated by the network side, and a system timing full synchronization request.
  • the user side when the user side changes the data, the user side initiates a data change request, and when the data change occurs on the network side, the network side also initiates a data change request.
  • the first ES device needs to be The manner of obtaining the change request, and the manner of obtaining the change request is not limited.
  • the synchronization data trigger may be configured in the first ES device, and the synchronization data trigger in the first ES device may be obtained.
  • the data change request initiated by the user side and the network side also acquires the timing full synchronization request in the first ES device, and then determines the priority order of the data synchronization according to the three requests.
  • the data synchronization priority sequence of the synchronization data of the data change request initiated by the user, the synchronization data of the data change request initiated by the network side, and the synchronization data of the system timing full synchronization request are sequentially sorted in descending order.
  • the first ES device sequentially determines data to be synchronized according to the determined data synchronization priority order.
  • the data to be synchronized may be sequentially determined according to the priority order, and the manner of determining the data to be synchronized is not limited in the embodiment of the present invention.
  • the synchronization data resource pool may be configured in the first ES device, and the synchronization data of the data change request initiated by the user, the synchronization data of the data change request initiated by the network side, and the synchronization data of the system timing full synchronization request may be The priority order is placed in the synchronous data resource pool, and the synchronization data of the system timing full synchronization request with the lowest priority is placed at the bottom of the synchronous data resource pool, and the data change request initiated by the user with the highest priority is synchronized. Data is placed in the synchronization At the top of the data resource pool, the data to be synchronized is sequentially determined in descending order of priority.
  • the data synchronization priority order is determined, and then according to the determined data synchronization priority order, Determine the data to be synchronized. Since the synchronization data of the data change request initiated by the user has the highest priority, the synchronization data of the data change request initiated by the user is always arranged at the top of the synchronous data resource pool, thereby ensuring that the change data initiated by the user side can be quickly Synchronization also achieves priority synchronization of different data.
  • the method for determining the data to be synchronized by the first ES device in the embodiment of the present invention is as shown in FIG. 4, and includes:
  • the first ES device determines a first ES device service identifier ID record that changes.
  • the first ES device uses a segment ID to identify the local service record.
  • the service data corresponding to the service ID record of the first ES device changes, the first ES device determines the changed ID record. .
  • the first ES device determines the service data corresponding to the changed first ES device service ID record as the data to be synchronized.
  • the first ES device after determining the service data corresponding to the changed first ES device service ID record, is determined to be the data to be synchronized, and further includes S33 and S34, as shown in FIG. 5, including:
  • the first ES device transmits the changed first ES device service ID record to the second ES device.
  • the second ES device acquires the changed first ES device service identifier ID record sent by the first ES device.
  • the first ES device determines the changed service ID record, and determines the service data corresponding to the changed service ID record as the data to be synchronized, to the first
  • the two ES devices transmit the changed service ID record, which reduces the number of synchronous data under a large amount of data, that is, only needs to synchronize the changed service data to the second ES device, thereby reducing the pressure on the first ES device. And to ensure low transmission requirements, improve synchronization efficiency.
  • the data synchronization may be performed by using the method shown in FIG. 6, as shown in FIG. step:
  • the second ES device searches, in the local database, whether there is a service ID record that is the same as the changed first ES device service ID record.
  • the second ES device updates the data corresponding to the searched service ID record to the decrypted data to be synchronized.
  • the second ES device also uses a segment ID to identify the local service record. After the second ES device receives the changed ID record sent by the first ES device, the second ES The device searches the local database for the existence of the same ID record, and if so, replaces the found data with the decrypted data to be synchronized.
  • the second ES device saves the decrypted data to be synchronized in a database of the second ES device.
  • the second ES device searches for the same ID record in the local database. If not, it can be seen that the second ES device local database has not synchronized the data to be synchronized after the decryption. Describe that the decrypted data to be synchronized needs to be synchronized to the local database of the second ES device, so that the decrypted data to be synchronized corresponding to the changed ID record sent by the first ES device is saved in the The local database of the second ES device.
  • the second ES device after the second ES device obtains the changed service identity ID record sent by the first ES device, it searches the local database for the existence of the same service as the changed first ES device service ID record.
  • ID records that is, only the data corresponding to the same ID record needs to be searched for, and compared with the data to be synchronized after the decryption, it can be seen that the decrypted data to be synchronized and the second need not be needed in the embodiment of the present invention. All the data in the ES device database are compared and matched one by one, which reduces the retrieval time of the data record, improves the data synchronization efficiency, and realizes real-time synchronization under large data volume.
  • the method further includes S44, as shown in FIG. 7, S44.
  • the first ES device sends a timestamp of the data to be synchronized to the second ES device, and the second ES device receives the timestamp of the data to be synchronized sent by the first ES device.
  • the device when the first ES device issues the service data, the device may allocate a timestamp to the issued service data, and send the timestamp of the to-be-synchronized data to the second ES device after determining the to-be-synchronized data. .
  • the second ES device After receiving the timestamp of the data to be synchronized sent by the first ES device, the second ES device may update the data corresponding to the service ID record obtained by the search to the decrypted waiting according to the timestamp.
  • the specific implementation process can refer to the implementation process shown in Figure 8, as shown in Figure 8, including:
  • S421 The second ES device compares whether the timestamp of the decrypted data to be synchronized is the same as the data timestamp stored in the database of the second ES device.
  • the service data is assigned a timestamp, and the second ES device finds the same record as the changed first ES device service ID in the local database.
  • the timestamp of the decrypted data to be synchronized corresponding to the changed ID record sent by the first ES device in the local database corresponds to the same ID record stored in the database of the second ES device. The timestamps of the data are compared.
  • the decrypted data to be synchronized need not be repeatedly saved.
  • the decrypted data to be synchronized is re-encrypted and transmitted back to the first ES device.
  • the data corresponding to the same ID record in the second ES device database needs to be updated in real time.
  • the data corresponding to the latest timestamp needs to be updated in the database of the second ES device. data.
  • a time stamp is respectively allocated to the service data, and when the data to be synchronized of the first ES device is sent to the second ES device for synchronization, It is not necessary to gradually compare the respective fields of the data to be synchronized with the respective fields of the data corresponding to the same ID record stored in the second ES device data, and only need to compare whether their time stamps are the same, thereby reducing the calculation amount and improving Synchronization efficiency enables real-time synchronization.
  • first ES device and the second ES device can implement the same function, and are not limited to the functions implemented by the foregoing embodiments.
  • FIG. 9 is a schematic structural diagram of a first ES device according to an embodiment of the present invention.
  • the device includes a determining unit 71 and a processing unit 72, where:
  • the determining unit 71 is configured to determine data to be synchronized, and the to-be-synchronized data is encrypted and stored in the first ES device database.
  • the processing unit 72 is configured to decrypt the to-be-synchronized data determined by the determining unit 71, obtain decrypted data, and re-create the decrypted data according to the shared key obtained by performing key negotiation with the second ES device. Encryption is performed and the re-encrypted data is transmitted to the second ES device.
  • the determining unit 71 is further configured to:
  • the determining unit 71 determines the data synchronization priority order according to the data change request initiated by the user, the data change request initiated by the network side, and the system timing full synchronization request.
  • the data synchronization priority sequence of the synchronization data of the data change request initiated by the user, the synchronization data of the data change request initiated by the network side, and the synchronization data of the system timing full synchronization request are sequentially sorted in descending order. According to the data synchronization priority order, the data to be synchronized is sequentially determined.
  • the determining unit 71 is specifically configured to:
  • Determining a first ES device service identifier ID record that is changed wherein the first ES device service ID record is used to identify a service record issued by the first ES device.
  • the service data corresponding to the changed first ES device service ID record is determined as the data to be synchronized.
  • processing unit 72 is further configured to:
  • the determining unit 71 After determining the data to be synchronized, the determining unit 71 transmits the changed first ES device service ID record to the second ES device.
  • processing unit 72 is further configured to:
  • the timestamp of the data to be synchronized is transmitted to the second ES device, where the timestamp is when the first ES device issues service data.
  • the timestamp of the business data assignment is transmitted to the second ES device, where the timestamp is when the first ES device issues service data.
  • FIG. 10 is a schematic structural diagram of a second ES device according to an embodiment of the present invention.
  • the device includes a receiving unit 81 and a processing unit 82, wherein:
  • the receiving unit 81 is configured to receive data to be synchronized transmitted by the first ES device, where the data to be synchronized is that the first ES device decrypts data to be synchronized stored in the first ES device database. Encrypted.
  • the processing unit 82 is configured to decrypt the to-be-synchronized data received by the receiving unit 81 according to the shared key obtained by performing key negotiation with the first ES device, and according to the decrypted to be synchronized The data is synchronized in the database of the second ES device.
  • the device further includes an obtaining unit, as shown in FIG. 11, the acquiring unit 83 is configured to:
  • processing unit 82 is specifically configured to:
  • the second ES device searches, according to the changed first ES device service ID record obtained by the acquiring unit, in the database of the second ES device, whether there is the same service as the changed first ES device service ID record ID record. If yes, the second ES device updates the data corresponding to the searched service ID record to the decrypted data to be synchronized; if not, the second ES device decrypts the decrypted data.
  • the data to be synchronized is saved in a database of the second ES device.
  • the receiving unit 81 is further configured to:
  • the processing unit 82 receives the timestamp of the to-be-synchronized data sent by the first ES device, before the data corresponding to the searched service ID record is updated to the decrypted data to be synchronized, where the time is A time stamp assigned to the service data when the first ES device issues service data.
  • processing unit 82 is specifically configured to:
  • FIG. 12 is a schematic structural diagram of a first ES device according to an embodiment of the present invention.
  • the first ES device includes a memory 101, a processor 102, and The transmitter 103, the program code for carrying out the inventive arrangement, is stored in the memory 101 and controlled by the processor 102 for execution.
  • the program stored in the memory 101 is used by the instruction processor 102 to perform the method of transmitting the re-encrypted data, including: determining, by the processor 102, the data to be synchronized, decrypting the data to be synchronized, obtaining the decrypted data, and then The two ES devices perform a key agreement obtained by key negotiation, and re-encrypt the decrypted data. Finally, the re-encrypted data is transmitted to the second ES device through the transmitter 103.
  • the first ES device in this embodiment can be used to implement all the functions involved in the foregoing method embodiments.
  • specific implementation process reference may be made to the related description of the foregoing method embodiments, and details are not described herein again.
  • FIG. 13 is a schematic structural diagram of a second ES device according to an embodiment of the present invention.
  • the second ES device includes a memory 201, a processor 202, and The receiver 203, the program code for executing the scheme of the present invention, is stored in the memory 201 and controlled by the processor 202 for execution.
  • the program stored in the memory 201 is used by the instruction processor 202 to perform the method of transmitting the re-encrypted data, including: receiving, by the receiver 203, the data to be synchronized transmitted by the first ES device, and then using the processor 202 according to the The shared key obtained by the key device is decrypted by the ES device, and the data to be synchronized received by the receiver 203 is decrypted, and the decrypted data to be synchronized is in the database of the second ES device according to the decrypted data to be synchronized. Perform data synchronization.
  • the second ES device in this embodiment may be used to implement all the functions involved in the foregoing method embodiments.
  • the processor involved in the foregoing first ES device and the second ES device may be a general-purpose central processing unit (CPU), a microprocessor, and an application-specific integrated circuit (ASIC). ), or one or more integrated circuits for controlling the execution of the program of the present invention.
  • One or more memories included in the computer system which may be read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM) Or other types of dynamic storage devices that can store information and instructions, or disk storage. These memories are connected to the processor via a bus.
  • any device such as a transceiver can be used to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), and the like.
  • RAN Radio Access Network
  • WLAN Wireless Local Area Network
  • a memory such as a RAM, holds an operating system and a program for executing the inventive scheme.
  • the operating system is a program that controls the running of other programs and manages system resources.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种数据同步方法及设备,本发明实施例中第一授权服务器ES设备确定待同步数据,所述待同步数据被加密存储在所述第一ES设备数据库中;所述第一ES设备对所述待同步数据进行解密,得到解密数据;所述第一ES设备对所述解密数据重新进行加密,并向第二ES设备传送所述重新加密得到的数据。通过本发明实施例可实现第一ES设备和第二ES设备之间加密数据的同步。

Description

一种数据同步方法及设备
本申请要求于2016年7月29日提交中国专利局、申请号为201610614054.6、发明名称为“一种数据同步方法及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机领域,尤其涉及一种数据同步方法及设备。
背景技术
随着通信技术的发展,基于无线保真(Wireless Fidelity,WiFi)的语音业务(Voice over WiFi,VoWiFi)被广泛应用。
VoWiFi语音业务的系统架构中需要部署授权服务器(Entitlement Server,ES),ES设备中保存有用户状态信息等用户数据,能够为用户设备分配VoWiFi语音业务相关的业务参数。众多的用户设备会通过互联网连接所述ES设备,通过所述ES获取VoWiFi语音业务的业务参数,实现VoWiFi语音业务。
为保证VoWiFi语音业务的可靠性,ES设备需要进行1+1地理容灾部署,所述1+1地理容灾部署是指设置主用ES设备和备用ES设备,以在发生ES设备容灾切换时,使VoWiFi语音业务能够从主用ES设备切换至备用ES设备。
为保证VoWiFi语音业务从主用ES设备切换至备用ES设备后能够正常进行,主用ES设备和备用ES设备之间需保持存储的用户数据的一致性同步。目前进行数据一致性同步时,通常采用直接同步的方法,例如可采用基于日志方式的数据库同步机制。基于日志方式的数据库同步机制的实现过程如下:当主用数据库有更新的时候,把更新操作的结构化查询语言(Structured Query Language,SQL)写入二进制日志文件,并维护一个二进制日志文件的索引。在备用数据库异步复制的时候,获取主用数据库二进制日志的变化部分,并在备用数据库执行,从而保证主备数据库之间的数据同步。
上述主用数据库和备用数据库实现数据同步过程中,要求主用数据库中同步的二进制日志文件必须要能够被备用数据库读取。然而ES设备中为保证用户数据的安全,通常需要对ES设备本地数据库中存储的用户数据进行加密存储,该加密存储的数据不能够简单的复制到异地数据库中进行解密,即主用ES设备中的加密数据是无法在备用ES设备上进行解密的。故,在主用ES设备和备用ES设备之间无法实现加密数据的同步。
发明内容
本发明实施例提供一种数据同步方法及装置,在ES设备之间实现加密数据的同步。
本发明实施例提供一种数据同步方法及装置,以在ES设备之间实现加密数据的同步。
第一方面,提供一种数据同步方法,在该方法中,第一ES设备确定待同步数据,该待同步数据为所述第一ES设备的数据库中加密存储的数据,并对所述待同步数据进行解密,得到解密数据,然后再依据与第二ES设备进行密钥协商得到的共享密钥,对所述解密数据 重新进行加密,并向第二ES设备传送所述重新加密得到的数据,实现将加密存储在所述第一ES设备数据库中的待同步数据,传送到第二ES设备,由于所述第一ES设备和所述第二ES设备之间可共享密钥,故所述第二ES设备接收到第一ES设备重新加密的数据后,可对所述重新加密后的数据进行解密,并依据所述解密后的待同步数据在所述第二ES设备的数据库中进行数据同步,以在ES设备之间实现加密数据的同步。
一种可能的设计中,所述第一ES设备根据用户发起的数据变更请求、网络侧发起的数据变更请求以及系统定时全同步请求,确定数据同步优先级顺序,然后按照确定的所述数据同步优先级顺序,依次确定待同步数据。其中,用户发起的数据变更请求的同步数据、网络侧发起的数据变更请求的同步数据以及系统定时全同步请求的同步数据的数据同步优先级顺序,按照从高到低的顺序依次排序。
本发明实施例中,所述数据同步优先级顺序,依次确定待同步数据可实现按照数据优先级顺序对数据进行同步。进一步的,由于用户发起的数据变更请求的同步数据的优先级最高,从而保证了用户侧发起的变更数据可以被优先同步。
可选的,本发明实施例中,所述第一ES设备可为所述第一ES设备发送的本地的业务记录分配ID,在进行数据同步时,所述第一ES设备确定发生变化的第一ES设备业务ID记录,将发生变化的第一ES设备业务ID记录对应的业务数据,确定为待同步数据,然后向所述第二ES设备传送所述发生变化的第一ES设备业务ID记录,而无需传输发生变化的数据,故能够减少了大数据量下进行数据同步过程中的传输量。
所述第二ES设备获取所述第一ES设备发送的发生变化的第一ES设备业务ID记录,并根据所述ID记录对发生变化的业务数据进行数据同步。
其中,所述第二ES设备可采用如下方式根据所述ID记录对发生变化的业务数据进行数据同步:根据所述发生变化的第一ES设备业务ID记录,在所述第二ES设备的数据库中查找是否存在与所述发生变化的第一ES设备业务ID记录相同的业务ID记录,若存在,则将所述查找得到的业务ID记录对应的数据更新为所述解密后的待同步数据,若不存在,则将所述解密后的待同步数据保存在所述第二ES设备的数据库中。
本发明实施例上述通过ID记录实现数据同步的方法,在本地数据库中查找是否存在与所述发生变化的第一ES设备业务ID记录相同的业务ID记录,只需要查找所述相同的ID记录对应的数据,并与所述解密后的待同步数据进行比较,可见本发明实施例中不需要将所述解密后的待同步数据与第二ES设备数据库中的所有数据一一进行比较和匹配,减少了数据记录的检索时间,提高了数据同步效率,可实现大数据量下的实时性同步。
另一种可能的设计中,本发明实施例中,第一ES设备发放业务数据时,可为发放的业务数据分配时间戳,并在确定出待同步数据后向第二ES设备发送所述待同步数据的时间戳。所述第二ES设备接收到第一ES设备发送的所述待同步数据的时间戳以后,可比较所述解密后的待同步数据的时间戳与所述第二ES设备的数据库中存储的数据时间戳是否相同,若相同,则保持所述第二ES设备的数据库中存储的数据不变,若不相同,则以解密后的待同步数据更新所述第二ES设备的数据库中存储的查找得到的业务ID记录对应的数据。
本发明实施例上述根据所述时间戳进行数据同步过程,不需要逐步将所述待同步数据的各个字段与第二ES设备数据中存储的相同ID记录对应的数据的各个字段进行比较,只需要对比它们的时间戳是否相同,因此可减少计算量,提高同步效率,实现了实时性同步。
第二方面,提供一种第一ES设备,该第一ES设备具有实现上述方法设计中第一ES设备的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。所述模块可以是软件和/或硬件。
一种可能的设计中,所述第一ES设备可以包括确定单元和处理单元,所述处理单元用于确定待同步数据,所述待同步数据被加密存储在所述第一ES设备数据库中。所述处理单元用于对所述确定单元确定出的所述待同步数据进行解密,得到解密数据,再依据与第二ES设备进行密钥协商得到的共享密钥,对所述解密数据重新进行加密,并向第二ES设备传送所述重新加密得到的数据。
另一种可能的设计中,所述第一ES设备可包括存储器、处理器和发射器,其中,所述存储器中存有计算机可读程序,所述处理器通过运行所述存储器中的程序,执行第一方面涉及的同步方法中第一ES设备的相应功能,并通过所述发射器向第二ES设备发送重新加密的数据,与第二ES设备之间进行数据同步。
第三方面,提供一种第二ES设备,该第二ES设备具有实现上述方法设计中第二ES设备的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。所述模块可以是软件和/或硬件。
一种可能的设计中,所述第二ES设备,包括接收单元和处理单元,所述接收单元,用于接收第一ES设备传送过来的待同步数据,所述处理单元,用于依据与所述第一ES设备进行密钥协商得到的共享密钥,对所述接收单元接收到的所述待同步数据进行解密,并依据所述解密后的待同步数据在所述第二ES设备的数据库中进行数据同步。
另一种可能的设计中,所述第二ES设备可包括存储器、处理器和接收器,其中,所述存储器中存有计算机可读程序,所述处理器通过运行所述存储器中的程序,执行第一方面涉及的同步方法中第二ES设备的相应功能,并通过所述接收器接收第一ES设备发送的重新加密的数据,实现与第一ES设备之间加密数据的同步。
附图说明
图1为本发明实施例涉及的系统架构图;
图2为本发明实施例提供的一种数据同步过程示意图;
图3为本发明实施例提供的另一种数据同步过程示意图;
图4为本发明实施例提供的一种ES设备确定待同步数据的方法流程图;
图5为本发明实施例提供的一种ES设备之间信息交互的示意图;
图6为本发明实施例提供的一种ES设备进行数据同步的方法实施流程图;
图7为本发明实施例提供的另一种ES设备进行数据同步的方法实施流程图;
图8为本发明实施例提供的ES设备更新数据的方法实施流程图;
图9所示为本发明实施例提供的一种ES设备的结构示意图;
图10所示为本发明实施例提供的一种ES设备的结构示意图;
图11所示为本发明实施例提供的另一种ES设备的结构示意图;
图12所示为本发明实施例提供的另一种ES设备的结构示意图;
图13所示为本发明实施例提供的又一种ES设备的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行详细地描述。
本发明实施例提供的数据同步方法可应用于图1所示的网络架构。图1中,第一ES设备和第二ES设备中均存储有数据,并可与用户侧和网络侧进行通信,例如,第一ES设备和第二ES设备可以用于处理用户侧和网络侧发送过来的数据,用户侧和网络侧也会从第一ES设备或者第二ES设备中获取数据并存储。
为保证存储数据的安全性,图1所示网络架构中的第一ES设备和第二ES设备,通常需要分别对本地数据库中存储的数据进行加密存储,该加密存储的数据不能够简单的复制到异地数据库中进行解密,例如第一ES设备数据库中加密存储的数据不能够被复制到第二ES设备中进行解密,第二ES设备数据库中加密存储的数据也不能够被复制到第一ES设备中进行解密,故按照目前的数据同步方法,第一ES设备和第二ES设备之间是无法进行加密数据同步的。
本发明实施例提供一种数据同步方法,第一ES设备对加密存储在数据库中的待同步数据在本地进行解密并重新加密后发送给第二ES设备,使得第二ES设备能够对接收到的待同步数据进行解密,进而可实现第一ES设备和第二ES设备之间对加密数据的数据同步。
需要说明的是,图1所示中涉及的第一ES设备和第二ES设备的结构仅是进行示意性说明,并不引以为限,例如第一ES设备和第二ES设备中均可以包括具有处理功能的处理单元,也可以包括具有发送功能的发送单元,且处理单元和发送单元的组合可以看作是一个独立的网络功能实体,图1中并未进行示意。本发明实施例中也不限定第一ES设备和第二ES设备的具体存在形态,但通常是指需要进行数据同步的两个ES设备,例如可以是VoWiFi语音业务中进行1+1地理容灾部署并互为主备的两个ES设备。
进一步需要说明的是,本发明实施例的说明书和权利要求书及附图中涉及的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序,例如本发明实施例中上述涉及的第一ES设备和第二ES设备仅是用于方便描述以及区分不同的ES设备,并不构成对ES设备的限定。应该理解这样使用的术语在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。
本发明实施例以下将结合实际应用对上述实施例涉及的数据同步方法进行说明。
图2为本发明实施例提供的一种数据同步过程示意图,可以包括以下步骤:
S11、第一ES设备确定待同步数据。
本发明实施例中,在第一ES设备本地数据库中存储着大量数据,并且为了保证数据的安全性,通常这些数据都会被加密,当第一ES设备向第二ES设备传送同步数据之前,第一ES设备需要从数据库中存储的大量数据中确定出待同步数据。
S12、所述第一ES设备对所述待同步数据进行解密,得到解密数据。
本发明实施例中,通常在第一ES设备本地数据库中存储的数据是经过加密的数据,由于第一ES设备具备本地解密的功能,所以能实现对所述待同步数据的解密。
S13、所述第一ES设备依据与第二ES设备进行密钥协商得到的共享密钥,对所述解密数据重新进行加密。
本发明实施例中,当第一ES设备对所述待同步数据进行解密之后,为保证所述待同步数据的安全,需要对所述解密数据重新进行加密,具体的加密方式本发明实施例不做限定。 例如可在第一ES设备和第二ES设备之间设置加密通道,所述加密通道是第一ES设备和第二ES设备共享的专用通道,在所述待同步数据进行解密之后,经过加密通道向第二ES设备进行传送所述待同步数据时,第一ES设备和第二ES设备可在所述加密通道中进行密钥协商,通过密钥协商,得到共同的密钥,根据所述共同的密钥对所述待同步数据进行重新加密。
S14、所述第一ES设备向第二ES设备传送所述重新加密得到的数据。
S15、所述第二ES设备接收第一ES设备传送过来的待同步数据,并依据与所述第一ES设备进行密钥协商得到的共享密钥,对所述待同步数据进行解密。
本发明实施例中,当第二ES设备收到第一ES设备传送过来的待同步数据之后,所述待同步数据是被重新加密过的,此时,第二ES设备会利用自身具备的本地解密功能,实现对所述重新加密数据的解密。
S16、所述第二ES设备依据所述解密后的待同步数据在所述第二ES设备的数据库中进行数据同步。
本发明实施例中,通过对第一ES设备数据库中加密存储的数据进行解密再重新加密,并向第二ES设备传送所述重新加密的数据。由于第一ES设备和第二ES设备在所述共享的加密通道中进行密钥协商后,得到共同的密钥,进而第二ES设备可以根据所述共同的密钥,对所述重新加密的数据进行解密,因此可实现第一ES设备和第二ES设备之间加密数据的同步。
进一步的,为实现不同数据的优先级同步,上述实施例中,所述第一ES设备确定待同步数据之前,上述实施例中还包括步骤S17,如图3所示,步骤S17、所述第一ES设备根据用户发起的数据变更请求、网络侧发起的数据变更请求以及系统定时全同步请求,确定数据同步优先级顺序。
本发明实施例中,当用户侧发生数据变更时,用户侧会发起数据变更请求,同样当网络侧发生数据变更时,网络侧也会发起数据变更请求,此时,所述第一ES设备需要获取这些变更请求,具体获取这些变更请求的方式本发明实施例不做限定,例如可在所述第一ES设备中配置同步数据触发器,所述第一ES设备中的同步数据触发器会获取用户侧和网络侧发起的数据变更请求,同时也会获取第一ES设备中的定时全同步请求,然后依据这三种请求,确定数据同步的优先级顺序。
其中,用户发起的数据变更请求的同步数据、网络侧发起的数据变更请求的同步数据以及系统定时全同步请求的同步数据的数据同步优先级顺序,按照从高到低的顺序依次排序。
进一步的,所述第一ES设备按照确定的所述数据同步优先级顺序,依次确定待同步数据。
本发明实施例中,第一ES设备确定出数据同步优先级顺序之后,可按照优先级顺序依次确定出待同步数据,具体确定待同步数据的方式本发明实施例不做限定。例如可在所述第一ES设备中配置同步数据资源池,将所述用户发起的数据变更请求的同步数据、网络侧发起的数据变更请求的同步数据以及系统定时全同步请求的同步数据,按照优先级顺序放入同步数据资源池中,将优先级最低的系统定时全同步请求的同步数据放置在所述同步数据资源池的最底端,将优先级最高的用户发起的数据变更请求的同步数据放置在所述同步 数据资源池的最顶端,按照优先级从高到低的顺序依次确定出待同步数据。
本发明实施例中,首先根据用户发起的数据变更请求、网络侧发起的数据变更请求以及系统定时全同步请求,确定出数据同步优先级顺序,然后按照确定的所述数据同步优先级顺序,依次确定待同步数据。由于用户发起的数据变更请求的同步数据的优先级最高,因此使得用户发起的数据变更请求的同步数据总是排列在同步数据资源池的最顶端,从而保证了用户侧发起的变更数据可以被快速同步,同时也实现了不同数据的优先级同步。
可选的,本发明实施例中第一ES设备确定待同步数据的方法流程图如图4所示,包括:
S31、第一ES设备确定发生变化的第一ES设备业务标识ID记录。
本发明实施例中,第一ES设备会采用一段ID来标识本地的业务记录,当第一ES设备的业务ID记录对应的业务数据发生变化时,第一ES设备会确定出发生变化的ID记录。
S32、所述第一ES设备将发生变化的第一ES设备业务ID记录对应的业务数据,确定为待同步数据。
此时,上述实施例中,第一ES设备将发生变化的第一ES设备业务ID记录对应的业务数据,确定为待同步数据之后,还包括S33、S34,如图5所示,包括:
S33、所述第一ES设备向第二ES设备传送所述发生变化的第一ES设备业务ID记录。
S34、所述第二ES设备获取所述第一ES设备发送的发生变化的第一ES设备业务标识ID记录。
可见,采用本发明实施例提供的确定待同步数据的方法,通过第一ES设备确定发生变化的业务ID记录,将发生变化的业务ID记录对应的业务数据确定为待同步数据,向所述第二ES设备传送所述发生变化的业务ID记录,减少了大数据量下的同步数据的数量,即只需要将发生变化的业务数据同步到第二ES设备,可减轻第一ES设备的压力,并保证低传输量的要求,提高了同步效率。
可选的,第二ES设备获取到第一ES设备发送的发生变化的第一ES设备业务标识ID记录之后,可以采用如图6所示的方法进行数据同步,如图6所示可以包括以下步骤:
S41、所述第二ES设备在本地数据库中查找是否存在与所述发生变化的第一ES设备业务ID记录相同的业务ID记录。
若存在,则执行S42:所述第二ES设备将所述查找得到的业务ID记录对应的数据更新为所述解密后的待同步数据。
本发明实施例中,通常第二ES设备也会采用一段ID来标识本地的业务记录,当第二ES设备的收到第一ES设备发送过来的所述发生变化的ID记录之后,第二ES设备会在本地数据库中查找是否存在相同的ID记录,若存在,则将所述查找到的数据替换为所述解密后的待同步数据。
若不存在,则执行S43:所述第二ES设备将所述解密后的待同步数据保存在所述第二ES设备的数据库中。
本发明实施例中,第二ES设备在本地数据库中查找是否存在相同的ID记录,若不存在,可见第二ES设备本地数据库还没有进行所述解密后的待同步数据的同步,此时,说明所述解密后的待同步数据需要被同步到第二ES设备的本地数据库中,因此将所述第一ES设备发送过来的发生变化的ID记录对应的所述解密后的待同步数据保存在第二ES设备的本地数据库中。
本发明实施例中,第二ES设备获取到第一ES设备发送的发生变化的业务标识ID记录之后,在本地数据库中查找是否存在与所述发生变化的第一ES设备业务ID记录相同的业务ID记录,即只需要查找所述相同的ID记录对应的数据,并与所述解密后的待同步数据进行比较,可见本发明实施例中不需要将所述解密后的待同步数据与第二ES设备数据库中的所有数据一一进行比较和匹配,减少了数据记录的检索时间,提高了数据同步效率,可实现大数据量下的实时性同步。
可选的,上述实施例中,所述第二ES设备将所述查找得到的业务ID记录对应的数据更新为所述解密后的待同步数据之前,还包括S44,如图7所示,S44、第一ES设备向第二ES设备发送待同步数据的时间戳,所述第二ES设备接收第一ES设备发送的所述待同步数据的时间戳。
具体的,本发明实施例中,第一ES设备发放业务数据时,可为发放的业务数据分配时间戳,并在确定出待同步数据后向第二ES设备发送所述待同步数据的时间戳。所述第二ES设备接收到第一ES设备发送的所述待同步数据的时间戳以后,可根据所述时间戳将所述查找得到的业务ID记录对应的数据更新为所述解密后的待同步数据,具体实现过程可参阅图8所示的实施过程,如图8所示,包括:
S421:所述第二ES设备比较所述解密后的待同步数据的时间戳与所述第二ES设备的数据库中存储的数据时间戳是否相同。
本发明实施例中,第二ES设备发放业务数据时,会给所述业务数据分配时间戳,当第二ES设备在本地数据库中找到与所述发生变化的第一ES设备业务ID记录相同的业务ID记录时,在本地数据库中将第一ES设备发送的所述发生变化的ID记录对应的所述解密后的待同步数据的时间戳与第二ES设备的数据库中存储的相同ID记录对应的数据的时间戳进行比较。
若相同,则执行S422:保持所述第二ES设备的数据库中存储的数据不变;
本发明实施例中,若时间戳相同,说明第二ES设备数据库中相同ID记录对应的数据已经被实时更新,不需要对所述解密后的待同步数据进行重复保存,此时第二ES设备会对所述解密后的待同步数据进行重新加密并回传给第一ES设备。
若不相同,则执行S423:以解密后的待同步数据更新所述第二ES设备的数据库中存储的查找得到的业务ID记录对应的数据。
本发明实施例中,若时间戳不相同,说明第二ES设备数据库中相同ID记录对应的数据需要被实时更新,此时需要以最新时间戳对应的数据更新第二ES设备的数据库中存储的数据。
本发明实施例中,第一ES设备和第二ES设备发放业务数据时会分别给所述业务数据分配时间戳,当第一ES设备的待同步数据发送到第二ES设备中进行同步时,不需要逐步将所述待同步数据的各个字段与第二ES设备数据中存储的相同ID记录对应的数据的各个字段进行比较,只需要对比它们的时间戳是否相同,因此可减少计算量,提高同步效率,实现了实时性同步。
需要说明的是,第一ES设备和第二ES设备可以实现完全相同的功能,并不仅限于上述实施例实现的功能。
基于上述实施例提供的数据同步方法,本发明实施例提供一种第一ES设备,该设备可 以应用于VoWiFi业务中,图9所示为本发明实施例提供的第一ES设备的结构示意图,如图9所示,该设备包括确定单元71和处理单元72,其中:
确定单元71,用于确定待同步数据,所述待同步数据被加密存储在所述第一ES设备数据库中。
处理单元72,用于对所述确定单元71确定出的所述待同步数据进行解密,得到解密数据,再依据与第二ES设备进行密钥协商得到的共享密钥,对所述解密数据重新进行加密,并向第二ES设备传送所述重新加密得到的数据。
进一步的,所述确定单元71还用于:
确定单元71确定出待同步数据之前,根据用户发起的数据变更请求、网络侧发起的数据变更请求以及系统定时全同步请求,确定数据同步优先级顺序。
其中,用户发起的数据变更请求的同步数据、网络侧发起的数据变更请求的同步数据以及系统定时全同步请求的同步数据的数据同步优先级顺序,按照从高到低的顺序依次排序。按照所述数据同步优先级顺序,依次确定待同步数据。
具体的,所述确定单元71具体用于:
确定发生变化的第一ES设备业务标识ID记录,其中,所述第一ES设备业务ID记录用于标识所述第一ES设备发放的业务记录。将发生变化的第一ES设备业务ID记录对应的业务数据,确定为待同步数据。
进一步的,所述处理单元72,还用于:
所述确定单元71确定出所述待同步数据之后,向所述第二ES设备传送所述发生变化的第一ES设备业务ID记录。
进一步的,所述处理单元72,还用于:
所述确定单元71确定出所述待同步数据之后,向所述第二ES设备传送所述待同步数据的时间戳,其中,所述时间戳为所述第一ES设备发放业务数据时为所述业务数据分配的时间戳。
需要说明的是,本发明实施例中的第一ES设备的各个单元的功能实现以及交互方式可以进一步参照相关方法实施例的描述,在此不再赘述。
基于上述实施例提供的数据同步方法,本发明实施例提供一种第二ES设备,该设备可以应用于VoWiFi业务中,图10所示为本发明实施例提供的第二ES设备的结构示意图,如图10所示,该设备包括接收单元81和处理单元82,其中:
接收单元81,用于接收第一ES设备传送过来的待同步数据,所述待同步数据是所述第一ES设备对加密存储在所述第一ES设备数据库中待同步的数据进行解密又重新加密得到的。
处理单元82,用于依据与所述第一ES设备进行密钥协商得到的共享密钥,对所述接收单元81接收到的所述待同步数据进行解密,并依据所述解密后的待同步数据在所述第二ES设备的数据库中进行数据同步。
进一步的,所述设备还包括获取单元,如图11所示,所述获取单元83,用于:
获取所述第一ES设备发送的发生变化的第一ES设备业务标识ID记录。
具体的,所述处理单元82,具体用于:
根据所述获取单元获取到的所述发生变化的第一ES设备业务ID记录,在所述第二ES设备的数据库中查找是否存在与所述发生变化的第一ES设备业务ID记录相同的业务ID记录。若存在,则所述第二ES设备将所述查找得到的业务ID记录对应的数据更新为所述解密后的待同步数据;若不存在,则所述第二ES设备将所述解密后的待同步数据保存在所述第二ES设备的数据库中。
进一步的,所述接收单元81,还用于:
所述处理单元82将所述查找得到的业务ID记录对应的数据更新为所述解密后的待同步数据之前,接收第一ES设备发送的所述待同步数据的时间戳,其中,所述时间戳为所述第一ES设备发放业务数据时为所述业务数据分配的时间戳。
具体的,所述处理单元82,具体用于:
比较解密后的待同步数据的时间戳与所述第二ES设备的数据库中存储的数据时间戳是否相同;若相同,则保持所述第二ES设备的数据库中存储的数据不变;若不相同,则以解密后的待同步数据更新所述第二ES设备的数据库中存储的查找得到的业务ID记录对应的数据。
需要说明的是,本发明实施例中的第二ES设备的各个单元的功能实现以及交互方式可以进一步参照相关方法实施例的描述,在此不再赘述。
本发明实施例还提供一种第一ES设备,图12所示为本发明实施例提供的第一ES设备的结构示意图,如图12所示,第一ES设备包括存储器101、处理器102和发射器103,执行本发明方案的程序代码保存在存储器101中,并由处理器102来控制执行。
存储器101中存储的程序用于指令处理器102执行传送重新加密得到的数据的方法,包括:通过处理器102确定待同步数据,对所述待同步数据进行解密,得到解密数据,再依据与第二ES设备进行密钥协商得到的共享密钥,对所述解密数据重新进行加密。最后通过发射器103向第二ES设备传送所述重新加密得到的数据。
可以理解的是,本实施例的第一ES设备可用于实现上述方法实施例中涉及的所有功能,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
本发明实施例还提供一种第二ES设备,图13所示为本发明实施例提供的第二ES设备的结构示意图,如图13所示,第二ES设备包括存储器201、处理器202和接收器203,执行本发明方案的程序代码保存在存储器201中,并由处理器202来控制执行。
存储器201中存储的程序用于指令处理器202执行传送重新加密得到的数据的方法,包括:通过接收器203接收第一ES设备传送过来的待同步数据,再通过处理器202依据与所述第一ES设备进行密钥协商得到的共享密钥,对所述接收器203接收到的所述待同步数据进行解密,并依据所述解密后的待同步数据在所述第二ES设备的数据库中进行数据同步。
可以理解的是,本实施例的第二ES设备可用于实现上述方法实施例中涉及的所有功能,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
可以理解的是,本发明实施例上述第一ES设备和第二ES设备中涉及的处理器可以是一个通用中央处理器(CPU),微处理器,特定应用集成电路application-specific integrated circuit(ASIC),或一个或多个用于控制本发明方案程序执行的集成电路。计算机系统中包括的一个或多个存储器,可以是只读存储器read-only memory(ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器random access memory(RAM) 或者可存储信息和指令的其他类型的动态存储设备,也可以是磁盘存储器。这些存储器通过总线与处理器相连接。
发射器和接收器,可以使用任何收发器一类的装置,以便与其他设备或通信网络通信,如以太网,无线接入网(RAN),无线局域网(WLAN)等。
存储器,如RAM,保存有操作系统和执行本发明方案的程序。操作系统是用于控制其他程序运行,管理系统资源的程序。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (14)

  1. 一种数据同步方法,其特征在于,所述方法包括:
    第一授权服务器ES设备确定待同步数据,所述待同步数据被加密存储在所述第一ES设备的数据库中;
    所述第一ES设备对所述待同步数据进行解密,得到解密数据;
    所述第一ES设备依据与第二ES设备进行密钥协商得到的共享密钥,对所述解密数据重新进行加密,并向所述第二ES设备传送所述重新加密得到的数据。
  2. 如权利要求1所述的方法,其特征在于,所述第一ES设备确定待同步数据之前,所述方法还包括:
    所述第一ES设备根据用户发起的数据变更请求、网络侧发起的数据变更请求以及系统定时全同步请求,确定数据同步优先级顺序;
    其中,用户发起的数据变更请求的同步数据、网络侧发起的数据变更请求的同步数据以及系统定时全同步请求的同步数据的数据同步优先级顺序,按照从高到低的顺序依次排序;
    所述第一ES设备确定待同步数据,包括:
    所述第一ES设备按照确定的所述数据同步优先级顺序,依次确定待同步数据。
  3. 如权利要求1或2所述的方法,其特征在于,所述第一ES设备确定待同步数据,包括:
    所述第一ES设备确定发生变化的第一ES设备业务标识ID记录,其中,所述第一ES设备业务ID记录用于标识所述第一ES设备发放的业务记录;
    所述第一ES设备将发生变化的第一ES设备业务ID记录对应的业务数据,确定为待同步数据;
    所述第一ES设备确定待同步数据之后,所述方法还包括:
    所述第一ES设备向所述第二ES设备传送所述发生变化的第一ES设备业务ID记录。
  4. 如权利要求1至3任一项所述的方法,其特征在于,所述第一ES设备确定待同步数据之后,所述方法还包括:
    所述第一ES设备向所述第二ES设备传送所述待同步数据的时间戳,其中,所述时间戳为所述第一ES设备发放业务数据时为所述业务数据分配的时间戳。
  5. 一种数据同步方法,其特征在于,所述方法包括:
    第二授权服务器ES设备接收第一ES设备传送过来的待同步数据,所述待同步数据是所述第一ES设备对加密存储在所述第一ES设备的数据库中的待同步数据进行解密并依据与第二ES设备进行密钥协商得到的共享密钥重新加密得到的;
    所述第二ES设备依据与所述第一ES设备进行密钥协商得到的共享密钥,对所述待同步数据进行解密,并依据解密后的待同步数据在所述第二ES设备的数据库中进行数据同步。
  6. 如权利要求5所述的方法,其特征在于,所述第二ES设备依据解密后的待同步数据在所述第二ES设备的数据库中进行数据同步之前,所述方法还包括:
    所述第二ES设备获取所述第一ES设备发送的发生变化的第一ES设备业务标识ID记录;
    所述第二ES设备依据解密后的待同步数据在所述第二ES设备的数据库中进行数据同步,包括:
    所述第二ES设备根据所述发生变化的第一ES设备业务ID记录,在所述第二ES设备的数据库中查找是否存在与所述发生变化的第一ES设备业务ID记录相同的业务ID记录;
    若存在,则所述第二ES设备将查找得到的业务ID记录对应的数据更新为解密后的待同步数据;
    若不存在,则所述第二ES设备将解密后的待同步数据保存在所述第二ES设备的数据库中。
  7. 如权利要求6所述的方法,其特征在于,所述第二ES设备将查找得到的业务ID记录对应的数据更新为解密后的待同步数据之前,所述方法还包括:
    所述第二ES设备接收第一ES设备发送的所述待同步数据的时间戳,其中,所述时间戳为所述第一ES设备发放业务数据时为所述业务数据分配的时间戳;
    所述第二ES设备将查找得到的业务ID记录对应的数据更新为所述解密后的待同步数据,包括:
    所述第二ES设备比较解密后的待同步数据的时间戳与所述第二ES设备的数据库中存储的数据时间戳是否相同;
    若相同,则保持所述第二ES设备的数据库中存储的数据不变;
    若不相同,则以解密后的待同步数据更新所述第二ES设备的数据库中存储的查找得到的业务ID记录对应的数据。
  8. 一种第一授权服务器ES设备,其特征在于,包括:
    确定单元,用于确定待同步数据,所述待同步数据被加密存储在所述第一ES设备数据库中;
    处理单元,用于对所述确定单元确定出的所述待同步数据进行解密,得到解密数据,再依据与第二ES设备进行密钥协商得到的共享密钥,对所述解密数据重新进行加密,并向第二ES设备传送所述重新加密得到的数据。
  9. 如权利要求8所述的第一ES设备,其特征在于,所述确定单元还用于:
    确定单元确定出待同步数据之前,根据用户发起的数据变更请求、网络侧发起的数据变更请求以及系统定时全同步请求,确定数据同步优先级顺序;
    其中,用户发起的数据变更请求的同步数据、网络侧发起的数据变更请求的同步数据以及系统定时全同步请求的同步数据的数据同步优先级顺序,按照从高到低的顺序依次排序;
    按照所述数据同步优先级顺序,依次确定待同步数据
  10. 如权利要求8或9所述的第一ES设备,其特征在于,所述确定单元具体用于:
    确定发生变化的第一ES设备业务标识ID记录,其中,所述第一ES设备业务ID记录用于标识所述第一ES设备发放的业务记录;
    将发生变化的第一ES设备业务ID记录对应的业务数据,确定为待同步数据;
    所述处理单元,还用于:
    所述确定单元确定出所述待同步数据之后,向所述第二ES设备传送所述发生变化的第一ES设备业务ID记录。
  11. 如权利要求8至10任一项所述的第一ES设备,其特征在于,所述处理单元,还用于:
    所述确定单元确定出所述待同步数据之后,向所述第二ES设备传送所述待同步数据的时间戳,其中,所述时间戳为所述第一ES设备发放业务数据时为所述业务数据分配的时间戳。
  12. 一种第二授权服务器ES设备,其特征在于,包括:
    接收单元,用于接收第一ES设备传送过来的待同步数据,所述待同步数据是所述第一ES设备对加密存储在所述第一ES设备数据库中待同步的数据进行解密并依据与第二ES设备进行密钥协商得到的共享密钥加密得到的;
    处理单元,用于依据与所述第一ES设备进行密钥协商得到的共享密钥,对所述接收单元接收到的所述待同步数据进行解密,并依据所述解密后的待同步数据在所述第二ES设备的数据库中进行数据同步。
  13. 如权利要求12所述的第二ES设备,其特征在于,所述设备还包括获取单元,用于:
    获取所述第一ES设备发送的发生变化的第一ES设备业务标识ID记录;
    所述处理单元,具体用于:
    根据所述获取单元获取到的所述发生变化的第一ES设备业务ID记录,在所述第二ES设备的数据库中查找是否存在与所述发生变化的第一ES设备业务ID记录相同的业务ID记录;
    若存在,则所述第二ES设备将所述查找得到的业务ID记录对应的数据更新为所述解密后的待同步数据;
    若不存在,则所述第二ES设备将所述解密后的待同步数据保存在所述第二ES设备的数据库中。
  14. 如权利要求13所述的第二ES设备,其特征在于,所述接收单元,还用于:
    所述处理单元将所述查找得到的业务ID记录对应的数据更新为所述解密后的待同步数据之前,接收第一ES设备发送的所述待同步数据的时间戳,其中,所述时间戳为所述第一ES设备发放业务数据时为所述业务数据分配的时间戳;
    所述处理单元,具体用于:
    比较解密后的待同步数据的时间戳与所述第二ES设备的数据库中存储的数据时间戳是否相同;
    若相同,则保持所述第二ES设备的数据库中存储的数据不变;
    若不相同,则以解密后的待同步数据更新所述第二ES设备的数据库中存储的查找得到的业务ID记录对应的数据。
PCT/CN2017/087239 2016-07-29 2017-06-06 一种数据同步方法及设备 WO2018019029A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610614054.6A CN106255103A (zh) 2016-07-29 2016-07-29 一种数据同步方法及设备
CN201610614054.6 2016-07-29

Publications (1)

Publication Number Publication Date
WO2018019029A1 true WO2018019029A1 (zh) 2018-02-01

Family

ID=57605441

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/087239 WO2018019029A1 (zh) 2016-07-29 2017-06-06 一种数据同步方法及设备

Country Status (2)

Country Link
CN (1) CN106255103A (zh)
WO (1) WO2018019029A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105721463B (zh) * 2016-02-01 2020-05-26 腾讯科技(深圳)有限公司 一种文件安全传输方法和装置
CN106255103A (zh) * 2016-07-29 2016-12-21 华为技术有限公司 一种数据同步方法及设备
CN109325037A (zh) * 2018-08-17 2019-02-12 中国平安人寿保险股份有限公司 一种针对海量数据的数据同步方法、存储介质和服务器
CN109639627B (zh) * 2018-10-24 2021-12-17 视联动力信息技术股份有限公司 一种加密方式切换方法和装置
CN109710603B (zh) * 2018-12-28 2020-11-24 江苏满运软件科技有限公司 数据清洗方法、系统、存储介质及电子设备
CN111654523A (zh) * 2020-04-28 2020-09-11 珠海格力电器股份有限公司 一种数据处理方法、装置、存储介质及服务器

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007104174A1 (en) * 2006-03-10 2007-09-20 Abb Research Ltd Access control protocol for embedded devices
CN101242275A (zh) * 2008-03-07 2008-08-13 四川虹微技术有限公司 基于流密码加密的安全传输方法
CN104320248A (zh) * 2014-11-14 2015-01-28 中国建设银行股份有限公司 一种系统间密钥同步的方法及系统
CN104796251A (zh) * 2015-03-31 2015-07-22 杭州华三通信技术有限公司 一种密钥对的管理方法和设备
CN106255103A (zh) * 2016-07-29 2016-12-21 华为技术有限公司 一种数据同步方法及设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4746442B2 (ja) * 2006-02-24 2011-08-10 株式会社東芝 端末装置
CN100566234C (zh) * 2007-07-16 2009-12-02 腾讯科技(深圳)有限公司 数据同步方法及处理方法、客户端设备、服务器
CN101282250B (zh) * 2008-05-12 2011-02-09 华为终端有限公司 监听安全会话的方法、系统及网络设备
CN101808137B (zh) * 2010-03-29 2014-09-03 成都市华为赛门铁克科技有限公司 数据传输方法、装置和系统
CN103138912B (zh) * 2011-12-05 2016-08-03 阿里巴巴集团控股有限公司 数据同步方法及系统
CN105338093A (zh) * 2015-11-16 2016-02-17 中国建设银行股份有限公司 一种数据同步方法和系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007104174A1 (en) * 2006-03-10 2007-09-20 Abb Research Ltd Access control protocol for embedded devices
CN101242275A (zh) * 2008-03-07 2008-08-13 四川虹微技术有限公司 基于流密码加密的安全传输方法
CN104320248A (zh) * 2014-11-14 2015-01-28 中国建设银行股份有限公司 一种系统间密钥同步的方法及系统
CN104796251A (zh) * 2015-03-31 2015-07-22 杭州华三通信技术有限公司 一种密钥对的管理方法和设备
CN106255103A (zh) * 2016-07-29 2016-12-21 华为技术有限公司 一种数据同步方法及设备

Also Published As

Publication number Publication date
CN106255103A (zh) 2016-12-21

Similar Documents

Publication Publication Date Title
WO2018019029A1 (zh) 一种数据同步方法及设备
US8732462B2 (en) Methods and apparatus for secure data sharing
CN107086907B (zh) 用于量子密钥分发过程的密钥同步、封装传递方法及装置
US11363010B2 (en) Method and device for managing digital certificate
EP2940959B1 (en) Apparatuses and system for the privacy and security of user files stored at a cloud server
CN108134789B (zh) 通过云进行设备间数据同步的方法和云服务器
CN111787533B (zh) 加密方法、切片管理方法、终端及接入和移动性管理实体
US20170099138A1 (en) Encrypted group communications
US11601258B2 (en) Selector derived encryption systems and methods
WO2021027115A1 (zh) 数据同步方法、装置、计算机设备和存储介质
US11321471B2 (en) Encrypted storage of data
WO2023051337A1 (zh) 数据处理方法、装置、设备及存储介质
US11606193B2 (en) Distributed session resumption
EP2942899B1 (en) Information processing method, trust server and cloud server
CN112860790B (zh) 数据管理方法、系统、装置
US20240086562A1 (en) User data management method and related device
WO2021000622A1 (zh) 数据库访问方法和装置、计算设备和计算机程序产品
US11388001B2 (en) Encrypted communication device, encrypted communication system, encrypted communication method, and program
CN113163399A (zh) 一种终端与服务器的通信方法和装置
CN116208330A (zh) 一种基于量子加密的工业互联网云边协同数据安全传输方法及系统
KR101225903B1 (ko) 클라이언트 하이퍼바이저 기반의 사용자 단말장치 및 그의 가상머신 상의 파일 암복호화 방법, 그리고 이를 포함하는 가상머신 상의 파일 암복호화 시스템
CN112966045A (zh) 数据同步方法及系统
CN113452654B (zh) 一种数据解密的方法
CN113297586A (zh) 数据解密方法及装置
US20190334705A1 (en) Encrypted communication channels for distributed database systems

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: 17833334

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: 17833334

Country of ref document: EP

Kind code of ref document: A1