Data synchronization method, device, equipment, medium and program product

By transmitting business model code and using event processing classes and standard development packages to synchronize data, the problem of large data synchronization between applications in the existing technology is solved, and an efficient and simplified data synchronization process is achieved.

CN114968605BActive Publication Date: 2025-02-07INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210543101.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-16
Publication Date
2025-02-07
Estimated Expiration
2042-05-16

AI Technical Summary

Technical Problem

When data synchronization between applications is synchronized, a large amount of interface design, document writing and model conversion work is required, resulting in large workloads and errors are prone to.

Method used

By transmitting business model code from the data provider to the data receiver, using event processing classes and standard development packages for data release and listening, and using event bus for data synchronization, reducing the workload of manual model conversion.

Benefits of technology

Improve data synchronization efficiency, reduce developer workload and error rate, and simplify the data synchronization process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114968605B_ABST
    Figure CN114968605B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data synchronization method, which can be applied to the fields of computer software and financial technology. The method includes: transmitting a business model code from a data provider to a data receiver, the business model code including data to be synchronized; creating an event processing class according to the business model code; obtaining a standard development kit; using the event processing class and the standard development kit to publish the data provider and monitor the data receiver to synchronize the data; wherein the data to be synchronized is published and monitored through an event bus. The present disclosure also provides a data synchronization device, equipment, storage medium and program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of computer software and finance, and in particular to a data synchronization method, device, equipment, medium and program product. Background Art

[0002] In the process of building enterprise computer application software, cross-application data synchronization scenarios often occur. Generally, online and batch synchronization of business data is performed through online interfaces, message queues, batch files, etc. Under the existing technical solutions, when data is synchronized between applications, it is generally necessary to design interfaces, write interface documents, and communicate details, etc., which requires a lot of design and communication work.

[0003] For data providers, developers also need to convert the business model in the system into document data formats such as JSON and XML that are suitable for Internet interface transmission, and transmit them through interfaces or message queues. However, the design of the data format may be non-standard and irregular, and the documents may not be updated in a timely manner. In addition, after the data format changes, users need to be notified one by one to modify the model, which makes it difficult for data consumers to model according to interfaces and data documents.

[0004] Data consumers need to convert document data into the business model of the application based on the data description document of the data provider, which increases the workload of design, communication, and analysis for developers of data consumers. Developers of data consumers often have the problem of misunderstanding the business model and incorrectly modeling the business of the data. Summary of the invention

[0005] In view of the above problems, the present disclosure provides a data synchronization method, apparatus, device, medium and program product for improving data synchronization efficiency, which are used to at least partially solve the above technical problems.

[0006] According to the first aspect of the present disclosure, a data synchronization method is provided, including: transmitting a business model code from a data provider to a data receiver, the business model code including data to be synchronized; creating an event processing class according to the business model code; obtaining a standard development kit; utilizing the event processing class and the standard development kit to publish the data to be synchronized by the data provider and monitor the data receiver, so as to synchronize the data; wherein the data to be synchronized is published and monitored through an event bus.

[0007] According to an embodiment of the present disclosure, transmitting a business model code from a data provider to a data recipient includes: establishing a management platform, the management platform being used to provide a unified API; establishing an API dependency between the data provider and the data recipient through the unified API; and transmitting the business model code from the data provider to the data recipient based on the API dependency.

[0008] According to an embodiment of the present disclosure, establishing an API dependency between a data provider and a data recipient through a unified API includes: uploading a business model code from the data provider to a management platform; publishing the business model code through a unified API to establish an API dependency between the management platform and the data provider; downloading the business model code to the data recipient through a unified API to establish an API dependency between the data recipient and the management platform.

[0009] According to an embodiment of the present disclosure, obtaining a standard development package includes: respectively obtaining a data providing development package and a data receiving development package; wherein the data providing development package includes an event publishing API for being called to encapsulate the business model code into events and publish them from the data provider to the event bus; the data receiving development package includes an event listening API for being called to listen to events from the event bus.

[0010] According to an embodiment of the present disclosure, the data provider development kit also includes a serializer and a message producer. Through the event bus, the event processing class and the standard development kit are used to publish the data provider to the synchronized data, including: serializing the business model code into a string through the serializer; using the message producer to encapsulate the string into an event, and publishing the event to the event bus.

[0011] According to an embodiment of the present disclosure, through an event bus, using an event processing class and a standard development kit to monitor the data receiver of the synchronized data includes: marking the name of the event in the event processing class; registering the marked event processing class to the event monitoring API; and using the registered event monitoring API to monitor the event in the event bus.

[0012] According to an embodiment of the present disclosure, the data receiving development kit also includes a deserializer and a message listener. Using the registered event listening API to listen to events in the event bus includes: calling the event listening API to listen to events in the event bus through the message listener; using the deserializer to deserialize the event to obtain a standard event; extracting the standard event to the data receiver to synchronize the data.

[0013] According to an embodiment of the present disclosure, before uploading the business model code from the data provider to the management platform, the data synchronization method further includes: obtaining event completion information, the event completion information including complete data to be synchronized; and writing the business model code according to the event completion information.

[0014] According to an embodiment of the present disclosure, the business model code is uploaded from the data provider to the management platform through Maven; and the business model code is downloaded from the management platform to the data receiver through Maven.

[0015] The second aspect of the present disclosure provides a data synchronization device, including: a transmission module, used to transmit a business model code from a data provider to a data receiver, the business model code including data to be synchronized; a creation module, used to create an event processing class according to the business model code; an acquisition module, used to acquire a standard development kit; a synchronization module, used to use the event processing class and the standard development kit to publish the data provider and monitor the data receiver to synchronize the data; wherein the data to be synchronized is published and monitored through an event bus.

[0016] The third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the data synchronization method of any of the above-mentioned embodiments.

[0017] The fourth aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the data synchronization method of any of the above-mentioned embodiments.

[0018] The fifth aspect of the present disclosure further provides a computer program product, including a computer program, which implements the data synchronization method of any of the above embodiments when executed by a processor.

[0019] Compared with the prior art, the data synchronization method, device, electronic device, storage medium and program product provided by the present disclosure have at least the following beneficial effects:

[0020] (1) The present disclosure transmits programs and data separately, that is, the data to be synchronized is clarified by transmitting the program, thereby unifying the data transmission model; the data is then synchronized in the form of events through the event bus, eliminating the need for manual conversion of business models and data models, thereby reducing the workload.

[0021] (2) The present disclosure adopts a common business model code to unify the operations of the data provider and the data receiver on the business model, thereby reducing the workload of converting the document data model into the business model.

[0022] (3) The present disclosure provides a unified development kit that can automatically complete event publishing and monitoring by directly accessing the API, with high data synchronization efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0024] Figure 1The application scenario diagram of the data synchronization method, apparatus, device, medium and program product according to the embodiment of the present disclosure is schematically shown;

[0025] Figure 2 A flowchart of a data synchronization method according to an embodiment of the present disclosure is schematically shown;

[0026] Figure 3 A flowchart of a method for establishing a dependency relationship according to an embodiment of the present disclosure is schematically shown;

[0027] Figure 4 The structure diagram of the standard development kit according to the embodiment of the present disclosure is schematically shown;

[0028] Figure 5 A flowchart of a data transmission method according to an embodiment of the present disclosure is schematically shown;

[0029] Figure 6 A flowchart of an event monitoring method according to an embodiment of the present disclosure is schematically shown;

[0030] Figure 7 A structural block diagram of a data synchronization device according to an embodiment of the present disclosure is schematically shown; and

[0031] Figure 8 A block diagram of an electronic device suitable for implementing a data synchronization method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0032] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0033] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0034] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0035] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0036] The embodiments of the present disclosure provide a data synchronization method, device, equipment, medium and program product, which can be used in the financial field or other fields. It should be noted that the data synchronization method, device, equipment, medium and program product of the present disclosure can be used in the financial field, and can also be used in any field other than the financial field. The application field of the data synchronization method, device, equipment, medium and program product of the present disclosure is not limited.

[0037] In the technical solution disclosed in the present invention, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations, necessary confidentiality measures are taken, and do not violate public order and good morals.

[0038] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.

[0039] Figure 1 The application scenario diagram of the data synchronization method, apparatus, device, medium and program product according to the embodiments of the present disclosure is schematically shown.

[0040] like Figure 1 As shown, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0041] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0042] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0043] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0044] It should be noted that the data synchronization method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the data synchronization device provided in the embodiment of the present disclosure can generally be set in the server 105. The data synchronization method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the data synchronization device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.

[0045] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0046] The following will be based on Figure 1 The scene described by Figure 2 to Figure 6 The data synchronization method of the disclosed embodiment is described in detail.

[0047] Figure 2 The flowchart of the data synchronization method according to the embodiment of the present disclosure is schematically shown.

[0048] like Figure 2 As shown, an embodiment of the present disclosure provides a data synchronization method, for example, including:

[0049] S210, transmitting a business model code from a data provider to a data receiver, where the business model code includes data to be synchronized.

[0050] According to an embodiment of the present disclosure, a business model is, for example, a real-world or problem domain model based on which a software system is established, and is the basis for establishing a software system, and a business model code can be, for example, a code written to implement a business model. The data to be synchronized can be the specific data involved in the code, such as order data in an order code. For example, the business model code can be transmitted by establishing a management platform, and the management platform can provide a unified API. Specifically, an API dependency between a data provider and a data recipient can be established through the management platform, and then the business model code can be transmitted. API dependency refers to, for example, a reference relationship between application program interfaces. The business model code of the data provider is obtained through the management platform for the data recipient to call. Publishing the business model code of the data provider to the data recipient through the unified API provided by the management platform can cause the data provider and the data recipient to become dependent. The management platform can also synchronously obtain business model specifications from the data provider, and the business model specifications, for example, use event completion as the synchronization standard.

[0051] It is understandable that both the data provider and the data receiver can represent multiple applications. Data transmission from the data provider to the data receiver can be from one application to multiple applications, from multiple applications to multiple applications, or from multiple applications to multiple applications, and only requires corresponding interfaces (APIs) between the applications that need to transmit data.

[0052] According to an embodiment of the present disclosure, the data provider is, for example, application A that provides weather data, and the data receiver is, for example, application B of the map navigation class. It is necessary to synchronize the weather data in application A to application B. Then, the code related to the weather data model in application A can be uploaded to the management platform, and the management platform will then publish the code related to the weather data model through its own unified API interface. Then, application B can find the unified API interface of the management platform through version control tools such as Maven, and then reference the code related to the weather data model through the unified API interface, thereby realizing the API dependency between the data receiver and the data provider. Since the data receiver can already obtain the required code through API dependency, after further obtaining the data to be synchronized through the event bus, it does not need to create a business model and write related code by itself, but can directly use the existing business model code and the obtained data to be synchronized for subsequent applications, which saves a lot of model conversion work, greatly improves data synchronization efficiency, and saves labor costs.

[0053] S220: Create an event processing class according to the business model code.

[0054] According to the embodiments of the present disclosure, an event refers to the occurrence of any activity in the system, which has the characteristics of significance (occurring in a specific area of ​​interest in the system), instantaneity (occurring at a specific point in time) and atomicity (occurring or not occurring). Event processing refers to calling a related program or routine to process any activity occurring in the system so that the system can run normally. The event processing class is, for example, a user-defined reference data type for event processing.

[0055] S230, get the standard development kit.

[0056] S240, using an event processing class and a standard development kit to publish the data provider and monitor the data receiver to synchronize the data; wherein the data to be synchronized is published and monitored through an event bus.

[0057] According to the embodiments of the present disclosure, data that needs to be synchronized is directly synchronized in the form of events through an event bus, eliminating the need for data providers and data receivers to manually convert business models and data models, thereby reducing workload.

[0058] Figure 3 A flowchart of a method for establishing a dependency relationship according to an embodiment of the present disclosure is schematically shown.

[0059] According to the embodiments of the present disclosure, Figure 3 As shown, for example, an API dependency relationship between a data provider and a data receiver is established through operations S211 to S213.

[0060] S211, uploading the business model code from the data provider to the management platform.

[0061] According to an embodiment of the present disclosure, before obtaining the business model code from the data provider, the data provider may first obtain event completion information, which includes, for example, complete data to be synchronized, and then write the business model code according to the event completion information. The data provider may, for example, design a unified business model specification to construct a business model and obtain a business model code, and the business model may, for example, comply with the event-driven specification. For example, synchronization is performed based on the "completed xxx" event, and when the system detects that an event has been completed, a data synchronization operation is initiated. The business model code contains the data involved in the event. That is, for the data provider, the timing when data needs to be synchronized in the present disclosure is, for example, after an event occurs. Therefore, when the data provider accesses, it is necessary to access in an event-driven model. When an event has been completed, for example, the user has completed the transfer, the transfer bill information involved can be regarded as complete data to be synchronized, that is, the specific business information involved is synchronized, which can ensure the integrity, correctness and efficiency of data synchronization. The data provider needs to provide the business model code of its own system and a document explaining the business model code.

[0062] According to an embodiment of the present disclosure, the present disclosure obtains data from a data provider and provides data from the data provider to a data receiver through a unified management platform, for example. The management platform can coordinate the access of application synchronization functions and the management of model documents.

[0063] S212, publishing the business model code through a unified API to establish an API dependency between the management platform and the data provider.

[0064] S213, downloading the business model code to the data receiver through the unified API to establish an API dependency between the data receiver and the management platform.

[0065] According to the embodiment of the present disclosure, the management platform will add the business model code uploaded by the data provider to the dependency, and the data provider will interpret the document based on the business model code. For the data recipient, for example, the use registration can be completed on the management platform to associate it.

[0066] Specifically, the data upstream (data provider) registers a business model designed according to event-driven specifications with the management platform: the data upstream uploads the event-related package (i.e., business model code) to the company's Maven, and then enters the package information and business model specifications on the management platform. The data downstream (data receiver) connects to the business model: query the business model specifications and package information on the management platform, and download the relevant packages of the event through the Maven tool.

[0067] According to an embodiment of the present disclosure, the data provider's data (contained in the business model code) is transmitted to the data receiver in the form of events, for example, through an event bus. The event bus can, for example, receive events packaged by users of all data providers.

[0068] According to an embodiment of the present disclosure, the present disclosure provides a data synchronization system standard development kit, wherein the upstream data writes events to the event bus simply and quickly through the standard development kit (i.e., data providing development kit) provided by the data synchronization system, and the downstream data receives the events through the standard development kit (i.e., data receiving development kit). The standard development kit may be, for example, a program package with event publishing and monitoring functions.

[0069] Figure 4 The structure diagram of the standard development kit according to the embodiment of the present disclosure is schematically shown.

[0070] According to the embodiments of the present disclosure, Figure 4 As shown, the standard development kit built through the management platform includes, for example: a data providing development kit and a data receiving development kit. Among them, the data providing development kit includes, for example, an event publishing API, a serializer and a message producer, and the data receiving development kit includes, for example, an event listening API, a deserializer and a message listener. The data provider, for example, calls the event publishing API to encapsulate the data to be synchronized (for example, contained in the business model code) in the form of an event and writes it into the event bus. Then the data receiver listens to the events to be synchronized by calling the event listening API to achieve efficient data synchronization. The present disclosure provides a standard development kit for a data synchronization system, which publishes and listens to events through a standard API with a dependency relationship (i.e., a unified event publishing API and an event listening API). There is no need to write a code to interface with each application when it is connected, which simplifies the model conversion in the data synchronization process and simplifies the development work.

[0071] Figure 5 The flowchart of the data transmission method according to the embodiment of the present disclosure is schematically shown.

[0072] According to the embodiments of the present disclosure, Figure 5 As shown, data is transmitted, for example, through operations S241 to S245.

[0073] S241, serialize the business model code into a string through a serializer.

[0074] According to an embodiment of the present disclosure, the event publishing API provides a tool class that uses a serialization tool to serialize an event (i.e., an instance of a business model) into a string and writes it into an event bus. For example, the data upstream can customize the business model object (i.e., the business model code) and publish the event to the event bus by calling the event publishing API in the standard development kit.

[0075] Specifically, for the data provider, after writing the event, for example, the dispatch method of the EventDispatcher object in the API can be used to automatically publish the event that needs to be published.

[0076] S242, using the message producer to encapsulate the string into an event, and publish the event to the event bus.

[0077] According to an embodiment of the present disclosure, for example, a message middleware (such as Kafka) is used to transmit events published by a data provider.

[0078] S243, marking the name of the event in the event processing class.

[0079] According to the embodiments of the present disclosure, for example, the data receiver can introduce the latest API dependency of the system, that is, the business model data that all applications need to synchronize. After the data receiver queries and downloads the relevant program package on the management platform, it can parse the program package to define the processing method of the relevant events, create the corresponding event processing class, and then mark the annotations of the events that need to be monitored in the event processing class, and register the annotated event processing class on the event monitoring API, which forms the event monitoring API to monitor the business model code defined upstream of the data.

[0080] Specifically, for example, you can implement the EventListener class in the API and specify the events that need to be listened in the annotations. When there are related events in the event bus, you can listen to the events and perform related data synchronization operations.

[0081] S244, register the marked event processing class to the event listening API.

[0082] S245, using the registered event monitoring API to monitor events in the event bus.

[0083] According to the embodiments of the present disclosure, the data downstream can customize the event processing method, call the event listening API when the program starts, and register the processing method to the event listening API. Among them, the event processing method can, for example, realize the sharing of data upstream and downstream through a unified program package (i.e., business model code). When there is an event, the event listening API will automatically package the event into a business model object (i.e., business model code) defined by the data upstream, and pass it to the data recipient, thereby completing the data synchronization with the data provider.

[0084] Figure 6 The flowchart of the event monitoring method according to the embodiment of the present disclosure is schematically shown.

[0085] According to the embodiments of the present disclosure, Figure 6 As shown, for example, events are monitored through operations S2451 to S2453.

[0086] S2451, call the event monitoring API to monitor events in the event bus through the message listener.

[0087] S2452, use a deserializer to deserialize the event to obtain a standard event.

[0088] According to the embodiments of the present disclosure, the present disclosure proposes a data transmission specification: the upstream data party serializes the event through a general serialization tool and writes it into a message queue, and the downstream data automatically parses the event through a deserialization tool and performs corresponding processing according to the event. By serializing and deserializing the event, the events in the event bus can be accurately distinguished, which is convenient for event monitoring.

[0089] According to the embodiments of the present disclosure, the downstream provides an event listening API, for example, a declarative programming mode is adopted to provide a listening event annotation @ListenEvent("EventName"). The user of the data recipient only needs to write an event processing class and mark the class with the annotation. When the system starts, the SDK will scan the class marked with the event listening annotation, record the basic information of the class and the Event name (name of the event) processed by the class, and the SDK will listen to the events in the message middleware through the standard API of the message middleware, and deserialize the monitored event message (string) into a standard event object through the deserialization tool and the business model code provided by the data upstream.

[0090] S2453, extracting standard events to the data receiver to synchronize data.

[0091] According to the embodiments of the present disclosure, after the data receiver obtains the standard event object, it can extract the event name, find the class of the event marked with the corresponding @ListenEvent, and call the event processing methods corresponding to these classes to complete the event processing call. The present disclosure publishes the business model code uniformly through the management platform, and uses Maven tools to establish the API dependency of the data provider and the data receiver to clarify the events that need to be monitored and establish the corresponding event processing methods. Among them, the data provider and the data receiver can represent multiple different applications, and the data that needs to be synchronized between the applications can be the same or different. It is only necessary to publish and monitor the events through a unified standard development package, and the automatic synchronization of data between multiple applications can be achieved through the event bus, which greatly reduces the workload of data synchronization and reduces labor costs.

[0092] In order to better understand the method of the present disclosure, the data synchronization process of the present disclosure is described below through specific embodiments.

[0093] Application scenario: Application A needs to synchronize business data with applications B, C, and D.

[0094] Step 1: Use App A to log in to the management platform and enter relevant business information. Upload the business code in your system to the management platform. After review, the management platform will add relevant dependencies to the unified API and update the version number of the API.

[0095] The order received event written by application A includes, for example, event name, user name, product name, and order time. The data order model is, for example, a code that can implement these data elements.

[0096] Step 2: Add dependencies to applications B, C, and D.

[0097] Since application A has submitted the code to the management platform in the first step, the management platform will automatically integrate it into the API release after compilation. Therefore, applications B, C, and D can be associated with the latest dependency information in the system through version control tools such as Maven, that is, they can directly use the two codes ReceivedOrderEvent and Order. You only need to listen to the event, which can be done through relevant codes such as @ListenEvent and @Override. The @ListenEvent annotation indicates which event in the event bus to listen to. No other code is required. When the event arrives at the event bus, the handle method of this class will be automatically called.

[0098] Step 3: Application A publishes an event, and the monitoring method in BCD is automatically called.

[0099] After application A receives an order event, it packages the relevant order information into the event and automatically publishes the event to the event bus through the API's EventHandler event. After this event is listened to by the ListenEvent of other applications, it is automatically extracted from the event bus and performs relevant data processing to complete data synchronization.

[0100] Based on the above data synchronization method, the present disclosure also provides a data synchronization device. Figure 7 The device is described in detail.

[0101] Figure 7 The structure block diagram of the data synchronization device according to the embodiment of the present disclosure is schematically shown.

[0102] like Figure 7 As shown, the data synchronization device 700 of this embodiment includes a transmission module 710 , a creation module 720 , an acquisition module 730 and a synchronization module 740 .

[0103] The transmission module 710 is used to transmit the business model code from the data provider to the data receiver, and the business model code includes the data to be synchronized. In one embodiment, the transmission module 710 can be used to perform the operation S210 described above, which will not be described in detail here.

[0104] The creation module 720 is used to create an event processing class according to the business model code. In one embodiment, the creation module 720 can be used to perform the operation S220 described above, which will not be described in detail here.

[0105] The acquisition module 730 is used to acquire the standard development kit. In one embodiment, the acquisition module 730 can be used to perform the operation S230 described above, which will not be described in detail here.

[0106] The synchronization module 740 is used to use the event processing class and the standard development kit to publish the data provider and monitor the data receiver to synchronize the data; wherein the data to be synchronized is published and monitored through the event bus. In one embodiment, the synchronization module 740 can be used to perform the operation S240 described above, which will not be repeated here.

[0107] According to an embodiment of the present disclosure, any multiple modules of the transmission module 710, the creation module 720, the acquisition module 730 and the synchronization module 740 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the transmission module 710, the creation module 720, the acquisition module 730 and the synchronization module 740 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the transmission module 710, the creation module 720, the acquisition module 730 and the synchronization module 740 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be performed.

[0108] Figure 8 A block diagram of an electronic device suitable for implementing a data synchronization method according to an embodiment of the present disclosure is schematically shown.

[0109] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0110] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0111] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the I / O interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage portion 808 as needed.

[0112] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0113] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 802 and / or RAM 803 described above and / or one or more memories other than ROM 802 and RAM 803.

[0114] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the item recommendation method provided by the embodiment of the present disclosure.

[0115] The above functions defined in the system / device of the embodiment of the present disclosure are executed when the computer program is executed by the processor 801. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0116] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0117] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0118] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0119] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0120] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0121] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A data synchronization method, comprising: Transmitting a business model code from a data provider to a data receiver, wherein the business model code includes data to be synchronized; Create an event processing class according to the business model code; Obtain a standard development kit, the standard development kit including a data providing development kit and a data receiving development kit, the data providing development kit including an event publishing API, a serializer and a message producer, for being called to encapsulate the business model code into an event and publish it from the data provider to an event bus, the data receiving development kit including an event listening API, for being called to listen to the event from the event bus; Using the event processing class and the standard development kit, the data provider publishes the data to be synchronized and the data receiver monitors the data to be synchronized, so as to synchronize the data; Wherein, the data to be synchronized is published and monitored through the event bus; Publishing the data provider of the data to be synchronized by using the event bus and the event processing class and the standard development kit includes: Serializing the business model code into a string through the serializer; Encapsulating the string into the event using the message producer, and publishing the event to the event bus; Using the event bus and the event processing class and the standard development kit to monitor the data receiver of the data to be synchronized includes: Marking the name of the event in the event processing class; Register the annotated event processing class to the event listening API; The event is monitored in the event bus using the registered event monitoring API.

2. The data synchronization method according to claim 1, wherein the transmitting the business model code from the data provider to the data receiver comprises: Establishing a management platform, wherein the management platform is used to provide a unified API; Establishing an API dependency between the data provider and the data receiver through the unified API; The business model code is transmitted from the data provider to the data receiver according to the API dependency.

3. According to the data synchronization method of claim 2, the step of establishing an API dependency between the data provider and the data receiver through the unified API comprises: Uploading the business model code from the data provider to the management platform; Publishing the business model code through the unified API to establish an API dependency between the management platform and the data provider; The business model code is downloaded to the data receiver through the unified API to establish an API dependency between the data receiver and the management platform.

4. According to the data synchronization method of claim 1, the data receiving development kit further comprises a deserializer and a message listener, and the using the registered event listening API to listen to the event in the event bus comprises: Calling the event monitoring API to monitor the event in the event bus through the message listener; Deserialize the event using the deserializer to obtain a standard event; The standard event is extracted to the data receiver to synchronize data.

5. The data synchronization method according to claim 3, before uploading the business model code from the data provider to the management platform, the data synchronization method further comprises: Acquire event completion information, wherein the event completion information includes the complete data to be synchronized; The business model code is written according to the event completion information.

6. The data synchronization method according to claim 3, uploading the business model code from the data provider to the management platform through Maven; The business model code is downloaded from the management platform to the data receiver through Maven.

7. A data synchronization device, comprising: A transmission module, used to transmit a business model code from a data provider to a data receiver, wherein the business model code includes data to be synchronized; A creation module, used to create an event processing class according to the business model code; An acquisition module, used to acquire a standard development kit, wherein the standard development kit includes a data providing development kit and a data receiving development kit, wherein the data providing development kit includes an event publishing API, a serializer, and a message producer, and is used to be called to encapsulate the business model code into an event and publish it from the data provider to an event bus, and the data receiving development kit includes an event listening API, and is used to be called to listen to the event from the event bus; A synchronization module, used to use the event processing class and the standard development kit to publish the data provider and monitor the data receiver to synchronize the data; wherein the data to be synchronized is published and monitored through an event bus; Publishing the data provider of the data to be synchronized by using the event bus and the event processing class and the standard development kit includes: Serializing the business model code into a string through the serializer; Encapsulating the string into the event using the message producer, and publishing the event to the event bus; Using the event bus and the event processing class and the standard development kit to monitor the data receiver of the data to be synchronized includes: Marking the name of the event in the event processing class; Register the annotated event processing class to the event listening API; The event is monitored in the event bus using the registered event monitoring API.

8. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the data synchronization method according to any one of claims 1 to 6.

9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the data synchronization method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the data synchronization method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Application program event processing method and device and electronic equipment

    CN111309406A

  • Automatic multi-product document unified publishing and displaying method

    CN112817915A