Data synchronization method and apparatus, storage medium, and processor

By introducing a preset interface for communication in the real-time database, obtaining and processing subscription information to indicate changes in data tag numbers, the problem of difficult configuration data and real-time data synchronization in the real-time database is solved, achieving efficient data synchronization and deep data mining.

CN115811524BActive Publication Date: 2025-11-04ZHEJIANG DATANG WUSHASHAN POWER GENERATION CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211399296.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-09
Publication Date
2025-11-04
Estimated Expiration
2042-11-09

AI Technical Summary

Technical Problem

Existing real-time database products face difficulties in synchronizing configuration data and real-time data, leading to problems such as difficulty in synchronizing configuration and real-time data at the enterprise application layer, low utilization rate, and insufficient data mining depth.

Method used

The client establishes communication with the preset database through a preset interface, obtains and sends subscription information to indicate the tag number change information of the changed data, realizes the synchronization of configuration data and real-time data between the client and the database, and uses gRPC interface and WebSocket interface for unified integration, providing configuration data interface and real-time data interface to handle configuration change data and real-time change data respectively.

Benefits of technology

It achieves efficient configuration data synchronization and real-time data synchronization between the client and the preset database, solving the problem of difficult configuration data and real-time data synchronization, and improving data utilization and data mining depth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115811524B_ABST
    Figure CN115811524B_ABST
Patent Text Reader

Abstract

The application discloses a data synchronization method and device, a storage medium and a processor. The method comprises the following steps: obtaining subscription information sent by a client through a preset interface, wherein the preset interface is used for establishing communication between the client and a preset database, and the subscription information is used for indicating subscription of changed data in the preset database; sending the subscription information to the preset database through the preset interface, wherein in the case that the changed data appears in the preset database, bit number change information used for indicating a bit number where the changed data is located is generated; and sending the bit number change information to the client through the preset interface, wherein the client is used for synchronizing the changed data according to the bit number change information. The application solves the technical problem of difficult configuration data and real-time data synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of databases, and in particular, to a data synchronization method and device, a storage medium, and a processor. BACKGROUND

[0002] A real-time database is a new type of database that combines a database and a real-time system, and plays an important role in automatic production, aerospace, control and communication, and information systems. As basic software for petrochemical, papermaking, energy, military, pharmaceutical and other industries, real-time databases have a development history of more than 30 years. From early foreign real-time databases to the current domestic multiple real-time databases acting on various industries, real-time databases provide functions such as collection, storage, analysis, processing, and calculation for enterprise production data, and play a crucial role in helping enterprise decision makers make correct decisions. However, there are many real-time database products on the market, each of which provides different secondary development interfaces, and the functions of the real-time database secondary development interfaces are not complete enough. Products supporting configuration and real-time data subscription interfaces have not yet been released, making it difficult for enterprise application layers to configure and synchronize real-time data, and resulting in low usage of real-time big data and insufficient data mining depth.

[0003] At present, there is no effective solution to the above-mentioned configuration data and real-time data synchronization difficulty problem.

[0004] CONTENT

[0005] Embodiments of the present application provide a data synchronization method, device, storage medium and processor to at least solve the technical problem of configuration data and real-time data synchronization difficulty.

[0006] According to an aspect of an embodiment of the present application, a data synchronization method is provided, including: obtaining subscription information sent by a client through a preset interface, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription of changed data in the preset database; sending the subscription information to the preset database through the preset interface, wherein in the case that the changed data appears in the preset database, bit number change information indicating a bit number where the changed data is located is generated; and sending the bit number change information to the client through the preset interface, wherein the client is used to synchronize the changed data according to the bit number change information.

[0007] Optionally, the change data at least comprises configuration change data for indicating configuration change and real-time change data for indicating real-time data change; the subscription information at least comprises configuration subscription information for indicating subscription of the configuration change data or real-time subscription information for indicating subscription of the real-time change data; and the preset interface at least comprises a configuration data interface and a real-time data interface, wherein the configuration data interface is used for transmitting the configuration subscription information, and the real-time data interface is used for transmitting real-time data of the real-time subscription information.

[0008] Optionally, the obtaining of the subscription information initiated by the client through the preset interface comprises: obtaining a subscription request of the client, wherein the subscription request carries the subscription information; in a case where the subscription information is the configuration subscription information, calling the configuration data interface to obtain the configuration subscription information; and in a case where the subscription information is the real-time subscription information, calling the real-time data interface to obtain the real-time subscription information.

[0009] Optionally, in a case where the subscription information is the configuration subscription information, after the subscription information is sent to the preset database through the preset interface, the method further comprises: sending configuration version information provided by the preset database to the client through the preset interface, wherein the configuration version information is used for indicating a configuration version number of the configuration change data; and sending bit number query information provided by the client to the preset database through the preset interface, wherein the bit number query information is determined according to the configuration version information and is used for indicating bit number change information of the configuration change data.

[0010] Optionally, in a case where the subscription information is the real-time subscription information, after the subscription information is sent to the preset database through the preset interface, the method further comprises: sending subscription grouping information provided by the preset database to the client through the preset interface, wherein the preset database generates the subscription grouping information based on the real-time subscription information; and sending bit number listening information provided by the client to the preset database through the preset interface, wherein the client sets the bit number listening information in response to the subscription grouping information, and the bit number listening information is used for indicating change data of a preset bit number in the preset database.

[0011] According to another aspect of the embodiments of the present application, a data synchronization method is also provided. The method comprises: a client sending subscription information to a preset database through a preset interface, wherein the preset interface is used to establish communication between the client and the preset database, and the subscription information is used to indicate subscription of changed data in the preset database; the client receiving bit number change information provided by the preset database through the preset interface, wherein the bit number change information is used to indicate a bit number where the changed data is located, and the bit number change information is generated when the changed data occurs in the preset database; and the client synchronizing the changed data with the preset database according to the bit number change information.

[0012] According to another aspect of the embodiments of the present application, a data synchronization apparatus is also provided. The apparatus comprises: an acquisition module, configured to acquire subscription information sent by a client through a preset interface, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription of changed data in the preset database; a first sending module, configured to send the subscription information to the preset database through the preset interface, wherein bit number change information used to indicate a bit number where the changed data is located is generated when the changed data occurs in the preset database; and a second sending module, configured to send the bit number change information to the client through the preset interface, wherein the client is configured to synchronize the changed data according to the bit number change information.

[0013] According to another aspect of the embodiments of the present application, a data synchronization apparatus is also provided. The apparatus comprises: a third sending module, configured to send subscription information to a preset database by a client through a preset interface, wherein the preset interface is used to establish communication between the client and the preset database, and the subscription information is used to indicate subscription of changed data in the preset database; a receiving module, configured to receive bit number change information provided by the preset database by the client through the preset interface, wherein the bit number change information is used to indicate a bit number where the changed data is located, and the bit number change information is generated when the changed data occurs in the preset database; and a synchronization module, configured to synchronize the changed data with the preset database according to the bit number change information by the client.

[0014] According to another aspect of the embodiments of the present application, a non-volatile storage medium is also provided. The non-volatile storage medium is used to store a program, wherein the program controls a device where the non-volatile storage medium is located to execute the data synchronization method when the program is running.

[0015] According to another aspect of the embodiments of the present application, a processor is provided, and the processor is configured to run a program, wherein the program performs the data synchronization method.

[0016] In the embodiments of the present application, the subscription information sent by the client is acquired through a preset interface, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription of changed data in the preset database; the subscription information is sent to the preset database through the preset interface, wherein in the case that the changed data appears in the preset database, bit number change information indicating a bit number where the changed data is located is generated; and the bit number change information is sent to the client through the preset interface, wherein the client is used to synchronize the changed data according to the bit number change information. By establishing the communication between the client and the preset database through the preset interface, the client can subscribe to the changed data in the preset database, and then in the case that the changed data is configuration data, the configuration data synchronization between the client and the preset database can be realized, and in the case that the changed data is real-time data, the real-time data synchronization between the client and the preset database can be realized, thereby solving the technical problem of difficult configuration data and real-time data synchronization. BRIEF DESCRIPTION OF DRAWINGS

[0017] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the present application. In the drawings:

[0018] Figure 1 is a flowchart of a data synchronization method according to an embodiment of the present application Figure One ;

[0019] Figure 2 is a schematic diagram of subscription of configuration changed data according to an embodiment of the present application

[0020] Figure 3 is a schematic diagram of subscription of real-time changed data according to an embodiment of the present application

[0021] Figure 4 is a schematic diagram of a secondary development interface integration method of a real-time database according to an embodiment of the present application

[0022] Figure 5 is a schematic diagram of interface interaction of a secondary development interface integration method of a real-time database according to an embodiment of the present application

[0023] Figure 6 is a flowchart of a data synchronization method according to an embodiment of the present application Figure Two ;

[0024] Figure 7 is a schematic diagram of a data synchronization device according to an embodiment of the application Figure One ;

[0025] Figure 8 is a schematic diagram of a data synchronization device according to an embodiment of the application Figure Two ;

[0026] Figure 9 is a structural block diagram of a computer terminal according to an embodiment of the application. DETAILED DESCRIPTION

[0027] In order to enable persons skilled in the art to better understand the scheme of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should be within the scope of protection of the present application.

[0028] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:

[0030] gRPC: A high-performance RPC framework open-sourced by Google.

[0031] RPC: Remote Procedure Call framework, which provides a set of mechanisms to enable communication between applications.

[0032] Protobuf: A hybrid language data standard with a lightweight and efficient structured data storage format, which can be used for structured data serialization, or serialization.

[0033] SDK: Software Development Kit, software development kit. Generally, a set of development tools for software engineers to build software for a particular software package, software framework, hardware platform, operating system, etc.

[0034] WebSocket: a protocol for full-duplex communication over a single TCP connection.

[0035] Bit number: process variable in real-time database.

[0036] According to the embodiments of the present application, a data synchronization method embodiment is provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from here.

[0037] Figure 1 is a flow of a data synchronization method according to an embodiment of the present application Figure One As shown in Figure 1 , the method comprises the following steps:

[0038] Step S102, obtaining the subscription information sent by the client through the preset interface, wherein the preset interface is used to establish the communication between the client and the preset database, and the subscription information is used to indicate the subscription of the changed data in the preset database;

[0039] Step S104, sending the subscription information to the preset database through the preset interface, wherein in the case that the changed data occurs in the preset database, the bit number change information used to indicate the bit number where the changed data is located is generated;

[0040] Step S106, sending the bit number change information to the client through the preset interface, wherein the client is used to synchronize the changed data according to the bit number change information.

[0041] In the embodiment of the present application, the subscription information sent by the client is acquired through a preset interface, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription of changed data in the preset database; the subscription information is sent to the preset database through the preset interface, wherein bit number change information indicating a bit number where the changed data is located is generated in the case that the changed data occurs in the preset database; and the bit number change information is sent to the client through the preset interface, wherein the client is used to synchronize the changed data according to the bit number change information. The communication between the client and the preset database is established through the preset interface, so that the client can subscribe to the changed data in the preset database, and then in the case that the changed data is configuration data, configuration data synchronization between the client and the preset database can be realized, and in the case that the changed data is real-time data, real-time data synchronization between the client and the preset database can be realized, thereby solving the technical problem of difficult configuration data and real-time data synchronization.

[0042] In the step S102, the client can be a smart mobile terminal or a third-party application of a PC end.

[0043] In the step S102, the changed data at least includes configuration change data used to indicate configuration change and real-time change data used to indicate real-time data change; the subscription information at least includes configuration subscription information used to indicate subscription of the configuration change data or real-time subscription information used to indicate subscription of the real-time change data; and the preset interface at least includes a configuration data interface and a real-time data interface, wherein the configuration data interface is used to transmit the configuration subscription information, and the real-time data interface is used to transmit the real-time subscription information.

[0044] In the above embodiment, the changed data in the preset database includes configuration change data and real-time change data, and the preset interface at least includes a configuration data interface and a real-time data interface.

[0045] Optionally, in the process of subscribing to the changed data, the configuration subscription information provided by the client can be sent to the preset database for subscription through the configuration data interface, and information related to the configuration change data can be transmitted through the configuration data interface.

[0046] Optionally, in the process of subscribing to the changed data, the real-time subscription information provided by the client can be sent to the preset database for subscription through the real-time data interface, and information related to the real-time change data can be transmitted through the real-time data interface.

[0047] The above embodiment of the present application can perform subscription tasks of configuration change data and real-time change data through a configuration data interface and a real-time data interface respectively, realize configuration change data synchronization between the client and the preset database by the configuration data interface, and realize real-time change data synchronization between the client and the preset database by the real-time data interface.

[0048] In the above step S102, the preset interface can be a gRPC interface or a WebSocket interface; the gRPC interface and the WebSocket interface are integrated in an interface service; after receiving the subscription command, the interface service sends the configuration subscription command to a configuration service and sends the real-time data subscription command to a real-time service.

[0049] As an optional embodiment, the subscription information initiated by the client is obtained through the preset interface, including: obtaining a subscription request of the client, wherein the subscription request carries the subscription information; in the case that the subscription information is configuration subscription information, calling the configuration data interface to obtain the configuration subscription information; in the case that the subscription information is real-time subscription information, calling the real-time data interface to obtain the real-time subscription information.

[0050] Figure 2 is a configuration change data subscription schematic diagram according to an embodiment of the present application, as shown in Figure 2 The configuration subscription request is initiated by a third-party client, calls the preset interface through an rpc mode, and starts a configuration listening thread to listen to configuration changes; the interface service calls a real-time database configuration service subscription interface through a tcp mode; the configuration service caches the subscription ID and sends the changed version information to the corresponding client after the configuration change; the client configuration listening thread obtains the version number and queries the bit number change information according to the version number to refresh the local cached bit number configuration. The above process can realize the bit number configuration synchronization between the third-party client and the real-time database; that is, the configuration change data synchronization.

[0051] As an optional embodiment, in the case that the subscription information is configuration subscription information, after the subscription information is sent to the preset database through the preset interface, the method further includes: sending the configuration version information provided by the preset database to the client through the preset interface, wherein the configuration version information is used to indicate the configuration version number of the configuration change data; and sending the bit number query information provided by the client to the preset database through the preset interface, wherein the bit number query information is determined according to the configuration version information and is used to indicate the bit number change information of the configuration change data.

[0052] Figure 3 is a real-time change data subscription schematic diagram according to an embodiment of the present application, as shown in Figure 3As shown, the subscription request of the real-time change data is also initiated by the third-party client, and after being forwarded by the interface service, the subscription process is implemented in the real-time service of the real-time database. The third-party client needs to send three requests to complete the entire real-time data subscription: subscription group, add the bit number to be subscribed to the subscription group, and activate the subscription group.

[0053] Optionally, the real-time service implementation process is: after receiving the subscription group request, the subscription group is added to the subscription event, and the subscription group callback is called to notify the client of the subscription group result; after the subscription group is added successfully, the bit number list to be subscribed in the group is added, and the request is also forwarded to notify the client of the bit number addition result, and the ID of the subscription group is returned; after the client activates the subscription group according to the subscription group ID, the thread listens to the bit number change information, at this time, the activation request is forwarded, and the real-time service calls the client back if the activation is successful, and the changed bit number data is also called back to the client after the subscription bit number is changed. Through the above-mentioned manner, the client can keep consistent with the real-time database bit number data in real time.

[0054] In the above step S104, the preset database can be a real-time database.

[0055] As an optional embodiment, in the case of real-time subscription information, after sending the subscription information to the preset database through the preset interface, the method further comprises: sending the subscription group information provided by the preset database to the client through the preset interface, wherein the preset database generates the subscription group information based on the real-time subscription information; and sending the bit number listening information provided by the client to the preset database through the preset interface, wherein the client sets the bit number listening information in response to the subscription group information, and the bit number listening information is used to indicate listening to the change data of the preset bit number in the preset database.

[0056] In the above embodiment of the application, in the case of subscribing to real-time change data through real-time subscription information, the client can receive the subscription group information of the preset database to the client, and generate bit number listening information in response to the subscription group information, and then listen to the change data of the preset bit number in the preset database based on the bit number listening information, thereby realizing listening to the change data of the preset bit number.

[0057] As an optional embodiment, after sending the bit number change information to the client through the preset interface, the method further comprises: sending the bit number query information provided by the client to the preset database through the preset interface, wherein the bit number query information is used to indicate the query data of the preset bit number in the preset database; and sending the query data provided by the preset database to the client through the preset interface, wherein the preset database determines the query data based on the bit number query information.

[0058] In the above embodiments of the present invention, the preset interface can also provide the client with a query function for preset data. The preset interface forwards the tag number query information provided by the client and returns the query data returned by the preset database in response to the tag number query information to the client, thereby realizing the query of data in the preset database.

[0059] As an optional embodiment, the tag number query information includes: tag number change information for indicating querying changed data, and historical tag number information for indicating querying historical data.

[0060] In the above embodiments of the present invention, the tag number query information is used to indicate the query of data for a specified tag number, the tag number change information is used to indicate the query of changed data in a preset database, and the historical tag number information is used to indicate the query of historical data in a preset database.

[0061] As an optional embodiment, obtaining subscription information initiated by the client through a preset interface includes: forwarding a connection request initiated by the client to a preset database through the preset interface, wherein the connection request indicates that the client requests to establish a communication connection with the preset database through the preset interface; sending an authorization token provided by the preset database to the client through the preset interface, wherein the preset database responds to the connection request, determines whether the preset database agrees to establish a communication connection with the client, and generates an authorization token if the preset database agrees to establish a communication connection with the client; and sending subscription information initiated by the client to the preset database through the preset interface, wherein the subscription information carries the authorization token.

[0062] In the above embodiments of the present invention, the subscription information carries an authorization token. Based on the authorization token, the client can have the permission to subscribe to changed data in the preset database, thereby preventing unauthorized clients from accessing the preset database and ensuring the information security of the database.

[0063] Optionally, permission tokens can be used to limit the time a client can access a preset database.

[0064] This application also provides a preferred embodiment, which provides an integration method for a secondary development interface based on a real-time database.

[0065] This application addresses the problem of low utilization rate of industrial big data and insufficient data mining in process industry enterprises, as well as the issues existing in the practical use of real-time databases in the industrial software field. It proposes an integration method based on the secondary development interface of the i-SYS real-time database, including: definition, calling, and integration of the i-SYS secondary development interface. Based on a self-developed real-time database, the method achieves secondary use, aggregation, and integration of data by calling the secondary development interface of the real-time database, facilitating access, use, and modification of real-time database data by third-party applications.

[0066] The application is a gRPC interface (i.e., a preset interface) for real-time database (i.e., a preset database) interaction, which supports an application to obtain database bit number configuration information through an interface request mode, complete read and write query operations of real-time values and historical values, and is designed in an RPC mode with Protobuf as a main data encapsulation format. The application provides a gRPC interface definition, calling and integration method. The gRPC interface has the advantages of high performance, streaming request and response compared with a conventional SDK and Web API method.

[0067] The application is provided in a service form, and the interface calling can be realized after the service is started.

[0068] Table 1 is a definition table of the preset interface as a gRPC interface and a WebSocket interface.

[0069]

[0070] Table 1

[0071] Optionally, the gRPC interface is defined through a protobuf file, a developer copies the protobuf file to a local place, compiles the protobuf into a pb file of a corresponding programming language through a compiling tool, and references the pb file to a programming project.

[0072] Optionally, in the case that the preset interface is a user interface, the login function of the user interface can be used to log in to a configuration service, and return a JWT token to a user, which must be carried in metadata in a subsequent request of the user.

[0073] Optionally, in the case that the preset interface is a user interface, the logout function of the user interface can be used to log out of a real-time database system, and destroy all resources related to a logged-in user.

[0074] Optionally, in the case that the preset interface is a configuration data interface, the bit number query function of the configuration data interface includes: querying bit number configuration information of a real-time database according to specified query conditions, and only viewing bit numbers with a permission of a user. Before calling the interface, a JWT access token must be obtained through the user interface, and the same token can be repeatedly used in multiple calls.

[0075] Optionally, in the case that the preset interface is a configuration data interface, the current latest configuration version is obtained through the configuration data interface, including: querying a latest version of configuration data in a real-time database, and returning latest bit number configuration version information.

[0076] Optionally, the changed bit number configuration is obtained according to a version number through the configuration data interface, including: incrementally querying bit number configuration according to specified query conditions, and generally being used in cooperation with a subscription configuration interface.

[0077] Optionally, subscribing to the configuration through the configuration data interface comprises: subscribing to configuration version information, and pushing the configuration to the subscriber when the configuration changes.

[0078] Optionally, unsubscribing from the configuration through the configuration data interface comprises: unsubscribing from the configuration version, and no longer pushing the configuration information to the subscriber when the configuration changes.

[0079] Optionally, reading real-time data through the real-time data interface comprises: reading real-time data of specified bit numbers, and supporting batch reading.

[0080] Optionally, writing real-time data through the real-time data interface comprises: writing values to specified bit numbers, and supporting batch writing values.

[0081] Optionally, subscribing to real-time data through the real-time data interface comprises:

[0082] For a subscription group that needs to subscribe to multiple metadata or real-time value use set functions, batch subscription is supported in two modes: subscription by group and default group subscription.

[0083] 1) In the subscription by group mode, the platform automatically pushes data to the subscription client when the subscription group is activated.

[0084] 2) In the default group subscription mode, the group subscription related operations can be omitted, and the corresponding group ID does not need to be specified.

[0085] Optionally, the default group mode only supports change push data.

[0086] Optionally, the subscription client can actively pull the bit number data subscribed by the platform.

[0087] Optionally, the request address is ws: / / {{host:port}} / rtdb / api / v1 / rtd / pb, the request method is websocket, the format is JSON, and the encoding type is UTF-8.

[0088] Optionally, in the case of a preset interface in the websocket general communication protocol format, a subscription group can be added.

[0089] Optionally, the historical interface is used to provide four types of original data query, sampling query, aggregation query and expression calculation query for historical data query. The query type is directly determined in the interface definition.

[0090] Optionally, the original value query is used to query the original data of specified bit numbers, supports batch query, and can support multiple filtering conditions.

[0091] Optionally, the sampling query by interval includes: querying the historical sampling values of the bit number by a specified interval, supporting batch query.

[0092] Optionally, the sampling query by point number includes: querying the historical sampling values of the bit number by the expected number of returned results, supporting batch query.

[0093] Optionally, the sampling query by time point includes: querying the historical sampling values of the bit number by a specified time point, supporting batch query.

[0094] Optionally, the historical statistical value query includes: querying the aggregated data of the bit number, supporting batch query.

[0095] Optionally, the expression calculation query includes: querying the calculation result of a specified expression, supporting batch query.

[0096] Figure 4 is a schematic diagram of an integration method of a real-time database secondary development interface according to an embodiment of the present application, as shown in Figure 4 The technical scheme provided by the present application is mainly applied to a third-party client. The client development process starts interface calling after introducing the pb file compiled by the protobuf provided in the second aspect. The premise of the client accessing the real-time database is that the real-time database deployment, authorization and configuration are completed. A session is established by creating a client of the secondary development interface service. Before that, the secondary development interface service has been successfully connected with the configuration service, the real-time service and the historical query service. At this time, the client calls the login interface of the configuration, sends the username and password provided for the client to use for login operation, and the login command is transmitted to the configuration service. The configuration service checks the username and password, and returns the Token of the user after the check is successful. The Token carries the permission information of the user. The client needs to add the Token in the Metadata to transmit the user information when calling other interfaces.

[0097] Figure 5 is a schematic diagram of interface interaction of an integration method of a real-time database secondary development interface according to an embodiment of the present application, as shown in Figure 5 After login, the client needs to query the configuration information of the current database. The bit number query interface of the configuration is called to enumerate all bit number information of the database. The client can add the bit number to the corresponding group according to the demand. All bit numbers are queried as the bit number information corresponding to the current configuration version. In order to avoid the change of bit number information caused by the update of database configuration, it is suggested that the client subscribes to the database configuration after enumerating the bit number. After the database configuration is changed, the configuration service sends the latest configuration version to the subscribed client. The client updates the local bit number cache after querying the latest bit number configuration information according to the configuration version, so as to realize the configuration synchronization of the client and the database.

[0098] Optionally, the client selects to subscribe to the bit number real-time value or read the bit number real-time value according to the business needs of the client, the application provides a WebSocket real-time data subscription interface, adds a subscription group according to the interface definition of the first aspect, puts the subscribed bit number into the subscription group, and after the subscription group is activated, the real-time data subscription is completed. The client receives the pushed real-time data and is used for display, calculation or analysis.

[0099] Optionally, the client calls a historical data interface to obtain the bit number historical value of the database. The application provides a development interface for obtaining original historical values, sampled historical values and statistical values. The client calls different interfaces according to needs. When the client calls the interface to obtain the historical value, the secondary development interface service forwards the request to the real-time database historical query service, the historical query service queries the corresponding historical data according to the request condition and returns the historical data to the client. After the client obtains the historical data, the client can perform secondary utilization of the data such as display, secondary calculation, trend analysis and trend prediction.

[0100] Figure 6 is a flow of a data synchronization method according to an embodiment of the application Figure Two As shown in Figure 6 , the method comprises the following steps:

[0101] Step S602, the client sends subscription information to the preset database through a preset interface, wherein the preset interface is used to establish communication between the client and the preset database, and the subscription information is used to indicate subscription of changed data in the preset database;

[0102] Step S604, the client receives bit number change information provided by the preset database through the preset interface, wherein the bit number change information is used to indicate the bit number where the changed data is located, and the bit number change information is generated in the case that the changed data appears in the preset database;

[0103] Step S606, the client synchronizes the changed data with the preset database according to the bit number change information.

[0104] In this embodiment, subscription information sent by the client is obtained through a preset interface. The preset interface establishes communication between the client and a preset database, and the subscription information indicates subscription to changed data in the preset database. The subscription information is sent to the preset database through the preset interface. When the changed data appears in the preset database, bit change information indicating the bit number of the changed data is generated. The bit change information is sent to the client through the preset interface. The client synchronizes the changed data according to the bit change information. By establishing communication between the client and the preset database through the preset interface, the client can subscribe to changed data in the preset database. Therefore, when the changed data is configuration data, configuration data synchronization between the client and the preset database can be achieved; when the changed data is real-time data, real-time data synchronization between the client and the preset database can be achieved. This solves the technical problem of difficult synchronization of configuration data and real-time data.

[0105] According to the embodiments of this application, a data synchronization device embodiment is also provided. It should be noted that the data synchronization device can be used to execute the data synchronization method in the embodiments of this application, and the data synchronization method in the embodiments of this application can be executed in the data synchronization device.

[0106] Figure 7 This is a schematic diagram of a data synchronization device according to an embodiment of this application. Figure One ,like Figure 7 As shown, the device may include: an acquisition module 72, configured to acquire subscription information sent by a client through a preset interface, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription to changed data in the preset database; a first sending module 74, configured to send the subscription information to the preset database through the preset interface, wherein, when the changed data appears in the preset database, bit change information indicating the bit number where the changed data is located is generated; and a second sending module 76, configured to send the bit change information to the client through the preset interface, wherein the client is used to synchronize the changed data according to the bit change information.

[0107] In the embodiment of the present application, the subscription information sent by the client is acquired through a preset interface, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription of changed data in the preset database; the subscription information is sent to the preset database through the preset interface, wherein bit number change information indicating a bit number where the changed data is located is generated in the case that the changed data appears in the preset database; and the bit number change information is sent to the client through the preset interface, wherein the client is used to synchronize the changed data according to the bit number change information. The communication between the client and the preset database is established through the preset interface, so that the client can subscribe to the changed data in the preset database, and then in the case that the changed data is configuration data, the configuration data synchronization between the client and the preset database can be realized, and in the case that the changed data is real-time data, the real-time data synchronization between the client and the preset database can be realized, thereby solving the technical problem of difficult configuration data and real-time data synchronization.

[0108] As an optional embodiment, the changed data at least includes configuration change data used to indicate configuration change and real-time change data used to indicate real-time data change; the subscription information at least includes configuration subscription information used to indicate subscription of the configuration change data or real-time subscription information used to indicate subscription of the real-time change data; and the preset interface at least includes a configuration data interface and a real-time data interface, wherein the configuration data interface is used to transmit the configuration subscription information, and the real-time data interface is used to transmit the real-time subscription information.

[0109] As an optional embodiment, the acquisition module includes a first acquisition unit used to acquire a subscription request of the client, wherein the subscription request carries the subscription information; a first calling unit used to call the configuration data interface to acquire the configuration subscription information in the case that the subscription information is the configuration subscription information; and a second calling unit used to call the real-time data interface to acquire the real-time subscription information in the case that the subscription information is the real-time subscription information.

[0110] As an optional embodiment, the apparatus further comprises a first sending sub-module, configured to, when the subscription information is the configuration subscription information, send the configuration version information provided by the preset database to the client through the preset interface after sending the subscription information to the preset database through the preset interface, wherein the configuration version information is used to indicate a configuration version number of the configuration change data; and a second sending sub-module, configured to send the bit number query information provided by the client to the preset database through the preset interface, wherein the bit number query information is determined according to the configuration version information and is used to indicate the bit number change information of the configuration change data.

[0111] As an optional embodiment, the apparatus further comprises a third sending sub-module, configured to, when the subscription information is the real-time subscription information, send the subscription grouping information provided by the preset database to the client through the preset interface after sending the subscription information to the preset database through the preset interface, wherein the preset database generates the subscription grouping information based on the real-time subscription information; and a fourth sending sub-module, configured to send the bit number listening information provided by the client to the preset database through the preset interface, wherein the client sets the bit number listening information in response to the subscription grouping information, and the bit number listening information is used to indicate the change data of the preset bit number in the preset database.

[0112] As an optional embodiment, the apparatus further comprises a fifth sending sub-module, configured to send the bit number query information provided by the client to the preset database through the preset interface after sending the bit number change information to the client through the preset interface, wherein the bit number query information is used to indicate the query data of the preset bit number in the preset database; and a sixth sending sub-module, configured to send the query data provided by the preset database to the client through the preset interface, wherein the preset database determines the query data based on the bit number query information.

[0113] As an optional embodiment, the bit number query information comprises the bit number change information used to indicate the query of the change data and historical bit number information used to indicate the query of historical data.

[0114] As an optional embodiment, the obtaining module comprises: a seventh forwarding submodule, configured to forward, through the preset interface, a connection request initiated by the client to the preset database, wherein the connection request is used to indicate that the client requests to establish a communication connection to the preset database through the preset interface; an eighth sending submodule, configured to send, through the preset interface, an authority token provided by the preset database to the client, wherein the preset database determines whether to agree to establish a communication connection with the client in response to the connection request, and generates the authority token in a case where the preset database agrees to establish a communication connection with the client; and a ninth sending submodule, configured to send, through the preset interface, the subscription information initiated by the client to the preset database, wherein the subscription information carries the authority token.

[0115] Figure 8 is a schematic diagram of a data synchronization device according to an embodiment of the present application Figure Two As shown in Figure 8 the device can comprise: a third sending module 82, configured to send, by a client, subscription information to a preset database through a preset interface, wherein the preset interface is used to establish communication between the client and the preset database, and the subscription information is used to indicate subscription of changed data in the preset database; a receiving module 84, configured to receive, by the client, bit number change information provided by the preset database through the preset interface, wherein the bit number change information is used to indicate a bit number where the changed data is located, and the bit number change information is generated in a case where the changed data appears in the preset database; and a synchronization module 86, configured to synchronize, by the client, the changed data with the preset database according to the bit number change information.

[0116] In the embodiment of the present application, subscription information sent by a client is obtained through a preset interface, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription of changed data in the preset database; the subscription information is sent to the preset database through the preset interface, wherein bit number change information used to indicate a bit number where the changed data is located is generated in a case where the changed data appears in the preset database; and the bit number change information is sent to the client through the preset interface, wherein the client is used to synchronize the changed data according to the bit number change information. The communication between the client and the preset database is established through the preset interface, so that the client can subscribe to changed data in the preset database, and then in a case where the changed data is configuration data, configuration data synchronization between the client and the preset database can be implemented, and in a case where the changed data is real-time data, real-time data synchronization between the client and the preset database can be implemented, thereby solving the technical problem of difficult configuration data and real-time data synchronization.

[0117] The computer terminal can be any one of the computer terminal devices in the computer terminal group. Alternatively, in the embodiment, the computer terminal can be replaced by a mobile terminal or other terminal device.

[0118] Alternatively, in the embodiment, the computer terminal can be located in at least one of the network devices in the computer network.

[0119] In the embodiment, the computer terminal can execute program codes of the following steps in the data synchronization method: obtaining, by a preset interface, subscription information sent by a client, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription of changed data in the preset database; sending, by the preset interface, the subscription information to the preset database, wherein in a case where the changed data occurs in the preset database, bit number change information indicating a bit number where the changed data is located is generated; and sending, by the preset interface, the bit number change information to the client, wherein the client is used to synchronize the changed data according to the bit number change information.

[0120] In the embodiment, the computer terminal can execute program codes of the following steps in the data synchronization method: subscription information sent by a client to a preset database through a preset interface, wherein the preset interface is used to establish communication between the client and the preset database, and the subscription information is used to indicate subscription of changed data in the preset database; receiving, by the client through the preset interface, bit number change information provided by the preset database, wherein the bit number change information is used to indicate a bit number where the changed data is located, and the bit number change information is generated in a case where the changed data occurs in the preset database; and synchronizing, by the client, the changed data with the preset database according to the bit number change information.

[0121] Figure 9 is a structural block diagram of a computer terminal according to an embodiment of the present application, as shown in Figure 9 The computer terminal 90 can include one or more (only one is shown in the figure) processors 92 and a memory 94.

[0122] The memory can be configured to store software programs and modules, such as program instructions / modules corresponding to the data synchronization method and device in the embodiments of the present application. The processor executes various functions and data processing by running the software programs and modules stored in the memory, that is, implements the data synchronization method described above. The memory can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory can further include a memory remotely arranged with respect to the processor, which can be connected to the terminal A through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0123] The processor can call information and application programs stored in the memory through the transmission device to perform the following steps: obtaining subscription information sent by the client through a preset interface, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription of changed data in the preset database; sending the subscription information to the preset database through the preset interface, wherein in the case that changed data occurs in the preset database, bit number change information indicating a bit number where the changed data is located is generated; and sending the bit number change information to the client through the preset interface, wherein the client is used to synchronize the changed data according to the bit number change information.

[0124] Optionally, the changed data at least includes configuration change data used to indicate configuration change and real-time change data used to indicate real-time data change; the subscription information at least includes configuration subscription information used to indicate subscription of the configuration change data or real-time subscription information used to indicate subscription of the real-time change data; and the preset interface at least includes a configuration data interface and a real-time data interface, wherein the configuration data interface is used to transmit the configuration subscription information, and the real-time data interface is used to transmit the real-time subscription information.

[0125] Optionally, the processor can further execute program codes of the following steps: obtaining a subscription request of the client, wherein the subscription request carries the subscription information; in the case that the subscription information is configuration subscription information, calling the configuration data interface to obtain the configuration subscription information; and in the case that the subscription information is real-time subscription information, calling the real-time data interface to obtain the real-time subscription information.

[0126] Optionally, in the case that the subscription information is configuration subscription information, the processor can further execute program codes of the following steps: after sending the subscription information to the preset database through the preset interface, sending configuration version information provided by the preset database to the client through the preset interface, wherein the configuration version information is used to indicate a configuration version number of the configuration change data; and sending bit number query information provided by the client to the preset database through the preset interface, wherein the bit number query information is determined according to the configuration version information and is used to indicate bit number change information of the configuration change data.

[0127] Optionally, in the case that the subscription information is real-time subscription information, the processor can further execute program codes of the following steps: after sending the subscription information to the preset database through the preset interface, sending subscription grouping information provided by the preset database to the client through the preset interface, wherein the preset database generates the subscription grouping information based on the real-time subscription information; and sending bit number listening information provided by the client to the preset database through the preset interface, wherein the client sets the bit number listening information in response to the subscription grouping information, and the bit number listening information is used to indicate change data of a preset bit number in the preset database.

[0128] Optionally, the processor can further execute program codes of the following steps: after sending the bit number change information to the client through the preset interface, sending bit number query information provided by the client to the preset database through the preset interface, wherein the bit number query information is used to indicate query data of the preset bit number in the preset database; and sending the query data provided by the preset database to the client through the preset interface, wherein the preset database determines the query data based on the bit number query information.

[0129] Optionally, the bit number query information includes bit number change information used to indicate query change data and historical bit number information used to indicate query historical data.

[0130] Optionally, the processor can further execute program codes of the following steps: forwarding a connection request initiated by the client to the preset database through the preset interface, wherein the connection request is used to indicate that the client requests to establish a communication connection with the preset database through the preset interface; sending an authority token provided by the preset database to the client through the preset interface, wherein the preset database determines whether the preset database agrees to establish the communication connection with the client in response to the connection request, and generates the authority token in the case that the preset database agrees to establish the communication connection with the client; and sending subscription information initiated by the client to the preset database through the preset interface, wherein the subscription information carries the authority token.

[0131] The processor can call information and application programs stored in the memory through the transmission device to perform the following steps: the client sends subscription information to the preset database through a preset interface, wherein the preset interface is used to establish communication between the client and the preset database, and the subscription information is used to indicate subscription of changed data in the preset database; the client receives bit number change information provided by the preset database through the preset interface, wherein the bit number change information is used to indicate a bit number where the changed data is located, and the bit number change information is generated in the case that the changed data appears in the preset database; and the client synchronizes the changed data with the preset database according to the bit number change information.

[0132] By adopting the embodiment of the application, a data synchronization scheme is provided. The subscription information sent by the client is acquired through a preset interface, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription of changed data in the preset database; the subscription information is sent to the preset database through the preset interface, wherein bit number change information used to indicate a bit number where the changed data is located is generated in the case that the changed data appears in the preset database; and the bit number change information is sent to the client through the preset interface, wherein the client is used to synchronize the changed data according to the bit number change information. The communication between the client and the preset database is established through the preset interface, so that the client can subscribe to the changed data in the preset database, and then in the case that the changed data is configuration data, configuration data synchronization between the client and the preset database can be realized, and in the case that the changed data is real-time data, real-time data synchronization between the client and the preset database can be realized, thereby solving the technical problem of difficult configuration data and real-time data synchronization.

[0133] Those skilled in the art can understand that, Figure 9 The structure shown is only schematic, and the computer terminal can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Figure 9 It does not limit the structure of the electronic device. For example, the computer terminal 90 can further include more or fewer components (such as a network interface, a display device, etc.) than those shown in the figure, or have a different configuration from that shown in the figure. Figure 9 Figure 9

[0134] ​​Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiments can be completed by instructing the terminal device related hardware through a program, and the program can be stored in a computer readable storage medium, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0135] The embodiments of the present application also provide a storage medium. Optionally, in the embodiments, the storage medium can be used to save the program code executed by the data synchronization method provided by the embodiments.

[0136] Optionally, in the embodiments, the storage medium can be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.

[0137] Optionally, in the embodiments, the storage medium is configured to store program code for executing the following steps: obtaining, through a preset interface, subscription information sent by a client, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription of changed data in the preset database; sending, through the preset interface, the subscription information to the preset database, wherein in the case that the changed data occurs in the preset database, bit number change information indicating a bit number where the changed data is located is generated; and sending, through the preset interface, the bit number change information to the client, wherein the client is used to synchronize the changed data according to the bit number change information.

[0138] Optionally, in the embodiments, the changed data at least includes configuration changed data used to indicate configuration change and real-time changed data used to indicate real-time data change; the subscription information at least includes configuration subscription information used to indicate subscription of the configuration changed data or real-time subscription information used to indicate subscription of the real-time changed data; and the preset interface at least includes a configuration data interface and a real-time data interface, wherein the configuration data interface is used to transmit the configuration subscription information, and the real-time data interface is used to transmit the real-time subscription information.

[0139] Optionally, in the embodiments, the storage medium is configured to store program code for executing the following steps: obtaining a subscription request of a client, wherein the subscription request carries subscription information; in the case that the subscription information is configuration subscription information, calling a configuration data interface to obtain the configuration subscription information; and in the case that the subscription information is real-time subscription information, calling a real-time data interface to obtain the real-time subscription information.

[0140] Optionally, in the embodiment, when the subscription information is configuration subscription information, the storage medium is configured to store program code for performing the following steps: after sending the subscription information to the preset database through the preset interface, sending configuration version information provided by the preset database to the client through the preset interface, wherein the configuration version information is used to indicate a configuration version number of the configuration change data; and sending bit number query information provided by the client to the preset database through the preset interface, wherein the bit number query information is determined according to the configuration version information and is used to indicate bit number change information of the configuration change data.

[0141] Optionally, in the embodiment, when the subscription information is real-time subscription information, the storage medium is configured to store program code for performing the following steps: after sending the subscription information to the preset database through the preset interface, sending subscription grouping information provided by the preset database to the client through the preset interface, wherein the preset database generates the subscription grouping information based on the real-time subscription information; and sending bit number listening information provided by the client to the preset database through the preset interface, wherein the client sets the bit number listening information in response to the subscription grouping information, and the bit number listening information is used to indicate change data of a preset bit number in the preset database.

[0142] Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: after sending the bit number change information to the client through the preset interface, sending bit number query information provided by the client to the preset database through the preset interface, wherein the bit number query information is used to indicate query data of the preset bit number in the preset database; and sending the query data provided by the preset database to the client through the preset interface, wherein the preset database determines the query data based on the bit number query information.

[0143] Optionally, in the embodiment, the bit number query information includes: bit number change information used to indicate query change data, and historical bit number information used to indicate query historical data.

[0144] Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: forwarding a connection request initiated by the client to the preset database through the preset interface, wherein the connection request is used to indicate that the client requests to establish a communication connection with the preset database through the preset interface; sending an authority token provided by the preset database to the client through the preset interface, wherein the preset database determines whether the preset database agrees to establish the communication connection with the client in response to the connection request, and generates the authority token in a case where the preset database agrees to establish the communication connection with the client; and sending subscription information initiated by the client to the preset database through the preset interface, wherein the subscription information carries the authority token.

[0145] Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: the client sends subscription information to the preset database through a preset interface, wherein the preset interface is used to establish communication between the client and the preset database, and the subscription information is used to indicate subscription of changed data in the preset database; the client receives bit number change information provided by the preset database through the preset interface, wherein the bit number change information is used to indicate a bit number where the changed data is located, and the bit number change information is generated in a case where the changed data occurs in the preset database; and the client synchronizes the changed data with the preset database according to the bit number change information.

[0146] The serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.

[0147] In the above-described embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0148] In the several embodiments provided by the present application, it should be understood that the disclosed technology can be implemented in other ways. Of course, the unit embodiment described above is only schematic. For example, the division of the units can be a logical function division, and there can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection between the units can be indirect coupling or communication connection through some interface, unit or module, and can be electrical or other forms.

[0149] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0150] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of software functional unit.

[0151] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.

[0152] The above is only the preferred embodiment of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should be considered as the protection scope of the present application.

Claims

1. A data synchronization method, characterized in that, include: The subscription information sent by the client is obtained through a preset interface, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription to changed data in the preset database; The subscription information is sent to the preset database through the preset interface, wherein, when the changed data appears in the preset database, bit change information is generated to indicate the bit number where the changed data is located; The bit change information is sent to the client through the preset interface, wherein the client is used to synchronize the change data according to the bit change information; The change data includes at least: configuration change data for indicating configuration changes and real-time change data for indicating real-time data changes; The subscription information includes at least: configuration subscription information for indicating subscription to the configuration change data or real-time subscription information for indicating subscription to the real-time change data; The preset interface includes at least a configuration data interface and a real-time data interface, wherein the configuration data interface is used to transmit the configuration subscription information, and the real-time data interface is used to transmit the real-time subscription information; The preset interface is either a general remote procedure call interface or a network socket interface, wherein the general remote procedure call interface and the network socket interface are uniformly integrated into the interface service.

2. The method according to claim 1, characterized in that, The subscription information initiated by the client can be obtained through the preset interface, including: Obtain the subscription request from the client, wherein the subscription request carries the subscription information; If the subscription information is the configuration subscription information, the configuration data interface is invoked to obtain the configuration subscription information; If the subscription information is the real-time subscription information, the real-time data interface is invoked to obtain the real-time subscription information.

3. The method according to claim 1, characterized in that, When the subscription information is the configuration subscription information, after sending the subscription information to the preset database through the preset interface, the method further includes: The configuration version information provided by the preset database is sent to the client through the preset interface, wherein the configuration version information is used to indicate the configuration version number of the configuration change data; The tag number query information provided by the client is sent to the preset database through the preset interface. The tag number query information is determined according to the configuration version information and is used to indicate the tag number change information of the configuration change data.

4. The method according to claim 1, characterized in that, When the subscription information is the real-time subscription information, after sending the subscription information to the preset database through the preset interface, the method further includes: The preset interface sends the subscription group information provided by the preset database to the client, wherein the preset database generates the subscription group information based on the real-time subscription information. The client sends the bit number monitoring information provided by the client to the preset database through the preset interface. The client sets the bit number monitoring information in response to the subscription group information. The bit number monitoring information is used to indicate the monitoring of changes in preset bit numbers in the preset database.

5. A data synchronization method, characterized in that, include: The client sends subscription information to a preset database through a preset interface, wherein the preset interface is used to establish communication between the client and the preset database, and the subscription information is used to indicate subscription to changed data in the preset database; The client receives bit change information provided by the preset database through the preset interface. The bit change information is used to indicate the bit number where the changed data is located. The bit change information is generated when the changed data appears in the preset database. The client synchronizes the change data with the preset database based on the bit change information; The change data includes at least: configuration change data for indicating configuration changes and real-time change data for indicating real-time data changes; The subscription information includes at least: configuration subscription information for indicating subscription to the configuration change data or real-time subscription information for indicating subscription to the real-time change data; The preset interface includes at least a configuration data interface and a real-time data interface, wherein the configuration data interface is used to transmit the configuration subscription information, and the real-time data interface is used to transmit the real-time subscription information; The preset interface is either a general remote procedure call interface or a network socket interface, wherein the general remote procedure call interface and the network socket interface are uniformly integrated into the interface service.

6. A data synchronization device, characterized in that, include: The acquisition module is used to acquire subscription information sent by the client through a preset interface, wherein the preset interface is used to establish communication between the client and a preset database, and the subscription information is used to indicate subscription to changed data in the preset database; The first sending module is used to send the subscription information to the preset database through the preset interface, wherein, when the changed data appears in the preset database, bit change information is generated to indicate the bit number where the changed data is located; The second sending module is used to send the tag number change information to the client through the preset interface, wherein the client is used to synchronize the change data according to the tag number change information; The change data includes at least: configuration change data for indicating configuration changes and real-time change data for indicating real-time data changes; The subscription information includes at least: configuration subscription information for indicating subscription to the configuration change data or real-time subscription information for indicating subscription to the real-time change data; The preset interface includes at least a configuration data interface and a real-time data interface, wherein the configuration data interface is used to transmit the configuration subscription information, and the real-time data interface is used to transmit the real-time subscription information; The preset interface is either a general remote procedure call interface or a network socket interface, wherein the general remote procedure call interface and the network socket interface are uniformly integrated into the interface service.

7. A data synchronization device, characterized in that, include: The third sending module is used for the client to send subscription information to the preset database through a preset interface, wherein the preset interface is used to establish communication between the client and the preset database, and the subscription information is used to indicate subscription to changed data in the preset database; The receiving module is used for the client to receive bit change information provided by the preset database through the preset interface, wherein the bit change information is used to indicate the bit number where the changed data is located, and the bit change information is generated when the changed data appears in the preset database; The synchronization module is used by the client to synchronize the changed data with the preset database according to the bit change information; The change data includes at least: configuration change data for indicating configuration changes and real-time change data for indicating real-time data changes; The subscription information includes at least: configuration subscription information for indicating subscription to the configuration change data or real-time subscription information for indicating subscription to the real-time change data; The preset interface includes at least a configuration data interface and a real-time data interface, wherein the configuration data interface is used to transmit the configuration subscription information, and the real-time data interface is used to transmit the real-time subscription information; The preset interface is either a general remote procedure call interface or a network socket interface, wherein the general remote procedure call interface and the network socket interface are uniformly integrated into the interface service.

8. A non-volatile storage medium, characterized in that, The non-volatile storage medium is used to store a program, wherein, when the program is running, the device containing the non-volatile storage medium is controlled to execute the data synchronization method according to any one of claims 1 to 5.

9. A processor, characterized in that, The processor is used to run a program, wherein the program executes the data synchronization method according to any one of claims 1 to 5 when it runs.

Citation Information

Patent Citations

  • Data reading system and data reading method based on time sequence database

    CN114969057A