Database data processing methods, devices, electronic equipment and storage media
By acquiring changes and synchronization categories during database synchronization for real-time comparison and processing, the problem of low efficiency and complex manual intervention in database synchronization is solved. This enables real-time comparison of database information and automatic processing of abnormal data, thereby improving data consistency and processing efficiency.
Patent Information
- Application Number
- CN202211742085.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-12-30
AI Technical Summary
Existing technologies lack real-time data comparison capabilities during database synchronization, resulting in low efficiency, the need for manual intervention, and a complex and error-prone process.
When information changes occur in the source database, the change category and the synchronization category of the target database are obtained. It is then determined whether the change information and the synchronization information are consistent, and processing is performed according to the information status, including real-time data comparison and handling of abnormal data.
It enables real-time comparison of database synchronization information, ensuring data consistency, reducing manual intervention, and improving processing efficiency and accuracy.
Smart Images

Figure CN115982280B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of database processing technology, and in particular to a database data processing method, apparatus, electronic device and storage medium. Background Technology
[0002] In current production environments, database synchronization is increasingly widely used, and data comparison is an essential step in this process to ensure consistency. Regarding data comparison during database synchronization, current industry technologies largely focus on comparing data from tables that have synchronization records during a specific period after different databases have been synchronized for a period of time, choosing a window of time with or without system downtime. However, existing technologies may suffer from low efficiency, require manual intervention, and be complex and error-prone.
[0003] Therefore, how to achieve real-time comparison of synchronized information in the database has become an urgent problem to be solved. Summary of the Invention
[0004] In view of this, in order to solve the technical problem that real-time data comparison cannot be performed during the synchronization of information in the database, the present invention provides a database data processing method, apparatus, electronic device and storage medium.
[0005] In a first aspect, embodiments of the present invention provide a database data processing method, including:
[0006] When information changes occur in the source database, obtain the corresponding change category, and obtain the corresponding synchronization category in the target database;
[0007] Change information is determined based on the change category, and synchronization information is determined based on the synchronization category;
[0008] Determine whether the change information is consistent with the synchronization information to determine the information status of the target database;
[0009] Based on the information status, perform processing on the target database.
[0010] In one possible implementation, the method further includes:
[0011] The change category is determined based on the change address of the source database, and the synchronization category is determined based on the synchronization address of the target database;
[0012] When the changed address is a list, the list change category is determined; when the synchronization address is a list, the list synchronization category is determined.
[0013] When the changed address is data, determine the data change category; and when the synchronized address is data, determine the data synchronization category.
[0014] In one possible implementation, determining change information based on the change category and determining synchronization information based on the synchronization category includes:
[0015] The changed data is determined according to the data change category, and the synchronized data is determined according to the data synchronization category;
[0016] The change list is determined based on the change category of the list, and the synchronization list is determined based on the synchronization category of the list.
[0017] In one possible implementation, determining whether the change information is consistent with the synchronization information and determining the information status of the target database includes:
[0018] When the change information is changed data and the synchronization information is synchronized data, the expected change value corresponding to the source database is obtained based on the change data;
[0019] The actual synchronization value corresponding to the target database is obtained based on the synchronization data.
[0020] Determine whether the expected change value is consistent with the actual synchronization value to determine the information status of the target database.
[0021] In one possible implementation, determining whether the expected change value matches the actual synchronization value and thus determining the information status of the target database includes:
[0022] When the expected value of the change is consistent with the actual value of the synchronization, it is determined that the target database is in a normal data state;
[0023] When the expected value of the change is inconsistent with the actual value of the synchronization, the target database is determined to be in a data abnormal state.
[0024] In one possible implementation, the step of performing processing on the target database based on the information state of the target database includes:
[0025] When the target database is in a normal data state, a data change notification is sent to the source database.
[0026] When the target database is in an abnormal data state, the abnormal data of the synchronization data is processed.
[0027] In one possible implementation, processing the abnormal data of the synchronization data includes:
[0028] Obtain the abnormal data category of the synchronized data;
[0029] When the abnormal data category is missing data, the missing data is reported to the synchronization tool so that the synchronization tool can resynchronize the missing data corresponding to the target database.
[0030] When the abnormal data category is data error, the error data is reported to the synchronization tool so that the synchronization tool can perform synchronization change processing on the error data corresponding to the target database.
[0031] In one possible implementation, the synchronization data is obtained in the following way:
[0032] Obtain a synchronization feedback instruction sent by the synchronization tool, wherein the synchronization feedback instruction is generated by the synchronization tool after performing data synchronization processing on the target database through synchronization control instructions;
[0033] Obtain first identification information corresponding to the changed data sent by the synchronization tool, wherein the first identification information is the identification data of the changed data;
[0034] According to the synchronous feedback instruction, query the first identification information in the target database to obtain query data;
[0035] The queried data is used as synchronization data.
[0036] In one possible implementation, determining whether the change information is consistent with the synchronization information and determining the information status of the target database includes:
[0037] When the change information is a change list and the synchronization information is a synchronization list, determine whether the change list and the synchronization list are consistent.
[0038] When the change list is consistent with the synchronization list, a notification of normal list change is sent to the source database.
[0039] When the change list is inconsistent with the synchronization list, the abnormal change list information will be logged and reported for processing.
[0040] In a second aspect, embodiments of the present invention provide a database data processing apparatus, comprising:
[0041] The acquisition module is used to obtain the corresponding change category when information changes occur in the source database, and to obtain the corresponding synchronization category in the target database.
[0042] The determination module is used to determine change information based on change category and synchronization information based on synchronization category;
[0043] The judgment module is used to determine whether the change information is consistent with the synchronization information and to determine the information status of the target database;
[0044] The processing module is used to perform processing on the target database based on the information status.
[0045] Thirdly, embodiments of the present invention provide an electronic device, including: a processor and a memory, wherein the processor is configured to execute a data processing program for a database stored in the memory, to implement the data processing method for the database described in any of the first aspects.
[0046] Fourthly, embodiments of the present invention provide a storage medium storing one or more programs, which can be executed by one or more processors to implement the data processing method of the database described in any of the first aspects.
[0047] The database data processing scheme provided in this invention obtains the corresponding change category and the corresponding synchronization category in the target database when information changes occur in the source database; determines the change information based on the change category and the synchronization information based on the synchronization category; determines whether the change information and the synchronization information are consistent, and determines the information status of the target database; and performs processing on the target database based on the information status. By determining the change category after information changes occur in the source database, determining the change information based on the change category, comparing it with the synchronization information in the target database, and determining whether the change information and the synchronization information are consistent, if they are consistent, it is determined that the change information in the source database has achieved synchronized processing; if they are inconsistent, a reminder or modification is required. This scheme can achieve the technical effect of real-time comparison of database synchronization information. Attached Figure Description
[0048] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0049] Figure 1 A schematic flowchart of a database data processing method provided in an embodiment of the present invention;
[0050] Figure 2 A flowchart illustrating another database data processing method provided in an embodiment of the present invention;
[0051] Figure 3 A flowchart illustrating a change data processing method provided in an embodiment of the present invention;
[0052] Figure 4A flowchart illustrating another database data processing method provided in an embodiment of the present invention;
[0053] Figure 5 This is a schematic diagram of the structure of a database data processing device provided in an embodiment of the present invention;
[0054] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0056] In this invention, the terms "comprising" and "having" are used to indicate an open-ended inclusion, meaning that additional elements / components / etc. may exist besides those listed. The terms "first" and "second," etc., are used only as labels and are not intended to limit the number of objects. Furthermore, the different elements and areas in the drawings are only schematic, and therefore the invention is not limited to the dimensions or distances shown in the drawings.
[0057] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.
[0058] Figure 1 This is a flowchart illustrating a database data processing method provided in an embodiment of the present invention. The execution entity of the present invention is a comparison module. According to... Figure 1 The provided diagrams and database data processing methods specifically include:
[0059] S101. When information changes occur in the source database, obtain the corresponding change category and the corresponding synchronization category in the target database.
[0060] The execution entity of this invention is a comparison module, which compares the change information in the source database with the synchronization information in the target database after being processed by the synchronization tool to determine whether the two are consistent, thereby determining whether the change information in the source database has been successfully synchronized and ensuring data consistency.
[0061] The change category mentioned here can be understood as the classification of changed information according to a specified rule. The synchronization category mentioned here can be understood as the classification of synchronized information according to a specified rule.
[0062] Furthermore, when information changes occur in the source database, the change category is first analyzed based on the type of the changed information. Similarly, when changes occur in the source database, the target database undergoes corresponding information synchronization processing, and the synchronization category is obtained based on the type of synchronization information, in preparation for the next step of analysis and synchronization processing.
[0063] S102. Determine change information based on change category, and determine synchronization information based on synchronization category.
[0064] The "change information" mentioned here can be understood as the specific content of the change. The "synchronization information" mentioned here can be understood as the specific content of the synchronization.
[0065] Furthermore, after determining the change category, the specific content of the change is obtained; after determining the synchronization category, the specific content of the synchronization is obtained.
[0066] S103. Determine whether the change information and the synchronization information are consistent, and determine the information status of the target database.
[0067] The information status mentioned here can be understood as representing the result of the synchronous processing of synchronous information, which can be the result of successful or failed synchronization.
[0068] Furthermore, by comparing the change information and the synchronization information, it is determined whether the two are consistent, thus confirming whether the synchronization information has been successfully synchronized, and thereby determining the information status of the target database.
[0069] S104. Based on the information status, perform processing on the target database.
[0070] The processing mentioned here can be understood as a strategy that modifies or leaves the information in the target database unchanged.
[0071] Furthermore, the target database is processed differently depending on the information status. When the information status synchronization is successful, the target database is controlled to maintain its current data. When the information status synchronization fails, the target database is controlled to adjust the erroneous synchronization information to ensure that the information is synchronized with the source database.
[0072] The database data processing method provided in this invention obtains the corresponding change category and the corresponding synchronization category in the target database when information changes occur in the source database; determines the change information based on the change category and the synchronization information based on the synchronization category; determines whether the change information and the synchronization information are consistent, and determines the information status of the target database; and performs processing on the target database based on the information status. By determining the change category after information changes occur in the source database, determining the change information based on the change category, and comparing it with the synchronization information in the target database, the method determines whether the change information and the synchronization information are consistent. If they are consistent, it is determined that the change information in the source database has been synchronized; if they are inconsistent, a reminder or modification is required. This solution achieves the technical effect of real-time comparison of database synchronization information.
[0073] Figure 2 This is a flowchart illustrating another database data processing method provided in an embodiment of the present invention. Figure 2 This is based on the previous embodiment. (See reference) Figure 2 The provided diagrams and database data processing methods specifically include:
[0074] S201. Determine the change category based on the change address of the source database, and determine the synchronization category based on the synchronization address of the target database.
[0075] The execution entity of this invention is a comparison module, which compares the change information in the source database with the synchronization information in the target database after being processed by the synchronization tool to determine whether the two are consistent, thereby determining whether the change information in the source database has been successfully synchronized and ensuring data consistency.
[0076] The change category mentioned here can be understood as the classification of changed information according to a specified rule. The synchronization category mentioned here can be understood as the classification of synchronization information according to a specified rule. The change address mentioned here can be understood as the variable address or other information in the database where the information has changed. The synchronization address mentioned here can be understood as the synchronization information corresponding to the address information or specific coordinate information of the location of the information undergoing synchronization processing in the target database.
[0077] Furthermore, when information changes occur in the source database, the change category is first determined by analyzing the address information of the changed information. Similarly, when changes occur in the source database, the target database undergoes corresponding information synchronization processing, and the synchronization category is determined by analyzing the address information of the synchronization information, thus preparing for the next step of synchronization processing.
[0078] S202. When the address is changed to data, determine the data change category; when the synchronization address is data, determine the data synchronization category.
[0079] The data mentioned here can be understood as specific information such as parameter values and variable values in the source database.
[0080] Furthermore, when the information corresponding to the changed address is data, it is determined that the specific data in the source database has changed, and this is confirmed as a data change category; when the information corresponding to the synchronization address is data, it is determined that the specific data in the target database has changed, and this is confirmed as a data synchronization category.
[0081] S203. Determine the changed data based on the data change category, and determine the synchronized data based on the data synchronization category.
[0082] The changed data mentioned here is different from change information; it can be understood as all changed data in the source database where specific variable or parameter values have changed. The synchronized data mentioned here can be understood as data that changes during the synchronization process.
[0083] Furthermore, based on the change category and synchronization category, the specific data for the change and the specific data for synchronization processing are determined to prepare for the next step of processing the target database.
[0084] The synchronized data is obtained in the following ways:
[0085] Step 1: Obtain the synchronization feedback command sent by the synchronization tool. The synchronization feedback command is generated by the synchronization tool after performing data synchronization processing on the target database through synchronization control commands.
[0086] Step 2: Obtain the first identification information corresponding to the changed data sent by the synchronization tool. The first identification information is the identification data of the changed data.
[0087] The synchronous feedback command mentioned here can be understood as an operation command used to query the target database. The first identification information mentioned here can be understood as identification information used to distinguish each row of data in the target database.
[0088] Step 3: Query the first identifier information in the target database according to the synchronous feedback instruction to obtain the query data;
[0089] Step 4: Use the queried data as the synchronized data.
[0090] The query data mentioned here is the synchronization data. The query data is obtained by searching for the first identifier information in the target database, and the queried data is used as the synchronization data.
[0091] S204. Obtain the expected change value corresponding to the source database based on the changed data.
[0092] S205. Obtain the actual synchronization value corresponding to the target database based on the synchronization data.
[0093] The expected value of change mentioned here can be understood as the calculated value obtained through data calculation and analysis. The actual value of synchronization mentioned here can be understood as the actual value representing the synchronized data obtained through data calculation and analysis.
[0094] Furthermore, the expected value of the changed data is obtained by specifying logical operations and analysis, while the actual value of the synchronized data in the target database is obtained by analysis and operation, in preparation for the next step of comparison.
[0095] S206. Determine whether the expected value of the change is consistent with the actual value of the synchronization, and determine the information status of the target database.
[0096] S207. When the expected value of the change is consistent with the actual value of the synchronization, it is determined that the target database is in a normal data state.
[0097] S208. When the expected value of the change is inconsistent with the actual value of the synchronization, it is determined that the target database is in a data abnormal state.
[0098] The normal data state referred to here can be understood as a state where the changed data in the source database and the synchronized data in the target database are in sync. The abnormal data state referred to here can be understood as a state where an error occurs in the synchronization process between the changed data in the source database and the synchronized data in the target database.
[0099] Furthermore, the synchronization process is judged to be normal by comparing whether the expected change value and the actual synchronization value are the same. When the expected change value and the actual synchronization value are the same, it indicates that the target database synchronization process is successful and the target database is in a normal data state; when the expected change value and the actual synchronization value are inconsistent, it indicates that the target database synchronization has failed and the target database is in an abnormal data state.
[0100] S209. When the target database is in a normal data state, send a notification to the source database that the data change is normal.
[0101] S210. When the target database is in an abnormal data state, process the abnormal data of the synchronization data.
[0102] The "notification" mentioned here can be understood as feedback indicating success, such as code feedback or annotations. The "error data handling" mentioned here can be understood as the operation of modifying data that has synchronization errors.
[0103] Furthermore, the synchronization status of the synchronized data is obtained through comparison. When the data is in a normal state, it indicates that the synchronization process is successful, and feedback and reminders are sent to the target database. When the data is in an abnormal state, it indicates that the synchronization process has failed, and processing operations such as modifying the synchronized data are performed.
[0104] S211, Obtain the abnormal data category of the synchronization data.
[0105] Furthermore, when synchronizing data anomalies, the first step is to determine the type of anomaly, which may include, but is not limited to, data misalignment, missing data, or excessive data alteration.
[0106] S212. When the abnormal data category is missing data, the missing data is reported to the synchronization tool so that the synchronization tool can resynchronize the missing data corresponding to the target database.
[0107] S213. When the abnormal data category is data error, the error data is reported to the synchronization tool so that the synchronization tool can perform synchronization change processing on the corresponding error data in the target database.
[0108] The synchronization tool mentioned here is used to control the target database to perform data synchronization operations.
[0109] Furthermore, when anomalies occur in the synchronized data, the categories of the anomalies are analyzed. When data is missing, it indicates that the synchronized data is incomplete, and the target database is re-synchronized using a synchronization tool. When data is incorrect, it indicates that the synchronized data is incorrect, which may be due to incorrect variable values. The synchronization tool is used to synchronize and change the corresponding incorrect data in the target database, thereby achieving the technical effect of real-time comparison of database synchronization information.
[0110] In one possible scenario of power dynamics... Figure 3 This is a flowchart illustrating a change data processing method provided in an embodiment of the present invention. (Reference) Figure 3 The provided diagram illustrates the specific methods for processing changed data, including:
[0111] Step 1: Configure the comparison module to connect to the data collection end of the data synchronization tool, and collect a data record of source database change at the data collection end of the data synchronization tool;
[0112] Step 2: The changed data records in the source database are sent to the comparison module to obtain the expected values;
[0113] Step 3: After the playback of this record on the target database is completed on the playback end of the data synchronization tool, a message of successful playback will be sent to the comparison module.
[0114] Step 4: The comparison module initiates a query on the target database to obtain the actual value after synchronization processing;
[0115] Step 5: The comparison module compares the expected value of this record with the actual value to determine whether the data is consistent;
[0116] Step 6: If the data matches, the data is confirmed to be normal;
[0117] Step 7: If the data is inconsistent, identify the data anomaly, log it, and report it for processing.
[0118] This invention provides a database data processing method that obtains changed data by acquiring the type and address of the changed data, and simultaneously obtains synchronized data from the target database. The changed data is then processed and analyzed to obtain an expected value, and the synchronized data is processed and analyzed to obtain an actual value. The expected value and the actual value are compared to determine if they are consistent. If they are consistent, the data synchronization is considered successful. If they are inconsistent, the type of data anomaly is detected. If a data error is found, the target database is updated using a synchronization tool. If data is missing, the target database is resynchronized using the synchronization tool. This method achieves the technical effect of real-time comparison of database synchronization information.
[0119] Figure 4 This is a flowchart illustrating another database data processing method provided in an embodiment of the present invention. Figure 4 This is based on the first embodiment. (See reference) Figure 4 The provided diagrams and database data processing methods specifically include:
[0120] S401. Determine the change category based on the change address of the source database, and determine the synchronization category based on the synchronization address of the target database.
[0121] The execution entity of this invention is a comparison module, which compares the change information in the source database with the synchronization information in the target database after being processed by the synchronization tool to determine whether the two are consistent, thereby determining whether the change information in the source database has been successfully synchronized and ensuring data consistency.
[0122] The change category mentioned here can be understood as the classification of changed information according to a specified rule. The synchronization category mentioned here can be understood as the classification of synchronized information according to a specified rule. The change address mentioned here can be understood as the variable address or other information in the database where the information has changed. The synchronization address mentioned here can be understood as the address information or specific coordinate information of the location of the information undergoing synchronization processing in the target database.
[0123] Furthermore, when information changes occur in the source database, the change category is first determined by analyzing the address information of the changed information. Similarly, when changes occur in the source database, the target database undergoes corresponding information synchronization processing, and the synchronization category is determined by analyzing the address information of the synchronization information, thus preparing for the next step of synchronization processing.
[0124] S402. When the change address is a list, determine the list change category; when the synchronization address is a list, determine the list synchronization category.
[0125] The list mentioned here can be understood as a table containing specific information such as parameters and variables from the source database.
[0126] Furthermore, if the information corresponding to the changed address is a list, it is determined that the list information (DDR data table) in the source database has changed, and it is confirmed as a list change category; if the information corresponding to the synchronization address is a list, it is determined that the list information in the target database has changed, and it is determined as a list synchronization category.
[0127] S403. Determine the change list based on the list change category, and determine the synchronization list based on the list synchronization category.
[0128] The change list mentioned here is different from change information; it can be understood as a list of changes to the tables storing parameters in the source database. The synchronization list mentioned here can be understood as a list of changes that occurred during the synchronization process.
[0129] Furthermore, based on the change category and synchronization category, a list of changes and a list of synchronization processes are determined to prepare for the next step of processing the target database.
[0130] S404. Determine whether the change list and the synchronization list are consistent.
[0131] S405. When the change list is consistent with the synchronization list, send a notification to the source database that the list change is normal.
[0132] S406. When the change list is inconsistent with the synchronization list, the abnormal change list information shall be logged and reported for processing.
[0133] The reminder mentioned here can be understood as a message of successful feedback, such as code feedback or annotations.
[0134] Furthermore, the success of the synchronization process is determined by comparing the change list and the synchronization list. When the change list and the synchronization list are consistent, it indicates that the target database synchronization process is successful, and a notification of normal list changes is sent to the source database. When the change list and the synchronization list are inconsistent, it indicates that the target database synchronization has failed, and the abnormal change list information is logged and reported for further processing, achieving the technical effect of real-time comparison of database synchronization information.
[0135] Another database data processing method provided by this invention involves determining a change list and a synchronization list based on the change category and synchronization category when information changes occur in the source database. Then, the obtained change list information is compared with the synchronization list information to determine whether they are consistent. If they are consistent, the synchronization process is determined to be successful. If they are inconsistent, the synchronization process is determined to be unsuccessful. The abnormal change list information is then logged and reported for processing, thereby achieving the technical effect of real-time comparison of database synchronization information.
[0136] Figure 5 This is a schematic diagram of the structure of a database data processing device provided in an embodiment of the present invention. Figure 5 The provided diagram shows that the data processing device for the database specifically includes:
[0137] The acquisition module 51 is used to acquire the corresponding change category when information changes occur in the source database, and to acquire the corresponding synchronization category in the target database;
[0138] The determination module 52 is used to determine change information based on the change category and to determine synchronization information based on the synchronization category;
[0139] Module 53 is used to determine whether the change information and the synchronization information are consistent, and to determine the information status of the target database;
[0140] Processing module 54 is used to perform processing on the target database based on the information status.
[0141] The data processing device for the database provided in this embodiment can be as follows: Figure 5 The data processing device for the database shown can perform, for example... Figure 1-4 All steps of the data processing method in the database, thereby achieving Figure 1-4 For details on the technical effectiveness of the data processing method shown in the database, please refer to [link / reference]. Figure 1-4 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0142] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 6 The illustrated electronic device 600 includes at least one processor 601, a memory 602, at least one network interface 604, and other user interfaces 603. The various components in the electronic device 600 are coupled together via a bus system 605. It is understood that the bus system 605 is used to implement communication between these components. In addition to a data bus, the bus system 605 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 6 The general designated all buses as Bus System 605.
[0143] The user interface 603 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).
[0144] It is understood that the memory 602 in this embodiment of the invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 602 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0145] In some implementations, memory 602 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 6021 and application program 6022.
[0146] The operating system 6021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 6022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 6022.
[0147] In this embodiment of the invention, by calling the program or instructions stored in memory 602, specifically the program or instructions stored in application program 6022, processor 601 executes the method steps provided in each method embodiment, including, for example:
[0148] The processor executes a data processing program for a database stored in memory to implement the following steps of a database data processing method executed on the database data processing device side: when information changes occur in the source database, obtain the corresponding change category and the corresponding synchronization category in the target database; determine the change information based on the change category and the synchronization information based on the synchronization category; determine whether the change information and the synchronization information are consistent and determine the information status of the target database; and perform processing on the target database based on the information status.
[0149] The methods disclosed in the above embodiments of the present invention can be applied to processor 601, or implemented by processor 601. Processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 601 or by instructions in the form of software. The processor 601 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 602. Processor 601 reads the information in memory 602 and, in conjunction with its hardware, completes the steps of the above method.
[0150] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0151] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0152] The electronic device provided in this embodiment may be as follows: Figure 6 The electronic device shown can perform the following: Figure 1-4 All steps of the data processing method in the database, thereby achieving Figure 1-4 For details on the technical effectiveness of the data processing method shown in the database, please refer to [link / reference]. Figure 1-4 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0153] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; it may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; and it may also include combinations of the above types of memory.
[0154] When one or more programs in the storage medium can be executed by one or more processors to implement the database data processing method described above, which is executed on the database data processing device side.
[0155] The processor executes a data processing program for a database stored in memory to implement the following steps of a database data processing method executed on the database data processing device side: when information changes occur in the source database, obtain the corresponding change category and the corresponding synchronization category in the target database; determine the change information based on the change category and the synchronization information based on the synchronization category; determine whether the change information and the synchronization information are consistent and determine the information status of the target database; and perform processing on the target database based on the information status.
[0156] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0157] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0158] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A data processing method for a database, characterized in that, include: When information changes occur in the source database, obtain the corresponding change category, and obtain the corresponding synchronization category in the target database; Change information is determined based on the change category, and synchronization information is determined based on the synchronization category; Determine whether the change information is consistent with the synchronization information to determine the information status of the target database; Based on the information status, perform processing on the target database; The change category is determined based on the change address of the source database, and the synchronization category is determined based on the synchronization address of the target database; When the changed address is a list, the list change category is determined; when the synchronization address is a list, the list synchronization category is determined. When the changed address is data, determine the data change category; and when the synchronized address is data, determine the data synchronization category.
2. The method according to claim 1, characterized in that, The steps of determining change information based on the change category and determining synchronization information based on the synchronization category include: The changed data is determined according to the data change category, and the synchronized data is determined according to the data synchronization category; The change list is determined based on the change category of the list, and the synchronization list is determined based on the synchronization category of the list.
3. The method according to claim 2, characterized in that, The step of determining whether the change information is consistent with the synchronization information and determining the information status of the target database includes: When the change information is changed data and the synchronization information is synchronized data, the expected change value corresponding to the source database is obtained based on the change data; The actual synchronization value corresponding to the target database is obtained based on the synchronization data. Determine whether the expected change value is consistent with the actual synchronization value to determine the information status of the target database.
4. The method according to claim 3, characterized in that, The step of determining whether the expected change value is consistent with the actual synchronization value, and determining the information status of the target database, includes: When the expected value of the change is consistent with the actual value of the synchronization, it is determined that the target database is in a normal data state; When the expected value of the change is inconsistent with the actual value of the synchronization, the target database is determined to be in a data abnormal state.
5. The method according to claim 4, characterized in that, The step of processing the target database based on its information status includes: When the target database is in a normal data state, a data change notification is sent to the source database. When the target database is in an abnormal data state, the abnormal data of the synchronization data is processed.
6. The method according to claim 5, characterized in that, The processing of abnormal data in the synchronization data includes: Obtain the abnormal data category of the synchronized data; When the abnormal data category is missing data, the missing data is reported to the synchronization tool so that the synchronization tool can resynchronize the missing data corresponding to the target database. When the abnormal data category is data error, the error data is reported to the synchronization tool so that the synchronization tool can perform synchronization change processing on the error data corresponding to the target database.
7. The method according to claim 2, characterized in that, The synchronization data is obtained through the following methods: Obtain a synchronization feedback instruction sent by the synchronization tool, wherein the synchronization feedback instruction is generated by the synchronization tool after performing data synchronization processing on the target database through synchronization control instructions; Obtain first identification information corresponding to the changed data sent by the synchronization tool, wherein the first identification information is the identification data of the changed data; According to the synchronous feedback instruction, query the first identification information in the target database to obtain query data; The queried data is used as synchronization data.
8. The method according to claim 2, characterized in that, The step of determining whether the change information is consistent with the synchronization information and determining the information status of the target database includes: When the change information is a change list and the synchronization information is a synchronization list, determine whether the change list and the synchronization list are consistent. When the change list is consistent with the synchronization list, a notification of normal list change is sent to the source database. When the change list is inconsistent with the synchronization list, the abnormal change list information will be logged and reported for processing.
9. A data processing device for a database, characterized in that, include: The acquisition module is used to obtain the corresponding change category when information changes occur in the source database, and to obtain the corresponding synchronization category in the target database. The determination module is used to determine change information based on change category and synchronization information based on synchronization category; The judgment module is used to determine whether the change information is consistent with the synchronization information and to determine the information status of the target database; The processing module is used to perform processing on the target database based on the information status; The change category is determined based on the change address of the source database, and the synchronization category is determined based on the synchronization address of the target database; When the changed address is a list, the list change category is determined; when the synchronization address is a list, the list synchronization category is determined. When the changed address is data, determine the data change category; and when the synchronized address is data, determine the data synchronization category.
10. An electronic device, characterized in that, include: A processor and a memory, the processor being configured to execute a data processing program for a database stored in the memory, to implement the data processing method for the database as described in any one of claims 1 to 8.
11. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the data processing method of the database according to any one of claims 1 to 8.
Citation Information
Patent Citations
Database synchronization verification method and device, equipment, and storage medium
CN112307124A