Data processing method and device based on database operation

By configuring the operation change interface and change mapping relationship in the first database, downstream database operations are automatically executed, and resource waste caused by human communication is solved and data processing efficiency is improved.

CN114625745BActive Publication Date: 2025-08-19PINGAN INT SMART CITY TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210249822.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-14
Publication Date
2025-08-19
Estimated Expiration
2042-03-14

AI Technical Summary

Technical Problem

In the prior art, human communication is required to make downstream database changes after database operation, resulting in frequent human operations, waste of resources, and reduce data processing efficiency.

Method used

Configure the operation change interface of the first database, monitor data changes, and automatically perform downstream database operations through the change mapping relationship to reduce human operations.

Benefits of technology

Automatic database operations are realized, reducing the cumbersomeness of human operations, saving resources, and improving data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114625745B_ABST
    Figure CN114625745B_ABST
Patent Text Reader

Abstract

The present invention discloses a data processing method and device based on database operations, which relates to the field of data processing technology and is mainly intended to solve the problem of low efficiency of existing data processing based on database operations. The method comprises: configuring an operation change interface for performing database operations on a first database, and initiating a data monitoring operation for performing the database operations on the first database, wherein the operation change interface is used to retrieve data on which the database operations have occurred in the first database and associate it with a second database; when monitoring a change in first target data in the first database, retrieving a change mapping relationship between the first database and the second database, and determining the changed field content that matches the first target data based on the change mapping relationship; and performing the database operation on the second target data in the second database with the changed field content through the operation change interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a data processing method and device based on database operation. Background Art

[0002] With the rapid development of big data, data stored in different databases need to be linked to each other for business operations. For example, DDL operations in a MySQL database will cause changes in the data content and data attributes in the related Hive database. This will cause data changes to occur more frequently, resulting in an increasing workload for the database.

[0003] Currently, after performing DDI operations on data in an upstream database, manual communication is required with the users of the downstream database to make manual changes by submitting work orders to the downstream database. However, manually changing the data in the downstream database after manual communication greatly increases the frequency of manual operations, wastes a lot of resources, and thus reduces the efficiency of data processing based on database operations. Summary of the Invention

[0004] In view of this, the present invention provides a data processing method and device based on database operations, a storage medium, and a computer device, the main purpose of which is to solve the problem of low efficiency of existing data processing based on database operations.

[0005] According to one aspect of the present invention, a data processing method based on database operation is provided, comprising:

[0006] Configuring an operation change interface for performing database operations on the first database, and starting a data monitoring operation for performing the database operations on the first database, wherein the operation change interface is used to retrieve data of the database operations occurring in the first database and associate the data with the second database;

[0007] When monitoring a change in first target data in the first database, retrieving a change mapping relationship between the first database and the second database, and determining a change field content that matches the first target data based on the change mapping relationship;

[0008] The database operation is performed on the second target data in the second database with the changed field content through the operation change interface.

[0009] Furthermore, before retrieving the change mapping relationship between the first database and the second database and determining the changed field content matching the first target data based on the change mapping relationship, the method further includes:

[0010] Acquire business requirement information matching the first database and the second database, the business requirement information being business-related content for executing the database operation;

[0011] A change mapping relationship is established based on the business demand information for corresponding changed field contents when data in the first database and the second database are changed. The change mapping relationship includes field change range, field change conditions, and field change limitation information.

[0012] Furthermore, performing the database operation on the second target data in the second database with the changed field content through the operation change interface includes:

[0013] Parsing the database operation to determine the execution business information, associated database, and execution environment of the database operation;

[0014] extracting second target data corresponding to the changed field content based on the execution business information, the associated database, and the execution environment;

[0015] The database operation is performed on the second target data in the second database through the operation change interface.

[0016] Furthermore, before performing the database operation on the second target data in the second database through the operation change interface, the method further includes:

[0017] Acquire a preset data change condition of the second database, where the preset data change condition is used to represent a business condition for performing a database operation on the data in the second database;

[0018] If the second target data matches the preset data change condition, performing the database operation on the second target data through the operation change interface;

[0019] If the second target data does not match the preset data change condition, the database operation is adjusted based on the preset data change condition, and the adjusted database operation is performed on the second target data through the operation change interface.

[0020] Furthermore, the initiating a data monitoring operation of performing the database operation on the first database includes:

[0021] monitoring database operations in the first database to determine first target data;

[0022] The operation content of executing the database operation and the first target data are stored in a preset monitoring database, and the preset monitoring database is configured with a monitoring list matching different database operations, so that the first target data can be retrieved from the monitoring list after performing different database operations.

[0023] Furthermore, the method further comprises:

[0024] After determining that the operation change interface configuration of the first database is completed, the operation interface parameters of the second database are retrieved, and the operation interface parameters are configured in the operation change interface to obtain an operation change interface associated with the second database.

[0025] Furthermore, after performing the database operation on the second target data in the second database with the changed field content through the operation change interface, the method further includes:

[0026] After performing the database operation on the second target database, determining a data difference between the first target data and the second target data after performing the database operation;

[0027] If the data difference meets the preset business data difference threshold range, determining that the first target data and the second data have completed the change operation;

[0028] If the data difference does not meet the preset business data difference threshold range, an alarm message is output to perform a database operation of changing the second target data alone.

[0029] According to another aspect of the present invention, there is provided a data processing device based on database operations, comprising:

[0030] a configuration module, configured to configure an operation change interface for performing database operations on the first database, and to initiate a data monitoring operation for performing the database operations on the first database, wherein the operation change interface is configured to retrieve data of the database operations occurring in the first database and associate the data with the second database;

[0031] a retrieval module configured to retrieve a change mapping relationship between the first database and the second database when a change occurs to the first target data in the monitored first database, and determine, based on the change mapping relationship, a change field content that matches the first target data;

[0032] An execution module is used to execute the database operation on the second target data with the changed field content in the second database through the operation change interface.

[0033] Furthermore, the device further comprises:

[0034] An acquisition module, configured to acquire business requirement information matching the first database and the second database, wherein the business requirement information is business-related content for executing the database operation;

[0035] An establishment module is used to establish a change mapping relationship of the corresponding changed field content when the data in the first database and the second database changes based on the business demand information. The change mapping relationship includes field change range, field change conditions, and field change limitation information.

[0036] Furthermore, the execution module includes:

[0037] a determination unit, configured to analyze the database operation and determine execution business information, an associated database, and an execution environment of the database operation;

[0038] an extraction unit, configured to extract second target data corresponding to the changed field content based on the execution business information, the associated database, and the execution environment;

[0039] The first execution unit is configured to execute the database operation on the second target data in the second database through the operation change interface.

[0040] Furthermore, the execution module further includes:

[0041] an acquiring unit, configured to acquire a preset data change condition of the second database, wherein the preset data change condition is used to represent a business condition for performing a database operation on the data in the second database;

[0042] a second execution unit, configured to execute the database operation on the second target data through the operation change interface if the second target data matches the preset data change condition;

[0043] The third execution unit is configured to adjust the database operation based on the preset data change condition if the second target data does not match the preset data change condition, and execute the adjusted database operation on the second target data through the operation change interface.

[0044] Furthermore, the configuration module includes:

[0045] a determining unit, configured to monitor database operations in the first database and determine first target data;

[0046] A storage unit is used to store the operation content of executing the database operation and the first target data in a preset monitoring database. The preset monitoring database is configured with a monitoring list matching different database operations, so as to retrieve the first target data from the monitoring list after performing different database operations.

[0047] Further,

[0048] The calling module is further used to call the operation interface parameters of the second database after determining that the first database completes the operation change interface configuration, and configure the operation interface parameters in the operation change interface to obtain an operation change interface associated with the second database.

[0049] Furthermore, the device further comprises: an output module,

[0050] The determining module is configured to determine, after performing the database operation on the second target database, a data difference between the first target data and the second target data after performing the database operation;

[0051] The determining module is further configured to determine that the change operation between the first target data and the second data is completed if the data difference meets a preset business data difference threshold range;

[0052] The output module is configured to output an alarm message if the data difference does not meet a preset business data difference threshold range, so as to perform a database operation of changing the second target data alone.

[0053] According to another aspect of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, wherein the executable instruction enables a processor to execute an operation corresponding to the above-mentioned data processing method based on database operation.

[0054] According to another aspect of the present invention, there is provided a computer device comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0055] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned data processing method based on database operations.

[0056] By means of the above technical solution, the technical solution provided by the embodiment of the present invention has at least the following advantages:

[0057] The present invention provides a data processing method and device based on database operations. Compared with the prior art, an embodiment of the present invention configures an operation change interface for performing database operations on a first database, and starts a data monitoring operation for performing the database operations on the first database. The operation change interface is used to retrieve the data of the database operations occurring in the first database and associate it with a second database; when monitoring a change in first target data in the first database, the change mapping relationship between the first database and the second database is retrieved, and the change field content matching the first target data is determined based on the change mapping relationship; through the operation change interface, the database operation is performed on the second target data of the change field content in the second database, thereby automatically performing database operations on the downstream database through a pre-configured interface, reducing the tediousness of manual operations and saving a large amount of resources. At the same time, the change field content is automatically determined based on the change mapping relationship to determine the target data for performing database operations in the downstream database, thereby improving the data processing efficiency based on database operations.

[0058] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:

[0060] Figure 1 A flow chart of a data processing method based on database operation provided by an embodiment of the present invention is shown;

[0061] Figure 2 A flow chart of another data processing method based on database operations provided by an embodiment of the present invention is shown;

[0062] Figure 3 A flow chart of another data processing method based on database operation provided by an embodiment of the present invention is shown;

[0063] Figure 4 A flow chart of another data processing method based on database operation provided by an embodiment of the present invention is shown;

[0064] Figure 5A flow chart of a data processing method based on database operation provided by an embodiment of the present invention is shown;

[0065] Figure 6 A block diagram showing the composition of a data processing device based on database operations provided by an embodiment of the present invention is shown;

[0066] Figure 7 A schematic structural diagram of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0067] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0068] After performing DDI operations on data in an upstream database, manual communication with the user of the downstream database is required to manually change the data in the downstream database by submitting a work order. However, manually changing the data in the downstream database after manual communication greatly increases the frequency of manual operations, wastes a lot of resources, and thus reduces the efficiency of data processing based on database operations. The embodiment of the present invention provides a data processing method based on database operations, such as Figure 1 As shown, the method includes:

[0069] 101. Configure an operation change interface for performing database operations on a first database, and start a data monitoring operation for performing the database operations on the first database.

[0070] In an embodiment of the present invention, since different databases store data corresponding to different business operations, in order to perform the same database operation on a second database that has a business association with the first database while performing a database operation on the first database, an operation change interface for performing data operations on the first database is configured. The operation change interface is used to retrieve the data of the database operation occurring in the first database and associate it with the second database. Among them, the first database and the second database are both warehouse-type databases, which are used to store large or massive amounts of data in business operation processes. The business operation processes include but are not limited to insurance business, product updates, claims operations, etc. The data in the database are suitable for executing data in the data warehouse technology ETL (Extract-Transform-Load) process, through the process of extracting (extract), transforming (transform), and loading (load) the data in the database from the source end to the destination end. At this time, it includes the application scenario of performing database operations on the data in the first database and the second database respectively. Preferably, the first database is DLL, MySQL library, and the second data is hive database. Hive is a data warehouse tool based on Hadoop, used for data extraction, transformation, and loading. It is a mechanism that can store, query and analyze large-scale data stored in Hadoop. The hive data warehouse tool can map structured data files into a database table and provide SQL query functions. In an application scenario, when the first database is a DLL database, the database stores code content and data content corresponding to different business operations. The corresponding database operations are DLL operations. In this case, the DLL operation is the content of the operation on the data in this database. Therefore, a DLL operation change interface is configured for the first database, so that the changed data can be retrieved based on this operation change interface, and the corresponding data changes are executed in the associated second database.

[0071] It should be noted that in order to accurately automatically update data in the second database when data changes occur in the first database, a monitoring operation is simultaneously initiated for database operations performed on the first database, i.e., to determine whether any data in the database has been changed due to a database operation. Database operations that change data in the first database include, but are not limited to, adding, subtracting, or replacing data, as well as adding, subtracting, or replacing code parameters or logic.

[0072] 102. When monitoring a change in first target data in the first database, retrieve a change mapping relationship between the first database and the second database, and determine a change field content that matches the first target data based on the change mapping relationship.

[0073] In an embodiment of the present invention, during the process of monitoring the execution of database operations on data in a first database, when a change is detected in the first target data in the first database, that is, a database operation is executed on the first target data, at which time, the change mapping relationship between the first database and the second data is retrieved, thereby determining the change field content that matches the first target data based on the change mapping relationship. The change mapping relationship is pre-configured in the current execution end, and the change field content is the field content of the target data in the second database that requires simultaneous database operations. Therefore, based on the change mapping relationship, the change field content corresponding to the data to be operated on in the second database can be determined based on the first target data, thereby executing the corresponding database operation in the second database based on the second target data with the change field content.

[0074] It should be noted that if the first database is a MySQL database and the second database is a Hive database, the current execution terminal also stores mappings between the MySQL and Hive databases with different field types, thereby converting SQL statements in the MySQL database into executable SQL statements in the Hive database. In this case, the first database and the second database can be relational and non-relational databases, respectively, converting field types and SQL syntax. The data corresponding to the changed field content in the Hive data is then executed based on the converted SQL statements.

[0075] 103. Execute the database operation on the second target data with the changed field content in the second database through the operation change interface.

[0076] In an embodiment of the present invention, after determining the changed field content in the second database, this changed field content can be used as the object of the nsql statement executed in the second database, so that the database operation of the second target data is executed in the second database according to this changed field content. At this time, since the operation change interface is configured for the first database, in order to execute the database operation on the second target data corresponding to the changed field content in the second database according to the first target data that has changed in the first database, the operation change interface is associated with the second database when configured, so that when the second target data with the changed field content is executed in the second database, the database operation is executed based on the configured operation change interface. In addition, for the nsql statement that executes the changed field content, the databus data synchronization tool can be used to regularly run the spliced nsql statement, which is not specifically limited in the embodiment of the present invention.

[0077] In another embodiment of the present invention, in order to further define and illustrate, as Figure 2As shown, before the step of retrieving the change mapping relationship between the first database and the second database and determining the changed field content matching the first target data based on the change mapping relationship, the method further includes:

[0078] 201. Acquire business demand information matching the first database and the second database;

[0079] 202. Establish a change mapping relationship between the first database and the second database for corresponding changed field contents when data in the first database and the second database are changed based on the business demand information.

[0080] In an embodiment of the present invention, in order to ensure that database operations in the second database are consistent with the target data executed in the first database, a change mapping relationship is pre-generated based on the business requirement information between the first and second databases, indicating the corresponding changed field content of the data in the first and second databases when a change occurs. The business requirement information obtained for the first and second databases refers to the business-related content required to execute the database operations, including but not limited to insurance-related requirements, product update-related requirements, and claims-related requirements, thereby establishing a field mapping relationship between the first and second databases based on the business requirement information. Among them, the change mapping relationship includes field change range, field change conditions, and field change limitation information. The field change range is to limit the range of field changes executed by the target data in the first database relative to the data in the second database. For example, the target data is a, and the field change range is used to limit the upper limit of field changes in the second database to a+10, etc., which is not specifically limited in the embodiment of the present invention; the field change condition is to limit the system conditions, software conditions, and business conditions when the target data in the first data is changed relative to the data in the second database. The embodiment of the present invention does not make specific limitations; the field change limitation content is to limit whether the target data in the first database can perform operations on the corresponding data in the second database. For example, the first database is an insurance product database. When the insurance name and amount are changed, the insurance name in the user underwriting database can be changed, but the field change limitation content is that the amount remains unchanged, thereby ensuring that the insurance purchased by the user remains unchanged. The embodiment of the present invention does not make specific limitations.

[0081] It should be noted that, since the first database and the second database are associated databases, the data stored in the database is identified by fields in the list form stored in the database. For example, if a field used to describe a feature or attribute of a certain data is a name, then when performing database operations that meet business requirements, the field corresponding to the name data can be queried, retrieved, deleted, etc., and the embodiments of the present invention do not specifically limit this. Therefore, when the first target data in the first database changes, it should be uniquely matched to the corresponding field content in the second database, that is, the second target data in the second database is matched based on the changed field content corresponding to the changed first target data in the change mapping relationship, so as to perform database operations on the second target data. At this time, when establishing a change mapping relationship based on business demand information, that is, establishing a mapping relationship between the fields of the data in the first database corresponding to the fields in the second database when changes occur according to the insurance association requirements, product update association requirements, and claim association requirements for executing database operations, the fields in the second database are the changed field contents, which can be determined by pre-selection by the user, and then the data is found based on the changed field contents in the second database, so as to perform database operations. For example, the fields "amount", "2021" and the corresponding data in the first database, and the fields "number of payments", "2022" and the corresponding data in the second database, based on the insurance association requirements, establish a mapping relationship between the changed field content of "amount" and "2021" to "number of payments" and "2022", so that when performing database operations on the first target data corresponding to "amount" and "2021", the changed field content is determined to be "number of payments" and "2022" based on the mapping relationship, and the data of "number of payments" and "2022" are used as the second target data. The embodiments of the present invention do not make specific limitations.

[0082] In another embodiment of the present invention, in order to further define and illustrate, as Figure 3 As shown, the step of performing the database operation on the second target data of the changed field content in the second database through the operation change interface includes:

[0083] 301. Analyze the database operation to determine the execution business information, associated database, and execution environment of the database operation;

[0084] 302. Extracting second target data corresponding to the changed field content based on the execution business information, the associated database, and the execution environment;

[0085] 303. Execute the database operation on the second target data in the second database through the operation change interface.

[0086] In order to accurately implement database operations, when performing database operations on the second target data based on the operation change interface, the execution business information, associated database, and execution environment of the database operation are specifically parsed to extract the corresponding second target data based on the execution business information, associated database, and execution environment to perform the database operation. Among them, the execution business information is the business content corresponding to the execution of the database operation in the second database, such as insurance business, product update business, etc. The associated database is used to indicate whether the second database is a database with a specific relationship with the first database, and the execution environment is used to indicate the system environment for executing the database operation in the second database. At this time, based on the determined execution business information, associated database, and execution environment, the second target data corresponding to the changed field content is extracted. That is, if the execution business information, associated database, and execution environment all match the second database, it means that the database operation can be performed in the second database, and therefore, the corresponding second target data is extracted.

[0087] It should be noted that the database operations in the embodiments of the present invention include but are not limited to performing operations such as extracting, querying, deleting, and updating target data in the database to meet business processing requirements.

[0088] In another embodiment of the present invention, in order to further define and illustrate, as Figure 4 As shown, before performing the database operation on the second target data in the second database through the operation change interface, the method further includes:

[0089] 401. Obtain preset data change conditions of the second database;

[0090] 402. If the second target data matches the preset data change condition, perform the database operation on the second target data through the operation change interface;

[0091] 403. If the second target data does not match the preset data change condition, adjust the database operation based on the preset data change condition, and execute the adjusted database operation on the second target data through the operation change interface.

[0092] In order to ensure that the database operation performed on the second target data is effective, thereby improving the accuracy of data processing in the database, a preset data change condition is pre-configured in the second database to judge the second target data. The preset data change condition is used to characterize the business conditions for performing database operations on the data in the second database. For example, the preset data change condition for performing database operations on the data in the second database is an insurance claim business operation. If the second target data is the data for which the database operation is to be performed for the insurance claim business operation, it means that the second target data matches the preset data change condition, and the database operation can be performed on the second target data through the operation change interface. If the second target data is not the data for which the database operation is to be performed for the insurance claim business operation, it means that even if the second target data for changing the field content is determined based on the field mapping relationship, the database operation cannot be directly performed on the second target data through the operation change interface. At this time, if the second target data does not match the preset data change condition, the database operation can be adjusted based on the preset data change condition, thereby performing the adjusted database operation on the second target data. Among them, the database operation is adjusted based on the preset data change conditions, and the database operations include but are not limited to extraction, query, deletion, update, etc., that is, the extraction, query, deletion, and update operations are adjusted based on the business conditions of the database operations on the data in the second database. The specific content of the adjustment, such as adjusting the direct deletion to deletion after the preset cache time according to the business conditions, or adjusting the update of deleting the original data to the update of retaining the original data, etc., is pre-set by the user, and the embodiment of the present invention does not make specific limitations, so as to ensure that the database operation can be accurately executed in the second database.

[0093] In another embodiment of the present invention, for further limitation and explanation, the step of initiating a data monitoring operation for performing the database operation on the first database includes: monitoring the database operation in the first database to determine the first target data; storing the operation content of performing the database operation and the first target data in a preset monitoring database, so as to retrieve the first target data from the monitoring list after performing different database operations.

[0094] In order to timely and accurately link the data of executing database operations in the first database to the operations executed in the second database, the data of executing database operations in the first database is monitored. Specifically, the data of executing database operations in the first database is determined as the first target data. At this time, the specific operation content of the executed database operations and the first target data are stored in a preset monitoring database, so that after performing different database operations, the first target data is retrieved from the monitoring list in the preset monitoring database. The preset monitoring database is configured with a monitoring list that matches different database operations, that is, the execution of different database operations is stored in the matching monitoring list. The monitoring list records the database and target data executed by a database operation. Therefore, when the database operation is called, the entire first database and target data are directly obtained to be associated with the entire second database and the changed field content, greatly improving data processing efficiency.

[0095] In another embodiment of the present invention, in order to further limit and illustrate, it also includes: after determining that the first database completes the configuration of the operation change interface, retrieving the operation interface parameters of the second database, and configuring the operation interface parameters in the operation change interface to obtain an operation change interface associated with the second database.

[0096] In order to accurately associate database operations with the second target data in the second database, thereby improving the efficiency and accuracy of data processing, after determining that the configuration of the operation change interface of the first database is completed, the operation interface parameters of the second database are retrieved and this operation interface is configured in the operation change interface. The resulting operation change interface can be associated with the second database, thereby enabling database operations on the second database associated with the first database through an operation change interface. Among them, the operation change interface includes but is not limited to ODBC (Open Database Connectivity), Java Data Base (JDBC), PDO (PHP Data Object), etc., so that the operation change interface associated with the second database is configured for the first database in combination with the operation interface parameters of the second database. The embodiment of the present invention does not specifically limit this.

[0097] In another embodiment of the present invention, in order to further define and illustrate, as Figure 5 As shown, after performing the database operation on the second target data in the second database with the changed field content through the operation change interface, the method further includes:

[0098] 501. After performing the database operation on the second target database, determine a data difference between the first target data and the second target data after performing the database operation;

[0099] 502. If the data difference meets a preset business data difference threshold range, determining that the first target data and the second data have completed the change operation;

[0100] 503. If the data difference does not meet the preset business data difference threshold range, output an alarm message and perform a database operation to change the second target data alone.

[0101] In an embodiment of the present invention, to ensure a stable and accurate correspondence between database operations executed in the first database and those executed in the second database, after performing the database operation on the second target data, the data difference between the first target data and the second target data after the database operation is performed is determined. The data difference is the difference between the first target data and the second target data after the database operation is performed. Of course, if the database operation is a query or retrieval, the difference is 0. If the database operation is a delete or modification, a specific difference can be calculated. If the data difference meets a preset business data difference threshold, the change operation is completed. If it does not meet the threshold, an alarm is output, and the database operation is performed separately on the second target data to implement the change. The preset business data difference threshold ranges from 0 to a, where a is a user-defined natural number greater than 0. For example, in insurance claims processing, the preset business data difference threshold is 0-10, and in insurance product trading, the preset business data difference threshold is 0-100. This is not specifically limited in the embodiment of the present invention. This ensures that the changed second and first target data still meet business requirements.

[0102] An embodiment of the present invention provides a data processing method based on database operations. Compared with the prior art, the embodiment of the present invention configures an operation change interface for performing database operations on a first database, and starts a data monitoring operation for performing the database operations on the first database. The operation change interface is used to retrieve the data of the database operations occurring in the first database and associate it with a second database; when monitoring changes to first target data in the first database, the change mapping relationship between the first database and the second database is retrieved, and the change field content that matches the first target data is determined based on the change mapping relationship; through the operation change interface, the database operation is performed on the second target data of the change field content in the second database, thereby automatically performing database operations on the downstream database through a pre-configured interface, reducing the tediousness of manual operations and saving a large amount of resources. At the same time, the change field content is automatically determined based on the change mapping relationship to determine the target data for performing database operations in the downstream database, thereby improving the data processing efficiency based on database operations.

[0103] Furthermore, as a response to the above Figure 1 The embodiment of the present invention provides a data processing device based on database operation, such as Figure 6 As shown, the device includes:

[0104] Configuration module 61, configured to configure an operation change interface for performing database operations on the first database, and to initiate data monitoring operations for performing the database operations on the first database, wherein the operation change interface is used to retrieve data of the database operations occurring in the first database and associate the data with the second database;

[0105] a retrieval module 62 configured to retrieve a change mapping relationship between the first database and the second database when a change occurs to the first target data in the monitored first database, and determine, based on the change mapping relationship, a changed field content that matches the first target data;

[0106] The execution module 63 is configured to execute the database operation on the second target data in the second database with the changed field content through the operation change interface.

[0107] Furthermore, the device further comprises:

[0108] An acquisition module, configured to acquire business requirement information matching the first database and the second database, wherein the business requirement information is business-related content for executing the database operation;

[0109] An establishment module is used to establish a change mapping relationship of the corresponding changed field content when the data in the first database and the second database changes based on the business demand information. The change mapping relationship includes field change range, field change conditions, and field change limitation information.

[0110] Furthermore, the execution module includes:

[0111] a determination unit, configured to analyze the database operation and determine execution business information, an associated database, and an execution environment of the database operation;

[0112] an extraction unit, configured to extract second target data corresponding to the changed field content based on the execution business information, the associated database, and the execution environment;

[0113] The first execution unit is configured to execute the database operation on the second target data in the second database through the operation change interface.

[0114] Furthermore, the execution module further includes:

[0115] an acquiring unit, configured to acquire a preset data change condition of the second database, wherein the preset data change condition is used to represent a business condition for performing a database operation on the data in the second database;

[0116] a second execution unit, configured to execute the database operation on the second target data through the operation change interface if the second target data matches the preset data change condition;

[0117] The third execution unit is configured to adjust the database operation based on the preset data change condition if the second target data does not match the preset data change condition, and execute the adjusted database operation on the second target data through the operation change interface.

[0118] Furthermore, the configuration module includes:

[0119] a determining unit, configured to monitor database operations in the first database and determine first target data;

[0120] A storage unit is used to store the operation content of executing the database operation and the first target data in a preset monitoring database. The preset monitoring database is configured with a monitoring list matching different database operations, so as to retrieve the first target data from the monitoring list after performing different database operations.

[0121] Further,

[0122] The calling module is further used to call the operation interface parameters of the second database after determining that the first database completes the operation change interface configuration, and configure the operation interface parameters in the operation change interface to obtain an operation change interface associated with the second database.

[0123] Furthermore, the device further comprises: an output module,

[0124] The determining module is configured to determine, after performing the database operation on the second target database, a data difference between the first target data and the second target data after performing the database operation;

[0125] The determining module is further configured to determine that the change operation between the first target data and the second data is completed if the data difference meets a preset business data difference threshold range;

[0126] The output module is configured to output an alarm message if the data difference does not meet a preset business data difference threshold range, so as to perform a database operation of changing the second target data alone.

[0127] An embodiment of the present invention provides a data processing device based on database operations. Compared with the prior art, the embodiment of the present invention configures an operation change interface for performing database operations on a first database, and starts a data monitoring operation for performing the database operations on the first database. The operation change interface is used to retrieve the data of the database operations occurring in the first database and associate it with a second database; when monitoring a change in the first target data in the first database, the change mapping relationship between the first database and the second database is retrieved, and the change field content matching the first target data is determined based on the change mapping relationship; through the operation change interface, the database operation is performed on the second target data of the change field content in the second database, thereby automatically performing database operations on the downstream database through a pre-configured interface, reducing the tediousness of manual operations and saving a large amount of resources. At the same time, the change field content is automatically determined based on the change mapping relationship to determine the target data for performing database operations in the downstream database, thereby improving the data processing efficiency based on database operations.

[0128] According to one embodiment of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction. The computer-executable instruction can execute the data processing method based on database operation in any of the above method embodiments.

[0129] Figure 7 A schematic structural diagram of a computer device provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the computer device.

[0130] like Figure 7 As shown, the computer device may include: a processor (processor) 702 , a communication interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .

[0131] The processor 702 , the communication interface 704 , and the memory 706 communicate with each other via a communication bus 708 .

[0132] The communication interface 704 is used to communicate with other devices such as clients or other servers.

[0133] The processor 702 is configured to execute the program 710 , and specifically to execute the relevant steps in the above-mentioned embodiment of the data processing method based on database operation.

[0134] Specifically, the program 710 may include program codes, which include computer operation instructions.

[0135] Processor 702 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in a computer device may be of the same type, such as one or more CPUs, or may be of different types, such as one or more CPUs and one or more ASICs.

[0136] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0137] The program 710 may be specifically configured to cause the processor 702 to perform the following operations:

[0138] Configuring an operation change interface for performing database operations on the first database, and starting a data monitoring operation for performing the database operations on the first database, wherein the operation change interface is used to retrieve data of the database operations occurring in the first database and associate the data with the second database;

[0139] When monitoring a change in first target data in the first database, retrieving a change mapping relationship between the first database and the second database, and determining a change field content that matches the first target data based on the change mapping relationship;

[0140] The database operation is performed on the second target data in the second database with the changed field content through the operation change interface.

[0141] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, can be centralized on a single computing device, or can be distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, and thus, can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than herein, or can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0142] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A data processing method based on database operation, characterized in that: include: Configuring an operation change interface for performing database operations on the first database, and starting a data monitoring operation for performing the database operations on the first database, wherein the operation change interface is used to retrieve data of the database operations occurring in the first database and associate the data with the second database; When monitoring a change in first target data in the first database, retrieving a change mapping relationship between the first database and the second database, and determining a change field content that matches the first target data based on the change mapping relationship; Acquire a preset data change condition of the second database, where the preset data change condition is used to represent a business condition for performing a database operation on the data in the second database; If the second target data in the second database whose field content is changed matches the preset data change condition, performing the database operation on the second target data through the operation change interface; If the second target data does not match the preset data change condition, adjusting the database operation based on the preset data change condition, and performing the adjusted database operation on the second target data through the operation change interface, including: adjusting the database operation based on a business condition for performing the database operation on the data in the second database; The database operation is performed on the second target data in the second database whose field content is changed through the operation change interface, including: parsing the database operation, determining execution business information, an associated database, and an execution environment of the database operation; extracting the second target data corresponding to the changed field content based on the execution business information, the associated database, and the execution environment; and performing the database operation on the second target data in the second database through the operation change interface, where the execution business information is the business content corresponding to executing the database operation in the second database, the associated database is used to indicate whether the second database is a database associated with the first database, and the execution environment is used to indicate the system environment in which the database operation is executed in the second database.

2. The method according to claim 1, characterized in that Before retrieving the change mapping relationship between the first database and the second database and determining the changed field content matching the first target data based on the change mapping relationship, the method further includes: Acquire business requirement information matching the first database and the second database, the business requirement information being business-related content for executing the database operation; A change mapping relationship is established based on the business demand information for corresponding changed field contents when data in the first database and the second database are changed. The change mapping relationship includes field change range, field change conditions, and field change limitation information.

3. The method according to claim 1, characterized in that The initiating a data monitoring operation for executing the database operation on the first database includes: monitoring database operations in the first database to determine first target data; The operation content of executing the database operation and the first target data are stored in a preset monitoring database, and the preset monitoring database is configured with a monitoring list matching different database operations, so that the first target data can be retrieved from the monitoring list after performing different database operations.

4. The method according to claim 1, wherein The method further comprises: After determining that the operation change interface configuration of the first database is completed, the operation interface parameters of the second database are retrieved, and the operation interface parameters are configured in the operation change interface to obtain an operation change interface associated with the second database.

5. The method according to any one of claims 1 to 4, characterized in that After performing the database operation on the second target data in the second database with the changed field content through the operation change interface, the method further includes: After performing the database operation on the second target database, determining a data difference between the first target data and the second target data after performing the database operation; If the data difference meets the preset business data difference threshold range, determining that the first target data and the second target data have completed the change operation; If the data difference does not meet the preset business data difference threshold range, an alarm message is output to perform a database operation of changing the second target data alone.

6. A data processing device based on database operation, characterized in that: include: a configuration module, configured to configure an operation change interface for performing database operations on the first database, and to initiate a data monitoring operation for performing the database operations on the first database, wherein the operation change interface is configured to retrieve data of the database operations occurring in the first database and associate the data with the second database; a retrieval module configured to retrieve a change mapping relationship between the first database and the second database when a change occurs to the first target data in the monitored first database, and determine, based on the change mapping relationship, a change field content that matches the first target data; The execution module includes an acquisition unit, a second execution unit, and a third execution unit. The acquisition unit is used to acquire a preset data change condition of the second database, and the preset data change condition is used to represent a business condition for performing a database operation on the data in the second database; the second execution unit is configured to execute the database operation on the second target data through the operation change interface if the second target data in the second database whose field content is changed matches the preset data change condition; The third execution unit is configured to adjust the database operation based on the preset data change condition if the second target data does not match the preset data change condition, and execute the adjusted database operation on the second target data through the operation change interface, including: adjusting the database operation based on a business condition for performing the database operation on the data in the second database; The execution module is used to perform the database operation on the second target data of the changed field content in the second database through the operation change interface. The execution module includes a determination unit, an extraction unit, and a first execution unit. The determination unit is used to parse the database operation and determine the execution business information, associated database, and execution environment of the database operation. The extraction unit is used to extract the second target data corresponding to the changed field content based on the execution business information, the associated database, and the execution environment. The first execution unit is used to perform the database operation on the second target data in the second database through the operation change interface. The execution business information is the business content corresponding to the execution of the database operation in the second database. The associated database is used to indicate whether the second database is a database associated with the first database. The execution environment is used to indicate the system environment for executing the database operation in the second database.

7. A storage medium storing at least one executable instruction, wherein the executable instruction enables a processor to execute an operation corresponding to the data processing method based on database operation according to any one of claims 1 to 5.

8. A computer device comprising: A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the data processing method based on database operation according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data synchronization method and device

    CN113157811A