CN116881284A - Data retrieval method, device and equipment for structured query statement and storage medium - Google Patents

Data retrieval method, device and equipment for structured query statement and storage medium Download PDF

Info

Publication number
CN116881284A
CN116881284A CN202310866125.1A CN202310866125A CN116881284A CN 116881284 A CN116881284 A CN 116881284A CN 202310866125 A CN202310866125 A CN 202310866125A CN 116881284 A CN116881284 A CN 116881284A
Authority
CN
China
Prior art keywords
information
query statement
compensation
data
structured query
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310866125.1A
Other languages
Chinese (zh)
Inventor
庄志辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202310866125.1A priority Critical patent/CN116881284A/en
Publication of CN116881284A publication Critical patent/CN116881284A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2452Query translation
    • G06F16/24528Standardisation; Simplification
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a data processing technology, and discloses a data retrieval method, a device, electronic equipment and a storage medium for abnormal structured query sentences, which can be used for data retrieval of abnormal financial data. The method comprises the following steps: intercepting the structural query statement with failure execution by an interceptor, and splitting the structural query statement to obtain information to be complemented; obtaining a retrieval patch information table from a retrieval patch configuration center through a timing retrieval patch task; inquiring a main key and the complement information of the complement information table, matching the complement information with the information to be complemented, and generating a complement object by combining the main key, the complement information and the information to be complemented; and storing the complement object into a preset key value data storage library to construct a complement database, extracting an abnormal structured query statement in the system, and carrying out data complement on the abnormal structured query statement based on the complement database to obtain a complement structured query statement. The application can improve the data retrieval efficiency of abnormal financial data.

Description

Data retrieval method, device and equipment for structured query statement and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a data retrieval method and apparatus for an abnormally structured query statement, an electronic device, and a computer readable storage medium.
Background
Currently, the finance industry typically employs SQL (Structured Query Language ) for database storage and management of data, and performs various tasks between the production end and the test end, including creating and modifying tables, and inserting, updating, deleting data, etc. In practical application, because of the difference between the financial production data and the financial test data, in the process of adding, deleting and modifying the difference through the structure query statement, the problem that the field length is insufficient and the field is empty exists, at this time, the problem that the financial data can only be modified once in batch by log or according to time is solved, complex multiple modification operations are involved, batch investigation on the financial data cannot be carried out according to time, and therefore abnormal financial data retrieval efficiency is low.
Disclosure of Invention
The application provides a data retrieval method and device of an abnormal structured query statement and a computer readable storage medium, and mainly aims to solve the problem of low data retrieval efficiency of abnormal financial data.
In order to achieve the above object, the present application provides a data retrieval method for an abnormally structured query statement, including:
intercepting a structured query statement with failed execution by an interceptor, and splitting the structured query statement to obtain splitting information;
taking the split information as information to be complemented, and receiving the data complemented requirement of the structured query statement;
constructing a timing compensation task based on the data compensation requirement, and obtaining a compensation information retrieval table from a compensation configuration center through the timing compensation task;
inquiring a main key and the compensation information of the compensation information table, matching the compensation information with the information to be compensated, and generating a compensation object by combining the main key, the compensation information and the information to be compensated;
and storing the complement object into a preset key value data storage library, constructing a complement database, extracting an abnormal structural query statement in a system, and carrying out data complement on the abnormal structural query statement based on the complement database to obtain a complement structural query statement.
Optionally, the splitting the structured query statement to obtain split information includes:
acquiring a character string in the structured query statement;
converting the character string into a mark stream, analyzing data in the mark stream, and generating an analysis tree;
traversing the analysis tree, and analyzing and inquiring each node in the analysis tree to obtain the splitting information of the analysis tree.
Optionally, before the intercepting, by the interceptor, the structured query statement that fails to be executed, the method further includes:
querying a database management system of the structured query statement, and extracting a state code returned by the database management system;
judging whether the state code is 0 value or not;
if the state code is 0 value, the structured query statement is successfully executed;
if the status code is not 0 value, the structured query statement fails to execute.
Optionally, the constructing a timing compensation task based on the data compensation requirement, and obtaining, by the timing compensation task, a compensation information table from a compensation configuration center, includes:
constructing a timing compensation task by utilizing the time requirement in the data compensation requirement, and inquiring the triggering time and the execution interval of the timing compensation task;
generating a plurality of information extraction tasks according to the trigger time and the execution interval, and extracting a plurality of compensation information from the compensation configuration center based on the plurality of information extraction tasks;
and storing the plurality of the compensation information into a preset data table, and creating a primary key to generate the compensation information table.
Optionally, the performing data complement on the abnormal structured query statement based on the complement database to obtain a complement structured query statement includes:
calculating the similarity between the abnormal structured query statement and each piece of information to be complemented in the complemented database, and acquiring a primary key of the information to be complemented when the similarity is greater than or equal to a preset similarity threshold;
inquiring the complementary information corresponding to the information to be complementary according to the primary key, and carrying out data complementary on the abnormal structural language inquiry statement by utilizing the complementary information to obtain a complementary structural inquiry statement.
Optionally, before splitting the structured query statement to obtain split information, the method further includes:
and backing up the structural query statement.
Optionally, after the querying the primary key and the refill information of the refill information table, the method further includes:
traversing all the primary keys in the compensation information table to obtain a plurality of primary key information;
and acquiring corresponding compensation information in the compensation information table according to the plurality of main key information to obtain the main key and the compensation information of the compensation information table.
In order to solve the above problem, the present application further provides a data retrieval device for an abnormally structured query statement, the device comprising:
the sentence splitting module is used for intercepting the structural query sentences which fail to be executed through the interceptor and splitting the structural query sentences to obtain splitting information;
the information table acquisition module is used for taking the split information as information to be complemented and receiving the data complemented requirement of the structured query statement; constructing a timing compensation task based on the data compensation requirement, and obtaining a compensation information retrieval table from a compensation configuration center through the timing compensation task;
the object generation module is used for inquiring a main key and the compensation information of the compensation information table, matching the compensation information with the information to be compensated, and combining the main key, the compensation information and the information to be compensated to generate a compensation object;
and the data complement module is used for storing the complement object into a preset key value data storage library, constructing a complement database, extracting an abnormal structural query statement in the system, and carrying out data complement on the abnormal structural query statement based on the complement database to obtain a complement structural query statement.
In order to solve the above-mentioned problems, the present application also provides an electronic apparatus including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data retrieval method of the anomalously structured query statement described above.
In order to solve the above-mentioned problems, the present application further provides a computer readable storage medium, in which at least one computer program is stored, the at least one computer program being executed by a processor in an electronic device to implement the data retrieval method of the above-mentioned abnormal structured query statement.
According to the embodiment of the application, the interceptor intercepts the structural query statement which fails to be executed, the structural query statement is split to obtain the information to be supplemented, the information splitting is realized, then the supplement information table is obtained from the supplement configuration center through the timing supplement task, the main key and the supplement information of the supplement information table are queried, the supplement information and the information to be supplemented are matched, the supplement object is generated by combining the main key, the supplement information and the information to be supplemented, the purpose of generating the object for supplementing the abnormal statement is achieved, finally the supplement object is stored in a preset key value data storage library to construct a supplement database, the abnormal structural query statement in the system is extracted, and the data supplement is carried out on the abnormal structural query statement based on the supplement database, so that the supplement of financial industry data, medical industry data and the like is completed. Therefore, the data retrieval method, the device, the electronic equipment and the computer readable storage medium of the abnormal structured query statement can improve the data retrieval efficiency of abnormal financial data.
Drawings
FIG. 1 is a flowchart illustrating a method for data retrieval of an abnormally structured query statement according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a detailed implementation of one of the steps in the data retrieval method of the abnormal structured query term shown in FIG. 1;
FIG. 3 is a flowchart illustrating a detailed implementation of one of the steps in the data retrieval method of the abnormal structural query statement shown in FIG. 1;
FIG. 4 is a functional block diagram of a data retrieval device for an abnormally structured query term according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device for implementing the data retrieval method of the abnormal structured query statement according to an embodiment of the present application.
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The embodiment of the application provides a data retrieval method of an abnormal structured query statement. The execution main body of the data retrieval method of the abnormal structured query statement comprises at least one of a server, a terminal and the like which can be configured to execute the method provided by the embodiment of the application. In other words, the data retrieval method of the abnormally structured query statement may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (ContentDelivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flow chart of a data retrieval method of an abnormally structured query statement according to an embodiment of the application is shown.
In this embodiment, the data retrieval method of the abnormal structured query statement includes:
s1, intercepting a structural query statement with failure execution through an interceptor, and splitting the structural query statement to obtain splitting information.
In an embodiment of the present application, the structured query statement (Structured Query Language, SQL) is a statement based on a database query and programming language for accessing financial data and querying, updating and managing a financial database system. In addition, the structured query language can also be used for financial data analysis and financial report generation, so that financial analysts can be helped to extract required financial data from a financial database system quickly and efficiently, and perform multidimensional data analysis, statistical calculation and other operations.
In the embodiment of the application, the interceptor is a MyBatis interceptor, which is used for intercepting and customizing the structured query statement in a MyBatis framework. The interface of the interceptor provides a plurality of expansion points in the MyBatis framework, and can intercept and modify each link of the execution of the structured query statement, such as before the execution of the structured query statement, after the execution of the structured query statement, before the parameter processing, after the parameter processing, and the like.
Referring to fig. 2, further, splitting the structured query statement to obtain split information includes:
s101, acquiring a character string in the structured query statement;
s102, converting the character string into a mark stream, analyzing data in the mark stream, and generating an analysis tree;
s103, traversing the analysis tree, and analyzing and inquiring each node in the analysis tree to obtain the splitting information of the analysis tree.
In detail, the Token Stream is a data Stream that divides a structured query sentence into continuous sub-strings, and the parse tree is a relationship tree generated based on the strings in the Token Stream and the correlations between the strings.
In the embodiment of the application, the split information comprises a structured query operation, a structured query instruction, an information target table, a main key ID of the target table, an assembled target object and the like.
Further, before the intercepting, by the interceptor, the structured query statement that fails to be executed, the method further includes:
querying a database management system of the structured query statement, and extracting a state code returned by the database management system;
judging whether the state code is 0 value or not;
if the state code is 0 value, the structured query statement is successfully executed;
if the status code is not 0 value, the structured query statement fails to execute.
In the embodiment of the application, the identification code returned by the state database management system when the structured query statement is executed is used for indicating the execution state (execution success and execution failure) and the state result (the result obtained by executing the result query statement) of the structured query statement. The database management system is a system supporting structured query sentences, such as Oracle, mySQL, SQL Server, etc.
In another embodiment of the present application, before the splitting the structured query term to obtain the splitting information, the method further includes backing up the structured query term. The structural query statement is backed up, so that when errors occur in the data retrieval process, the data can be restored to the original state, and data loss is avoided.
S2, taking the split information as information to be complemented, and receiving the data complemented requirement of the structured query statement.
In the embodiment of the application, the split information is used as the information to be complemented, and then by comparing the abnormal structured query statement with the information to be complemented, whether the abnormal structured query statement needs to be complemented or not and how to complement the abnormal structured query statement can be judged.
In the embodiment of the present application, the data compensation requirement is used to obtain a specific data compensation mode of the information to be compensated. The data compensation requirement can be a compensation requirement in application scenes such as financial transaction data compensation, credit score data compensation, risk data compensation and the like.
S3, constructing a timing compensation task based on the data compensation requirement, and obtaining a compensation information table from a compensation configuration center through the timing compensation task.
In the embodiment of the application, the benefit information table has benefit information, and the benefit information determines the benefit mode and the benefit type of the structured query statement, for example, the form A has benefit information of insufficient length and the error of data missing, which requires benefit, and the benefit information can be used for carrying out data benefit on financial reports such as an asset liability table, a cash flow table and the like. The supplementary information table also records statement characteristics of the structured query statement with supplementary information.
In detail, the timing compensation task is a task generated based on the data compensation requirement of the structured query statement, and the required compensation information table is automatically acquired from the compensation configuration center through setting the planning time, wherein the compensation configuration center refers to a system or a platform for storing and managing the compensation information table, and in general, the compensation configuration center provides some key value pairs for marking the compensation information table and the error information corresponding to the compensation information table.
Referring to fig. 3, further, the obtaining, by the timing compensation task, the compensation information table from the compensation configuration center includes:
s301, constructing a timing compensation task by utilizing time requirements in the data compensation requirements, and inquiring the triggering time and the execution interval of the timing compensation task;
s302, generating a plurality of information extraction tasks according to the trigger time and the execution interval, and extracting a plurality of compensation information from the compensation configuration center based on the plurality of information extraction tasks;
s303, storing the plurality of compensation information into a preset data table, and creating a primary key to generate the compensation information table.
In the embodiment of the application, the trigger time and the execution interval are used for determining a plurality of information extraction tasks in a time dimension.
S4, inquiring a main key and the compensation information of the compensation information table, matching the compensation information with the information to be compensated, and combining the main key, the compensation information and the information to be compensated to generate a compensation object.
In the embodiment of the application, the complementary information exists in the form of a table, so that the main key and the complementary information of the complementary information table can be queried. And the primary key is an attribute or attribute combination of only identifying one record in the compensation information table and is used for ensuring the consistency and the integrity of information in the table.
Further, the data-compensating information is information for compensating the data of the compensation object, for example, an error with insufficient length of a certain piece of data in the compensation object needs compensation, and the length of the data needing compensation can be determined by the compensation information.
In the embodiment of the present application, the querying the primary key and the complementary information of the complementary information table includes:
traversing all the primary keys in the compensation information table to obtain a plurality of primary key information;
and acquiring corresponding compensation information in the compensation information table according to the plurality of main key information to obtain the main key and the compensation information of the compensation information table.
In the embodiment of the application, the corresponding unique complementary information in the primary key can be determined through the primary key information.
In the embodiment of the application, the matching of the compensation information and the information to be compensated can be obtained by calculating the similarity between the error information corresponding to each compensation information in the compensation information table and the information to be compensated.
Further, after the generating the complement object by combining the primary key, the complement information and the to-be-complemented information, the method further includes:
and deleting the compensation information which does not have the corresponding information to be compensated from the compensation configuration center.
In the embodiment of the present application, the record form of the information in the record in the refill information table is: the complement data prefix-table name [ reassembled complement object ].
S5, storing the complement object into a preset key value data storage library, constructing a complement database, extracting an abnormal structural query statement in a system, and carrying out data complement on the abnormal structural query statement based on the complement database to obtain a complement structural query statement.
In the embodiment of the application, the key value stores the complement object in the data storage library (redis) through a key value storage system based on the key value.
In the embodiment of the present application, the performing data complement on the abnormal structured query statement based on the complement database to obtain a complement structured query statement includes:
calculating the similarity between the abnormal structured query statement and each piece of information to be complemented in the complemented database, and acquiring a primary key of the information to be complemented when the similarity is greater than or equal to a preset similarity threshold;
inquiring the complementary information corresponding to the information to be complementary according to the primary key, and carrying out data complementary on the abnormal structural language inquiry statement by utilizing the complementary information to obtain a complementary structural inquiry statement.
In this embodiment, the preset similarity threshold is used to determine a similarity between the abnormal structural query statement and the information to be complemented.
In another embodiment of the present application, if the similarity is smaller than the preset similarity threshold, the similarity indicates that the abnormal structural query statement does not have corresponding complement data in the complement database.
In the embodiment of the application, the calculation of the similarity between the abnormal structural query statement and each piece of information to be complemented in the complemented database can be realized by vectorizing the abnormal structural query statement and each piece of information to be complemented in the complemented database and then calculating the similarity between the abnormal structural query statement and each piece of information to be complemented in the complemented database through a cosine similarity calculation formula.
According to the embodiment of the application, the interceptor intercepts the structural query statement which fails to be executed, the structural query statement is split to obtain the information to be supplemented, the information splitting is realized, then the supplement information table is obtained from the supplement configuration center through the timing supplement task, the main key and the supplement information of the supplement information table are queried, the supplement information and the information to be supplemented are matched, the supplement object is generated by combining the main key, the supplement information and the information to be supplemented, the purpose of generating the object for supplementing the abnormal statement is achieved, finally the supplement object is stored in a preset key value data storage library to construct a supplement database, the abnormal structural query statement in the system is extracted, and the data supplement is carried out on the abnormal structural query statement based on the supplement database, so that the supplement of financial industry data, medical industry data and the like is completed. Therefore, the data retrieval method, the device, the electronic equipment and the computer readable storage medium of the abnormal structured query statement can improve the data retrieval efficiency of abnormal financial data.
FIG. 4 is a functional block diagram of a data retrieval device for an abnormally structured query term according to an embodiment of the present application.
The data retrieval device 100 of the abnormal structured query statement of the present application may be installed in an electronic device. Depending on the implemented functions, the data retrieval device 100 of the abnormally structured query statement may include a statement splitting module 101, an information table obtaining module 102, an object generating module 103, and a data retrieval module 104. The module of the application, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the sentence splitting module 101 is configured to intercept, by using an interceptor, a structured query sentence that fails to be executed, and split the structured query sentence to obtain split information;
the information table obtaining module 102 is configured to take the split information as information to be complemented, and receive a data complemented requirement of the structured query statement; constructing a timing compensation task based on the data compensation requirement, and obtaining a compensation information retrieval table from a compensation configuration center through the timing compensation task;
the object generating module 103 is configured to query a primary key and complementary information of the complementary information table, match the complementary information with the information to be complementary, and combine the primary key, the complementary information and the information to be complementary to generate a complementary object;
the data complement module 104 is configured to store the complement object into a preset key value and construct a complement database, extract an abnormal structured query statement in the system, and perform data complement on the abnormal structured query statement based on the complement database to obtain a complement structured query statement.
In detail, each module in the data retrieval device 100 of the abnormal structural query statement in the embodiment of the present application adopts the same technical means as the data retrieval method of the abnormal structural query statement described in fig. 1 to 3, and can generate the same technical effects, which is not repeated here.
Fig. 5 is a schematic structural diagram of an electronic device for implementing a data retrieval method of an abnormally structured query statement according to an embodiment of the present application.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program stored in the memory 11 and executable on the processor 10, such as a data retrieval program of an abnormally structured query statement.
The processor 10 may be formed by an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed by a plurality of integrated circuits packaged with the same function or different functions, including one or more central processing units (Central Processing unit, CPU), a microprocessor, a digital processing chip, a graphics processor, a combination of various control chips, and so on. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the entire electronic device using various interfaces and lines, executes or executes programs or modules stored in the memory 11 (for example, executes a data complement program of an abnormal structural query statement, etc.), and invokes data stored in the memory 11 to perform various functions of the electronic device and process data.
The memory 11 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 11 may in other embodiments 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 memory Card (Flash Card) or the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in an electronic device and various data, such as codes of a data retrieval program of an abnormally structured query statement, but also to temporarily store data that has been output or is to be output.
The communication bus 12 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
The communication interface 13 is used for communication between the electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), or alternatively a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
Fig. 5 shows only an electronic device with components, it being understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or may be arranged in different components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to the respective components, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device may further include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described herein.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The data retrieval program of the abnormally structured query statement stored in the memory 11 in the electronic device 1 is a combination of a plurality of instructions, which, when executed in the processor 10, can implement:
intercepting a structured query statement with failed execution by an interceptor, and splitting the structured query statement to obtain splitting information;
taking the split information as information to be complemented, and receiving the data complemented requirement of the structured query statement;
constructing a timing compensation task based on the data compensation requirement, and obtaining a compensation information retrieval table from a compensation configuration center through the timing compensation task;
inquiring a main key and the compensation information of the compensation information table, matching the compensation information with the information to be compensated, and generating a compensation object by combining the main key, the compensation information and the information to be compensated;
and storing the complement object into a preset key value data storage library, constructing a complement database, extracting an abnormal structural query statement in a system, and carrying out data complement on the abnormal structural query statement based on the complement database to obtain a complement structural query statement.
In particular, the specific implementation method of the above instructions by the processor 10 may refer to the description of the relevant steps in the corresponding embodiment of the drawings, which is not repeated herein.
Further, the modules/units integrated in the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. The computer readable storage medium may be volatile or nonvolatile. For example, the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present application also provides a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, can implement:
intercepting a structured query statement with failed execution by an interceptor, and splitting the structured query statement to obtain splitting information;
taking the split information as information to be complemented, and receiving the data complemented requirement of the structured query statement;
constructing a timing compensation task based on the data compensation requirement, and obtaining a compensation information retrieval table from a compensation configuration center through the timing compensation task;
inquiring a main key and the compensation information of the compensation information table, matching the compensation information with the information to be compensated, and generating a compensation object by combining the main key, the compensation information and the information to be compensated;
and storing the complement object into a preset key value data storage library, constructing a complement database, extracting an abnormal structural query statement in a system, and carrying out data complement on the abnormal structural query statement based on the complement database to obtain a complement structural query statement.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, verification mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present application and not for limiting the same, and 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 modifications and equivalents may be made to the technical solution of the present application without departing from the spirit and scope of the technical solution of the present application.

Claims (10)

1. A method for data retrieval of an abnormally structured query statement, the method comprising:
intercepting a structured query statement with failed execution by an interceptor, and splitting the structured query statement to obtain splitting information;
taking the split information as information to be complemented, and receiving the data complemented requirement of the structured query statement;
constructing a timing compensation task based on the data compensation requirement, and obtaining a compensation information retrieval table from a compensation configuration center through the timing compensation task;
inquiring a main key and the compensation information of the compensation information table, matching the compensation information with the information to be compensated, and generating a compensation object by combining the main key, the compensation information and the information to be compensated;
and storing the complement object into a preset key value data storage library, constructing a complement database, extracting an abnormal structural query statement in a system, and carrying out data complement on the abnormal structural query statement based on the complement database to obtain a complement structural query statement.
2. The method for data retrieval of an abnormally structured query statement according to claim 1, wherein splitting the structured query statement to obtain split information includes:
acquiring a character string in the structured query statement;
converting the character string into a mark stream, analyzing data in the mark stream, and generating an analysis tree;
traversing the analysis tree, and analyzing and inquiring each node in the analysis tree to obtain the splitting information of the analysis tree.
3. A method of data retrieval of an abnormally structured query statement as claimed in claim 1, wherein, prior to intercepting, by the interceptor, the structured query statement that failed to be executed, the method further comprises:
querying a database management system of the structured query statement, and extracting a state code returned by the database management system;
judging whether the state code is 0 value or not;
if the state code is 0 value, the structured query statement is successfully executed;
if the status code is not 0 value, the structured query statement fails to execute.
4. The data retrieval of an abnormally structured query statement of claim 1, wherein the constructing a timed retrieval task based on the data retrieval requirement, the retrieving a retrieval information table from a retrieval configuration center by the timed retrieval task, comprises:
constructing a timing compensation task by utilizing the time requirement in the data compensation requirement, and inquiring the triggering time and the execution interval of the timing compensation task;
generating a plurality of information extraction tasks according to the trigger time and the execution interval, and extracting a plurality of compensation information from the compensation configuration center based on the plurality of information extraction tasks;
and storing the plurality of the compensation information into a preset data table, and creating a primary key to generate the compensation information table.
5. The method for data retrieval of an abnormally structured query statement as recited in claim 1, wherein said performing data retrieval of the abnormally structured query statement based on the retrieval database to obtain a retrieval structured query statement comprises:
calculating the similarity between the abnormal structured query statement and each piece of information to be complemented in the complemented database, and acquiring a primary key of the information to be complemented when the similarity is greater than or equal to a preset similarity threshold;
inquiring the complementary information corresponding to the information to be complementary according to the primary key, and carrying out data complementary on the abnormal structural language inquiry statement by utilizing the complementary information to obtain a complementary structural inquiry statement.
6. The data retrieval of an abnormally structured query statement of claim 1, wherein before splitting the structured query statement to obtain split information, the method further comprises:
and backing up the structural query statement.
7. The method for data retrieval of an abnormally structured query statement of claim 1, wherein after the querying of the primary key and retrieval information of the retrieval information table, the method further comprises:
traversing all the primary keys in the compensation information table to obtain a plurality of primary key information;
and acquiring corresponding compensation information in the compensation information table according to the plurality of main key information to obtain the main key and the compensation information of the compensation information table.
8. A data retrieval device for an abnormally structured query statement, the device comprising:
the sentence splitting module is used for intercepting the structural query sentences which fail to be executed through the interceptor and splitting the structural query sentences to obtain splitting information;
the information table acquisition module is used for taking the split information as information to be complemented and receiving the data complemented requirement of the structured query statement; constructing a timing compensation task based on the data compensation requirement, and obtaining a compensation information retrieval table from a compensation configuration center through the timing compensation task;
the object generation module is used for inquiring a main key and the compensation information of the compensation information table, matching the compensation information with the information to be compensated, and combining the main key, the compensation information and the information to be compensated to generate a compensation object;
and the data complement module is used for storing the complement object into a preset key value data storage library, constructing a complement database, extracting an abnormal structural query statement in the system, and carrying out data complement on the abnormal structural query statement based on the complement database to obtain a complement structural query statement.
9. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data retrieval method of an abnormally structured query statement of any of claims 1 to 7.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements a data retrieval method of an abnormally structured query statement according to any one of claims 1 to 7.
CN202310866125.1A 2023-07-13 2023-07-13 Data retrieval method, device and equipment for structured query statement and storage medium Pending CN116881284A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310866125.1A CN116881284A (en) 2023-07-13 2023-07-13 Data retrieval method, device and equipment for structured query statement and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310866125.1A CN116881284A (en) 2023-07-13 2023-07-13 Data retrieval method, device and equipment for structured query statement and storage medium

Publications (1)

Publication Number Publication Date
CN116881284A true CN116881284A (en) 2023-10-13

Family

ID=88265758

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310866125.1A Pending CN116881284A (en) 2023-07-13 2023-07-13 Data retrieval method, device and equipment for structured query statement and storage medium

Country Status (1)

Country Link
CN (1) CN116881284A (en)

Similar Documents

Publication Publication Date Title
CN112541338A (en) Similar text matching method and device, electronic equipment and computer storage medium
CN112115152B (en) Data increment updating and inquiring method and device, electronic equipment and storage medium
CN114979120B (en) Data uploading method, device, equipment and storage medium
CN113961584A (en) Method and device for analyzing field blood relationship, electronic equipment and storage medium
CN112506486A (en) Search system establishing method and device, electronic equipment and readable storage medium
CN116226166A (en) Data query method and system based on data source
CN114185895A (en) Data import and export method and device, electronic equipment and storage medium
CN113282854A (en) Data request response method and device, electronic equipment and storage medium
CN113434542B (en) Data relationship identification method and device, electronic equipment and storage medium
CN114138243A (en) Function calling method, device, equipment and storage medium based on development platform
CN112486532A (en) Method and device for managing configuration file, electronic equipment and storage medium
CN111429085A (en) Contract data generation method and device, electronic equipment and storage medium
CN113849520B (en) Intelligent recognition method and device for abnormal SQL, electronic equipment and storage medium
CN113687827B (en) Data list generation method, device and equipment based on widget and storage medium
CN115114297A (en) Data lightweight storage and search method and device, electronic equipment and storage medium
CN115062023A (en) Wide table optimization method and device, electronic equipment and computer readable storage medium
CN114518993A (en) System performance monitoring method, device, equipment and medium based on business characteristics
CN116881284A (en) Data retrieval method, device and equipment for structured query statement and storage medium
CN114510400A (en) Task execution method and device, electronic equipment and storage medium
CN112686759A (en) Account checking monitoring method, device, equipment and medium
CN113360505B (en) Time sequence data-based data processing method and device, electronic equipment and readable storage medium
CN113434359B (en) Data traceability system construction method and device, electronic device and readable storage medium
CN113657076B (en) Page operation record table generation method and device, electronic equipment and storage medium
CN114036174B (en) Data updating method, device, equipment and storage medium
CN113672483B (en) Device log storage method and device, electronic device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination