CN117609257A - Database data synchronous updating method, device, equipment and storage medium - Google Patents

Database data synchronous updating method, device, equipment and storage medium Download PDF

Info

Publication number
CN117609257A
CN117609257A CN202311521518.5A CN202311521518A CN117609257A CN 117609257 A CN117609257 A CN 117609257A CN 202311521518 A CN202311521518 A CN 202311521518A CN 117609257 A CN117609257 A CN 117609257A
Authority
CN
China
Prior art keywords
data
value
processed
library
change
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311521518.5A
Other languages
Chinese (zh)
Inventor
王桂林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Jishu Technology Co ltd
Original Assignee
Hangzhou Jishu Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Jishu Technology Co ltd filed Critical Hangzhou Jishu Technology Co ltd
Priority to CN202311521518.5A priority Critical patent/CN117609257A/en
Publication of CN117609257A publication Critical patent/CN117609257A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to a database data synchronous updating method, a device, equipment and a storage medium, which relate to the technical field of data synchronization and comprise the following steps: acquiring a periodic execution plan of data synchronization; determining to-be-processed data to be synchronized to a new library in an execution period of the periodic execution plan; judging whether the data to be processed has data change or not according to the original library and the new library, and synchronizing the data with the data change to the new library. The method and the device have the purpose of synchronizing the data with the data change in the data to be processed of the original database into the new database.

Description

Database data synchronous updating method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data synchronization, and in particular, to a method, an apparatus, a device, and a storage medium for database data synchronization update.
Background
At present, with the development of the global scientific and technological information age, a large amount of data is accumulated in different industries, and the continuous iterative updating of the artificial intelligence technology is performed, so that the large model calculation is developed at a high speed, and the problem of data synchronization between databases is more and more prominent.
As the number of data between the database and the database is increasing, the service requirement cannot be met simply by means of the traditional manual synchronization mode. Therefore, in order to realize synchronous migration of the original database data, the invention provides a scheme for synchronizing the database data.
Disclosure of Invention
In order to realize synchronous migration of original database data, the application provides a method, a device, equipment and a storage medium for synchronously updating database data.
The technical scheme for solving the technical problems is as follows:
in a first aspect, the present application provides a method for synchronously updating database data, which adopts the following technical scheme, including:
acquiring a periodic execution plan of data synchronization;
determining to-be-processed data to be synchronized to a new library in an execution period of the periodic execution plan;
judging whether the data to be processed has data change or not according to the original library and the new library, and synchronizing the data with the data change to the new library.
The beneficial effects of the invention are as follows: by judging whether the data to be processed has data change or not and synchronizing the data of the new database, the aim of synchronizing the data with data change in the data to be processed of the original database into the new database is fulfilled.
Further, the data to be processed is table data, the table data comprises at least one row of row data, and the row data corresponds to a unique ID value;
the judging whether the data to be processed has data change according to the original library and the new library comprises the following steps:
acquiring a period labeling value of the current period based on the periodic execution plan;
acquiring all unique ID values corresponding to the data to be processed, and inquiring whether target ID values identical to all the unique ID values exist in the new library according to all the unique ID values;
if yes, judging that the data to be processed has no data newly-added change, wherein the data change comprises the data newly-added change;
if not, judging that the data to be processed has new data addition change.
The adoption of the further scheme has the beneficial effect that the monitoring of the newly added change of the data in the data to be processed in the original library can be realized by inquiring whether the same unique ID value record exists in the new library. And updating the period labeling value of the row data corresponding to the target ID value which is the same as the unique ID value in the new library.
Further, after determining that the data to be processed has no data newly added change, the method further includes: and marking the cycle marking value of the current cycle to row data corresponding to the target ID value in the new library.
The beneficial effect of adopting the further proposal is that,
further, if it is determined that the data to be processed has a new data change, synchronizing the data having the new data change to the new library includes:
and inserting the data corresponding to each unique ID value into the new library, and labeling the cycle labeling value of the current cycle to the data corresponding to each unique ID value in the new library.
The further scheme has the beneficial effects that the line data corresponding to the unique ID value is inserted into the new library, and the synchronization with the new change of the data to be processed of the original library can be realized by inserting the line data into the new library.
Further, after determining that the data to be processed has not changed in data addition, determining whether the data to be processed has changed in data according to the original library and the new library, further includes:
and judging whether the data content of the data to be processed changes or not according to the original library and the new library.
The further scheme has the beneficial effect that the monitoring of the change of the data content to be processed in the original library can be realized by carrying out row data signature comparison on the data with the same unique ID value in the original library and the new library. And updating the period labeling value of the data in the new library and the data with no data content change.
Further, each data corresponding to the unique ID value corresponds to a data signature, and the determining, according to the original library and the new library, whether the data content of the data to be processed changes includes:
for each unique ID value, performing row data signature comparison on the row data corresponding to the target ID value and the row data corresponding to the unique ID value;
for each unique ID value, if the row data signature comparison is the same, judging that each field in the row data corresponding to the unique ID value has no data content change; the data changes further include the data content changes;
for each unique ID value, if the row data signature comparison is different, judging that the data content of the field in the row data corresponding to the unique ID value is changed;
after determining that each field in the row data in the original library has not changed in data content, further comprising: marking the cycle marking value of the current cycle to the row data corresponding to the target ID value in the new library;
if it is determined that the field in the row data in the original library has a data content change, synchronizing the data having the data change to the new library, and further including: and updating the data of the data content change of the field of the original library into the new library, and marking the period marking value of the current period to the data of the data content change of the field of the new library.
The further scheme has the beneficial effect that the synchronization with the change of the data content to be processed of the original library can be realized by updating the data of the data content change of the field of the original library into the new library.
Further, after judging whether the data to be processed has changed according to the original library and the new library and synchronizing the data having changed to the new library, the method further comprises:
judging whether the data to be processed is completely traversed in the execution period;
if yes, deleting the data of the periodic marked value which is not marked with the current period in the new library; the data of the periodic marked value which is not marked with the current period comprises the data of the periodic marked value which is not marked with the data and the data of the periodic marked value which is different from the current period.
The method has the beneficial effect that the synchronization with the deletion change of the data to be processed of the original library can be realized by executing the deletion action on the data which are not marked with the periodic marking value of the current period in the new library.
In a second aspect, the present application provides a database data synchronization update apparatus, which adopts the following technical scheme:
a database data synchronization updating apparatus comprising:
the acquisition module is used for acquiring a periodic execution plan of data synchronization;
the data processing module is used for determining data to be processed which needs to be synchronized to a new library in the execution period of the periodic execution plan;
and the judging and synchronizing module is used for judging whether the data to be processed has data change according to the original library and the new library and synchronizing the data with the data change to the new library.
In a third aspect, the present application provides an electronic device, which adopts the following technical scheme:
an electronic device comprising a processor and a memory, the processor coupled with the memory;
the processor is configured to execute a computer program stored in the memory to cause the electronic device to perform the method according to any one of the first aspects.
In a fourth aspect, the present application provides a computer readable storage medium, which adopts the following technical scheme:
a computer readable storage medium comprising a computer program or instructions which, when run on a computer, cause the computer to perform the method of any of the first aspects.
Drawings
FIG. 1 is a flow chart of a method for synchronously updating database data according to the present invention;
FIG. 2 is a flow chart of the present invention for determining the newly added change of data;
FIG. 3 is a flow chart of the present invention for determining the change of data content;
FIG. 4 is a flow chart of the present invention for determining a change in data deletion;
FIG. 5 is a block diagram showing a database data synchronous updating device according to the present invention;
fig. 6 is a block diagram of an electronic device according to the present invention.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for the purpose of illustrating the present application and are not to be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein includes all or any element and all combination of one or more of the associated listed items.
The database data synchronization updating method provided by the embodiment of the application can be applied to various actual application scenes of database data synchronization, such as distributed system data synchronization, real-time data analysis and report generation, real-time monitoring and notification and database remote disaster recovery.
The embodiment of the application provides a database data synchronous updating method, which can be executed by electronic equipment, wherein the electronic equipment can be a server or terminal equipment, the server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and a cloud server for providing cloud computing service. The terminal device may be, but is not limited to, a smart phone, a tablet computer, a desktop computer, etc.
The following describes the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
The embodiment of the present application provides a possible implementation manner, as shown in fig. 1, a flowchart of a method for synchronously updating database data is provided, and the scheme may be executed by any electronic device.
As shown in fig. 1, the main flow of a database data synchronization update method is described as follows (steps S101 to S103):
step S101: a periodic execution plan for data synchronization is acquired.
In the process of synchronizing data of the database, a scheduler can be constructed first, and the scheduler is used for managing and scheduling tasks such as data transmission and processing so as to ensure smooth progress of data synchronization. The scheduler will determine when and how to allocate system resources, such as processors, memory, and other resources, based on the task situation to achieve efficient computation and processing. The method can help a program to manage and control the execution time of the tasks, and can also set the priority and the execution sequence of the tasks.
The build scheduler specifically includes: firstly, acquiring the synchronous requirements of input database synchronization, such as which tables need to be synchronized, the synchronous time interval, the synchronous data volume and the like; selecting an appropriate scheduler framework, e.g., quartz, APScheduler or Celery, etc., based on synchronization requirements; according to the synchronous requirement, defining specific synchronous tasks, wherein the synchronous tasks comprise a periodic execution plan.
The periodic execution plan includes execution periods during which the scheduler performs scheduling and execution times for the data-synchronized tasks, the scheduler performing tasks according to the periodic execution plan. In general, the execution period and the execution time of the data synchronization task may be set according to actual requirements, for example, the execution period is daily, the execution time of the data synchronization task is 1 early morning of each day, that is, the synchronization task is executed from 1 early morning.
Step S102: and determining the data to be processed which needs to be synchronized to the new library in the execution period of the periodic execution plan.
The new database is the new database which needs to synchronize the original database data. The data to be processed is the data to be synchronized to the new library, and the data to be processed can be the data in the original library or the data not contained in the original library.
Step S103: judging whether the data to be processed has data change according to the original library and the new library, and synchronizing the data with the data change to the new library.
After judging whether the data to be processed has data change, the data of the new library is synchronously processed, and the synchronous direction is that the original library is synchronous to the new library in one way, so that the data changed in the original library can be synchronous to the new library, and a new access mode for the data of the original library can be provided.
In this embodiment, the data changes include changes such as data content changes, data deletion changes, and data addition changes of the data to be processed in the original library.
Alternatively, the data to be processed may be table data, where the table data includes at least one row of row data, and each row of data corresponds to a unique ID value.
As shown in fig. 2, in order to determine whether a new data change occurs in the data to be processed, in step S103, determining whether a data change occurs in the data to be processed according to the original library and the new library includes the following processes:
step S301: based on a periodic execution plan, acquiring a period labeling value of the current period;
in this embodiment, the period labeling value is a period time stamp labeling value corresponding to a period, and the period labeling value is used for marking a time stamp of the line data, so that the creation time and the final modification time of the line data can be tracked.
Step S302: acquiring all unique ID values corresponding to the data to be processed, and inquiring whether target ID values identical to all unique ID values exist in the new library according to all the unique ID values; if yes, go to step S303; if not, executing step S304;
the unique ID value is an identifier for uniquely identifying each line of data in the data to be processed of the original library. Whether the target ID value which is the same as the unique ID value exists in the data of the new library is inquired, and whether the data in the table data of the original library is newly added can be judged. Illustratively, the unique ID value is generated by UUID (universal unique identifier) or an auto-increment key, etc.
Step S303: judging that the data to be processed has no new data addition change;
step S304: and judging that the data to be processed generates new data addition change.
And monitoring the new change of the data in the data to be processed in the original library can be realized by inquiring whether the target ID value record which is the same as the unique ID value exists in the new library.
After determining that the data to be processed has not changed in data addition, the method further comprises the steps of: and marking the period marking value of the current period to the row data with the target ID value identical to the unique ID value in the new library. And updating the period labeling value of the row data corresponding to the target ID value which is the same as the unique ID value in the new library.
If it is determined that the data to be processed has changed, the step S103 of synchronizing the data with changed data to the new library includes the following steps: and inserting the data corresponding to each unique ID value into the new library, and labeling the cycle labeling value of the current cycle to the data corresponding to each unique ID value in the new library.
And inserting the row data corresponding to the unique ID value into the new library, and synchronizing with the new change of the data to be processed of the original library can be realized by inserting the row data into the new library.
In this embodiment, after step S304, in step S103, whether the data to be processed has a data content change is determined according to the original library and the new library, and the method further includes the following steps: and judging whether the data content of the data to be processed changes or not according to the original library and the new library.
As shown in fig. 3, the data corresponding to each unique ID value corresponds to a data signature, and the change of the data content is the change of the data content, so as to determine whether the data content of the data to be processed changes according to the original library and the new library, and determine whether the data content of the data to be processed changes, including the following processes:
step S311: for each unique ID value, comparing the line data corresponding to the target ID value with the line data corresponding to the unique ID value, and judging whether the line data signature is identical to the line data signature; if the data signature comparison is the same, step S312 is executed; if the data signature comparison is not the same, step S313 is executed;
the data content change monitoring of the data to be processed in the original library is judged through row data signature comparison. The line data signature typically involves comparing each field of the line data and generating a new signature when the line data content changes, so that the line data signature of the target ID value is compared with the line data signature of the unique ID value, and can be used to detect whether the line content of the original library line data has been altered.
Step S312: judging that each field in the row data corresponding to the unique ID value has no data content change;
step S313: and judging that the data content of the field in the row data corresponding to the unique ID value is changed.
And monitoring the change of the content of the data to be processed of the original library can be realized by performing row data signature comparison on the row data of the target ID value and the row data of the unique ID value.
After determining that no change in data content has occurred in each field in the row data of the unique ID value, the following processing is further included: and marking the cycle marking value of the current cycle to the row data corresponding to the target ID value in the new library. And updating the period labeling value of the data in the new library, wherein the period labeling value of the data does not change.
If it is determined that the data content of the row data field in the original library is changed, synchronizing the changed data to the new library includes the following steps: and updating the data of the data content change of the field of the original library into the new library, and marking the period marking value of the current period to the data of the data content change of the field in the new library.
The synchronization with the change of the data content to be processed of the original library can be realized by updating the data of the data content change of the field of the original library into the new library.
As shown in fig. 4, after step S103, the method further includes the following processing:
step S104: judging whether the data to be processed is completely traversed in the execution period; if yes, go to step S105; if not, the operation of step S103 is continued.
Step S105: deleting the data of the periodic marked value which is not marked with the current period in the new library; the data of the periodic marked value which is not marked with the current period comprises the data of the periodic marked value which is not marked with the data and the data of the periodic marked value which is different from the current period.
In this embodiment, whether the data to be processed in the original library has a data deletion change can be identified through the period labeling value of the line data recorded in the new library, and when a certain line of data in the data to be processed is deleted in the original library, the period value of the labeling of the line data in the new library is different from the current period, namely, the time stamp labeling value record of expiration is obtained.
And the synchronization with the deletion change of the data to be processed of the original library can be realized by executing the deletion action on the data which are not marked with the periodic marking value of the current period in the new library.
Based on the same technical concept, the present application further provides a database data synchronization update apparatus, as shown in fig. 5, where the database data synchronization update apparatus 200 mainly includes:
an acquisition module 201, configured to acquire a periodic execution plan of data synchronization;
a data to be processed determining module 202, configured to determine data to be processed that needs to be synchronized to a new library in an execution period of the periodic execution plan;
and the judging and synchronizing module 203 is configured to judge whether the data to be processed has a data change according to the original library and the new library, and synchronize the data with the data change to the new library.
Optionally, the processing data is table data, where the table data includes at least one row of data, and each row of data corresponds to a unique ID value. The discrimination synchronization module 203 includes:
the marking value obtaining sub-module is used for obtaining a period marking value of the current period based on the periodic execution plan;
the acquisition inquiry sub-module is used for acquiring unique ID values corresponding to all data of the data to be processed, and inquiring whether target ID values which are the same as the unique ID values exist in the new library or not according to all the unique ID values; if yes, judging that the data to be processed has no new data addition change; if not, judging that the data to be processed has new data addition change.
Optionally, after determining that no data new change occurs in the data to be processed, the database data synchronization updating apparatus 200 further includes:
and the first updating and labeling sub-module is used for labeling the period labeling value of the current period to the row data corresponding to the target ID value in the new library.
Optionally, if it is determined that the data to be processed has a new data addition change, the determining synchronization module 203 includes:
the data inserting sub-module is used for inserting the data corresponding to each unique ID value into the new library and labeling the period labeling value of the current period to the data corresponding to each unique ID value in the new library.
Optionally, after determining that no data new change occurs in the data to be processed, the determining synchronization module 203 further includes:
and the change judging sub-module is used for judging whether the data content of the data to be processed changes or not according to the original library and the new library.
Optionally, the data corresponding to each unique ID value corresponds to a data signature, and the change discrimination submodule includes:
the signature comparison sub-module is used for comparing the line data corresponding to the target ID value with the line data corresponding to the unique ID value for each unique ID value; if the data signature comparison is the same, judging that each field in the row data corresponding to the unique ID value has no data content change; if the data signature comparison is different, the data content change of the field in the row data corresponding to the unique ID value is judged.
After determining that each field in the row data of the unique ID value has not changed in data content, the database data synchronization updating apparatus 200 further includes:
and the second updating labeling sub-module is used for labeling the period labeling value of the current period to the row data corresponding to the target ID value in the new library.
Optionally, if it is determined that the data content of the line data field in the original library changes, the determining synchronization module 203 further includes:
and the updating sub-module is used for updating the data of the data content change of the field of the original library into the new library and labeling the period labeling value of the current period into the data of the data content change of the field in the new library.
Optionally, after the synchronization module 203 is determined, the database data synchronization updating apparatus 200 includes:
the judging module is used for judging whether the data to be processed is completely traversed in the execution period; if yes, transferring to a deleting module;
the deleting module is used for deleting the data of the periodic marked value which is not marked with the current period in the new library; the data of the periodic marked value which is not marked with the current period comprises the data of the periodic marked value which is not marked with the data and the data of the periodic marked value which is different from the current period.
In one example, a module in any of the above apparatuses may be one or more integrated circuits configured to implement the above methods, for example: one or more application specific integrated circuits (application specific integratedcircuit, ASIC), or one or more digital signal processors (digital signal processor, DSP), or one or more field programmable gate arrays (field programmable gate array, FPGA), or a combination of at least two of these integrated circuit forms.
For another example, when a module in an apparatus may be implemented in the form of a scheduler of processing elements, the processing elements may be general-purpose processors, such as a central processing unit (central processing unit, CPU) or other processor that may invoke a program. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Various objects such as various messages/information/devices/network elements/systems/devices/actions/operations/processes/concepts may be named in the present application, and it should be understood that these specific names do not constitute limitations on related objects, and that the named names may be changed according to the scenario, context, or usage habit, etc., and understanding of technical meaning of technical terms in the present application should be mainly determined from functions and technical effects that are embodied/performed in the technical solution.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system, apparatus and module may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
Those of ordinary skill in the art will appreciate that the various illustrative modules and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
Based on the same technical concept, the present application further provides an electronic device, as shown in fig. 6, where the electronic device 300 includes a processor 301 and a memory 302, and may further include an information input/information output I/O interface 303, one or more of communication components 304, and a communication bus 305.
The processor 301 is configured to control overall operations of the electronic device 300 to complete all or part of the steps in the database data synchronization update method described above; the memory 302 is used to store various types of data to support operation at the electronic device 300, which may include, for example, instructions for any application or method operating on the electronic device 300, as well as application-related data. The Memory 302 may be implemented by any type or combination of volatile or non-volatile Memory devices, such as one or more of static random access Memory (Static Random Access Memory, SRAM), electrically erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), erasable programmable Read-Only Memory (Erasable Programmable Read-Only Memory, EPROM), programmable Read-Only Memory (Programmable Read-Only Memory, PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk.
The I/O interface 303 provides an interface between the processor 301 and other interface modules, which may be a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 304 is used to test wired or wireless communication between the electronic device 300 and other devices. Wireless communication, such as Wi-Fi, bluetooth, near field communication (Near Field Communication, NFC for short), 2G, 3G, or 4G, or a combination of one or more thereof, and accordingly the communication component 304 can include: wi-Fi part, bluetooth part, NFC part.
Communication bus 305 may include a pathway to transfer information between the aforementioned components. The communication bus 305 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture ) bus, or the like. The communication bus 305 may be divided into an address bus, a data bus, a control bus, and the like.
The electronic device 300 may be implemented by one or more application specific integrated circuits (Application SpecificIntegrated Circuit, abbreviated as ASIC), digital signal processors (Digital Signal Processor, abbreviated as DSP), digital signal processing devices (Digital Signal Processing Device, abbreviated as DSPD), programmable logic devices (Programmable Logic Device, abbreviated as PLD), field programmable gate arrays (Field Programmable Gate Array, abbreviated as FPGA), controllers, microcontrollers, microprocessors, or other electronic components for performing the database data synchronization update method as set forth in the above embodiments.
The electronic device 300 may include, but is not limited to, a mobile terminal such as a digital broadcast receiver, a PDA (personal digital assistant), a PMP (portable multimedia player), etc., and a fixed terminal such as a digital TV, a desktop computer, etc., and may also be a server, etc.
Based on the same technical concept, the application also provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the steps of the database data synchronous updating method are realized when the computer program is executed by a processor.
The computer readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The foregoing description is only of the preferred embodiments of the present application and is presented as a description of the principles of the technology being utilized. It will be appreciated by persons skilled in the art that the scope of the application referred to in this application is not limited to the specific combinations of features described above, but it is intended to cover other embodiments in which any combination of features described above or their equivalents is possible without departing from the spirit of the application. Such as the above-mentioned features and the technical features having similar functions (but not limited to) applied for in this application are replaced with each other.

Claims (10)

1. A method for synchronously updating database data, comprising:
acquiring a periodic execution plan of data synchronization;
determining to-be-processed data to be synchronized to a new library in an execution period of the periodic execution plan;
judging whether the data to be processed has data change or not according to the original library and the new library, and synchronizing the data with the data change to the new library.
2. The method for synchronously updating database data according to claim 1, wherein the data to be processed is table data, the table data comprises at least one row of data, and each row of data corresponds to a unique ID value;
the judging whether the data to be processed has data change according to the original library and the new library comprises the following steps:
acquiring a period labeling value of the current period based on the periodic execution plan;
acquiring all unique ID values corresponding to the data to be processed, and inquiring whether target ID values identical to all the unique ID values exist in the new library according to all the unique ID values;
if yes, judging that the data to be processed has no data newly-added change, wherein the data change comprises the data newly-added change;
if not, judging that the data to be processed has new data addition change.
3. The method for synchronously updating data of a database according to claim 2, further comprising, after determining that no data addition change has occurred in the data to be processed: and marking the cycle marking value of the current cycle to row data corresponding to the target ID value in the new library.
4. The method for synchronously updating data of a database according to claim 2, wherein if it is determined that the data to be processed has changed newly, synchronizing the data having changed to the new database comprises:
and inserting the data corresponding to each unique ID value into the new library, and labeling the cycle labeling value of the current cycle to the data corresponding to each unique ID value in the new library.
5. The method for synchronously updating data of a database according to claim 2, wherein after determining that no data change occurs in the data to be processed, determining whether the data change occurs in the data to be processed according to the original library and the new library further comprises:
and judging whether the data content of the data to be processed changes or not according to the original library and the new library.
6. A method for synchronously updating database data according to claim 5,
and judging whether the data content of the data to be processed changes according to the original library and the new library, wherein the data corresponding to each unique ID value corresponds to one data signature, and the data signature comprises the following steps:
for each unique ID value, performing row data signature comparison on the row data corresponding to the target ID value and the row data corresponding to the unique ID value;
for each unique ID value, if the row data signature comparison is the same, judging that each field in the row data corresponding to the unique ID value has no data content change; the data changes further include the data content changes;
for each unique ID value, if the row data signature comparison is different, judging that the data content of the field in the row data corresponding to the unique ID value is changed;
after determining that each field in the row data in the original library has not changed in data content, further comprising: marking the cycle marking value of the current cycle to the row data corresponding to the target ID value in the new library;
if it is determined that the field in the row data in the original library has a data content change, synchronizing the data having the data change to the new library, and further including: and updating the data of the data content change of the field of the original library into the new library, and marking the period marking value of the current period to the data of the data content change of the field of the new library.
7. The method according to claim 6, wherein after said determining whether the data to be processed has changed based on the original library and the new library and synchronizing the data having changed to the new library, the method further comprises:
judging whether the data to be processed is completely traversed in the execution period;
if yes, deleting the data of the periodic marked value which is not marked with the current period in the new library; the data of the periodic marked value which is not marked with the current period comprises the data of the periodic marked value which is not marked with the data and the data of the periodic marked value which is different from the current period.
8. A database data synchronization updating apparatus, comprising:
the acquisition module is used for acquiring a periodic execution plan of data synchronization;
the data processing module is used for determining data to be processed which needs to be synchronized to a new library in the execution period of the periodic execution plan;
and the judging and synchronizing module is used for judging whether the data to be processed has data change according to the original library and the new library and synchronizing the data with the data change to the new library.
9. An electronic device comprising a processor and a memory, the processor coupled to the memory;
the processor is configured to execute a computer program stored in the memory to cause the electronic device to perform the method of any one of claims 1 to 7.
10. A computer readable storage medium comprising a computer program or instructions which, when run on a computer, cause the computer to perform the method of any of claims 1 to 7.
CN202311521518.5A 2023-11-15 2023-11-15 Database data synchronous updating method, device, equipment and storage medium Pending CN117609257A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311521518.5A CN117609257A (en) 2023-11-15 2023-11-15 Database data synchronous updating method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311521518.5A CN117609257A (en) 2023-11-15 2023-11-15 Database data synchronous updating method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117609257A true CN117609257A (en) 2024-02-27

Family

ID=89954192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311521518.5A Pending CN117609257A (en) 2023-11-15 2023-11-15 Database data synchronous updating method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117609257A (en)

Similar Documents

Publication Publication Date Title
US9639444B2 (en) Architecture for end-to-end testing of long-running, multi-stage asynchronous data processing services
US20090083210A1 (en) Exchange of syncronization data and metadata
CN112559475B (en) Data real-time capturing and transmitting method and system
CN111897808B (en) Data processing method and device, computer equipment and storage medium
CN108833584B (en) Message pushing method, terminal, server and computer storage medium
CN111984264B (en) Static library generation method and device
CN111338834B (en) Data storage method and device
CN113672692B (en) Data processing method, data processing device, computer equipment and storage medium
CN112199443B (en) Data synchronization method and device, computer equipment and storage medium
CN113190517A (en) Data integration method and device, electronic equipment and computer readable medium
CN110704099B (en) Alliance chain construction method and device and electronic equipment
CN110737458A (en) code updating method and related device
CN117609257A (en) Database data synchronous updating method, device, equipment and storage medium
CN115455006A (en) Data processing method, data processing device, electronic device, and storage medium
US11537455B2 (en) Schema management using an event stream
CN113971074A (en) Transaction processing method and device, electronic equipment and computer readable storage medium
CN109150993B (en) Method for obtaining network request tangent plane, terminal device and storage medium
CN111988429A (en) Algorithm scheduling method and system
CN112035256A (en) Resource allocation method, device, electronic equipment and medium
CN111506646A (en) Data synchronization method, device, system, storage medium and processor
CN112035471A (en) Transaction processing method and computer equipment
CN106469086B (en) Event processing method and device
CN115033647B (en) Data synchronization method and device, electronic equipment and storage medium
CN112311833B (en) Data updating method and device
CN112613845A (en) Task allocation processing method and device and workflow system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication