Data synchronization method, device and system, electronic equipment and storage medium

By sending data back-check requests on the search side and verifying the results, combining message queue processing and appropriate storage methods, the problem of data synchronization accuracy and effectiveness in various complex data synchronization scenarios is solved, and efficient in text search scenarios is achieved Data synchronization.

CN119226393APending Publication Date: 2024-12-31BEIJING QIHOOD TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310783861.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In the process of various and complex data synchronization scenarios, it is difficult to ensure the accuracy and effectiveness of data synchronization. Especially in text search scenarios, the data types are diverse and the structure is different, and the synchronization process has errors and low efficiency. question.

Method used

After receiving the data synchronization request from the service end on the search side, sending a data reverse search request, obtaining and verifying the data reverse search results, ensuring that the data is stored in the service end and then synchronously stored in the search service database, using a message queue to process it according to the data Select the appropriate storage method (simple storage database or relational database) to ensure the accuracy and effectiveness of the data.

Benefits of technology

The accuracy and effectiveness of data synchronization in various data types scenarios are achieved, the error and low efficiency in the synchronization process are avoided, and the accurate storage and efficient retrieval of data on the retrieval end are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226393A_ABST
    Figure CN119226393A_ABST
Patent Text Reader

Abstract

The invention discloses a data synchronization method, device and system, electronic equipment and a storage medium. The method comprises the steps that a data synchronization request of a service end is received, and the data synchronization request comprises an identity label of to-be-synchronized data; in response to the data synchronization request, sending a data reverse query request to the service end based on the identity identifier; receiving a data anti-checking result determined by the service end based on the data anti-checking request; and obtaining the to-be-synchronized data based on the data reverse checking result, and storing the to-be-synchronized data in the retrieval service database, so that after the retrieval end receives the data synchronization request of the service end, the to-be-synchronized data can be ensured to be stored at the service end through the step of reverse checking the to-be-synchronized data, and the data synchronization efficiency is improved. And the validity and accuracy of data synchronization can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer information processing technology, and in particular to a data synchronization method, device, system, electronic device and storage medium. Background Art

[0002] In text search scenarios, data synchronization and consistency are crucial factors that affect user experience. In the knowledge base scenario, there are multiple types of data, including structured (rich text), semi-structured (markdown), and unstructured (office suite). Different data types require different data processing, while ensuring data synchronization and efficiency.

[0003] Common data synchronization uses the method of directly synchronizing text content to the search service in the form of parameters, and then updating the search service when the text content changes. This method is suitable for scenarios with small amounts of data and simple business types. For data with diverse and complex data types, it is difficult to ensure the accuracy and effectiveness of data synchronization. Summary of the invention

[0004] The embodiment of the present application provides a data synchronization method, device, system, electronic device and storage medium. After receiving the data synchronization request from the service end, the search end can check the data to be synchronized by the step of reverse checking the data to be synchronized, so as to ensure that the data to be synchronized has been stored on the service end and ensure the validity and accuracy of data synchronization. The above technical solution is as follows:

[0005] In a first aspect, an embodiment of the present application provides a data synchronization method, which is applied to a search end and includes:

[0006] Receiving a data synchronization request from a business end; the data synchronization request includes an identity identifier of the data to be synchronized;

[0007] In response to the data synchronization request, sending a data reverse query request to the business end based on the identity identifier;

[0008] Receiving a data reverse query result determined by the business end based on the data reverse query request;

[0009] The data to be synchronized is obtained based on the data reverse query result, and the data to be synchronized is stored in the retrieval service database.

[0010] In a possible implementation, after receiving the data synchronization request from the service end and before responding to the data synchronization request and sending a data reverse query request to the service end based on the identity identifier, the method further includes:

[0011] Send the above data synchronization request to the message queue;

[0012] The above-mentioned response to the above-mentioned data synchronization request, sending a data reverse query request to the above-mentioned business end based on the above-mentioned identity identifier, includes:

[0013] When the data synchronization request in the message queue is consumed, a data reverse query request is sent to the business end based on the identity identifier.

[0014] In a possible implementation, the step of obtaining the data to be synchronized based on the data reverse query result includes:

[0015] Determine whether the above data reverse query results are valid;

[0016] If so, the data to be synchronized is determined based on the data reverse query result.

[0017] In a possible implementation, after determining whether the data reverse query result is valid, the method further includes:

[0018] If not, the step of sending a data reverse query request to the business end based on the identity identifier is executed again.

[0019] In a possible implementation, the data to be synchronized includes semi-structured or structured data; the data reverse query result is extracted from a simple storage database based on the identity identifier; the data reverse query result includes the data to be synchronized;

[0020] The above-mentioned data to be synchronized is determined based on the above-mentioned data reverse query result, including:

[0021] The data to be synchronized is extracted from the data reverse query results.

[0022] In a possible implementation, the data to be synchronized includes unstructured data; the data reverse query result includes a target storage link corresponding to the data to be synchronized;

[0023] The above-mentioned data to be synchronized is determined based on the above-mentioned data reverse query result, including:

[0024] The corresponding data to be synchronized is extracted from the relational database based on the target storage link.

[0025] In a possible implementation, the data to be synchronized includes data updated by the service end; and different types of the data to be synchronized result in different storage methods used by the service end to store the data to be synchronized.

[0026] In a second aspect, an embodiment of the present application provides another data synchronization method, which is applied to a service end and includes:

[0027] Get the data to be synchronized after the user updates;

[0028] Sending a data synchronization request to the search end; the data synchronization request includes the identity of the data to be synchronized;

[0029] Receiving a data reverse query request sent by the retrieval end based on the identity identifier;

[0030] In response to the data reverse query request, determine a corresponding data reverse query result based on the identity identifier;

[0031] The data reverse query result is sent to the search end, so that the search end obtains the data to be synchronized based on the data reverse query result, and stores the data to be synchronized in the search service database.

[0032] In a possible implementation, after obtaining the updated data to be synchronized by the user and before sending the data synchronization request to the search end, the method further includes:

[0033] The data to be synchronized are stored in a corresponding database according to the type of the data to be synchronized.

[0034] In a possible implementation, when the type of the data to be synchronized is a semi-structured type or a structured type, the data to be synchronized is stored in a simple storage database; when the type of the data to be synchronized is an unstructured type, the data to be synchronized is stored in a relational database.

[0035] In a third aspect, an embodiment of the present application provides a data synchronization device, the data synchronization device comprising:

[0036] A first receiving module, configured to receive a data synchronization request from a service end; the data synchronization request includes an identity identifier of the data to be synchronized;

[0037] A first sending module, configured to respond to the data synchronization request and send a data reverse query request to the service end based on the identity identifier;

[0038] A second receiving module is used to receive the data reverse query result determined by the above-mentioned service end based on the above-mentioned data reverse query request;

[0039] The first acquisition module is used to acquire the data to be synchronized based on the data reverse query result, and store the data to be synchronized in the retrieval service database.

[0040] In a possible implementation, the data synchronization device further includes:

[0041] A second sending module is used to send the above data synchronization request to the message queue;

[0042] The first sending module is specifically used for:

[0043] When the data synchronization request in the message queue is consumed, a data reverse query request is sent to the business end based on the identity identifier.

[0044] In a possible implementation, the first acquisition module includes:

[0045] A judgment unit, used to judge whether the above data reverse query result is valid;

[0046] The determination unit is used to determine the above-mentioned data to be synchronized based on the above-mentioned data reverse query result if yes.

[0047] In a possible implementation, the data synchronization device further includes:

[0048] The third sending module is used to, if not, again execute the step of sending a data reverse query request to the above-mentioned business end based on the above-mentioned identity identifier.

[0049] In a possible implementation, the data to be synchronized includes semi-structured or structured data; the data reverse query result is extracted from a simple storage database based on the identity identifier; the data reverse query result includes the data to be synchronized;

[0050] The above-mentioned determination unit is specifically used for:

[0051] The data to be synchronized is extracted from the data reverse query results.

[0052] In a possible implementation, the data to be synchronized includes unstructured data; the data reverse query result includes a target storage link corresponding to the data to be synchronized;

[0053] The above-mentioned determination unit is specifically used for:

[0054] The corresponding data to be synchronized is extracted from the relational database based on the target storage link.

[0055] In a possible implementation, the data to be synchronized includes data updated by the service end; and different types of the data to be synchronized result in different storage methods used by the service end to store the data to be synchronized.

[0056] In a fourth aspect, an embodiment of the present application provides another data synchronization device, the data synchronization device comprising:

[0057] The second acquisition module is used to acquire the data to be synchronized after being updated by the user;

[0058] A fourth sending module is used to send a data synchronization request to the search end; the data synchronization request includes an identity identifier of the data to be synchronized;

[0059] A third receiving module is used to receive a data reverse query request sent by the search end based on the identity identifier;

[0060] A determination module, configured to respond to the data reverse query request and determine a corresponding data reverse query result based on the identity identifier;

[0061] The fifth sending module is used to send the data reverse query result to the search end, so that the search end obtains the data to be synchronized based on the data reverse query result, and stores the data to be synchronized in the search service database.

[0062] In a possible implementation, the data synchronization device further includes:

[0063] The storage module is used to store the data to be synchronized into a corresponding database according to the type of the data to be synchronized.

[0064] In a possible implementation, when the type of the data to be synchronized is a semi-structured type or a structured type, the data to be synchronized is stored in a simple storage database; when the type of the data to be synchronized is an unstructured type, the data to be synchronized is stored in a relational database.

[0065] In the fifth aspect, an embodiment of the present application provides a data synchronization system, which includes: a retrieval end and a business end; the retrieval end is used to execute the method provided by the first aspect of the embodiment of this specification or any possible implementation of the first aspect; the business end is used to execute the method provided by the second aspect of the embodiment of this specification or any possible implementation of the second aspect.

[0066] In a sixth aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory;

[0067] The processor is connected to the memory;

[0068] The above-mentioned memory is used to store executable program code;

[0069] The above-mentioned processor runs the program corresponding to the above-mentioned executable program code by reading the executable program code stored in the above-mentioned memory, so as to execute the method provided by the first aspect or any possible implementation of the first aspect or the second aspect or any possible implementation of the second aspect of the embodiment of this specification.

[0070] In the seventh aspect, an embodiment of the present specification provides a computer storage medium, wherein the computer storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor and executing the method provided by the first aspect of the embodiment of the present specification or any possible implementation of the first aspect or the second aspect or any possible implementation of the second aspect.

[0071] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:

[0072] In one or more embodiments of the present application, a data synchronization request is received from a business end, the data synchronization request includes an identity identifier of the data to be synchronized; in response to the data synchronization request, a data reverse query request is sent to the business end based on the identity identifier; a data reverse query result determined by the business end based on the data reverse query request is received; the data to be synchronized is acquired based on the data reverse query result, and the data to be synchronized is stored in a retrieval service database, so that after receiving the data synchronization request from the business end, the retrieval end can ensure that the data to be synchronized has been stored on the business end and the validity and accuracy of the data synchronization by reverse querying the data to be synchronized.

[0073] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0075] Figure 1 A schematic diagram of the architecture of a data synchronization system provided for an exemplary embodiment of the present application;

[0076] Figure 2 A flowchart of a data synchronization method provided for an exemplary embodiment of the present application;

[0077] Figure 3 A flowchart of another data synchronization method provided for an exemplary embodiment of the present application;

[0078] Figure 4 A flowchart of another data synchronization method provided for an exemplary embodiment of the present application;

[0079] Figure 5 A schematic diagram of an implementation process of determining data to be synchronized provided by an exemplary embodiment of the present application;

[0080] Figure 6 A flowchart of another data synchronization method provided for an exemplary embodiment of the present application;

[0081] Figure 7 A schematic diagram of the structure of a data synchronization device provided by an exemplary embodiment of the present application;

[0082] Figure 8 A schematic diagram of the structure of another data synchronization device provided by an exemplary embodiment of the present application;

[0083] Fig. 9 A schematic structural diagram of an electronic device provided as an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0084] In order to make the features and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0085] The terms "first", "second", "third", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0086] Please refer to the following Figure 1 , which is a schematic diagram of the architecture of a data synchronization system provided by an exemplary embodiment of this specification. Figure 1 As shown, the data synchronization system may include: a service end 110 and a search end 120. Among them:

[0087] The business end 110 may be a terminal or server corresponding to the business party, and may specifically include one or more business ends. The business version of the software may be installed in the business end 110, which is used to realize the user's online update of the corresponding data, such as but not limited to the functions of editing and updating document data. After the business end 110 obtains the updated data to be synchronized by the user, it will send a data synchronization request to the search end 120 through the network or Hyper Text Transfer Protocol (HTTP), etc. The data synchronization request includes the identity of the data to be synchronized, and receives the data reverse query request sent by the search end 120 based on the identity, and responds to the data reverse query request, and determines the corresponding data reverse query result based on the identity. Finally, the business end 110 will send the above-mentioned data reverse query result to the search end 120, so that the search end 120 obtains the data to be synchronized based on the data reverse query result, and stores the data to be synchronized in the search service database. Among them, the business end 110 may be but not limited to a mobile phone, tablet computer, laptop computer and other devices installed with the business version of the software, and may also be but not limited to a hardware server, a virtual server, a cloud server and the like.

[0088] The search end 120 may be a terminal or server that can provide a variety of search services, and may receive a data synchronization request from the business end 110 through a network or HTTP, and in response to the data synchronization request, send a data reverse query request to the business end 110 based on the identity identifier. Then, the search end 120 may receive the data reverse query result determined by the business end 110 based on the data reverse query request, and obtain the data to be synchronized based on the data reverse query result, and store the data to be synchronized in the search service database, thereby completing data synchronization. Among them, the search end 120 may be, but is not limited to, a mobile phone, tablet computer, laptop computer and other devices with a business version of the software installed, and may also be, but is not limited to, a hardware server, a virtual server, a cloud server and the like.

[0089] The network may be a medium that provides a communication link between any service end 110 and the search end 120, or may be the Internet including network devices and transmission media, but is not limited thereto. The transmission medium may be a wired link (such as but not limited to coaxial cable, optical fiber, and digital subscriber line (DSL)) or a wireless link (such as but not limited to wireless fidelity (WIFI), Bluetooth, and mobile device network).

[0090] Understandably, Figure 1The number of service terminals 110 and search terminals 120 in the data synchronization system shown is only an example. In a specific implementation, the data synchronization system may include any number of service terminals and search terminals. This specification embodiment does not specifically limit this. For example, but not limited to, the service terminal 110 may be a service terminal cluster composed of multiple service terminals, and the search terminal 120 may be a search terminal cluster composed of multiple search terminals.

[0091] Please refer to the following Figure 2 , which exemplarily shows a flow chart of a data synchronization method provided by an embodiment of the present application. Figure 2 As shown, the data synchronization method includes the following steps:

[0092] S201, the business end obtains the data to be synchronized after the user updates.

[0093] Specifically, after a user updates the data on the business side, such as but not limited to inputting a document or editing the corresponding business data, the business side will obtain the updated data to be synchronized by the user. That is, the above-mentioned data to be synchronized includes the data updated by the business side, which may include but is not limited to semi-structured data such as morkdown, unstructured data such as office suites, structured data such as rich text, etc.

[0094] It is understandable that in order to ensure the efficiency and diversity of data synchronization, the types of the above-mentioned data to be synchronized are different, and the storage methods used by the business end to store the data to be synchronized are different. For example, but not limited to, semi-structured types such as morkdown and structured types such as rich text to be synchronized data can be stored in a simple storage database (S3 storage service), and unstructured types such as office suites can be stored in a relational database (mysql service). The above-mentioned simple storage database, i.e. Simple Storage Service (S3), is theoretically a global storage area network (SAN), which is represented by an oversized hard disk in which digital assets can be stored and retrieved, etc. The above-mentioned relational database will save the data in different tables.

[0095] S202, the business end sends a data synchronization request to the search end, where the data synchronization request includes the identity of the data to be synchronized.

[0096] Specifically, in order to ensure the accuracy and timeliness of the search end's search, enhance the search end's search capabilities, and facilitate the business end's corresponding business party's data search, after the business end obtains the updated data to be synchronized by the user, it will be triggered to send a corresponding data synchronization request to the search end through the network or HTTP, thereby notifying the search end that the data to be synchronized needs to be synchronized and updated. The above-mentioned data synchronization request includes the identity of the data to be synchronized, and the above-mentioned identity can be, but is not limited to, the document ID corresponding to the data to be synchronized.

[0097] It can be understood that after the business end obtains the updated data to be synchronized by the user, the step of sending the corresponding data synchronization request to the retrieval end can be manually triggered by the corresponding business party of the business end, or it can be automatically triggered by the business end after obtaining the updated data to be synchronized by the user or after the business end completes storing the obtained data to be synchronized. The embodiments of the present application are not limited to this.

[0098] S203, the search end responds to the data synchronization request and sends a data reverse query request to the business end based on the identity identifier.

[0099] Specifically, in order to ensure the validity of data synchronization and avoid the retrieval end synchronizing invalid data or blank data, after receiving a data synchronization request from the business end through the network or HTTP, the retrieval end can respond to the data synchronization request and send a corresponding data reverse query request to the business end based on the identity of the data to be synchronized carried in the data synchronization request. The above-mentioned data reverse query request carries an identity, which is used to reversely check whether the data corresponding to the identity in the business end is valid.

[0100] S204, the business end responds to the data reverse query request and determines the corresponding data reverse query result based on the identity identifier.

[0101] Specifically, the business end may receive a data reverse query request sent by the search end based on the identity identifier through the network or HTTP, and in response to the data reverse query request, determine a corresponding data reverse query result based on the identity identifier.

[0102] Optionally, when the data to be synchronized is of a semi-structured type or a structured type, the data reverse query result can be, but is not limited to, extracted from a simple storage database based on the identity carried in the data reverse query request, and the data reverse query result includes the data to be synchronized corresponding to the identity. That is, after receiving the data reverse query request from the retrieval end, the service end can, but is not limited to, first determine the type of data to be synchronized corresponding to the identity carried in the data reverse query request. If it is determined that the corresponding data to be synchronized is of a semi-structured type or a structured type, the corresponding data to be synchronized can be found by querying the simple storage database storing the semi-structured type data or the structured type data through the identity, thereby obtaining the data reverse query result corresponding to the data reverse query request.

[0103] Optionally, when the data to be synchronized is of an unstructured type, the data reverse query result includes the target storage link corresponding to the data to be synchronized corresponding to the identity identifier. That is, after receiving the data reverse query request from the retrieval end, the service end may, but is not limited to, first determine the type of data to be synchronized corresponding to the identity identifier based on the identity identifier carried in the data reverse query request. If it is determined that the corresponding data to be synchronized is of an unstructured type, it may, but is not limited to, query the target storage link corresponding to the data to be synchronized from the relational database storing the unstructured type data through the identity identifier or find the target storage link corresponding to the identity identifier from the pre-stored target storage mapping relationship through the identity identifier, thereby obtaining the data reverse query result corresponding to the data reverse query request. The above-mentioned target storage mapping relationship is used to characterize the correspondence between each identity identifier and the target storage link corresponding to the data to be synchronized corresponding to each identity identifier in the relational database.

[0104] S205, the business end sends the data reverse query result to the search end.

[0105] Specifically, after the business end responds to the data reverse query request of the retrieval end and determines the corresponding data reverse query result based on the identity identifier, it will feed back the above data reverse query result to the retrieval end so that the retrieval end can obtain the corresponding data to be synchronized based on the data reverse query result and store the data to be synchronized in the retrieval service database.

[0106] S206, the search end obtains the data to be synchronized based on the data reverse query result, and stores the data to be synchronized in the search service database.

[0107] Specifically, after the retrieval end receives the data reverse query result determined by the business end based on the data reverse query request, it will first extract the corresponding valid data to be synchronized from the data reverse query result, and then store the data to be synchronized in the retrieval service database to realize the retrieval operation of the data to be synchronized.

[0108] It can be understood that the above-mentioned search service database can be integrated inside the search end, or can be located in a device independent of the search end, and the embodiments of the present application are not limited to this.

[0109] In an embodiment of the present application, after the business end obtains the data to be synchronized after the user's update, it will send a data synchronization request to the retrieval end; after the retrieval end receives the data synchronization request from the business end, the data synchronization request includes the identity of the data to be synchronized, and in response to the data synchronization request, sends a data reverse query request to the above-mentioned business end based on the above-mentioned identity, and receives the data reverse query result determined by the above-mentioned business end based on the above-mentioned data reverse query request, and finally obtains the above-mentioned data to be synchronized based on the above-mentioned data reverse query result, and stores the above-mentioned data to be synchronized in the retrieval service database. Therefore, after receiving the data synchronization request from the business end, the retrieval end can reverse query the data to be synchronized, thereby ensuring that the data to be synchronized has been stored in the business end before being synchronously stored in the retrieval service database, and can also ensure the effectiveness and accuracy of data synchronization.

[0110] Next, taking the data synchronization performed by the search end as an example, another data synchronization method provided by an exemplary embodiment of the present application is introduced. Figure 3 As shown, the data synchronization method includes the following steps:

[0111] S301, receiving a data synchronization request from a business end, where the data synchronization request includes an identity of the data to be synchronized.

[0112] Specifically, when the business party or user corresponding to the business end modifies, adds, or updates the data in its database, the business end will be triggered to send a corresponding data synchronization request to the search end through the network or HTTP, thereby notifying the search end that the business end has data that needs to be synchronized and updated. At this time, the search end can also receive the data synchronization request sent by the search end through the network or HTTP.

[0113] S302: Send the data synchronization request to the message queue.

[0114] Specifically, in order to prevent the situation where the data synchronization on the retrieval end is unstable due to the increase in traffic on the business end, the retrieval end will send the data synchronization request to the message queue in the order of receipt after receiving the data synchronization request from the business end, thereby avoiding the problem of data synchronization failure or low efficiency and instability when the business end has multiple data synchronization requests or there are multiple business ends sending data synchronization requests to the retrieval end, thereby improving the stability of data synchronization.

[0115] S303: When the data synchronization request in the message queue is consumed, a data reverse query request is sent to the business end based on the identity identifier.

[0116] Specifically, when the data synchronization request in the message queue is consumed, that is, when the retrieval end currently starts to respond to the data synchronization request corresponding to the above-mentioned business end in the message queue, it will be automatically triggered or manually triggered based on the operation of the retrieval party to send the corresponding data reverse query request to the business end. The specific implementation process is consistent with S203 and will not be repeated here.

[0117] It can be understood that the message queue may include, but is not limited to, one or more data synchronization requests sent by business terminals, and the data of the data synchronization request sent by each business terminal may be one or more, which is not limited in the embodiments of the present application. When the retrieval end receives multiple data synchronization requests, it may, but is not limited to, send and cache the multiple data synchronization requests to the message queue in the order of preset data synchronization of the business terminals corresponding to the multiple data synchronization requests, or in the order in which the multiple data synchronization requests are received.

[0118] S304, receiving the data reverse query result determined by the business end based on the data reverse query request.

[0119] Specifically, after the search end sends a data reverse query request to the business end, it will receive the data reverse query result fed back by the business end through the network or HTTP.

[0120] S305: Acquire the data to be synchronized based on the data reverse query result, and store the data to be synchronized in the retrieval service database.

[0121] Specifically, S305 is consistent with S206 and will not be described in detail here.

[0122] Next, taking the data synchronization performed by the search end as an example, another data synchronization method provided by an exemplary embodiment of the present application is introduced. Figure 4 As shown, the data synchronization method includes the following steps:

[0123] S401, receiving a data synchronization request from a business end, where the data synchronization request includes an identity of the data to be synchronized.

[0124] Specifically, S401 is consistent with S301 and will not be described in detail here.

[0125] S402, in response to the data synchronization request, sending a data reverse query request to the business end based on the identity identifier.

[0126] Specifically, S402 is consistent with S203 and will not be described in detail here.

[0127] S403, receiving the data reverse query result determined by the business end based on the data reverse query request.

[0128] Specifically, S403 is consistent with S304 and will not be described in detail here.

[0129] Please continue to refer to Figure 4 ,like Figure 4 As shown, the implementation process of obtaining the data to be synchronized based on the data reverse query result in the above S206 may include:

[0130] S404, determining whether the data reverse query result is valid.

[0131] Specifically, in order to ensure the validity of the data synchronized by the retrieval end and avoid the situation where the retrieval end synchronizes incorrect or blank data, the retrieval end will first determine whether the data reverse query result is valid after receiving the data reverse query result, for example but not limited to determining whether the data reverse query result is non-blank or the data reverse query is successful.

[0132] S405: If yes, determine the data to be synchronized based on the data reverse query result.

[0133] Specifically, if the data reverse query result contains data extracted by the business end, it can be considered that the identity identifier in the data reverse query request is correct and the corresponding data reverse query result is valid, then the corresponding data to be synchronized is determined based on the valid data reverse query result.

[0134] Alternatively, if Figure 5 As shown, the data to be synchronized may include, but is not limited to, semi-structured or structured data, and the data reverse query result is extracted from a simple storage database based on the identity identifier in the data synchronization request, that is, it may include the data to be synchronized. If the data reverse query result is valid, and the data to be synchronized corresponding to the identity identifier in the data synchronization request is semi-structured or structured data, the search end may directly extract the corresponding data to be synchronized from the data reverse query result fed back by the business end for synchronous storage.

[0135] Alternatively, if Figure 5 As shown, the data to be synchronized may include, but is not limited to, unstructured data, and the data reverse query result includes a target storage link corresponding to the data to be synchronized. If the data reverse query result is valid, and the data to be synchronized corresponding to the identity identifier in the data synchronization request is unstructured data, the search end can directly extract the corresponding data to be synchronized from the relational database based on the target storage link in the data reverse query result for synchronous storage.

[0136] In the embodiment of the present application, different extraction methods are used for semi-structured or structured data and unstructured data to be synchronized, thereby ensuring both the accuracy and efficiency of data synchronization and the diversity of data synchronization.

[0137] Alternatively, if Figure 4As shown, in S404, after determining whether the data reverse query result is valid, the data synchronization method also includes: if the data reverse query result is blank or the data reverse query result directly shows that the data reverse query fails, it can be considered that the identity in the data reverse query request is incorrect or the network between the retrieval end and the business end oscillates, resulting in a connection failure. Then the above S402 can be executed again, and the step of sending a data reverse query request to the business end based on the identity identifier is performed. If the consecutive target data reverse query results are invalid, the data reverse query operation is terminated, and the result of the data synchronization failure can be, but is not limited to, fed back to the business end. At the same time, after receiving the result of the data synchronization failure, the business end can, but is not limited to, automatically trigger the re-sending of the data synchronization request to the retrieval end, thereby preventing the problem of data synchronization failure caused by network service fluctuations, and by adding an automatic request retry mechanism on the business end, ensuring the stability of data synchronization and improving the success rate of data synchronization.

[0138] S406: Store the data to be synchronized in the retrieval service database.

[0139] In an embodiment of the present application, after receiving the data synchronization request from the business end, the retrieval end will send a corresponding data reverse query request to the business end, and after receiving the data reverse query result determined by the business end based on the data reverse query request, only if the data reverse query result is valid, will it extract the corresponding valid data to be synchronized and store it synchronously in the corresponding retrieval service database, thereby ensuring the effectiveness and accuracy of data synchronization.

[0140] Next, taking data synchronization performed by the service end as an example, another data synchronization method provided by an exemplary embodiment of the present application is introduced. Figure 6 As shown, the data synchronization method includes the following steps:

[0141] S601, obtaining the data to be synchronized after being updated by the user.

[0142] Specifically, S601 is consistent with S201 and will not be described in detail here.

[0143] S602: Store the data to be synchronized into a corresponding database according to the type of the data to be synchronized.

[0144] Specifically, after the business end obtains the data to be synchronized after the user's update, the data to be synchronized can be stored in the corresponding database according to the type of the data to be synchronized, for example, different types of data to be synchronized are stored in different or the same database, etc. In the embodiment of the present application, in order to avoid the loss of the data to be synchronized on the business end before the data synchronization is completed, the business end will first store the data to be synchronized before sending a data synchronization request to the retrieval end, and then inform the corresponding business party or user of the storage completion status, so that data synchronization can be completed without the business party or user's perception, and the security of the data to be synchronized can be ensured.

[0145] Optionally, the database includes a simple storage database and a relational database. In order to ensure the diversity and efficiency of data synchronization, when the type of the data to be synchronized is a semi-structured type or a structured type, the data to be synchronized is stored in the simple storage database; when the type of the data to be synchronized is an unstructured type, the data to be synchronized is stored in the relational database. After the data to be synchronized is stored in the relational database, a corresponding target storage link is also generated so that the search end can find the corresponding data to be synchronized through the target storage link.

[0146] S603: Send a data synchronization request to the search end, where the data synchronization request includes the identity of the data to be synchronized.

[0147] Specifically, S603 is consistent with S202 and will not be described in detail here.

[0148] It can be understood that the above S603 and S602 can be executed successively or simultaneously, and the embodiment of the present application is not limited to this.

[0149] S604, receiving a data reverse query request sent by the search end based on the identity identifier.

[0150] Specifically, the service end may receive a data reverse query request sent by the search end based on the identity identifier through a network or HTTP, and the data reverse query request carries the identity identifier in the data synchronization request currently responded by the search end.

[0151] S605: In response to the data reverse query request, determine a corresponding data reverse query result based on the identity identifier.

[0152] Specifically, S605 is consistent with S204 and will not be described in detail here.

[0153] S606: Send the data reverse query result to the search end, so that the search end obtains the data to be synchronized based on the data reverse query result, and stores the data to be synchronized in the search service database.

[0154] Specifically, S606 is consistent with S205 and will not be described in detail here.

[0155] Please refer to the following Figure 7 , which is a structural diagram of a data synchronization device provided in an embodiment of the present application. Figure 7 As shown, the data synchronization device 700 includes:

[0156] The first receiving module 710 is used to receive a data synchronization request from a service end; the data synchronization request includes an identity identifier of the data to be synchronized;

[0157] A first sending module 720, configured to respond to the data synchronization request and send a data reverse query request to the service end based on the identity identifier;

[0158] The second receiving module 730 is used to receive the data reverse query result determined by the service end based on the data reverse query request;

[0159] The first acquisition module 740 is used to acquire the data to be synchronized based on the data reverse query result, and store the data to be synchronized in the retrieval service database.

[0160] In a possible implementation, the data synchronization device 700 further includes:

[0161] A second sending module is used to send the above data synchronization request to the message queue;

[0162] The first sending module 720 is specifically used for:

[0163] When the data synchronization request in the message queue is consumed, a data reverse query request is sent to the business end based on the identity identifier.

[0164] In a possible implementation, the first acquisition module 740 includes:

[0165] A judgment unit, used to judge whether the above data reverse query result is valid;

[0166] The determination unit is used to determine the above-mentioned data to be synchronized based on the above-mentioned data reverse query result if yes.

[0167] In a possible implementation, the data synchronization device 700 further includes:

[0168] The third sending module is used to, if not, again execute the step of sending a data reverse query request to the above-mentioned business end based on the above-mentioned identity identifier.

[0169] In a possible implementation, the data to be synchronized includes semi-structured or structured data; the data reverse query result is extracted from a simple storage database based on the identity identifier; the data reverse query result includes the data to be synchronized;

[0170] The determination unit is specifically used to extract the data to be synchronized from the data reverse query result.

[0171] In a possible implementation, the data to be synchronized includes unstructured data; the data reverse query result includes a target storage link corresponding to the data to be synchronized;

[0172] The above-mentioned determination unit is specifically used for:

[0173] The corresponding data to be synchronized is extracted from the relational database based on the target storage link.

[0174] In a possible implementation, the data to be synchronized includes data updated by the service end; and different types of the data to be synchronized result in different storage methods used by the service end to store the data to be synchronized.

[0175] The division of the modules in the above-mentioned data synchronization device is only for illustration. In other embodiments, the data synchronization device can be divided into different modules as needed to complete all or part of the functions of the above-mentioned data synchronization device. The implementation of each module in the data synchronization device provided in the embodiments of this specification can be in the form of a computer program. The computer program can be run on a terminal or a server. The program modules constituted by the computer program can be stored in the memory of the terminal or the server. When the computer program is executed by the processor, all or part of the steps of the data synchronization method described in the embodiments of this specification are implemented.

[0176] Please refer to the following Figure 8 , which is a structural diagram of a data synchronization device provided in an embodiment of the present application. Figure 8 As shown, the data synchronization device 800 includes:

[0177] The second acquisition module 810 is used to acquire the to-be-synchronized data updated by the user;

[0178] The fourth sending module 820 is used to send a data synchronization request to the search end; the data synchronization request includes the identity of the data to be synchronized;

[0179] The third receiving module 830 is used to receive the data reverse query request sent by the search end based on the identity identifier;

[0180] A determination module 840, configured to respond to the data reverse query request and determine a corresponding data reverse query result based on the identity identifier;

[0181] The fifth sending module 850 is used to send the data reverse query result to the search end, so that the search end obtains the data to be synchronized based on the data reverse query result, and stores the data to be synchronized in the search service database.

[0182] In a possible implementation, the data synchronization device 800 further includes:

[0183] The storage module is used to store the data to be synchronized into a corresponding database according to the type of the data to be synchronized.

[0184] In a possible implementation, when the type of the data to be synchronized is a semi-structured type or a structured type, the data to be synchronized is stored in a simple storage database; when the type of the data to be synchronized is an unstructured type, the data to be synchronized is stored in a relational database.

[0185] The division of the modules in the above-mentioned data synchronization device is only for illustration. In other embodiments, the data synchronization device can be divided into different modules as needed to complete all or part of the functions of the above-mentioned data synchronization device. The implementation of each module in the data synchronization device provided in the embodiments of this specification can be in the form of a computer program. The computer program can be run on a terminal or a server. The program modules constituted by the computer program can be stored in the memory of the terminal or the server. When the computer program is executed by the processor, all or part of the steps of the data synchronization method described in the embodiments of this specification are implemented.

[0186] See next Fig. 9 , which is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of this specification. Fig. 9 As shown, the electronic device 900 may include: at least one processor 910 , at least one communication bus 920 , a user interface 930 , at least one network interface 940 , and a memory 950 .

[0187] The communication bus 920 may be used to realize the connection and communication among the above-mentioned components.

[0188] The user interface 930 may include a display screen (Display) and a camera (Camera), and the optional user interface 930 may also include a standard wired interface and a wireless interface.

[0189] The network interface 940 may optionally include a Bluetooth module, a Near Field Communication (NFC) module, a Wireless Fidelity (Wi-Fi) module, and the like.

[0190] Among them, the processor 910 may include one or more processing cores. The processor 910 uses various interfaces and lines to connect various parts within the entire electronic device 900, and executes various functions and processes data of the routing electronic device 900 by running or executing instructions, programs, code sets or instruction sets stored in the memory 950, and calling data stored in the memory 950. Optionally, the processor 910 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 910 can integrate one or more combinations of a processor (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 910, but may be implemented separately through a chip.

[0191] The memory 950 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 950 includes a non-transitory computer-readable medium. The memory 950 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 950 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a receiving function, a sending function, a data synchronization function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 950 may optionally be at least one storage device located away from the aforementioned processor 910. As Fig. 9 As shown, the memory 950 as a computer storage medium may include an operating system, a network communication module, a user interface module, and program instructions.

[0192] In some possible embodiments, the electronic device 900 may be the aforementioned Figure 7In the data synchronization device shown, the processor 910 can be used to call the program instructions stored in the memory 950, and perform the following operations: receiving a data synchronization request from the business end; the above-mentioned data synchronization request includes the identity of the data to be synchronized; in response to the above-mentioned data synchronization request, sending a data reverse query request to the above-mentioned business end based on the above-mentioned identity; receiving the data reverse query result determined by the above-mentioned business end based on the above-mentioned data reverse query request.

[0193] The data to be synchronized is obtained based on the data reverse query result, and the data to be synchronized is stored in the retrieval service database.

[0194] In some possible embodiments, after receiving the data synchronization request from the service end, the processor 910 executes the above-mentioned response to the data synchronization request and before sending the data reverse query request to the service end based on the above-mentioned identity identifier, and is further used to execute:

[0195] Send the above data synchronization request to the message queue.

[0196] When the processor 910 executes, in response to the data synchronization request, sending a data reverse query request to the service end based on the identity identifier, it is specifically used to execute:

[0197] When the data synchronization request in the message queue is consumed, a data reverse query request is sent to the business end based on the identity identifier.

[0198] In some possible embodiments, when the processor 910 executes to obtain the data to be synchronized based on the data reverse query result, it is specifically used to execute:

[0199] Determine whether the above data reverse query results are valid.

[0200] If so, the data to be synchronized is determined based on the data reverse query result.

[0201] In some possible embodiments, after determining whether the data reverse query result is valid, the processor 910 is further used to execute: if not, again executing the step of sending a data reverse query request to the business end based on the identity identifier.

[0202] In some possible embodiments, the data to be synchronized includes semi-structured or structured data; the data reverse query result is extracted from a simple storage database based on the identity identifier; the data reverse query result includes the data to be synchronized;

[0203] When the processor 910 determines the data to be synchronized based on the data reverse query result, it is specifically used to execute:

[0204] The data to be synchronized is extracted from the data reverse query results.

[0205] In some possible embodiments, the data to be synchronized includes unstructured data; the data reverse query result includes a target storage link corresponding to the data to be synchronized;

[0206] When the processor 910 determines the data to be synchronized based on the data reverse query result, it is specifically used to execute:

[0207] The corresponding data to be synchronized is extracted from the relational database based on the target storage link.

[0208] In some possible embodiments, the data to be synchronized includes data updated by the business end; and the business end may use different storage methods to store the data to be synchronized depending on the type of the data to be synchronized.

[0209] In some possible embodiments, the electronic device 900 may be the aforementioned Figure 8 In the data synchronization device shown, the processor 910 can be used to call the program instructions stored in the memory 950, and specifically perform the following operations: obtain the data to be synchronized after the user updates; send a data synchronization request to the retrieval end; the above data synchronization request includes the identity of the data to be synchronized; receive the data reverse query request sent by the above retrieval end based on the above identity; respond to the above data reverse query request, determine the corresponding data reverse query result based on the above identity; send the above data reverse query result to the above retrieval end, so that the retrieval end obtains the above data to be synchronized based on the above data reverse query result, and stores the above data to be synchronized in the retrieval service database.

[0210] In some possible embodiments, after the processor 910 obtains the to-be-synchronized data updated by the user and before executing the sending of the data synchronization request to the search end, it is further configured to execute:

[0211] The data to be synchronized are stored in a corresponding database according to the type of the data to be synchronized.

[0212] In some possible embodiments, when the type of the data to be synchronized is a semi-structured type or a structured type, the data to be synchronized is stored in a simple storage database; when the type of the data to be synchronized is an unstructured type, the data to be synchronized is stored in a relational database.

[0213] The embodiment of the present application also provides a computer storage medium, which stores instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods. If the components of the above data synchronization device are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above storage medium.

[0214] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The above computer program product includes one or more computer instructions. When the above computer program instructions are loaded and executed on a computer, the above process or function according to the embodiment of the present application is generated in whole or in part. The above computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above computer instructions can be stored in a computer-readable storage medium or transmitted by the above computer-readable storage medium. The above computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The above computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The above available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.

[0215] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes. In the absence of conflict, the technical features in this embodiment and the implementation scheme can be combined arbitrarily.

[0216] The above-mentioned embodiments are merely preferred embodiments of the present application and are not intended to limit the scope of the present application. Without departing from the design spirit of the present application, various modifications and improvements made to the technical solutions of the present application by ordinary technicians in this field should fall within the protection scope determined by the claims of the present application.

Claims

1. A data synchronization method, characterized in that: The method is applied to a search end, and the method comprises: Receiving a data synchronization request from a service end; the data synchronization request includes an identity identifier of the data to be synchronized; In response to the data synchronization request, sending a data reverse query request to the service end based on the identity identifier; Receiving a data reverse query result determined by the service end based on the data reverse query request; The data to be synchronized is acquired based on the data reverse query result, and the data to be synchronized is stored in a retrieval service database.

2. The method according to claim 1, characterized in that The acquiring the data to be synchronized based on the data reverse query result includes: Determine whether the data reverse query result is valid; If so, the data to be synchronized is determined based on the data reverse query result.

3. The method according to claim 2, characterized in that After determining whether the data reverse query result is valid, the method further includes: If not, the step of sending a data reverse query request to the service end based on the identity identifier is executed again.

4. The method according to claim 2, characterized in that: The data to be synchronized includes unstructured data; the data reverse query result includes a target storage link corresponding to the data to be synchronized; The determining the data to be synchronized based on the data reverse query result includes: The corresponding data to be synchronized is extracted from the relational database based on the target storage link.

5. A data synchronization method, characterized in that: The method is applied to a service end, and the method includes: Get the data to be synchronized after the user updates; Sending a data synchronization request to the search end; the data synchronization request includes the identity of the data to be synchronized; Receiving a data reverse query request sent by the search end based on the identity identifier; In response to the data reverse query request, determining a corresponding data reverse query result based on the identity identifier; The data reverse query result is sent to the search end, so that the search end obtains the data to be synchronized based on the data reverse query result, and stores the data to be synchronized in the search service database.

6. A data synchronization device, characterized in that: The device comprises: A first receiving module, configured to receive a data synchronization request from a service end; the data synchronization request includes an identity identifier of the data to be synchronized; A first sending module, configured to send a data reverse query request to the service end based on the identity identifier in response to the data synchronization request; A second receiving module, used to receive a data reverse query result determined by the service end based on the data reverse query request; The first acquisition module is used to acquire the data to be synchronized based on the data reverse query result, and store the data to be synchronized in a retrieval service database.

7. A data synchronization device, characterized in that: The device comprises: The second acquisition module is used to acquire the data to be synchronized after being updated by the user; A fourth sending module, configured to send a data synchronization request to the search end; the data synchronization request includes an identity identifier of the data to be synchronized; A third receiving module, used for receiving a data reverse query request sent by the search end based on the identity identifier; A determination module, configured to determine a corresponding data reverse query result based on the identity identifier in response to the data reverse query request; The fifth sending module is used to send the data reverse query result to the retrieval end, so that the retrieval end obtains the data to be synchronized based on the data reverse query result, and stores the data to be synchronized in the retrieval service database.

8. A data synchronization system, characterized in that: include: The search end and the business end; among them, The retrieval end is used to execute the method steps as described in any one of claims 1 to 4; the service end is used to execute the method steps as described in claim 5.

9. An electronic device, characterized in that: include: processor and memory; wherein, The processor is connected to the memory; the memory is used to store executable program code; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method steps according to any one of claims 1 to 5.

10. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, which are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • MySQL large table association query system and method

    CN115905313A

  • Data synchronization method, system and device

    CN116192874A

  • Method and device for data restoration, computer device, and storage medium

    WO2021056726A1