Data backfill method and device of structured query statement, equipment and storage medium

By using interceptors to split structured query statements and build a backup database, the problem of low efficiency in abnormal data backup in the financial industry was solved, and efficient data backup was achieved.

CN116881284BActive Publication Date: 2025-11-28CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310866125.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-13
Publication Date
2025-11-28
Estimated Expiration
2043-07-13

AI Technical Summary

Technical Problem

In the financial industry, due to the differences between financial production data and test data, there are problems such as insufficient field length or empty fields when adding, deleting and modifying data through structured query statements. This leads to low efficiency in replenishing abnormal financial data, and existing technologies are difficult to efficiently perform batch screening and replenishment.

Method used

The system intercepts failed structured query statements, splits the information, generates split information, constructs a scheduled data recovery task to obtain the data recovery information table from the data recovery configuration center, matches the primary key and data recovery information to generate data recovery objects, stores them in the key-value pair data storage store, and constructs the data recovery database to perform data recovery.

Benefits of technology

It improved the efficiency of data recovery for abnormal financial data, and achieved efficient data recovery for the financial and healthcare industries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116881284B_ABST
    Figure CN116881284B_ABST
Patent Text Reader

Abstract

The present application relates to data processing technology, disclose a kind of data backfilling method, device, electronic equipment and storage medium of abnormal structured query statement, can be used for the data backfilling of abnormal financial data.The method comprises: intercepting the structured query statement of execution failure by interceptor, structured query statement is split, and the information to be backfilled is obtained;By backfilling configuration center from backfilling information table is obtained by timing backfilling task;The primary key and backfilling information of backfilling information table are queried, and backfilling information and the information to be backfilled are matched, and backfilling object is generated in combination with primary key, backfilling information and the information to be backfilled;Backfilling object is stored into the key-value pair data storage library of preestablished, constructs backfilling database, and extracts abnormal structured query statement in system, based on backfilling database, data backfilling is carried out to abnormal structured query statement, and backfilling structured query statement is obtained.The present application can improve the data backfilling efficiency of abnormal financial data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to an abnormal structured query statement data backfill method and device, electronic equipment and computer readable storage medium. BACKGROUND

[0002] At present, the financial industry generally uses SQL (Structured Query Language) to store and manage data in the database, and to perform various tasks between the production end and the test end, including creating and modifying tables, and inserting, updating and deleting data. However, in actual application, due to the difference between financial production data and financial test data, there are problems such as insufficient field length and empty fields in the process of adding, deleting and modifying through structured query statements. At this time, batch checking of financial data according to time through logs or can only solve the problem of single data change, and it is impossible to batch check financial data according to time when complex multiple change operations are involved, resulting in low efficiency of abnormal financial data backfill. SUMMARY

[0003] The present application provides an abnormal structured query statement data backfill method, device and computer readable storage medium, which mainly aims to solve the problem of low efficiency of abnormal financial data backfill.

[0004] To achieve the above purpose, the present application provides an abnormal structured query statement data backfill method, which comprises:

[0005] The interceptor intercepts the structured query statement that fails to execute, and splits the structured query statement to obtain split information;

[0006] The split information is used as backfill information to be backfilled, and the data backfill requirement of the structured query statement is received;

[0007] A timing backfill task is constructed based on the data backfill requirement, and the backfill information table is obtained from the backfill configuration center through the timing backfill task;

[0008] The primary key and backfill information of the backfill information table are queried, the backfill information and the backfill information to be backfilled are matched, and the backfill object is generated in combination with the primary key, backfill information and backfill information to be backfilled;

[0009] The backfill object is stored in a preset key-value pair data storage, a backfill database is constructed, abnormal structured query statements in the system are extracted, and the abnormal structured query statements are backfilled based on the backfill database to obtain backfilled structured query statements.

[0010] Optionally, the splitting the structured query statement to obtain splitting information comprises:

[0011] Obtaining a string in the structured query statement;

[0012] Converting the string into a token stream, and parsing data in the token stream to generate a parse tree;

[0013] Traversing the parse tree, and analyzing each node in the parse tree to obtain splitting information of the parse tree.

[0014] Optionally, before the intercepting the structured query statement with execution failure by the interceptor, the method further comprises:

[0015] Querying a database management system of the structured query statement, and extracting a status code returned by the database management system;

[0016] Determining whether the status code is a 0 value;

[0017] If the status code is a 0 value, the structured query statement is executed successfully;

[0018] If the status code is not a 0 value, the structured query statement is executed unsuccessfully.

[0019] Optionally, the constructing a timing backfill task based on the data backfill requirement, and obtaining a backfill information table from a backfill configuration center through the timing backfill task comprises:

[0020] Constructing a timing backfill task by using a time requirement in the data backfill requirement, and querying a trigger time and an execution interval of the timing backfill task;

[0021] Generating a plurality of information extraction tasks according to the trigger time and the execution interval, and extracting a plurality of backfill information from the backfill configuration center based on the plurality of information extraction tasks;

[0022] Storing the plurality of backfill information into a preset data table, and creating a primary key to generate the backfill information table.

[0023] Optionally, the performing data backfill on the abnormal structured query statement based on the backfill database to obtain a backfilled structured query statement comprises:

[0024] Calculating a similarity between the abnormal structured query statement and each to-be-backfilled information in the backfill database, and obtaining a primary key of the to-be-backfilled information when the similarity is greater than or equal to a preset similarity threshold;

[0025] According to the primary key, the backfill information corresponding to the to-be-backfilled information is queried, and the backfill information is used for data backfilling on the abnormal structured query statement, so that a backfilled structured query statement is obtained.

[0026] Optionally, before the splitting of the structured query statement to obtain the split information, the method further comprises:

[0027] The structured query statement is backed up.

[0028] Optionally, after the querying of the primary key and the backfill information of the backfill information table, the method further comprises:

[0029] All primary keys in the backfill information table are traversed to obtain a plurality of primary key information.

[0030] According to the plurality of primary key information, corresponding backfill information in the backfill information table is obtained, so that the primary key and the backfill information of the backfill information table are obtained.

[0031] In order to solve the above problems, the application further provides a data backfilling device for an abnormal structured query statement, the device comprising:

[0032] A statement splitting module is configured to intercept an executed structured query statement with a failure through an interceptor, split the structured query statement to obtain split information, and the like.

[0033] An information table obtaining module is configured to take the split information as to-be-backfilled information, receive a data backfilling requirement of the structured query statement, construct a timing backfill task based on the data backfilling requirement, and obtain a backfill information table from a backfill configuration center through the timing backfill task.

[0034] An object generating module is configured to query a primary key and backfill information of the backfill information table, match the backfill information and the to-be-backfilled information, and generate a backfill object in combination with the primary key, the backfill information and the to-be-backfilled information.

[0035] A data backfilling module is configured to store the backfill object into a preset key-value pair data storage, construct a backfill database, extract an abnormal structured query statement in a system, perform data backfilling on the abnormal structured query statement based on the backfill database, and obtain a backfilled structured query statement.

[0036] In order to solve the above problems, the application further provides an electronic device, the electronic device comprising:

[0037] At least one processor; and,

[0038] A memory in communication connection with the at least one processor; wherein,

[0039] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the data backfill method of the abnormal structured query statement.

[0040] To solve the above problems, the application further provides a computer readable storage medium, wherein the computer readable storage medium stores at least one computer program, and the at least one computer program is executed by a processor in an electronic device to implement the data backfill method of the abnormal structured query statement.

[0041] The embodiment of the application realizes the splitting of information by intercepting the structured query statement with the interceptor, splitting the structured query statement, obtaining the to-be-backfilled information, obtaining the backfill information table from the backfill configuration center through the timing backfill task, querying the primary key and the backfill information of the backfill information table, matching the backfill information and the to-be-backfilled information, and generating the backfill object in combination with the primary key, the backfill information and the to-be-backfilled information, so as to achieve the purpose of generating the object for backfilling the abnormal statement. Finally, the backfill object is stored into the preset key-value pair data storage, a backfill database is constructed, the abnormal structured query statement in the system is extracted, and the data backfill is performed on the abnormal structured query statement based on the backfill database, so as to complete the backfill of the data in the financial and medical industries. Therefore, the data backfill method, device, electronic device and computer readable storage medium of the abnormal structured query statement provided by the application can improve the data backfill efficiency of abnormal financial data. BRIEF DESCRIPTION OF DRAWINGS

[0042] Figure 1 The flowchart of the data backfill method of the abnormal structured query statement provided by an embodiment of the application is shown in the figure.

[0043] Figure 2 The detailed implementation flowchart of one step in the data backfill method of the abnormal structured query statement is shown in the figure. Figure 1 The detailed implementation flowchart of one step in the data backfill method of the abnormal structured query statement is shown in the figure.

[0044] Figure 3 The detailed implementation flowchart of one step in the data backfill method of the abnormal structured query statement is shown in the figure. Figure 1 The detailed implementation flowchart of one step in the data backfill method of the abnormal structured query statement is shown in the figure.

[0045] Figure 4 The functional module diagram of the data backfill device of the abnormal structured query statement provided by an embodiment of the application is shown in the figure.

[0046] Figure 5 The structural diagram of the electronic device for implementing the data backfill method of the abnormal structured query statement provided by an embodiment of the application is shown in the figure.

[0047] The objectives, functional characteristics and advantages of the present application will be further illustrated with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

[0049] Embodiments of the present application provide a data backfill method for an abnormal structured query statement. The execution subject of the data backfill method for the abnormal structured query statement includes, but is not limited to, at least one of an electronic device capable of being configured to execute the method provided by the embodiments of the present application, such as a server and a terminal. In other words, the data backfill method for the abnormal structured query statement can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster, etc. The server can be a stand-alone server, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms, etc. basic cloud computing services.

[0050] Reference Figure 1 As shown in the figure, the flowchart of the data backfill method for the abnormal structured query statement provided by an embodiment of the present application.

[0051] In the present embodiment, the data backfill method for the abnormal structured query statement includes:

[0052] S1, intercepting the failed structured query statement through an interceptor, and splitting the structured query statement to obtain splitting information.

[0053] In the embodiments of the present application, the structured query language (SQL) is a statement based on database query and program design language, which is used to access financial data and query, update and manage financial database systems. In addition, the structured query language can also be used for financial data analysis and financial report generation, helping financial analysts to quickly and efficiently extract the required financial data from the financial database system, and to perform multi-dimensional data analysis and statistical calculation operations, etc.

[0054] In the embodiment of the present application, the interceptor is a mybatis interceptor, which is an interceptor for intercepting and customizing structured query statements in a MyBatis framework. The interface of the interceptor provides many extension points in the MyBatis framework, and the structured query statements can be intercepted and modified at various links of execution, such as before execution, after execution, before parameter processing, and after parameter processing.

[0055] Referring to Figure 2 Further, the splitting of the structured query statement to obtain splitting information includes:

[0056] S101, obtaining a string in the structured query statement;

[0057] S102, converting the string into a token stream, and parsing data in the token stream to generate a parse tree;

[0058] S103, traversing the parse tree, and analyzing and querying each node in the parse tree to obtain splitting information of the parse tree.

[0059] In detail, the token stream is a data stream for splitting a structured query statement into continuous sub-strings, and the parse tree is a relationship tree generated based on the strings in the token stream and the mutual relationship between the strings.

[0060] In the embodiment of the present application, the splitting information includes a structured query operation, a structured query instruction, an information target table, a primary key ID of the target table, and an assembled target object.

[0061] Further, before intercepting the structured query statement that fails to execute by the interceptor, the method further includes:

[0062] querying a database management system of the structured query statement, and extracting a status code returned by the database management system;

[0063] determining whether the status code is a 0 value;

[0064] If the status code is a 0 value, the structured query statement is successfully executed;

[0065] If the status code is not a 0 value, the structured query statement fails to execute.

[0066] In the embodiment of the present application, the state code is an identification code returned by a database management system when executing a structured query statement, used to indicate the execution state (successful execution and failed execution) of the structured query statement and the state result (result obtained by executing the result query statement).

[0067] In another embodiment of the present application, before the structured query statement is split to obtain the split information, the method further comprises backing up the structured query statement.

[0068] S2, the split information is taken as the to-be-repaired information, and the data repair requirement of the structured query statement is received.

[0069] In the embodiment of the present application, the split information is taken as the to-be-repaired information, and then by comparing the abnormal structured query statement with the to-be-repaired information, it can be determined whether the data repair of the abnormal structured query statement is needed and how to repair the abnormal structured query statement.

[0070] In the embodiment of the present application, the data repair requirement is used to obtain the specific data repair method of the to-be-repaired information.

[0071] S3, a timing repair task is constructed based on the data repair requirement, and the repair information table is obtained from the repair configuration center through the timing repair task.

[0072] In the embodiment of the present application, the repair information in the repair information table determines the repair method and repair type of the structured query statement, for example, the repair information of the table A with insufficient length and missing data error needs to be repaired, which can be used for data repair of financial statements such as balance sheet and cash flow statement.

[0073] In detail, the timing repair task is a task generated based on the data repair requirement of the structured query statement, which automatically obtains the repair information table from the repair configuration center by setting the planned time. The repair configuration center refers to a system or platform for storing and managing the repair information table, and in general cases, the repair configuration center will provide some key-value pairs for marking the repair information table and the corresponding error information.

[0074] Referring to Figure 3 Further, the obtaining the backfill information table from the backfill configuration center by the timing backfill task comprises:

[0075] S301, constructing a timing backfill task by using the time requirement in the data backfill requirement, and querying a trigger time and an execution interval of the timing backfill task;

[0076] S302, generating a plurality of information extraction tasks according to the trigger time and the execution interval, and extracting a plurality of backfill information from the backfill configuration center based on the plurality of information extraction tasks;

[0077] S303, storing the plurality of backfill information into a preset data table, and creating a primary key to generate the backfill information table.

[0078] In the embodiment of the application, the trigger time and the execution interval are used to determine a plurality of information extraction tasks in the time dimension.

[0079] S4, querying the primary key and the backfill information of the backfill information table, matching the backfill information and the to-be-backfilled information, and generating a backfill object in combination with the primary key, the backfill information and the to-be-backfilled information.

[0080] In the embodiment of the application, the backfill information exists in the form of a table, so the primary key and the backfill information of the backfill information table can be queried. The primary key is a property or a combination of properties that uniquely identifies a record in the backfill information table, and is used to ensure the consistency and integrity of the information in the table.

[0081] Further, the backfill information is information for data backfill of the backfill object, for example, an error of insufficient length of a certain data in the backfill object needs to be backfilled, and the backfill information can determine the length of the data that needs to be backfilled to what length.

[0082] In the embodiment of the application, the querying the primary key and the backfill information of the backfill information table comprises:

[0083] traversing all the primary keys in the backfill information table to obtain a plurality of primary key information;

[0084] obtaining corresponding backfill information in the backfill information table according to the plurality of primary key information to obtain the primary key and the backfill information of the backfill information table.

[0085] In the embodiment of the application, the primary key corresponds to unique backfill information, which can be determined by the primary key information.

[0086] In the embodiment of the present application, the matching of the patch information and the to-be-patched information can be obtained by similarity calculation of the error information corresponding to each patch information in the patch information table and the to-be-patched information.

[0087] Further, after the patch object is generated by combining the primary key, the patch information and the to-be-patched information, the method further comprises:

[0088] The patch information without corresponding to-be-patched information is deleted from the patch configuration center.

[0089] In the embodiment of the present application, the record form of the information in the record in the patch information table is: patch data prefix-table name [re-assembled patch object].

[0090] S5, the patch object is stored into a preset key-value pair data storage, a patch database is constructed, an abnormal structured query statement in a system is extracted, data patching is performed on the abnormal structured query statement based on the patch database, and a patched structured query statement is obtained.

[0091] In the embodiment of the present application, the key-value pair data storage (redis) stores the patch object by a key-value storage system based on the key-value pair data storage.

[0092] In the embodiment of the present application, the data patching on the abnormal structured query statement based on the patch database to obtain the patched structured query statement comprises:

[0093] The similarity between the abnormal structured query statement and each to-be-patched information in the patch database is calculated, and the primary key of the to-be-patched information is obtained when the similarity is greater than or equal to a preset similarity threshold value.

[0094] The patch information corresponding to the to-be-patched information is queried according to the primary key, and the abnormal structured query statement is patched with the patch information to obtain a patched structured query statement.

[0095] In the embodiment of the present application, the preset similarity threshold value is used to judge the similarity between the abnormal structured query statement and the to-be-patched information.

[0096] In another embodiment of the present application, if the similarity is less than the preset similarity threshold value, it indicates that the abnormal structured query statement does not have corresponding patch data in the patch database.

[0097] In the embodiment of the present application, the similarity between the abnormal structured query statement and each piece of information to be supplemented in the supplement database can be calculated by vectorizing the abnormal structured query statement and each piece of information to be supplemented in the supplement database, and then calculating the similarity between the two through a cosine similarity calculation formula.

[0098] The embodiment of the present application intercepts the structured query statement that fails to execute through an interceptor, splits the structured query statement to obtain information to be supplemented, realizes the splitting of information, and then obtains a supplement information table from a supplement configuration center through a timing supplement task, queries the primary key and supplement information of the supplement information table, matches the supplement information and the information to be supplemented, and generates a supplement object in combination with the primary key, the supplement information and the information to be supplemented, so as to achieve the purpose of generating an object for supplementing an abnormal statement. Finally, the supplement object is stored in a preset key-value pair data storage, a supplement database is constructed, an abnormal structured query statement in the system is extracted, and data supplement is performed on the abnormal structured query statement based on the supplement database, so as to complete the supplement of financial, medical and other industry data. Therefore, the data supplement method, device, electronic equipment and computer readable storage medium for the abnormal structured query statement provided by the present application can improve the data supplement efficiency of abnormal financial data.

[0099] As shown in Figure 4 FIG. 1 is a functional module diagram of a data supplement device for an abnormal structured query statement according to an embodiment of the present application.

[0100] The data supplement device 100 for the abnormal structured query statement according to the present application can be installed in an electronic device. According to the functions to be implemented, the data supplement device 100 for the abnormal structured query statement can include a statement splitting module 101, an information table obtaining module 102, an object generating module 103 and a data supplement module 104. The modules according to the present application can also be referred to as units, which refer to a series of computer program segments that can be executed by an electronic device processor and can complete a fixed function, and are stored in the memory of the electronic device.

[0101] In the present embodiment, the functions of each module / unit are as follows:

[0102] The statement splitting module 101 is configured to intercept a structured query statement that fails to execute through an interceptor, and split the structured query statement to obtain splitting information.

[0103] The information table obtaining module 102 is configured to take the splitting information as information to be supplemented, and receive a data supplement requirement of the structured query statement; construct a timing supplement task based on the data supplement requirement, and obtain a supplement information table from a supplement configuration center through the timing supplement task.

[0104] The object generation module 103 is configured to query the primary key and the supplement information of the supplement information table, match the supplement information and the to-be-supplemented information, and generate a supplement object in combination with the primary key, the supplement information and the to-be-supplemented information.

[0105] The data supplement module 104 is configured to store the supplement object into a preset key-value pair data storage, construct a supplement database, extract an abnormal structured query statement in the system, perform data supplement on the abnormal structured query statement based on the supplement database, and obtain a supplemented structured query statement.

[0106] In detail, each module in the data supplement device 100 for the abnormal structured query statement in the embodiment of the present application adopts the same technical means as the data supplement method for the abnormal structured query statement in the above Figures 1 to 3 , and can produce the same technical effects, which will not be described herein again.

[0107] As shown in Figure 5 , it is a structural schematic diagram of an electronic device for implementing the data supplement method for the abnormal structured query statement according to an embodiment of the present application.

[0108] The electronic device 1 can include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and can further include a computer program stored in the memory 11 and executable on the processor 10, such as a data supplement program for the abnormal structured query statement.

[0109] In some embodiments, the processor 10 can be composed of integrated circuits, for example, can be composed of a single packaged integrated circuit, or can be composed of multiple packaged integrated circuits with the same function or different functions, including one or more combinations of central processing units (CPUs), microprocessors, digital processing chips, graphics processors and various control chips. The processor 10 is the control core of the electronic device. It connects all components of the electronic device through various interfaces and lines, executes or runs programs or modules stored in the memory 11 (such as the data supplement program for the abnormal structured query statement), and calls data stored in the memory 11 to perform various functions of the electronic device and process data.

[0110] The memory 11 includes at least one type of readable storage medium, such as a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 can also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 11 can include both an internal storage unit and an external storage device of the electronic device. The memory 11 can be used to store application software installed in the electronic device and various data, such as the code of the data backfill program for the abnormal structured query language, and can also be used to temporarily store data that has been output or will be output.

[0111] The communication bus 12 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable connection and communication between the memory 11 and at least one processor 10, etc.

[0112] The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface can include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), and is usually used to establish a communication connection between the electronic device and other electronic devices. The user interface can be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface can also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, etc. The display can also be appropriately referred to as a display screen or a display unit, and is used to display information processed in the electronic device and to display a visualized user interface.

[0113] Figure 5 Only the electronic device with components is shown, and those skilled in the art can understand that, Figure 5The illustrated structure does not constitute a limitation on the electronic device 1, and can include fewer or more components than illustrated, or combine certain components, or arrange different components.

[0114] For example, although not shown, the electronic device can also include a power supply (such as a battery) for powering individual components. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, so that functions such as charge management, discharge management, and power consumption management can be achieved through the power management device. The power supply can also include one or more direct current or alternating current power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The electronic device can also include various sensors, Bluetooth modules, Wi-Fi modules, and the like, which are not described here.

[0115] It should be understood that the embodiments are only for illustration and are not limited in the scope of the patent application by this structure.

[0116] The data backfill program for abnormal structured query statements stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, which, when executed in the processor 10, can achieve:

[0117] Intercept the structured query statement that fails to execute through an interceptor, and split the structured query statement to obtain split information;

[0118] Take the split information as to-be-backfilled information, and receive a data backfill requirement for the structured query statement;

[0119] Construct a timing backfill task based on the data backfill requirement, and obtain a backfill information table from a backfill configuration center through the timing backfill task;

[0120] Query the primary key and backfill information of the backfill information table, match the backfill information and the to-be-backfilled information, and generate a backfill object in combination with the primary key, the backfill information, and the to-be-backfilled information;

[0121] Store the backfill object into a preset key-value pair data storage, construct a backfill database, extract abnormal structured query statements in the system, and perform data backfill on the abnormal structured query statements based on the backfill database to obtain backfilled structured query statements.

[0122] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the related steps in the corresponding embodiments of the accompanying drawings, which is not described here.

[0123] Further, the modules / units integrated in the electronic device 1 are stored in a computer readable storage medium if they are realized in the form of software function units and sold or used as independent products. The computer readable storage medium can be volatile or non-volatile. For example, the computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM).

[0124] The application further provides a computer readable storage medium, which stores a computer program, and the computer program can realize the following when executed by a processor of an electronic device:

[0125] The structured query statement with execution failure is intercepted by an interceptor, and the structured query statement is split to obtain split information;

[0126] The split information is taken as to-be-replenished information, and a data replenishment demand of the structured query statement is received;

[0127] A timing replenishment task is constructed based on the data replenishment demand, and replenishment information table is obtained from a replenishment configuration center through the timing replenishment task;

[0128] The primary key and replenishment information of the replenishment information table are queried, the replenishment information and the to-be-replenished information are matched, and a replenishment object is generated in combination with the primary key, the replenishment information and the to-be-replenished information;

[0129] The replenishment object is stored in a preset key-value pair data storage, a replenishment database is constructed, an abnormal structured query statement in the system is extracted, the abnormal structured query statement is replenished with data based on the replenishment database, and a replenished structured query statement is obtained.

[0130] In the several embodiments of the application, it should be understood that the disclosed device, apparatus and method can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the modules is only a logical function division. There can be another division manner in actual implementation.

[0131] The modules described as separate components can or can not be physically separated, and the components displayed as modules can or can not be physical units, i.e. they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment.

[0132] In addition, each function module in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of hardware plus software function modules.

[0133] It is obvious for those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and the present application can be realized in other specific forms without departing from the spirit or essential characteristics of the present application.

[0134] Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting, the scope of the present application is defined by the appended claims rather than the above description, and therefore all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present application. Any additional reference signs in the claims should not be considered as limiting the claims involved.

[0135] The blockchain referred to in the present application is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, verification mechanism, and encryption algorithm. Blockchain, in essence, is a decentralized database, which is a series of data blocks associated using cryptographic methods, each data block containing information of a batch of network transactions, for verifying the validity (anti-fake) of the information and generating the next block. The blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer, etc.

[0136] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Artificial intelligence (AI) is the use of digital computers or computer-controlled machines to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results.

[0137] In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The plurality of units or devices stated in the system claims can also be realized by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, not any particular order.

[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the present application.

Claims

1. A method for data recovery of abnormal structured query statements, characterized in that, The method includes: The interceptor intercepts failed structured query statements and splits the structured query statements to obtain split information, which is data information of various dimensions obtained by parsing the characters of the structured query statements. The split information is used as the information to be supplemented, and the data supplementation request of the structured query statement is received; Based on the data replenishment requirements, a scheduled replenishment task is constructed, and the replenishment information table is obtained from the replenishment configuration center through the scheduled replenishment task; Query the primary key and replenishment information of the replenishment information table, calculate the similarity between the error information corresponding to each replenishment information in the replenishment information table and the information to be replenished to match the replenishment information corresponding to the information to be replenished, and generate a replenishment object by combining the primary key, the replenishment information corresponding to the information to be replenished and the information to be replenished; The restored objects are stored in a preset key-value pair data repository to construct a restoration database. Abnormal structured query statements in the system are extracted, and data restoration is performed on the abnormal structured query statements based on the restoration database to obtain restored structured query statements.

2. The data recovery method for abnormal structured query statements as described in claim 1, characterized in that, The step of splitting the structured query statement to obtain splitting information includes: Retrieve the string from the structured query statement; The string is converted into a token stream, and the data in the token stream is parsed to generate a parse tree; The parse tree is traversed, and each node in the parse tree is analyzed and queried to obtain the splitting information of the parse tree.

3. The data recovery method for abnormal structured query statements as described in claim 1, characterized in that, Before intercepting the failed structured query statement via an interceptor, the method further includes: Query the database management system of the structured query statement and extract the status code returned by the database management system; Determine whether the status code is 0; If the status code is 0, the structured query statement was executed successfully. If the status code is not 0, the structured query statement fails to execute.

4. The data recovery method for abnormal structured query statements as described in claim 1, characterized in that, The step of constructing a scheduled data replenishment task based on the data replenishment requirement, and obtaining the replenishment information table from the replenishment configuration center through the scheduled replenishment task, includes: Construct a timed data recovery task using the time requirement in the data recovery request, and query the trigger time and execution interval of the timed data recovery task; Multiple information extraction tasks are generated based on the trigger time and the execution interval, and multiple replenishment information is extracted from the replenishment configuration center based on the multiple information extraction tasks. The multiple backfill information entries are stored in a preset data table, and a primary key is created to generate the backfill information table.

5. The data recovery method for abnormal structured query statements as described in claim 1, characterized in that, The process of performing data restoration on the abnormal structured query statement based on the restored database to obtain the restored structured query statement includes: Calculate the similarity between the abnormal structured query statement and each piece of information to be replenished in the replenishment database, and obtain the primary key of the information to be replenished when the similarity is greater than or equal to a preset similarity threshold; Based on the primary key, query the corresponding recovery information for the information to be recovered, and use the recovery information to recover data from the abnormal structured query statement to obtain the recovered structured query statement.

6. The data recovery method for abnormal structured query statements as described in claim 1, characterized in that, Before splitting the structured query statement to obtain the split information, the method further includes: Back up the structured query statement.

7. The data recovery method for abnormal structured query statements as described in claim 1, characterized in that, After querying the primary key and replenishment information of the replenishment information table, the method further includes: Traverse all primary keys in the replenished information table to obtain multiple primary key information; Based on the multiple primary key information, obtain the corresponding replenishment information in the replenishment information table to obtain the primary key and replenishment information of the replenishment information table.

8. A data recovery device for abnormal structured query statements, characterized in that, The device includes: The statement splitting module is used to intercept failed structured query statements through an interceptor, and split the structured query statements to obtain splitting information, which is data information of various dimensions obtained by parsing the characters of the structured query statements; The information table acquisition module is used to take the split information as the information to be supplemented, and to receive the data supplementation request of the structured query statement; to construct a timed supplementation task based on the data supplementation request, and to obtain the supplementation information table from the supplementation configuration center through the timed supplementation task; The object generation module is used to query the primary key and replenishment information of the replenishment information table, calculate the similarity between the error information corresponding to each replenishment information in the replenishment information table and the information to be replenished to match the replenishment information corresponding to the information to be replenished, and generate a replenishment object by combining the primary key, the replenishment information corresponding to the information to be replenished and the information to be replenished. The data recovery module is used to store the recovery objects into a preset key-value pair data repository, construct a recovery database, extract abnormal structured query statements from the system, and perform data recovery on the abnormal structured query statements based on the recovery database to obtain the recovered structured query statements.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the data recovery method for abnormal structured query statements as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the data recovery method for abnormal structured query statements as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for automatically generating data base access program, and recording medium

    JP2001184241A