Data synchronization method, system, device and medium

By using database log data screening and change operations in the multi-service system collaboration scenario, timely data synchronization between multiple service systems is achieved, the waste of computing resources and idle business operations caused by untimely data synchronization is solved, and the system resource utilization rate and business process efficiency are improved.

CN119739724APending Publication Date: 2025-04-01BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411781080.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the multi-service system collaboration scenario, inadequate data synchronization leads to waste of computing resources and idle business operations.

Method used

By determining the first data in the first business system and filtering out the data change operation using the database log data of the system, the associated data in the second business system are synchronously updated. Meanwhile, the data in the first service system is updated according to the usage status in the second service system.

Benefits of technology

Timely synchronization of data between multi-service systems is achieved, and waste of computing resources and idle business operations are avoided, and the system's resource utilization rate and business process efficiency are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739724A_ABST
    Figure CN119739724A_ABST
Patent Text Reader

Abstract

The invention relates to a data synchronization method, system and device and a medium, the method comprises the following steps: determining first data in a first business system, the first data being created by the first business system and being used by a second business system; determining a database for storing the first data in the first service system, and screening out a change operation of the first service system on the first data through log data output by the database; synchronously updating second data in the second service system according to the change operation, the second data being data generated in the second service system after the second service system obtains the first data; and obtaining a use state of the second data in the second service system, and synchronously updating the first data in the first service system according to the use state. According to the embodiment of the invention, data among a plurality of service systems can be updated in time, the problem of idle running when data of other service systems are used in each service system is reduced, the phenomenon of invalid execution of tasks is reduced, and the execution efficiency of the service systems is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a data synchronization method, system, device and medium. Background Art

[0002] With the development of the Internet, the differentiation of business systems within enterprises has intensified. Different departments are responsible for different business directions. Usually, each business direction has a separate business system to maintain its own business. Multiple business systems achieve interoperability of business data by developing corresponding interfaces. However, since each business system is independent of each other, business changes in each business system will lead to changes in business data. Some data is used by other business systems. When it changes, a large amount of invalid business data cannot be updated to other business systems in time. Either other business systems are still using the corresponding data to execute their established business processes meaninglessly, or other business systems access invalid data through corresponding interface calls. These phenomena are all due to the inability to synchronize data in a timely manner in various business systems, which in turn causes a waste of computing resources in various business systems.

[0003] Therefore, an effective solution is urgently needed to deal with the above problems. Summary of the invention

[0004] The present application provides a data synchronization method to solve the problem of waste of computing resources and idle business operations caused by untimely data synchronization in a traditional multi-business system.

[0005] In a first aspect, the present application provides a data synchronization method applicable to a multi-business system collaboration scenario, including:

[0006] Determine first data in a first business system, where the first data is created by the first business system and is used by a second business system;

[0007] Determine a database storing the first data in the first business system, filter out change operations of the first business system on the first data through log data output by the database, and synchronously update second data in the second business system according to the change operations, where the second data is data generated in the second business system after the second business system obtains the first data;

[0008] A usage status of the second data in the second business system is obtained, and the first data in the first business system is synchronously updated according to the usage status.

[0009] In some embodiments of the present application, filtering out the change operation of the first business system on the first data through the log data output by the database includes:

[0010] Determining the output form of the database log data according to the type of the database;

[0011] If the output form is an interface form, connecting to the log output interface of the database based on the interface communication mode preset by the database;

[0012] The log data output by the database is acquired through the log output interface, and the change operation of the first business system on the first data is screened out from the log data.

[0013] In some embodiments of the present application, the method further comprises:

[0014] If the output format is a log file format, obtaining the log file content output by the database in a read-only manner;

[0015] Obtaining the change status of the log file through the operating system, and when the log file is changed, obtaining the written content of the log file after the change in a read-only manner;

[0016] The change operation of the first business system on the first data is filtered out from the written content.

[0017] In some embodiments of the present application, synchronously updating the second data in the second business system according to the change operation includes:

[0018] determining whether the change operation of the first business system on the first data is a change operation on the effective time of the first data;

[0019] If the operation is to change the validity period of the first data, determining whether the first data has expired based on the changed validity period;

[0020] If the first data expires, the usage status flag of the second data is synchronously updated to a first predetermined value.

[0021] In some embodiments of the present application, synchronously updating the second data in the second business system according to the change operation includes:

[0022] If the first data has not expired, an update operation on the second data is synchronously performed based on the changed effective time.

[0023] In some embodiments of the present application, obtaining a usage status of the second data in the second business system, and synchronously updating the first data in the first business system according to the usage status includes:

[0024] Acquire a current value of a usage status flag of the second data, and determine whether the current value is a second predetermined value;

[0025] If the current value is a second predetermined value, the valid flag corresponding to the first data is synchronously modified to be the second predetermined value.

[0026] In some embodiments of the present application, obtaining a usage status of the second data in the second business system, and synchronously updating the first data in the first business system according to the usage status includes:

[0027] Acquire current values ​​of usage status flags of second data of the first data in a plurality of second business systems, and count the number of usage statuses having a first predetermined value;

[0028] If the number is 0, the valid status flag of the first data in the first business system is synchronously updated to a second predetermined value, and an invalidation notification of the first data is sent to the first business system.

[0029] The second aspect of the present application further proposes a data synchronization system, which is applicable to a multi-business system collaboration scenario, including:

[0030] A data determination module, used to determine first data in a first business system, where the first data is created by the first business system and is used by a second business system;

[0031] A first data acquisition module is used to determine a database storing the first data in a first business system, and filter out change operations of the first business system on the first data through log data output by the database;

[0032] A first data synchronization module, used for synchronously updating second data in the second business system according to the change operation, where the second data is data generated in the second business system after the second business system acquires the first data;

[0033] The second data synchronization module is used to obtain the usage status of the second data in the second business system, and synchronously update the first data in the first business system according to the usage status.

[0034] The third aspect of the present application also proposes a computer device: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; at least one memory connected to the at least one bus, wherein the processor is configured to execute the data synchronization method described in any one of the above embodiments.

[0035] The fourth aspect of the present application further proposes a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the data synchronization method described in any one of the above embodiments.

[0036] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application determines the business data used in association with each other between business systems, obtains the change operation or use status of the business data used in association with each other by each business system, and timely updates it to other business systems associated with the business data. It can effectively solve the problem of waste of computing resources and idle business operations caused by untimely data synchronization in various business systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0039] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0040] Figure 1 A flowchart of a data synchronization method provided in an embodiment of the present application;

[0041] Figure 2 A schematic diagram of a process for filtering first data using a database log data interface provided in an embodiment of the present application;

[0042] Figure 3 A schematic diagram of a process for obtaining log data through a log file in a database provided in an embodiment of the present application;

[0043] Figure 4 A schematic diagram of a process for changing the valid state of second data according to the time change of first data provided in an embodiment of the present application;

[0044] Figure 5 A schematic diagram of a process for synchronously changing a valid flag of first data according to a usage status of second data in a first business system provided in an embodiment of the present application;

[0045] Figure 6 A schematic diagram of a process for modifying first data based on the usage status of second data of multiple business systems provided in an embodiment of the present application;

[0046] Figure 7 A schematic diagram of the structure of a data synchronization system provided in an embodiment of the present application;

[0047] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0049] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0050] In order to solve the problem of waste of computing resources and idle business operations caused by untimely data synchronization in traditional multi-business system collaboration scenarios, the present application provides a data synchronization method that can achieve timely updating of related data in multiple business systems, timely regulation of the execution status of business data in other business systems, and timely prevention of invalid processing of business data by other business systems.

[0051] Figure 1 A data synchronization method provided in an embodiment of the present application is applicable to a multi-service system collaboration scenario, including:

[0052] Step S1: determining first data in a first business system, where the first data is created by the first business system and used by a second business system;

[0053] Step S2: determining a database storing the first data in the first business system, and filtering out change operations of the first business system on the first data through log data output by the database;

[0054] Step S3: Synchronously update the second data in the second business system according to the change operation, where the second data is data generated in the second business system after the second business system acquires the first data;

[0055] Step S4: Acquire the usage status of the second data in the second business system, and synchronously update the first data in the first business system according to the usage status.

[0056] In the embodiment of the present application, the first business system and the second business system refer to the mutual relationship between multiple business systems due to the common associated data, that is, the business system that generates the first data is the first business system, and the one that uses the first data is the second business system; the first data and the second data refer to the same data, which are differentiated by being stored and used in different business systems. That is, the first business system generates the first data, and the second business system generates the second data inside it according to the first data. For example, business system A generates data a1, and after business system B obtains data a1 from business system A, it saves part or all of the content in data a1 in business system B to generate data b1. Then business system A is the first business system, data a1 is the first data, business system B is the second business system, and data b1 is the second data. Similarly, if business system B generates data b2, and business data A obtains data b2, it saves part or all of the content in data b2 in business data A to form data a2. In this case, business system B is the first business system, business system A is the second business system, data b2 is the first data, and data a2 is the second data.

[0057] The usage status of the second data refers to whether the second business system is still using the second data, which can correspondingly reflect whether the second business system is still using the first data.

[0058] In step S1, first confirm the data usage relationship between the business systems, that is, determine which system generates the corresponding first data between the systems (the corresponding first business system), which systems use it (the corresponding second business system), and determine the second data stored in the second system.

[0059] Specifically, the first data can be determined by obtaining the first data through the interface called between the systems, that is, determining which first data the second business system wants to obtain from the first business system through the interface provided by the first business system to the second business system.

[0060] In some embodiments of the present application, the first data and the second data used by the first business system and the second business system may also be determined according to the business logic of each business system. That is to say, under the premise of knowing the functional tasks of the first business system and the second business system, it is determined which data generated by the first business system will be used by the business processing flow corresponding to the second business system, so as to determine the first data.

[0061] In step S2, a database storing the first data in the first business system is determined, and log data output by the database is obtained. Change operations of the first business system on the first data are screened out according to the output log data, and the change operations are recorded changes to the data in the database.

[0062] In some embodiments of the present application, it is necessary to determine the database type used by the first business system, determine the output form of the corresponding log data, and determine the corresponding log data acquisition method based on the output form, and then acquire the corresponding log data.

[0063] In step S3, if it is determined through the filtered log data that the first business system has changed the first data, the changed first data is synchronized to the second business system, that is, the corresponding second data in the second business system is updated, so that the values ​​of the first data and the second data always keep changing synchronously.

[0064] Specifically, it is only necessary to confirm the storage location of the first data in the database, such as which data table the first data is stored in, and the unique identifier corresponding to the first data in the data table, such as the corresponding ID. Then, the log data of the corresponding database is obtained, and the operation log of the data table where the first data is located is first filtered out according to the corresponding data table, and then the change operation of the first data is filtered out according to the unique identifier corresponding to the first data. Then, the changed content in the first data is synchronously updated to the second data.

[0065] Further, according to the above example, take the circle system (first business system) and the reward system (second business system) as an example. If the circle system modifies the users of the conditional package in its system, for example, the decision maker of the circle system believes that some users do not meet the corresponding strategy, or some new users who meet the corresponding strategy are to be added to the conditional package. According to the execution subject implemented by the scheme proposed in this application, the data table where the conditional package is located is first filtered out through the output log of the database of the circle system, and then the conditional package is filtered out according to the ID of the conditional package, and the modification of the user is synchronized to the reward system.

[0066] By synchronizing the change operation of the first data through the database log, it is only necessary to filter the log data of the database, and the change of the first data can be obtained without embedding it into the business system. It has a low coupling degree with the business data and can be generally applicable to data synchronization between any business systems that use a database.

[0067] In step S4, the usage status of the second data in the second business system is also obtained. As mentioned above, the second data is the data locally stored by the second business system for the first data obtained. The usage status of the first data can be modified synchronously in the first business system according to the usage status of the second data in the second business system. If the second business system no longer uses the second data, the usage status of the first data in the first business system is also modified to no longer be used.

[0068] Specifically, in a typical implementation scenario of the present application, the first business system is a "circle people" system of a certain film and television service platform, that is, a business system with maintenance of users as its core task. The second business system is a reward system that executes corresponding rewards for users according to the "conditional package" generated by the circle people system. The conditional package (equivalent to the first data) refers to a user cluster that meets the corresponding user preferential policy in the circle people system, which contains multiple IDs of users who meet the preferential policy. The reward system obtains the conditional package through the interface provided by the circle people system, and saves the obtained conditional package to its own system (equivalent to the second data). Further, the reward system will send reward information to the users in the conditional package periodically or once, and the users can receive the corresponding rewards according to the reward information. For example, the strategy of a certain conditional package is "a red envelope worth 10 yuan will be sent to users who have watched 5 episodes of the Harbin 1944 TV series in the past 2 days"; the content of the conditional package includes: multiple users who meet the above strategy, the effective time of the conditional package, and the effective status of the conditional package. The reward system will send the corresponding reward information to the conditional package. The effective time of the reward is 1 month, that is, the user who receives the reward can receive the reward of 10 yuan red envelope through the reward information within one month. The reward system will process the reward request initiated by the user based on the reward information.

[0069] Furthermore, if it is obtained that the circle system makes changes to the users in the condition package, such as adding or deleting some users, then after obtaining this change operation, the changed condition package will be synchronized to the reward system, or the same change operation will be performed on the second data in the reward system based on the added or deleted users.

[0070] Furthermore, if the circle system modifies the expiration time of the conditional package in its system, for example, the decision maker of the circle system thinks that the validity period of the conditional package is too long and changes the validity period to 15 days. Then, according to the implementation subject of the scheme proposed in this application, the change of the validity period of the conditional package in the circle system is obtained, and the change of the validity period is synchronously updated to the reward system. When the time for the user to receive the reward through the reward information exceeds 15 days, the reward system will refuse to process the receipt behavior.

[0071] Furthermore, if the time of the circle system has not changed, but the reward system has processed the behavior of all users of the conditional package to receive rewards. At this time, in the reward system, the conditional package is a completed conditional package, and the usage status should be invalid. At this time, according to the execution subject implemented by the solution proposed in this application, the invalid status of the conditional package is synchronously updated to the circle system. So that the decision makers of the circle system can timely understand the specific usage status of the conditional package.

[0072] In some embodiments of the present application, the execution entity implemented according to the solution proposed in the present application will delete the users in the conditional packages that have been processed by the reward system and the users in the conditional packages in the circle system.

[0073] like Figure 2 As shown, in some embodiments of the present application, obtaining a change operation of the first business system on the first data, and synchronously updating the second data in the second business system according to the change operation includes:

[0074] Step S21, determining the output form of the database log data according to the type of the database;

[0075] Step S22: If the output form is an interface form, connecting to the log output interface of the database based on the interface communication mode preset by the database;

[0076] Step S23: acquiring log data output by the database through the log output interface, and filtering out change operations of the first business system on the first data from the log data.

[0077] In this embodiment, when the change operation of the first business system on the first data is screened through log data, the database type used by the first business system is first determined, and the output form of the database log data is determined according to the database type, and then the acquisition method of the day column data is determined.

[0078] Specifically, if the log output form of the database used by the first business system is a corresponding application program interface provided to the outside, other third-party applications can obtain the log data output by the database through the corresponding interface. In this case, the log data output interface provided by the database can be directly used to obtain the log data output by the database, and the change operation on the first data can be filtered out from the log data.

[0079] If the output format is a log file format, obtaining the log file content output by the database in a read-only manner;

[0080] Obtaining the change status of the log file through the operating system, and when the log file is changed, obtaining the written content of the log file after the change in a read-only manner;

[0081] The change operation of the first business system on the first data is filtered out from the written content.

[0082] For example, some databases provide a log event interface, so log data can be directly obtained through the log event interface without reading the log file output by the database and then filtering it. For example, the Binlog log event interface of the MySQL database. You only need to call the Binlog interface of the MySQL database where the first data is located to receive the event stream data of the MySQL database, and filter it directly in the memory without the need for IO operations on the file. The corresponding change operation and filtering operation on the first data can be quickly implemented.

[0083] like Figure 3 As shown, in some embodiments of the present application, it also includes:

[0084] Step S31: if the output format is a log file format, obtain the log file content output by the database in a read-only manner;

[0085] Step S32: obtaining the change status of the log file through the operating system, and when the log file is changed, obtaining the written content of the log file after the change in a read-only manner;

[0086] Step S33: Filter out the change operation of the first business system on the first data from the written content.

[0087] In this embodiment, if the database used by the first business system outputs log data in the form of a corresponding log file, no corresponding interface is provided. In this case, the corresponding log file is read in a read-only manner, and the database's higher operations on the log file are monitored in real time through the relevant interface of the operating system. Whenever log data is output to the database, the newly added content in the log file, that is, the corresponding written content, is read.

[0088] Furthermore, the change operation of the first business system on the first data is screened out according to the written content. In this way, the changed written content can be obtained without interfering with the database's reading and writing of the log file. At the same time, the change operation of the database on the log file is monitored by the operating system, and the written content in the log file is obtained. The number of accesses to the log file can be effectively reduced.

[0089] like Figure 4 As shown, in some embodiments of the present application, synchronously updating the second data in the second business system according to the change operation includes:

[0090] Step S41, determining whether the change operation of the first business system on the first data is a change operation on the effective time of the first data;

[0091] Step S42: if the operation is to change the validity period of the first data, determining whether the first data has expired based on the changed validity period;

[0092] Step S43: If the first data expires, the usage status flag of the second data is synchronously updated to a first predetermined value.

[0093] In the embodiment of the present application, as in the above example, if the ring system modifies the expiration time of the conditional package in its system. For example, the decision maker of the ring system believes that the validity period of the conditional package is too long, and changes the validity period to 20 days. Then, according to the execution subject implemented by the scheme proposed in the present application, after obtaining the validity period of 20 days, according to the generation time of the conditional package, it is determined whether the conditional package has exceeded 20 days from its generation to the current time. If it has exceeded 20 days, the usage status flag of the conditional package corresponding to the conditional package in the reward system is set to invalid.

[0094] In some embodiments of the present application, obtaining a change operation of the first business system on the first data, and synchronously updating the second data in the second business system according to the change operation includes:

[0095] If the first data has not expired, an update operation on the second data is synchronously performed based on the changed effective time.

[0096] In this embodiment, if the first data has not expired, the change of the effective time is synchronously updated to the reward system. In this way, the reward system will constrain the user's behavior of receiving the reward through the reward information according to the effective time. That is, the user who receives the reward within 20 days can obtain the reward, while the user who receives the reward after 20 days cannot obtain the corresponding reward.

[0097] like Figure 5As shown, in some embodiments of the present application, synchronously updating the first data in the first business system according to the usage status includes:

[0098] Step S51, obtaining a current value of the usage status flag of the second data, and determining whether the current value is a second predetermined value;

[0099] Step S52: If the current value of the valid flag is a second predetermined value, the valid flag corresponding to the first data is synchronously modified to be the second predetermined value.

[0100] In this embodiment, for the second business system, the usage status of the second data corresponding to the first data in the second business system is also obtained. That is, the usage status flag of the second data is obtained, and it is determined whether the current value of the usage status flag is valid or invalid. If it is invalid, the invalid usage status is synchronized to the first data in the first business system. The corresponding first data is also invalid in the first business system. For example, as in the above example, if the usage status of certain conditional packages in the reward system is invalid (the reason for the invalidity may be that the corresponding reward task has been executed), the usage status of the conditional package with invalid usage status in the circle person system is also invalid. The business logic in the circle person system can be prompted to directly filter when these conditional packages are involved, without displaying or continuing to execute the corresponding business. In this way, according to the usage status of the second business for the second data, the processing of the first data in the first business system can be adjusted in time, the processing of invalid data in the first business system can be reduced, and the consumption of computing resources can be reduced.

[0101] like Figure 6 As shown, in some embodiments of the present application, obtaining the usage status of the second data in the second business system, and synchronously updating the first data in the first business system according to the usage status includes:

[0102] Step S61, obtaining current values ​​of usage status flags of second data of first data in multiple second business systems, and counting the number of usage statuses of the first data being a first predetermined value;

[0103] Step S62: If the number is 0, the valid status flag of the first data in the first business system is synchronously updated to a second predetermined value, and an invalidation notification of the first data is sent to the first business system.

[0104] In this embodiment, in some scenarios, there are multiple business systems using the first data, that is, there are multiple second business systems that use the first data together. When the usage status of the first data in the first business system is updated according to the usage status of the second data, it is necessary to count the effective usage statuses in the multiple second business systems.

[0105] If the statistical number of the usage status is 0, it can be considered that all the second data are no longer used, and the corresponding first data should also be set to invalid. At the same time, a corresponding invalidation notification is sent to the first business system.

[0106] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application determines the business data used in association with each other between business systems, obtains the change operation or use status of the business data used in association with each other by each business system, and timely updates it to other business systems associated with the business data. It can effectively solve the problem of waste of computing resources and idle business operations caused by untimely data synchronization in various business systems.

[0107] Furthermore, by using the log data of the database used by the business system, the change operation of the first business system on the first data is obtained, and the second business system is updated in time. There is no need to embed more program logic in the first business system, or redevelop the corresponding functions to obtain the change operation of the first data. The coupling degree with the business system is low, and it can be widely adapted to the acquisition of corresponding data of more and more complex business systems. The cost of developing corresponding methods for each business system is saved.

[0108] like Figure 7 As shown, the second aspect of the present application further proposes a data synchronization system, which is applicable to a multi-business system collaboration scenario, including:

[0109] A data determination module 1, used to determine first data in a first business system, where the first data is created by the first business system and used by a second business system;

[0110] A first data acquisition module 2 is used to determine a database storing the first data in a first business system, and filter out change operations of the first business system on the first data through log data output by the database;

[0111] A first data synchronization module 3, used for synchronously updating second data in the second business system according to the change operation, where the second data is data generated in the second business system after the second business system acquires the first data;

[0112] The second data synchronization module 4 is used to obtain the usage status of the second data in the second business system, and synchronously update the first data in the first business system according to the usage status.

[0113] like Figure 8As shown, the third aspect of the present application further proposes a computer device: at least one communication interface 812; at least one bus 814 connected to the at least one communication interface 812; at least one processor 811 connected to the at least one bus 814; at least one memory 813 connected to the at least one bus, wherein the processor 811 is configured to execute the steps of the data synchronization method described in any one of the above embodiments:

[0114] Determine first data in a first business system, where the first data is created by the first business system and is used by a second business system;

[0115] Determine a database storing the first data in the first business system, filter out change operations of the first business system on the first data through log data output by the database, and synchronously update second data in the second business system according to the change operations, where the second data is data generated in the second business system after the second business system obtains the first data;

[0116] A usage status of the second data in the second business system is obtained, and the first data in the first business system is synchronously updated according to the usage status.

[0117] In some embodiments of the present application, filtering out the change operation of the first business system on the first data through the log data output by the database includes:

[0118] Determining the output form of the database log data according to the type of the database;

[0119] If the output form is an interface form, connecting to the log output interface of the database based on the interface communication mode preset by the database;

[0120] The log data output by the database is acquired through the log output interface, and the change operation of the first business system on the first data is screened out from the log data.

[0121] In some embodiments of the present application, the method further comprises:

[0122] If the output format is a log file format, obtaining the log file content output by the database in a read-only manner;

[0123] Obtaining the change status of the log file through the operating system, and when the log file is changed, obtaining the written content of the log file after the change in a read-only manner;

[0124] The change operation of the first business system on the first data is filtered out from the written content.

[0125] In some embodiments of the present application, synchronously updating the second data in the second business system according to the change operation includes:

[0126] determining whether the change operation of the first business system on the first data is a change operation on the effective time of the first data;

[0127] If the operation is to change the validity period of the first data, determining whether the first data has expired based on the changed validity period;

[0128] If the first data expires, the usage status flag of the second data is synchronously updated to a first predetermined value.

[0129] In some embodiments of the present application, synchronously updating the second data in the second business system according to the change operation includes:

[0130] If the first data has not expired, an update operation on the second data is synchronously performed based on the changed effective time.

[0131] In some embodiments of the present application, obtaining a usage status of the second data in the second business system, and synchronously updating the first data in the first business system according to the usage status includes:

[0132] Acquire a current value of a usage status flag of the second data, and determine whether the current value is a second predetermined value;

[0133] If the current value of the valid flag is a second predetermined value, the valid flag corresponding to the first data is synchronously modified to be the second predetermined value.

[0134] In some embodiments of the present application, obtaining a usage status of the second data in the second business system, and synchronously updating the first data in the first business system according to the usage status includes:

[0135] Acquire current values ​​of usage status flags of second data of the first data in a plurality of second business systems, and count the number of usage statuses having a first predetermined value;

[0136] If the number is 0, the valid status flag of the first data in the first business system is synchronously updated to a second predetermined value, and an invalidation notification of the first data is sent to the first business system.

[0137] The fourth aspect of the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the steps of the data synchronization method in any one of the above embodiments:

[0138] Determine first data in a first business system, where the first data is created by the first business system and used by a second business system; determine a database in the first business system that stores the first data, filter out change operations on the first data by the first business system through log data output by the database, and synchronously update second data in the second business system according to the change operations, where the second data is data generated in the second business system after the second business system obtains the first data; obtain a usage status of the second data in the second business system, and synchronously update the first data in the first business system according to the usage status.

[0139] In some embodiments of the present application, the output form of the database log data is determined according to the type of the database; if the output form is an interface form, the log output interface of the database is connected based on the interface communication method preset by the database; the log data output by the database is obtained through the log output interface, and the change operations of the first business system on the first data are filtered out from the log data.

[0140] In some embodiments of the present application, if the output is in the form of a log file, the log file content output by the database is obtained in a read-only manner; the change status of the log file is obtained through the operating system, and when the log file is changed, the written content of the log file after the change is obtained in a read-only manner; and the change operation of the first business system on the first data is filtered out from the written content.

[0141] In some embodiments of the present application, it is determined whether the change operation of the first business system on the first data is an operation to change the validity period of the first data; if it is an operation to change the validity period of the first data, it is determined whether the first data has expired based on the changed validity period; if the first data has expired, the usage status flag of the second data is synchronously updated to a first predetermined value.

[0142] In some embodiments of the present application, if the first data has not expired, an update operation on the second data is synchronously performed based on the changed effective time.

[0143] In some embodiments of the present application, the current value of the usage status flag of the second data is obtained, and it is determined whether the current value is a second predetermined value; if the current value of the valid flag is the second predetermined value, the valid flag corresponding to the first data is synchronously modified to the second predetermined value.

[0144] In some embodiments of the present application, the current value of the usage status flag of the second data of the first data in multiple second business systems is obtained, and the number of usage statuses that are a first predetermined value is counted; if the number is 0, the valid status flag of the first data in the first business system is synchronously updated to a second predetermined value, and an invalidation notification of the first data is sent to the first business system.

[0145] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0146] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0147] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0148] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A data synchronization method, applicable to a multi-business system collaboration scenario, characterized in that: include: Determine first data in a first business system, where the first data is created by the first business system and is used by a second business system; Determine a database storing the first data in the first business system, and filter out change operations of the first business system on the first data through log data output by the database; Synchronously updating second data in the second business system according to the change operation, where the second data is data generated in the second business system after the second business system acquires the first data; A usage status of the second data in the second business system is obtained, and the first data in the first business system is synchronously updated according to the usage status.

2. The method according to claim 1, characterized in that The step of filtering out the change operation of the first business system on the first data through the log data output by the database includes: Determining, according to the type of the database, an output format of the log data of the database; If the output form is an interface form, connecting to the log output interface of the database based on the interface communication mode preset by the database; The log data output by the database is acquired through the log output interface, and the change operation of the first business system on the first data is screened out from the log data.

3. The method according to claim 2, characterized in that The method further comprises: If the output format is a log file format, obtaining the log file content output by the database in a read-only manner; Obtaining the change status of the log file through the operating system, and when the log file is changed, obtaining the written content of the log file after the change in a read-only manner; The change operation of the first business system on the first data is filtered out from the written content.

4. The method according to claim 1, characterized in that The synchronously updating the second data in the second business system according to the change operation includes: determining whether the change operation of the first business system on the first data is a change operation on the effective time of the first data; If the operation is to change the validity period of the first data, determining whether the first data has expired based on the changed validity period; If the first data expires, the usage status flag of the second data is synchronously updated to a first predetermined value.

5. The method according to claim 4, characterized in that Synchronously updating the second data in the second business system according to the change operation includes: If the first data has not expired, an update operation on the second data is synchronously performed based on the changed effective time.

6. The method according to claim 1, characterized in that The acquiring the usage status of the second data in the second business system, and synchronously updating the first data in the first business system according to the usage status, includes: Acquire a current value of a usage status flag of the second data, and determine whether the current value is a second predetermined value; If the current value is a second predetermined value, the valid flag corresponding to the first data is synchronously modified to be the second predetermined value.

7. The method according to claim 1, characterized in that The acquiring the usage status of the second data in the second business system, and synchronously updating the first data in the first business system according to the usage status, includes: Acquire current values ​​of usage status flags of second data of the first data in a plurality of second business systems, and count the number of usage statuses having a first predetermined value; If the number is 0, the valid status flag of the first data in the first business system is synchronously updated to a second predetermined value, and an invalidation notification of the first data is sent to the first business system.

8. A data synchronization system, applicable to multi-business system collaboration scenarios, characterized in that: include: A data determination module, used to determine first data in a first business system, where the first data is created by the first business system and is used by a second business system; A first data acquisition module is used to determine a database storing the first data in a first business system, and filter out change operations of the first business system on the first data through log data output by the database; A first data synchronization module, used for synchronously updating second data in the second business system according to the change operation, where the second data is data generated in the second business system after the second business system acquires the first data; The second data synchronization module is used to obtain the usage status of the second data in the second business system, and synchronously update the first data in the first business system according to the usage status.

9. A computer device: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; at least one memory connected to the at least one bus, wherein: The processor is configured to execute the data synchronization method described in any one of claims 1-7.

10. A computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the data synchronization method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Twin platform data synchronization method and device

    CN121619326A