CN116467178B - Database detection method, apparatus, electronic device and computer readable medium - Google Patents

Database detection method, apparatus, electronic device and computer readable medium Download PDF

Info

Publication number
CN116467178B
CN116467178B CN202310280438.9A CN202310280438A CN116467178B CN 116467178 B CN116467178 B CN 116467178B CN 202310280438 A CN202310280438 A CN 202310280438A CN 116467178 B CN116467178 B CN 116467178B
Authority
CN
China
Prior art keywords
database system
target
database
feedback result
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.)
Active
Application number
CN202310280438.9A
Other languages
Chinese (zh)
Other versions
CN116467178A (en
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.)
Beijing Flywheel Data Technology Co ltd
Original Assignee
Beijing Flywheel Data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Flywheel Data Technology Co ltd filed Critical Beijing Flywheel Data Technology Co ltd
Priority to CN202310280438.9A priority Critical patent/CN116467178B/en
Publication of CN116467178A publication Critical patent/CN116467178A/en
Application granted granted Critical
Publication of CN116467178B publication Critical patent/CN116467178B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

Embodiments of the present disclosure disclose database detection methods, apparatuses, electronic devices, and computer-readable media. One embodiment of the method comprises the following steps: reading list information corresponding to each data table stored in the target database to obtain a list information set; constructing a query grammar tree according to the tabulated information set; selecting list information meeting target conditions from the query grammar tree as target list information, obtaining a target list information group, and constructing a target grammar tree according to the target list information group; merging all characters included in the target grammar tree into a query character string; and sending the query character string to each preset database system, and detecting each database system in response to receiving the feedback result sent by each database system. According to the embodiment, each branch database can be comprehensively tested, and the testing time is shortened.

Description

Database detection method, apparatus, electronic device and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a database detection method, apparatus, electronic device, and computer readable medium.
Background
Databases are typically used for data storage, while testing for new databases may effectively determine the throughput of the database to facilitate more efficient use of the database. Currently, for database detection, the following methods are generally adopted: the developer writes the unit test and regression test by himself before the service is brought on line, or by providing actual data cases during the deployment and use of the service in the production environment.
However, the following technical problems generally exist in the above manner:
firstly, a manually written data case cannot cover all branch databases before online, and the test time is long;
second, the database detection efficiency is low and the detection time is long.
In addition, when the database system is abnormal, a technician is usually required to repair the database system, and then the data table in the database system can be read, so that the data table in the abnormal database system is easy to lose.
The above information disclosed in this background section is only for enhancement of understanding of the background of the inventive concept and, therefore, may contain information that does not form the prior art that is already known to those of ordinary skill in the art in this country.
Disclosure of Invention
The disclosure is in part intended to introduce concepts in a simplified form that are further described below in the detailed description. The disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose database detection methods, apparatus, electronic devices, and computer readable media to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a database detection method, the method comprising: reading list information corresponding to each data table stored in the target database to obtain a list information set; constructing a query grammar tree according to the list information set; selecting a tabular statement meeting a target condition from the query grammar tree as a target tabular statement to obtain a target tabular statement group, and constructing a target grammar tree according to the target tabular statement group; merging all characters included in the target grammar tree into a query character string; transmitting the query character string to each preset database system, and detecting each database system in response to receiving feedback results transmitted by each database system; in response to detecting downtime of any one of the database systems, the query string is recorded, and the downtime database system is determined as an abnormal database system.
In a second aspect, some embodiments of the present disclosure provide a database detection apparatus, the apparatus comprising: the reading unit is configured to read list information corresponding to each data list stored in the target database to obtain a list information set; a construction unit configured to construct a query syntax tree according to the tabular information set; a selecting unit configured to select, as a target tabular statement, tabular statement satisfying a target condition from the query syntax tree, to obtain a target tabular statement group, and to construct a target syntax tree according to the target tabular statement group; a merging unit configured to merge each character included in the target syntax tree into a query string; the detection unit is configured to send the query character strings to preset database systems and detect the database systems in response to receiving feedback results sent by the database systems; and a determining unit configured to record the query string and determine the down database system as an abnormal database system in response to detecting that any one of the database systems is down.
In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors causes the one or more processors to implement the method described in any of the implementations of the first aspect above.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
The above embodiments of the present disclosure have the following advantageous effects: according to the database detection method, all branch databases can be comprehensively tested, and the test time is shortened. Specifically, the reason for the longer test time is that: the developer writes the unit test and the regression test by himself before the service is on line. Based on this, in the database detection method according to some embodiments of the present disclosure, first, table information corresponding to each data table stored in the target database is read, and a table information set is obtained. Thus, testing of individual database systems is facilitated. And secondly, constructing a query grammar tree according to the list information set. Then, selecting the list sentence meeting the target condition from the inquiry grammar tree as a target list sentence, obtaining a target list sentence group, and constructing a target grammar tree according to the target list sentence group. Thus, each database system can be tested using the database listing information that meets the conditions. Then, the characters included in the target grammar tree are combined into a query character string. And finally, sending the query character string to each preset database system, and detecting each database system in response to receiving the feedback result sent by each database system. Thus, different database systems may be detected by the same query string. Therefore, each branch database can be comprehensively tested, and the test time is shortened.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow chart of some embodiments of a database detection method according to the present disclosure;
FIG. 2 is a schematic diagram of the structure of some embodiments of a database detection apparatus according to the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a flow chart of some embodiments of a database detection method according to the present disclosure. A flow 100 of some embodiments of a database detection method according to the present disclosure is shown. The database detection method comprises the following steps:
and 101, reading list information corresponding to each data list stored in the target database to obtain a list information set.
In some embodiments, an executing body (e.g., a server) of the database detection method may read the tabular information corresponding to each data table stored in the target database, to obtain the tabular information set. Here, the target database may be a database storing respective data tables for the test database system. The list information may refer to information composed of individual list information included in a data list. Here, the column information may be one column of data in the data table.
And 102, constructing a query grammar tree according to the list information set.
In some embodiments, the execution body may construct a query syntax tree according to the tabular information set.
In practice, the execution subject may construct a query syntax tree by:
first, for each of the list information in the list information set, merging each character included in the list information into a list sentence.
And secondly, constructing a query grammar tree according to each tabular statement. And connecting all list sentences according to the set sequence to construct a query grammar tree. For example, each tabular statement may be input into the homemade interpreter Pascal, generating an abstract syntax tree (query syntax tree). In another implementation, individual tabular statements may be input into a Neural Network Language Model (NNLM) resulting in a grammar tree (query grammar tree). The neural network language model may be a pre-trained neural network language model with each tabular statement as input and a query syntax tree as output.
Step 103, selecting the list sentences meeting the target conditions from the query grammar tree as target list sentences to obtain target list sentence groups, and constructing a target grammar tree according to the target list sentence groups.
In some embodiments, the execution body may select a tabular statement satisfying a target condition from the query syntax tree as a target tabular statement, obtain a target tabular statement group, and construct a target syntax tree according to the target tabular statement group. The target condition may be a condition set for filtering the tabular information. For example, the target condition may be: the data format corresponding to the list information is a preset data format. In practice, each target list statement is connected according to a set order to construct a target grammar tree. That is, each target tabular statement may be input into the homemade interpreter Pascal, generating an abstract syntax tree (target syntax tree). In another implementation, the execution body may further input each target tabular statement into a Neural Network Language Model (NNLM) to obtain a grammar tree.
And 104, merging all the characters included in the target grammar tree into a query character string.
In some embodiments, the execution body may combine each character included in the target syntax tree into a query string.
And 105, transmitting the query character string to each preset database system, and detecting each database system in response to receiving the feedback result transmitted by each database system.
In some embodiments, the executing entity may send the query string to each preset database system, and detect each database system in response to receiving a feedback result sent by each database system.
In practice, in response to receiving feedback results sent by the respective database systems, the executing entity may detect the respective database systems:
first, a standard database system among the database systems is determined. That is, the set standard database system can be determined by the database system identification. That is, the judgment can be made by the database system identification corresponding to the standard database system.
And secondly, determining the feedback result corresponding to the standard database system as a standard feedback result.
And thirdly, determining each database system without the standard database system as a database system group to be detected.
And fourthly, determining each feedback result corresponding to the database system group to be detected as a feedback result group to be compared.
And fifthly, detecting the database system group to be detected according to the standard feedback result and the feedback result group to be compared.
In practice, for each feedback result to be compared in the feedback result set to be compared, the following processing steps are executed:
and a first sub-step of determining the comparison type corresponding to the feedback result to be compared. The comparison type may be a type of comparing feedback results.
And a second sub-step of determining whether the data quantity corresponding to the feedback result to be compared is consistent with the data quantity corresponding to the standard feedback result or not in response to determining that the comparison type is the quantity comparison type. The quantity comparison type may characterize the quantity of data contained in the comparison feedback result. And determining whether the data quantity corresponding to the feedback result to be compared is the same as the data quantity corresponding to the standard feedback result.
And a third sub-step of determining the database system to be detected corresponding to the feedback result to be compared as an abnormal database system in response to the fact that the data quantity corresponding to the feedback result to be compared is inconsistent with the data quantity corresponding to the standard feedback result.
Optionally, the above processing step further includes:
and a fourth sub-step of determining whether the data content included in the feedback result to be compared is consistent with the data content included in the standard feedback result in response to determining that the comparison type is the content comparison type. The content contrast type may characterize the content contained in the contrast feedback result. That is, it is determined whether the data content included in the feedback result to be compared is the same as the data content included in the standard feedback result.
And a fifth sub-step of determining the database system to be detected corresponding to the feedback result to be compared as an abnormal database system in response to determining that the data content included in the feedback result to be compared is inconsistent with the data content included in the standard feedback result.
And a sixth substep, in response to determining that the data quantity corresponding to the feedback result to be compared is consistent with the data quantity corresponding to the standard feedback result, reconstructing a target grammar tree, and detecting the database system to be detected again according to the reconstructed target grammar tree. The method for reconstructing the target syntax tree may refer to the method for constructing the target syntax tree, which is not described herein. Here, the manner of detecting the database system to be detected again may be referred to the description in step 105, which is not repeated here.
And 106, in response to detecting that any one of the database systems is down, recording the query character string, and determining the down database system as an abnormal database system.
In some embodiments, the executing entity may respond to detecting that any one of the database systems is down, record the query string, and determine the down database system as an abnormal database system. Here, the database system downtime may be a crash of the database system.
Optionally, in response to receiving the query string, the database system performs the following steps for each list information included in the query string according to a set processing mode:
first, in response to determining that the processing mode is a first processing mode, a pre-set number of column information is selected from the column information included in the table column information as a sub-feedback result. Wherein each column information included in the table column information has an arrangement order. The first processing mode may represent selecting a preset number of column information from among the respective column information included in the above-described table column information.
And a second step of selecting, as a sub-feedback result, each piece of column information satisfying a target condition from among the pieces of column information included in the table column information in response to determining that the processing mode is the second processing mode. The second processing mode may express column information in which the index value included in the selection is larger than the set value. The target conditions may be: the column information includes an index value greater than the set value.
Optionally, the database system combines the generated sub-feedback results into a feedback result, and sends the feedback result to the target server.
In some embodiments, the database system may combine the generated sub-feedback results into a feedback result, and send the feedback result to the target server. Combining may be referred to as stitching. The target server may refer to the execution subject described above.
The above related matters are taken as an invention point of the present disclosure, and solve the second technical problem mentioned in the background art, namely that the detection time is long. ". Factors that have long detection times tend to be as follows: the detection efficiency of the database is low. If the above factors are solved, the effect of reducing the detection time can be achieved. To achieve this, first, a standard database system among the above-described respective database systems is determined. Thus, the standard database system can be utilized to perform comparison detection on other database systems. And secondly, determining the feedback result corresponding to the standard database system as a standard feedback result. Therefore, the standard feedback result can be used for comparing and detecting the results output by other database systems. Next, each database system from which the above standard database system is removed is determined as a database system group to be detected. And then, determining each feedback result corresponding to the database system group to be detected as a feedback result group to be compared. And finally, detecting the database system group to be detected according to the standard feedback result and the feedback result group to be compared. Therefore, the detection can be performed on a plurality of database systems through standard feedback results, so that the database detection efficiency is improved, and the detection time is shortened.
Alternatively, each database system from which each abnormal database system is removed is determined as a usable database system group.
In some embodiments, the executing entity may determine each database system from which each abnormal database system is removed as a usable database system group.
Optionally, for each of the above-described respective exception database systems, the following processing steps are performed:
firstly, migrating each data information table stored by the abnormal database system to a preset data table cache pool. Here, the respective data information tables may refer to respective data tables stored by the abnormal database system. The data table cache pool may refer to a cache node for caching data information tables stored by the abnormal database system.
And step two, determining the data memory capacity of each data information table cached in the data table cache pool. That is, the data capacity corresponding to each data information table is determined.
And thirdly, determining the current available memory of each available database system in the available database system groups to obtain available memory groups. Here, the available memory may refer to an operable memory of a database system that is currently available.
And step four, determining the available memory with the capacity larger than the data memory in the available memory group as a movable memory, and obtaining the movable memory group.
And fifthly, determining the available database system corresponding to the movable memory with the minimum number in the movable memory group as a target database system.
And sixthly, migrating each data information table cached in the data table cache pool into the target database system.
The related content in the first step to the sixth step is taken as an invention point of the present disclosure, which solves the technical problem three' mentioned in the background art, which is easy to cause the data table loss in the abnormal database system. ". Factors that easily cause the loss of the data table in the abnormal database system are as follows, when the database system is abnormal, a technician is usually required to repair the data table in the database system. If the above factors are solved, the effect of avoiding the loss of the data table in the abnormal database system can be achieved. In order to achieve the effect, firstly, each data information table stored in the abnormal database system is migrated to a preset data table cache pool. Thus, the data table in the abnormal database system can be temporarily cached. And secondly, determining the data memory capacity of each data information table cached in the data table cache pool. And then, determining the current available memory of each available database system in the available database system groups to obtain available memory groups. And then, determining the available memory with the capacity larger than the data memory in the available memory group as a movable memory to obtain a movable memory group. Thereby facilitating migration of individual data information tables into an operational database system. And then, determining the usable database system corresponding to the movable memory with the minimum value in the movable memory group as a target database system. Thereby, the operating resources of the database can be maximally utilized. And finally, migrating each data information table cached in the data table cache pool into the target database system. Thus, data table loss in the abnormal database system can be avoided.
With further reference to fig. 2, as an implementation of the method shown in the above figures, the present disclosure provides some embodiments of a database detection apparatus, which correspond to those method embodiments shown in fig. 1, and which are particularly applicable in various electronic devices.
As shown in fig. 2, the database detection apparatus 200 of some embodiments includes: a reading unit 201, a construction unit 202, a selection unit 203, a merging unit 204, a detection unit 205, and a determination unit 206. Wherein, the reading unit 201 is configured to read the list information corresponding to each data table stored in the target database to obtain a list information set; a construction unit 202 configured to construct a query syntax tree from the above-described tabular information set; a selecting unit 203 configured to select, as a target tabular statement, tabular statement satisfying a target condition from the query syntax tree, obtain a target tabular statement group, and construct a target syntax tree from the target tabular statement group; a merging unit 204 configured to merge each character included in the target syntax tree into a query string; a detecting unit 205 configured to send the query string to each preset database system, and detect each database system in response to receiving a feedback result sent by each database system; the determining unit 206 is configured to record the query string and determine the down database system as an abnormal database system in response to detecting that any one of the database systems is down.
Optionally, the detection unit 205 is further configured to: determining a standard database system in the database systems; determining a feedback result corresponding to the standard database system as a standard feedback result; determining each database system from which the standard database system is removed as a database system group to be detected; determining each feedback result corresponding to the database system group to be detected as a feedback result group to be compared; and detecting the database system group to be detected according to the standard feedback result and the feedback result group to be compared.
Optionally, the detection unit 205 is further configured to: for each feedback result to be compared in the feedback result set to be compared, executing the following processing steps: determining a comparison type corresponding to the feedback result to be compared; determining whether the data quantity corresponding to the feedback result to be compared is consistent with the data quantity corresponding to the standard feedback result or not according to the comparison type; and determining the database system to be detected corresponding to the feedback result to be compared as an abnormal database system in response to the fact that the data quantity corresponding to the feedback result to be compared is inconsistent with the data quantity corresponding to the standard feedback result.
Optionally, the detection unit 205 is further configured to: in response to determining that the comparison type is a content comparison type, determining whether the data content included in the feedback result to be compared is consistent with the data content included in the standard feedback result; in response to determining that the data content included in the feedback result to be compared is inconsistent with the data content included in the standard feedback result, determining a database system to be detected corresponding to the feedback result to be compared as an abnormal database system; and reconstructing a target grammar tree in response to the fact that the data quantity corresponding to the feedback result to be compared is consistent with the data quantity corresponding to the standard feedback result, and detecting the database system to be detected again according to the reconstructed target grammar tree.
Optionally, the database detection apparatus 200 further includes: an information selection unit configured to: in response to receiving the query string, the database system performs the following steps for each list information included in the query string according to a set processing mode: in response to determining that the processing mode is the first processing mode, selecting a pre-preset number of column information from the column information included in the table column information as a sub-feedback result, wherein the column information included in the table column information has an arrangement sequence; in response to determining that the processing mode is the second processing mode, selecting, as a sub-feedback result, each piece of column information satisfying a target condition from among the pieces of column information included in the table column information; a transmission unit configured to: and the database system combines the generated sub feedback results into a feedback result and sends the feedback result to the target server.
Optionally, the construction unit 202 is further configured to: for each piece of list information in the list information set, merging each character included in the list information into a list sentence; and constructing a query grammar tree according to each tabular statement.
It will be appreciated that the elements described in the database detection apparatus 200 correspond to the various steps in the method described with reference to fig. 1. Thus, the operations, features and advantages described above for the method are equally applicable to the database detection device 200 and the units contained therein, and are not described herein.
Referring now to fig. 3, a schematic diagram of an electronic device (e.g., server) 300 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic devices in some embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), car terminals (e.g., car navigation terminals), and the like, as well as stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 3 is merely an example and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 3, the electronic device 300 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various suitable actions and processes in accordance with a program stored in a Read Only Memory (ROM) 302 or a program loaded from a storage means 308 into a Random Access Memory (RAM) 303. In the RAM303, various programs and data required for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM302, and the RAM303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
In general, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 308 including, for example, magnetic tape, hard disk, etc.; and communication means 309. The communication means 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. While fig. 3 shows an electronic device 300 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 3 may represent one device or a plurality of devices as needed.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via communications device 309, or from storage device 308, or from ROM 302. The above-described functions defined in the methods of some embodiments of the present disclosure are performed when the computer program is executed by the processing means 301.
It should be noted that, the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: reading list information corresponding to each data table stored in the target database to obtain a list information set; constructing a query grammar tree according to the list information set; selecting a tabular statement meeting a target condition from the query grammar tree as a target tabular statement to obtain a target tabular statement group, and constructing a target grammar tree according to the target tabular statement group; merging all characters included in the target grammar tree into a query character string; transmitting the query character string to each preset database system, and detecting each database system in response to receiving feedback results transmitted by each database system; in response to detecting downtime of any one of the database systems, the query string is recorded, and the downtime database system is determined as an abnormal database system.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor includes a reading unit, a construction unit, a selection unit, a merging unit, a detection unit, and a determination unit. The names of the units are not limited to the unit itself in some cases, for example, the detection unit may also be described as "a unit that sends the query string to each preset database system, and detects each database system in response to receiving a feedback result sent by each database system".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.

Claims (6)

1. A database detection method, comprising:
reading list information corresponding to each data table stored in the target database to obtain a list information set;
constructing a query grammar tree according to the list information set;
selecting list information meeting target conditions from the query grammar tree as target list information, obtaining a target list information group, and constructing a target grammar tree according to the target list information group;
merging all characters included in the target grammar tree into a query character string;
sending the query character string to each preset database system, and detecting each database system in response to receiving feedback results sent by each database system;
in response to detecting downtime of any one of the database systems, recording the query string, and determining the downtime database system as an abnormal database system;
wherein the detecting each database system in response to receiving the feedback result sent by each database system includes:
determining a standard database system in the database systems;
determining a feedback result corresponding to the standard database system as a standard feedback result;
determining each database system from which the standard database system is removed as a database system group to be detected;
determining each feedback result corresponding to the database system group to be detected as a feedback result group to be compared;
and detecting the database system group to be detected according to the standard feedback result and the feedback result group to be compared.
2. The method of claim 1, wherein the method further comprises:
in response to receiving the query string, the database system performs the following steps for each list information included in the query string according to a set processing mode:
in response to determining that the processing mode is a first processing mode, selecting a pre-preset number of column information from the column information included in the table column information as a sub-feedback result, wherein the column information included in the table column information has an arrangement sequence;
in response to determining that the processing mode is a second processing mode, selecting, as a sub-feedback result, each piece of column information satisfying a target condition from among the pieces of column information included in the tabular information;
and the database system combines the generated sub feedback results into a feedback result and sends the feedback result to a target server.
3. The method of claim 1, wherein said constructing a query syntax tree from said tabular information set comprises:
for each piece of tabular information in the tabular information set, merging all characters included in the tabular information into tabular statement;
and constructing a query grammar tree according to each tabular statement.
4. A database detection apparatus comprising:
the reading unit is configured to read list information corresponding to each data list stored in the target database to obtain a list information set;
a construction unit configured to construct a query syntax tree from the tabular information set;
a selecting unit configured to select, from the query syntax tree, tabular information satisfying a target condition as target tabular information, obtain a target tabular information group, and construct a target syntax tree according to the target tabular information group;
a merging unit configured to merge each character included in the target syntax tree into a query string;
the detection unit is configured to send the query character strings to preset database systems and detect the database systems in response to receiving feedback results sent by the database systems; a detection unit further configured to:
determining a standard database system in the database systems;
determining a feedback result corresponding to the standard database system as a standard feedback result;
determining each database system from which the standard database system is removed as a database system group to be detected;
determining each feedback result corresponding to the database system group to be detected as a feedback result group to be compared;
detecting the database system group to be detected according to the standard feedback result and the feedback result group to be compared;
and the determining unit is configured to respond to detection of downtime of any one of the database systems, record the query character string and determine the downtime of the database system as an abnormal database system.
5. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-3.
6. A computer readable medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the method of any of claims 1-3.
CN202310280438.9A 2023-03-21 2023-03-21 Database detection method, apparatus, electronic device and computer readable medium Active CN116467178B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310280438.9A CN116467178B (en) 2023-03-21 2023-03-21 Database detection method, apparatus, electronic device and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310280438.9A CN116467178B (en) 2023-03-21 2023-03-21 Database detection method, apparatus, electronic device and computer readable medium

Publications (2)

Publication Number Publication Date
CN116467178A CN116467178A (en) 2023-07-21
CN116467178B true CN116467178B (en) 2024-02-20

Family

ID=87177944

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310280438.9A Active CN116467178B (en) 2023-03-21 2023-03-21 Database detection method, apparatus, electronic device and computer readable medium

Country Status (1)

Country Link
CN (1) CN116467178B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111159016A (en) * 2019-12-16 2020-05-15 深圳前海微众银行股份有限公司 Standard detection method and device
CN113535773A (en) * 2021-07-27 2021-10-22 工银科技有限公司 Database optimization method, database optimization device, electronic device and storage medium
CN113722325A (en) * 2021-08-31 2021-11-30 北京锐安科技有限公司 Method and device for detecting table information in database, computer equipment and storage medium
US11550765B1 (en) * 2021-09-28 2023-01-10 Sap Se Pre-migration detection and resolution of issues in migrating databases systems

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11537571B2 (en) * 2018-09-25 2022-12-27 Salesforce, Inc. Column data compression schemes for scaling writes and reads on database systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111159016A (en) * 2019-12-16 2020-05-15 深圳前海微众银行股份有限公司 Standard detection method and device
CN113535773A (en) * 2021-07-27 2021-10-22 工银科技有限公司 Database optimization method, database optimization device, electronic device and storage medium
CN113722325A (en) * 2021-08-31 2021-11-30 北京锐安科技有限公司 Method and device for detecting table information in database, computer equipment and storage medium
US11550765B1 (en) * 2021-09-28 2023-01-10 Sap Se Pre-migration detection and resolution of issues in migrating databases systems

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
利用数据库系统表实现多表关联查询;管冰蕾;;网络与信息;20070509(05);第77页 *
基于前馈神经网络的数据库异常检测;何源;许力;金华松;;信息与电脑(理论版)(第06期);第119-121页 *

Also Published As

Publication number Publication date
CN116467178A (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
US20210200806A1 (en) Method and apparatus for parallel processing of information
CN111555940A (en) Client test method and device, electronic equipment and computer readable storage medium
CN115757400B (en) Data table processing method, device, electronic equipment and computer readable medium
CN111857720B (en) User interface state information generation method and device, electronic equipment and medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN111858381B (en) Application fault tolerance capability test method, electronic device and medium
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN113807056B (en) Document name sequence error correction method, device and equipment
CN116467178B (en) Database detection method, apparatus, electronic device and computer readable medium
CN112286808B (en) Application program testing method and device, electronic equipment and medium
CN112507676B (en) Method and device for generating energy report, electronic equipment and computer readable medium
CN112017685B (en) Speech generation method, device, equipment and computer readable medium
CN111754984B (en) Text selection method, apparatus, device and computer readable medium
CN116820354B (en) Data storage method, data storage device and data storage system
CN115328811B (en) Program statement testing method and device for industrial control network simulation and electronic equipment
CN115565607B (en) Method, device, readable medium and electronic equipment for determining protein information
CN111930704B (en) Service alarm equipment control method, device, equipment and computer readable medium
CN116541421B (en) Address query information generation method and device, electronic equipment and computer medium
CN116360710B (en) Data storage method applied to server cluster, electronic device and readable medium
CN111694755B (en) Application program testing method and device, electronic equipment and medium
CN112346728B (en) Device adaptation method, apparatus, device and computer readable medium
CN109740100B (en) Webpage node sniffing method, device, equipment and storage medium
CN111582482B (en) Method, apparatus, device and medium for generating network model information
CN117807167A (en) Database table copying method, apparatus, electronic device and computer readable 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
GR01 Patent grant
GR01 Patent grant