Data synchronization method, data synchronization device, and computer-readable storage medium

By generating synchronization tasks at version points and polling these tasks, the problem of untimely data synchronization in existing technologies is solved, achieving efficient data synchronization at non-periodic version points and improving the efficiency and convenience of data synchronization.

CN115203329BActive Publication Date: 2025-12-23CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210860264.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-21
Publication Date
2025-12-23
Estimated Expiration
2042-07-21

AI Technical Summary

Technical Problem

Existing technologies only support single execution or repeated execution at fixed times, which cannot adapt to non-periodic version timings. This results in untimely data synchronization, affecting the accuracy of the test database and increasing the time cost of application forms and approval processes.

Method used

By obtaining the input version time point, a synchronization task is generated, and the synchronization task is polled to synchronize the data in the production database to the test database. This is applicable to both periodic and non-periodic version time points, enabling automated data synchronization.

Benefits of technology

It improves the convenience and efficiency of data synchronization, reduces labor costs, avoids the problem of untimely data synchronization, and is suitable for non-periodic version releases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115203329B_ABST
    Figure CN115203329B_ABST
Patent Text Reader

Abstract

The application discloses a data synchronization method, a data synchronization device and a computer readable storage medium. The data synchronization method comprises the following steps: obtaining an input version time point; generating a synchronization task according to the version time point; and polling the synchronization task to synchronize data in a production database to a test database. According to the technical scheme of the application, the data in the production database can be synchronized to the test database according to the non-periodic version time point or the periodic version time point, the convenience of data synchronization can be improved, and the efficiency of data synchronization can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

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

[0002] At present, in big data testing, the latest production data is generally needed for support, so after each version ends, data needs to be synchronized from the production database to the test database. The current derivative platform data synchronization only supports single execution or fixed time point repeated execution. However, the monthly version date is irregular, such as version update on January 8, January 22 and February 19, and data synchronization to the test database. How to synchronize data from the production database to the test database according to the non-periodic version time point is a technical problem to be solved. SUMMARY

[0003] The present application aims to at least solve one of the technical problems in the prior art, and provides a data synchronization method, a data synchronization device and a computer readable storage medium, which can synchronize data in the production database to the test database at the version time point through polling synchronization tasks, thereby improving the efficiency of data synchronization.

[0004] In a first aspect, the embodiments of the present application provide a data synchronization method applied to a derivative platform, wherein the derivative platform is used to import data in a production database to a test database, and the method comprises the following steps:

[0005] Obtaining an input version time point;

[0006] Generating a synchronization task according to the version time point;

[0007] Synchronizing data in the production database to the test database through polling the synchronization task.

[0008] According to the data synchronization method of the present application, the following advantages are achieved: obtaining an input version time point; generating a synchronization task according to the version time point; and polling the synchronization task to synchronize data in the production database to the test database. According to the technical solution of the present application, data in the production database can be synchronized to the test database at the version time point according to the synchronization task, which is suitable for non-periodic version time points and periodic version time points, can improve the convenience of data synchronization, and thus can achieve the purpose of improving the efficiency of data synchronization.

[0009] In a second aspect, the embodiments of the present application provide a data synchronization device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the data synchronization method of the first aspect when executing the computer program.

[0010] In a third aspect, an embodiment of the present application provides a computer readable storage medium, which stores computer executable instructions. The computer executable instructions are used to make a computer execute the data synchronization method according to the first aspect.

[0011] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent from the description, or can be learned by practice of the present application. The objects and other advantages of the present application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings. BRIEF DESCRIPTION OF DRAWINGS

[0012] The accompanying drawings, which are included to provide a further understanding of the present application and constitute a part of this specification, illustrate embodiments of the present application and together with the description help to explain the present application, but do not limit the present application in any way.

[0013] The present application will be further described by the following embodiments in conjunction with the accompanying drawings;

[0014] Figure 1 is a step flow chart of the data synchronization method provided by an embodiment of the present application;

[0015] Figure 2 is a step flow chart of the data synchronization method provided by an embodiment of the present application; Figure 1 is a step flow chart of the data synchronization method provided by an embodiment of the present application;

[0016] Figure 3 is a step flow chart of the data synchronization method provided by an embodiment of the present application; Figure 1 is a step flow chart of the data synchronization method provided by an embodiment of the present application;

[0017] Figure 4 is a step flow chart of the data synchronization method provided by an embodiment of the present application; Figure 1 is a step flow chart of the data synchronization method provided by an embodiment of the present application;

[0018] Figure 5 is a step flow chart of the data synchronization method provided by an embodiment of the present application;

[0019] Figure 6 is a step flow chart of the data synchronization method provided by an embodiment of the present application;

[0020] Figure 7 is a step flow chart of the data synchronization method provided by an embodiment of the present application;

[0021] Figure 8 is a step flow chart of the data synchronization method provided by an embodiment of the present application; Figure 1 is a step flow chart of the data synchronization method provided by an embodiment of the present application;

[0022] Figure 9 is a structural schematic diagram of the data synchronization device provided by an embodiment of the present application;

[0023] Figure 10 is a state transition diagram of a synchronization task of a data synchronization method provided by an embodiment of the present application. DETAILED DESCRIPTION

[0024] This part will describe the specific embodiments of the present application in detail, and the preferred embodiments of the present application are shown in the drawings, and the drawings serve to supplement the description of the text part of the description, so that people can intuitively and visually understand each technical feature and the overall technical scheme of the present application, but it cannot be understood as a limitation on the protection scope of the present application.

[0025] In the description of the present application, if the first, second, and the like are described for the purpose of distinguishing technical features, they cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the sequence of indicated technical features.

[0026] In the description of the present application, unless otherwise explicitly limited, the words such as setting, installing, connecting and the like should be understood in a broad sense, and the person skilled in the art can reasonably determine the specific meaning of the above words in the present application in combination with the specific content of the technical scheme.

[0027] In big data testing, the latest production data is generally needed to support, so after the end of each version, data needs to be synchronized from the production database to the test database. The derivative platform is a platform for controlling data synchronization, and the derivative platform in the related art is connected to the production database and the test database. The derivative platform in the related art only supports single execution or fixed time point repeated execution for data synchronization operation, but in actual situations, the version day is affected by the test progress of the test end, and the version day of each month is irregular, for example, January can be 8th and 22nd, and February can be 19th. If the data is synchronized at a fixed time every week or every month, it may cause the data synchronization to be not timely, or the synchronized data may affect the data in the test database, thereby affecting the accuracy of the test data. Therefore, if the latest data from the production database is synchronized to the test database before the start of each version, the data synchronization needs to be re-submitted each time, N represents any number of values, and N versions in a year need to be submitted N times, thereby causing a large number of application forms involved, a large time cost of submitting the forms, and a large time cost of the approval process.

[0028] The embodiments of the present application provide a data synchronization method and device and a computer readable storage medium, comprising: obtaining an input version time point; generating a synchronization task according to the version time point; polling the synchronization task to synchronize data in the production database to the test database. According to the technical scheme of the present application, the data in the production database can be synchronized to the test database at a non-periodic version time point according to the synchronization task, which can improve the convenience of data synchronization, thereby achieving the purpose of improving the efficiency of data synchronization.

[0029] The embodiments of the present application will be further described below with reference to the drawings.

[0030] With reference to Figure 1 The first aspect of the present application provides a data synchronization method, applied to a derivative platform, the derivative platform is used for importing data in a production database into a test database, the method can include but is not limited to steps S110, S120 and S130.

[0031] Step S110: Obtain the input version time point.

[0032] In this step, the derivative platform is used for importing data in the production database into the test database, the version time point refers to the time point at which the derivative platform imports data in the production database into the test database, the version time point is a numerical value of a specific time point, for example, July 3, 2021, 13:45. The version time point can be periodic, since the version time point refers to the time point of the derivative platform, the version time point can be related to the development progress, and the version time point can also be non-periodic. The input version time point is obtained in order to facilitate the generation of a synchronization task in the subsequent step.

[0033] In another embodiment of the present application, the derivative platform can be provided with an input end for inputting the version time point. The input end can be provided with an input box for inputting a string, and the derivative platform can obtain the input non-periodic version time point from the input end.

[0034] In another embodiment of the present application, the input version time point can be any number of version time points, which is not limited here.

[0035] Step S120: Generate a synchronization task according to the version time point.

[0036] In this step, the version time point refers to a non-periodic version time point, and can also be a periodic version time point. The synchronization task refers to any task on the system, for example, a task that is executed on the derivative platform at a fixed time. The synchronization task aggregates the version time points according to the version time point, which can improve the efficiency of synchronizing data. The synchronization task is generated according to the version time point in order to facilitate the synchronization of data in the production database to the test database in the subsequent step.

[0037] In another embodiment of the present application, the synchronization task can be a synchronization task stored in the database, and the derivative platform can be provided with a corresponding synchronization rule to facilitate the synchronization of data by the synchronization task according to the version time point, for example, for each version time point in the synchronization task, the version time point is compared with the current time point, and if the version time point is the same as the current time point, the data is synchronized.

[0038] Step S130: polling the synchronization task to synchronize the data in the production database to the test database.

[0039] In this step, since the synchronization task is generated according to the version point, the synchronization task is polled to synchronize the data in the production database to the test database. The derivative platform can listen to the time point of the day according to the synchronization task, so that the data in the production database can be synchronized to the test database when the version point arrives, thereby achieving the purpose of automatically updating the data according to the version point, reducing the labor cost, avoiding the risk of manual forgetting, and greatly improving the efficiency.

[0040] It can be understood that since the synchronization task to be polled is generated by the version point, the version point in the synchronization task is not limited. The data synchronization method can be applied to periodic version points and non-periodic version points, and has strong applicability, thereby achieving the purpose of improving the efficiency of data synchronization.

[0041] In this embodiment, by steps S110 to S130, the input version point is obtained; the synchronization task is generated according to the version point; and the synchronization task is polled to synchronize the data in the production database to the test database. According to the scheme of the present application, the data in the production database can be synchronized to the test database at the version point corresponding to the synchronization task, which can improve the convenience of data synchronization, thereby achieving the purpose of improving the efficiency of data synchronization.

[0042] It is worth noting that the production database refers to the database of the production end, and the test database refers to the database of the test end. In an optional embodiment, the data of the target table in the test database is incomplete and only has 100 pieces, and the target table in the production database has complete data of 120 pieces. In order to verify the complete business scenario, we need to import the complete data in the target table from the production database to the test database through the derivative platform.

[0043] In an embodiment, as shown in Figure 2 The synchronization task includes a version point, and the synchronization task has a task state. The task state includes a valid state and an invalid state. Step S130 further includes, but is not limited to, steps S210, S220, and S230.

[0044] Step S210: obtaining a valid synchronization task, the valid synchronization task being a synchronization task with a valid state.

[0045] In this step, the synchronization task is generated by the version time point, the synchronization task can be aggregated by multiple version time points, the synchronization task has a task state, that is, a corresponding task state is set for each synchronization task, the task state includes a valid state and an invalid state, and the valid synchronization task refers to the synchronization task with the valid state. The valid synchronization task is obtained to facilitate the subsequent step of synchronizing the data in the production database to the test database.

[0046] In another embodiment of the present application, the task state can be set as a fixed value as the corresponding task state value, for example, the task state 1 represents the valid state, and the task state 0 represents the invalid state, which is not limited here. The task state in the valid state refers to the existence of a version time point in the synchronization task that has not been reached by the current time point, that is, the synchronization task still needs to continue to listen to the current time point to synchronize the data according to the version time point in the synchronization task; the task state in the invalid state refers to that all version time points in the synchronization task are executed to synchronize the data.

[0047] Step S220: Poll the valid synchronization task every first time interval.

[0048] In this step, the first time refers to any time value, for example, one day, one month. The valid synchronization task is polled every first time interval, that is, all valid synchronization tasks are polled in the time period of the first time, so as to determine whether the version time point in the valid synchronization task matches the current time point and the time point between the current time point and the first time, and to achieve the purpose of synchronizing the data.

[0049] In another embodiment of the present application, the first time is one day, the current time point is March 1, 2022, eight o'clock, the valid synchronization task is polled, and it is determined whether the version time point in the valid synchronization task includes the version time point from March 1, 2022, eight o'clock to March 2, 2022, eight o'clock, so as to determine to synchronize the data in the production database to the test database.

[0050] In another embodiment of the present application, the polling refers to any form of polling in the related art, that is, it can achieve the effect of traversing all version time points in the valid synchronization task, which is not limited here. The valid synchronization task is polled every first time interval, which can be at the start time point of each day, that is, zero o'clock.

[0051] Step S230: Synchronize the data in the production database to the test database according to the valid synchronization task and the valid version time point, wherein the valid version time point is the version time point included in the valid synchronization task.

[0052] In this step, the effective version point refers to the version point included in the effective synchronization task. According to the effective synchronization task and the effective version point, the data in the production database is synchronized to the test database, which means that when the effective synchronization task is polled, it is found that there may be a version point in the range between the current point in time and the current point in time plus the first time. A timer or any other method can be used to synchronize the data in the production database to the test database at the point in time when the current point in time matches the version point, thereby enabling automatic data synchronization according to the synchronization task and achieving the purpose of improving the efficiency of data synchronization.

[0053] In another embodiment of the present application, the effective version point in the effective synchronization task only limits the time of data synchronization and does not affect the content of the data. When there are multiple effective version points falling within the range of the current point in time to the point in time after the current point in time plus the first time, for example, the current point in time is March 1, 2022, 00:00, the first time is one day, and there is an effective version point in the effective synchronization task between March 1, 2022, 00:00 and March 2, 2022, 00:00. It can be a re-polling or a timer or any other reminder method. When the current point in time is equal to the effective version point, the data in the production database is synchronized to the test database.

[0054] In this embodiment, by steps S210 to S230, the effective synchronization task is obtained, and the effective synchronization task is a synchronization task with an effective state. Every first time interval, the effective synchronization task is polled. According to the effective synchronization task and the effective version point, the data in the production database is synchronized to the test database, wherein the effective version point is a version point included in the effective synchronization task. According to the scheme of the embodiment of the present application, automatic data synchronization according to the synchronization task can be achieved, and the purpose of improving the efficiency of data synchronization is achieved.

[0055] It is worth noting that the current point in time refers to the point in time corresponding to the current time of the derivative platform when the derivative platform executes the polling program or other tasks.

[0056] In an embodiment, as shown in FIG. 3, Figure 3 As shown in FIG. 3, step S230 is further illustrated, which includes but is not limited to steps S310, S320, S330 and S340.

[0057] Step S310: Every first time interval, a first polling point for polling the effective synchronization task and an effective version point are obtained.

[0058] In this step, the first polling time point refers to the system time point corresponding to the derivative platform when polling the effective synchronization task, and the effective version time point refers to the version time point in the effective synchronization task, and the effective version time point can be obtained by the derivative platform when polling the effective synchronization task. The first polling time point and the effective version time point are obtained in order to facilitate the judgment in the subsequent step whether the time difference between the effective version time point and the first polling time point is less than the first time.

[0059] In another embodiment of the present application, since the effective synchronization task is polled every first time interval, the first polling time point of the effective synchronization task is obtained every first time interval, which means that when the derivative platform needs to perform polling operation, the corresponding system time point is taken as the first polling time point. It can be understood that each time the polling operation is restarted, the first polling time point will be updated.

[0060] Step S320: When the time difference between the effective version time point and the first polling time point is less than the first time, poll the effective synchronization task every second time interval, wherein the second time interval is less than the first time interval.

[0061] In this step, the second time can be any time less than the first time, for example, the first time is one day, and the second time can be one hour. When the time difference between the effective version time point and the execution time point is less than the first time, that is, during the polling of the effective synchronization task by the derivative platform, there is a version time point in the effective synchronization task between the first polling time point and the time point corresponding to the first polling time point plus the first time, so that the effective synchronization task is polled every second time interval, and the execution time point closer to the effective version time point can be obtained, thereby improving the efficiency of the listening time update and achieving the purpose of improving the efficiency of data synchronization.

[0062] In another embodiment of the present application, the effective version time point in the effective synchronization task exists between the first polling time point and the time point corresponding to the first polling time point plus the first time, which means that when the first polling time point is 00:00 on March 1, 2022, and the first time is one day, there is a case that the effective version time point is between 00:00 on March 1, 2022 and 00:00 on March 2, 2022.

[0063] Step S330: Obtain the second polling time point of the polling effective synchronization task every second time interval;

[0064] In this step, since the effective synchronization task is polled every second time interval, when the derivative platform polls the effective synchronization task, the second polling time point is the current system time point, so that the second polling time point can be obtained. The second polling time point of the polling effective synchronization task is obtained every second time interval in order to facilitate the synchronization of the data in the production database to the test database in the subsequent step.

[0065] Step S340: When the second round of queries matches a valid version, synchronize the data in the production database to the test database.

[0066] In this step, when the second polling time point matches the valid version time point, that is, when the second polling time point and the valid version time point are the same, for example, the second time point is one hour, the valid synchronization task is polled every hour. When the second polling time point matches the valid version time point, the second polling time point and the valid version time point are in the same hour of the same date, so that the data in the production database can be synchronized to the test database. The polling is all operated by the data acquisition platform, which can improve the efficiency of data synchronization.

[0067] In this embodiment, through steps S310 to S340, the first polling time point and the effective version time point of the valid synchronization task are obtained at each first time interval; when the time difference between the effective version time point and the first polling time point is less than the first time, the valid synchronization task is polled at each second time interval, wherein the second time is less than the first time; the second polling time point of the valid synchronization task is obtained at each second time interval; when the second polling time point matches the effective version time point, the data in the production database is synchronized to the test database. According to the scheme of this application embodiment, the polling is all operated by the derivative platform, which can achieve the purpose of improving the efficiency of data synchronization.

[0068] In one embodiment, such as Figure 4 As shown, step S230 is further explained, which includes, but is not limited to, steps S410, S420, and S430.

[0069] Step S410: At each interval, obtain the third execution time and the effective version time of the polling valid synchronization task.

[0070] In this step, the third polling time point refers to the system time point corresponding to the polling of valid synchronization tasks by the derivative platform, and the valid version time point refers to the version time point in the valid synchronization task. The valid version time point can be obtained by the derivative platform when polling valid synchronization tasks. Obtaining the third polling time point and the valid version time point is to facilitate subsequent steps in determining whether the time difference between the valid version time point and the third polling time point is less than the first time point.

[0071] In another embodiment of this application, since the effective synchronization task is polled at each first time interval, the third polling time point of the effective synchronization task is obtained at each first time interval. This means that at each first time interval, when the derivative platform needs to perform a polling operation, the corresponding system time point is used as the third polling time point. It is understood that this third polling time point can be updated each time the polling operation restarts.

[0072] Step S420: When the time difference between the effective version time point and the third execution time point is less than the first time, setting a quasi-point execution trigger according to the effective version time point.

[0073] In this step, the quasi-point execution trigger refers to any form of quasi-point execution trigger in the related art. When the time difference between the effective version time point and the third execution time point is less than the first time, that is, before the next polling starts, the data in the production database needs to be synchronized to the test database according to the effective version time point, therefore, a quasi-point execution trigger is set according to the effective version, and the trigger can be a trigger that listens to the system time point. When the effective version time point is equal to the system time point, the data synchronization task is executed to synchronize the data in the production database to the test database.

[0074] In another embodiment of the present application, the synchronization task can include a plurality of aperiodic version time points, so that the derivative platform obtains a system time point close to the version time point according to the periodic polling, and sets a quasi-point execution trigger to trigger the data synchronization operation, which can achieve the purpose of synchronizing the data at the corresponding version time point, and the derivative platform can automatically perform the polling operation without consuming human resources to process, has strong applicability, and can achieve the purpose of improving the efficiency of data synchronization.

[0075] Step S430: Synchronizing the data in the production database to the test database at the effective version time point according to the quasi-point execution trigger.

[0076] In this step, the data in the production database is synchronized to the test database at the effective version time point according to the quasi-point execution trigger, that is, the quasi-point execution trigger listens to the system time point, and when the system time point is equal to the effective version time point, the data in the production database is synchronized to the test database, which can limit the polling of the effective synchronization task every first time interval, reduce the listening duration of the trigger, and thus achieve the purpose of improving the efficiency of data synchronization.

[0077] In this embodiment, through steps S410 to S430, the third execution time point of polling the effective synchronization task and the effective version time point are obtained every first time interval; when the time difference between the effective version time point and the third execution time point is less than the first time, a quasi-point execution trigger is set according to the effective version time point; and the data in the production database is synchronized to the test database at the effective version time point according to the quasi-point execution trigger. According to the scheme of the embodiment of the present application, the polling of the effective synchronization task can be limited every first time interval, the listening duration of the trigger is reduced, and thus the purpose of improving the efficiency of data synchronization can be achieved.

[0078] In an embodiment, as shown in Figure 5 The task state further includes an execution state, and the data synchronization method further includes but is not limited to step S510.

[0079] Step S510: When the synchronization task is being executed, the task state of the synchronization task is set to the execution state; when the synchronization task is executed, if all version time points in the synchronization task have been executed, the task state of the synchronization task is set to the invalid state; if there is a version time point in the synchronization task that has not been executed, the task state of the synchronization task is set to the valid state.

[0080] In this step, the task state includes the valid state and the invalid state, and further includes the execution state. For details, refer to Figure 10 When the synchronization task is being executed, that is, the synchronization task is executed by the derivative platform, which can poll, verify or read the synchronization task, so that the synchronization task is executed, and the synchronization task enters the execution state. When the synchronization task is in the execution state, it can be understood that the derivative platform can determine whether the task has unreasonable version time points according to the state of the synchronization task. When the derivative platform is verifying the synchronization task, it can temporarily not poll the synchronization task, so as to avoid thread conflicts and improve the availability of the data synchronization method.

[0081] It can be understood that, referring to Figure 10 If all version time points in the synchronization task have been executed, that is, all version time points in the synchronization task are less than the system time point, there is no need to poll the synchronization task again. For example, the largest version time point in the synchronization task is March 1, 2021, the current system time point has reached March 9, 2021, the derivative platform has performed data synchronization operation according to the version time point, or the version time point is invalid, the task state of the synchronization task is discarded, and the task state of the synchronization task becomes the invalid state.

[0082] It can also be understood that if there is a version time point in the synchronization task that has not been executed, the data in the production database needs to be synchronized to the test database according to the version time point in the synchronization task, so the task state of the synchronization task is set to the valid state.

[0083] In another embodiment of the present application, the synchronization task is generated according to the version time point. Since the version time point in the generated synchronization task has not reached the system time point, the task state of the synchronization task can be initialized to the valid state, so as to facilitate subsequent polling of the synchronization task.

[0084] In this embodiment, by step S510, when the synchronization task is being executed, the task state of the synchronization task is set to the execution state, when the synchronization task is executed, if all version time points in the synchronization task have been executed, the task state of the synchronization task is set to the invalid state, if there is a version time point not executed in the synchronization task, the task state of the synchronization task is set to the valid state, according to the scheme of the embodiment of the application, according to the execution state of the synchronization task and whether the version time point in the synchronization task has been executed, the task state of the synchronization task is determined, so that the reliability of the synchronization task is improved.

[0085] In an embodiment, as shown in FIG. 6, the data synchronization method further includes but is not limited to steps S610 and S620. Figure 6

[0086] Step S610: Obtain a valid synchronization task, the valid synchronization task including a first version time point to be corrected.

[0087] In this step, the valid synchronization task refers to a synchronization task that needs to be polled every first time interval, and the valid synchronization task includes a first version time point to be corrected, that is, the first version time point in the valid synchronization task is a version time point that is incorrect or needs to be modified, so when the derivative platform polls the valid synchronization task or verifies the valid synchronization task, the version time point in the valid synchronization task can be verified, so that the valid synchronization task including the first version time point to be corrected is obtained. The valid synchronization task including the first version time point to be corrected is obtained to facilitate adding a correct version time point to the valid synchronization task in the subsequent step.

[0088] Step S620: Obtain a second version time point, and modify the first version time point according to the second version time point or add the second version time point to the valid synchronization task.

[0089] In this step, the second version time point can be a version time point used to replace the first version time point, and the first version time point is modified according to the second version time point, which can be replacing the first version time point with the second version time point, for example, the version time point has changed, and there is no need to synchronize data at the first version time point, so the second version time point can replace the first version time point. In an optional embodiment, when the test end encounters a sudden update, it is necessary to synchronize the latest data from the production database to the test database at the second version time point, so the second version time point can be added to the valid synchronization task.

[0090] ​In another embodiment of the present application, it can be understood that the first version point is a version point in a synchronization task, and the data in the production database can be synchronized to the test database at the first version point. When the second version point is a version point for replacing the first version point, the second version point can also be added in the effective synchronization task to synchronize the data in the production database to the test database at the second version point, so as to improve the efficiency of adding or modifying the version point and improve the efficiency of data synchronization.

[0091] In the embodiment, the effective synchronization task is obtained through steps S610 to S620, and the effective synchronization task includes the first version point to be corrected. The second version point is obtained, and the first version point is modified according to the second version point or the second version point is added in the effective synchronization task. According to the scheme of the embodiment of the present application, when there is an added version point or the version point needs to be modified, the synchronization task can be modified by modifying or directly adding the version point, so as to improve the efficiency of adding or modifying the version point and improve the efficiency of data synchronization.

[0092] In an embodiment, as shown in FIG. 7, after step S110, the data synchronization method further includes but is not limited to steps S710 and S720. Figure 7

[0093] Step S710: generating an approval form according to the version point.

[0094] In this step, the approval form is generated according to the version point, which can be a list of version points, so as to obtain the approval form. The approval form is generated to facilitate the verification of the version point in the subsequent step.

[0095] In another embodiment of the present application, the approval form includes the version point, and the approval form can also include other information related to data synchronization, such as the state of the test database under the corresponding version point, that is, whether there is manually made data in the test database to affect data synchronization. In addition, the approval form is generated on the derivative platform, which can be verified by the production end with the production database and the test end with the test database respectively.

[0096] Step S720: verifying the approval form, and updating the version point to the verified version point.

[0097] ​In this step, the approval form is verified, which means that the version time point in the approval form is verified, or when the derivative platform needs to import data in the production database into the test database, it is determined whether the data can be synchronized according to the version time point. This is because the production database involves security issues and cannot be used at will. The data in the production database needs to be approved by the production database management side. In addition, the test database cannot be updated at will, because the test database may contain manually manufactured data, and updating will affect the use of the test environment. The updated version time point is the verified version time point, which means that the version time point can be modified and adjusted during the verification process to reduce the possibility of test environment errors caused by synchronizing data at the version time point, thereby improving the reliability of the version time point.

[0098] In another embodiment of the present application, with reference to Figure 10 The version time point can be generated according to the synchronization task, the task state of the synchronization task is initialized to an invalid state, the approval form is generated according to the version time point in the synchronization task and audited, the task state of the synchronization task is set to a valid state after the audit is passed, and the task state of the synchronization task is maintained as an invalid state if the audit is not passed. Therefore, the version time point can be processed according to the dimension of the synchronization task, and the efficiency of the audit can be improved.

[0099] In this embodiment, the approval form is generated according to the version time point through steps S710 to S720, the approval form is verified, and the updated version time point is the verified version time point. According to the scheme of the present application, the version time point is audited to reduce the possibility of test environment errors caused by synchronizing data at the version time point, thereby improving the reliability of the version time point.

[0100] In an embodiment, as Figure 8 Further illustrated in step S120, the step includes but is not limited to steps S810 and S820.

[0101] Step S810: The version time points are sorted in chronological order.

[0102] In this step, the input version time points have no order requirement, and the version time points can be sorted in chronological order, thereby achieving the purpose of sorting the version time points. According to the sorted version time points, the synchronization task can be generated in the subsequent step.

[0103] In another embodiment of the present application, the version time points can also be sorted in reverse chronological order to obtain version time points with an order, thereby making it easier to read the generated synchronization task.

[0104] Step S820: generating the synchronization task with the task state being the valid state according to the sorted version time points.

[0105] In this step, after the version time points are sorted, the synchronization task with the task state being the valid state is generated according to the sorted version time points, and the version time points in the synchronization task are sorted, which can facilitate reading of the version time points in the synchronization task, thereby achieving the purpose of improving the efficiency of data synchronization.

[0106] In this embodiment, the version time points are sorted in chronological order through steps S810 to S820, and the synchronization task with the task state being the valid state is generated according to the sorted version time points. According to the scheme of the embodiment of the present application, the version time points in the synchronization task are sorted, which can facilitate reading of the version time points in the synchronization task, thereby achieving the purpose of improving the efficiency of data synchronization.

[0107] In addition, with reference to Figure 9 , one embodiment of the present application further provides a data synchronization device, which comprises a memory 1002, a processor 1001, and a computer program stored in the memory 1002 and executable on the processor 1001.

[0108] The processor 1001 and the memory 1002 can be connected through a bus or other means.

[0109] The memory 1002, as a non-transitory computer readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory 1002 can include a high-speed random access memory 1002, and can also include a non-transitory memory 1002, such as at least one disk memory 1002, a flash memory device, or other non-transitory solid-state memory 1002. In some embodiments, the memory 1002 can optionally include a memory 1002 remotely arranged relative to the processor 1001, and these remote memories 1002 can be connected to the processor 1001 through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0110] The non-transitory software programs and instructions required to implement the data synchronization method of the above-mentioned embodiments are stored in the memory 1002, and when executed by the processor 1001, the data synchronization method in the above-mentioned embodiments is executed, for example, the method steps S110 to S130 in the above-mentioned Figure 1 , the method steps S210 to S230 in the above-mentioned Figure 2 , the method steps S310 to S340 in the above-mentioned Figure 3 , the method steps S410 to S1430 in the above-mentioned Figure 4 , and the method steps S510 to S1430 in the above-mentionedFigure 5 Method steps S510, Figure 6 Method steps S610 to S620 in the text Figure 7 Method steps S710 to S720 in the text Figure 8 Method steps S810 to S820.

[0111] Furthermore, one embodiment of this application also provides a computer-readable storage medium storing computer-executable instructions that are executed by a processor or controller, for example, by a processor 1001 in the above-described device embodiment, causing the processor 1001 to perform the data synchronization method described above, for example, performing the above-described... Figure 1 Method steps S110 to S130 in the text Figure 2 Method steps S210 to S230 in the text Figure 3 Method steps S310 to S340 in the text Figure 4 Method steps S410 to S1430, Figure 5 Method steps S510, Figure 6 Method steps S610 to S620 in the text Figure 7 Method steps S710 to S720 in the text Figure 8 Method steps S810 to S820.

[0112] As will be appreciated by one of ordinary skill in the art, all or some steps, systems of the above-disclosed methods can be implemented as software, firmware, hardware, or suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on computer readable media, which can comprise computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, computer storage media includes all computer-readable media in which data, such as computer readable instructions, data structures, program modules or other data, is tangibly embodied. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Further, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. In the foregoing specification, the concepts have been described with reference to specific embodiments. However, one of ordinary skill in the art appreciates that various modifications and changes can be made without departing from the scope of the application as set forth in the claims below. Accordingly, the specification is to be regarded in an illustrative rather than a restrictive sense.

[0113] The above detailed description has shown, described, and pointed out the various embodiments of the application. However, it will be understood that changes and modifications can be made without departing from the scope of the application, which is set forth in the various following claims.

Claims

1. A data synchronization method applied to a derivative platform, wherein the derivative platform is used to import data from a production database into a test database, characterized in that, include: Obtain the version time point of the input; Generate an approval form based on the version time point mentioned; The approval form is validated, and the version time point is updated to the validated version time point; A synchronization task is generated based on the verified version time point, wherein the synchronization task includes the version time point, and the synchronization task has a task status, which includes a valid status and an invalid status. Obtain a valid synchronization task, wherein the valid synchronization task is a synchronization task with the valid state; At each time interval, poll the valid synchronization tasks. Based on the effective synchronization task and the effective version time point, the data in the production database is synchronized to the test database, wherein the effective version time point is the version time point included in the effective synchronization task.

2. The data synchronization method according to claim 1, characterized in that, The step of synchronizing data from the production database to the test database based on the valid synchronization task and the valid version time point includes: At each of the first time intervals, the first polling time point and the effective version time point of the valid synchronization task are obtained and polled. When the time difference between the effective version time point and the first polling time point is less than the first time, the effective synchronization task is polled every second time interval, wherein the second time is less than the first time; At each of the second time intervals, the second polling time point of the valid synchronization task is obtained; When the second polling time point matches the valid version time point, the data in the production database is synchronized to the test database.

3. The data synchronization method according to claim 1, characterized in that, The step of synchronizing data from the production database to the test database based on the valid synchronization task and the valid version time point includes: At each of the first time intervals, the third execution time and the effective version time of the valid synchronization task are obtained and polled. When the time difference between the effective version time point and the third execution time point is less than the first time, a time-based execution trigger is set according to the effective version time point; According to the scheduled execution trigger, the data in the production database is synchronized to the test database at the effective version time.

4. The data synchronization method according to claim 1, characterized in that, The task status also includes an execution status, and the data synchronization method further includes: When the synchronization task is being executed, the task status of the synchronization task is set to the executing state. When the synchronization task is completed, if all version timestamps in the synchronization task have been executed, the task status of the synchronization task is set to the invalid state. If there are unexecuted version timestamps in the synchronization task, the task status of the synchronization task is set to the valid state.

5. The data synchronization method according to claim 1, characterized in that, Also includes: Obtain the valid synchronization task, which includes the first version time point to be corrected; Obtain the second version time point, modify the first version time point based on the second version time point, or add the second version time point to the effective synchronization task.

6. The data synchronization method according to claim 1, characterized in that, The step of generating a synchronization task based on the version time point includes: Sort the versions in ascending chronological order; Based on the sorted version timestamps, generate synchronization tasks with a valid task status.

7. A data synchronization device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the data synchronization method as described in any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the data synchronization method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • A cross-gateway data synchronization method

    CN108984725A

  • Data synchronization method and device, computer device and storage medium

    CN109783504A