Database detection method and device, equipment and storage medium
Through the collaborative work of automated detection methods and supervision platforms, the problem of low performance testing and evaluation efficiency during the database transformation process is solved, and the effect of quickly discovering and solving database operation problems is achieved.
Patent Information
- Application Number
- CN202411742286.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-21
AI Technical Summary
During the database transformation process, it is difficult for the existing technology to conduct performance testing and evaluation efficiently, resulting in high costs, low efficiency, and low efficiency in discovering and solving problems.
Through automated detection methods, the running items to be detected in the database are determined, the matching detection rules are applied for automatic detection, abnormal items are found, and the adjustment methods are obtained through the supervision platform to automatically adjust.
It realizes rapid problem search and resolution of the database, reduces manual detection costs, and improves the efficiency of problem discovery and resolution.
Smart Images

Figure CN119493789A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a database detection method, device, equipment and storage medium. Background Art
[0002] In the wave of central database transformation, database transformation is an important part. In the process of transformation, along with the architecture transformation of the business system, the performance of the domestic database is different, and the business functions may be affected. Therefore, the programs and functions involved in the database transformation need to be subject to performance testing and evaluation to ensure that the business functions can run normally after the transformation.
[0003] Currently, the scope of programs and functions involved in database transformation is too large. Manually executing test cases to cover and verify them requires a high cost. At the same time, testing business transactions involves a large number of manual steps and requires the use of different tools, which consumes a lot of manpower costs. As a result, the efficiency of discovering and solving problems is low. Summary of the invention
[0004] The present invention provides a database detection method to realize rapid problem finding and solving for a transformed database.
[0005] According to a first aspect of the present invention, there is provided a method for detecting a database, comprising: determining running items to be detected in the database, wherein the running items include SQL statements, transactions, table partitions, sequence tables, logs, and table fragments;
[0006] Determine the detection rules matched by each of the running items, and use the matched detection rules to detect each of the running items to obtain abnormal items with faults;
[0007] Sending the abnormal item to the supervision platform for display, and obtaining the adjustment method for the abnormal item through the supervision platform;
[0008] The abnormal item is adjusted using the adjustment method.
[0009] According to another aspect of the present invention, there is provided a database detection device, comprising: an operation item determination module, used to determine the operation items to be detected in the database, wherein the operation items include SQL statements, transactions, table partitions, sequence tables, logs and table fragments;
[0010] An abnormal item determination module is used to determine the detection rules matched by each of the running items, and use the matched detection rules to detect each of the running items to obtain abnormal items with faults;
[0011] An adjustment method acquisition module, used to send the abnormal item to the supervision platform for display, and obtain the adjustment method for the abnormal item through the supervision platform;
[0012] The abnormal item adjustment module is used to adjust the abnormal item by adopting the adjustment method.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can perform the method described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method described in any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, and when the computer program is executed by a processor, the method described in any embodiment of the present invention is implemented.
[0019] The beneficial technical effect of the present invention is that the database is detected in an automated manner, the operating items of the database are automatically detected by rule matching to find abnormal items, and the corresponding adjustment methods are obtained to automatically adjust the abnormal items, so as to quickly discover problems in the operation of the database and solve database operation problems.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1is a flow chart of a database detection method provided according to Embodiment 1 of the present invention;
[0023] Figure 2 is a flow chart of a database detection method provided according to Embodiment 2 of the present invention;
[0024] Figure 3 is a schematic diagram of the structure of a database detection device provided according to Embodiment 3 of the present invention;
[0025] Figure 4 It is a schematic diagram of the structure of an electronic device provided by Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Embodiment 1
[0029] Figure 1 A flowchart of a database detection method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of detecting a transformed database. The method can be executed by a database detection device, which can be implemented in the form of hardware and / or software. Figure 1 As shown, the method includes:
[0030] Step S101, determining the running items to be detected in the database.
[0031] Optionally, determining the running items to be tested in the database includes: displaying a project detection interface when it is determined that a database detection request has been received, wherein the project detection interface includes running items to be selected that are associated with the database operation; receiving a selection instruction input by the user in the project detection interface, and determining the running items to be tested from the project detection interface according to the selection instruction.
[0032] Among them, in this implementation, a comprehensive test is performed on the transformed database to ensure the operating quality of the transformed database. Before testing the database, it is first necessary to determine the operating items of the database to be tested, that is, which specific items of the database need to be tested. In order to meet the user's testing needs, the specific test items can be specified by the user in this implementation.
[0033] In a specific implementation, when the database transformation is completed and the database needs to be tested, a database test request can be sent to the terminal device, and the terminal device will display the project test interface according to the test request. The project test interface contains all the running projects associated with the database operation. The user can choose from them according to the needs of this database test. For example, you can select by clicking or manually enter the name. The user's selection interaction method is not limited in this embodiment. As long as the selection of the running project can be realized on the project detection interface, it is within the protection scope of this application. Among them, when the selection instruction entered by the user on the project detection interface by clicking is received, the running project to be selected will be determined from the project detection interface according to the selection instruction.
[0034] It should be noted that the running items to be detected in this embodiment include SQL statements, transactions, table partitions, sequence tables, logs and table fragments, where SQL statements refer to database queries and programming languages, which are used to access data and query, update and manage relational database systems; transactions refer to a sequence of database operations that access and may operate various data items, and these operations can only be executed in full or not at all, and are an indivisible unit of work; table partitions refer to dividing the data of a large table into many small subsets, each subset is called a partition; logs refer to the running records of the database; table fragments refer to the number of gaps between data blocks in the data tables contained in the database. Of course, this embodiment is only an example, and does not limit the specific number and type of running items to be detected in the database. As long as they are determined according to the user's detection needs, they are all within the protection scope of this application.
[0035] Step S102, determining the detection rules matched by each running item, and using the matched detection rules to detect each running item to obtain abnormal items with faults.
[0036] Among them, the detection rules matched by each item in this embodiment can be pre-configured and saved locally. For example, the detection rule matched by the SQL statement item is that the SQL statement execution time is greater than the first value, such as 2 seconds; the detection rule matched by the transaction item is that the number of transactions is greater than the second value, such as 100,000; the detection rule matched by the table partition item is that the table data volume is greater than the third value and the partition state is no partition, such as greater than 30 million and no partition; the detection rule matched by the sequence table item is that the cache table step is less than the fourth value, such as 100; the detection rule corresponding to the log item is that there is a deadlock error in the error log; the detection rule corresponding to the table fragmentation item is that the table fragmentation rate is greater than the fifth value, such as 50%. Of course, this embodiment is only an example, and does not specifically limit the detection rules matched by each running item. As long as the running item can be detected, it is within the protection scope of this application. In addition, for the detection rules saved locally, users can make personalized modifications to them according to actual detection needs to meet the detection needs of different databases. For example, the execution time of SQL statements required for different databases may be different. In this case, the first value in the detection rules can be personalized for different databases to meet the detection needs of different databases.
[0037] Optionally, a matching detection rule is used to detect each running project to obtain abnormal projects with faults, including: obtaining the project running parameters corresponding to each running project during the operation of the database; for each running project, the corresponding project running parameters are verified with reference to the matching detection rules, and when it is determined that the project running parameters hit the detection rules, it is determined that there is a fault in the running project; and the running project with faults is treated as an abnormal project.
[0038] Specifically, in this embodiment, when detecting the running items selected by the database, the project running parameters corresponding to each running item will be obtained, for example, the SQL statement execution time corresponding to the SQL statement item in the database running process is obtained; the number of transactions corresponding to the transaction item in the database running process is obtained; the table data volume and partition status corresponding to the table partition item in the database running process are obtained; the cache table step length corresponding to the sequence table item in the database running process is obtained; the error log corresponding to the log item in the database running process is obtained; the table fragmentation rate corresponding to the table fragmentation item in the database running process is obtained, etc. Of course, this embodiment is only an example for illustration, and does not limit the specific content of the project running parameters corresponding to each running item.
[0039] Among them, in this embodiment, after obtaining the project operation parameters corresponding to each operation project, when the database is detected by the operation project, the project operation parameters corresponding to the operation project are specifically checked with reference to the matching detection rules to determine whether the operation project has a fault. For example, for the operation project "SQL statement", the corresponding project operation parameter is "SQL statement execution time is 3 seconds", and the detection rule it matches is "SQL statement execution time is greater than 2 seconds", from which it can be known that the project operation parameter hits the detection rule, so it can be determined that the SQL statement is an abnormal project; for "transaction", the corresponding project operation parameter is "the number of transactions is 50,000", and the detection rule it matches is "the number of transactions is greater than 100,000", from which it can be known that the project operation parameter does not hit the detection rule, so it can be determined that the transaction is a normal project; for "table partition", the corresponding project operation parameter is "the table data volume is 40 million and the partition status is no partition", and the detection rule it matches is "the table data volume is greater than 30 million and the partition status is no partition", from which it can be known that the project operation parameter hits the detection rule. Then, it can be determined that the table partition is an abnormal project; for the "sequence table", the corresponding project operation parameter is "cache table step 200", and the detection rule it matches is "cache table step less than 100", from which it can be known that the project operation parameter does not hit the detection rule, so the sequence table can be determined to be a normal project; for the "log", the corresponding project operation parameter is "error log contains deadlock error", and the detection rule it matches is "error log contains deadlock error", from which it can be known that the project operation parameter hits the detection rule, so the log can be determined to be an abnormal project; for the "table fragmentation rate is 40%", the corresponding project operation parameter is "table fragmentation rate", and the detection rule it matches is "table fragmentation rate is greater than 50%", from which it can be known that the project operation parameter does not hit the detection rule, so the table fragment can be determined to be a normal project. Of course, this embodiment is only an example, and does not limit the specific detection method of the running project.
[0040] Step S103, sending the abnormal items to the supervision platform for display, and obtaining the adjustment method for the abnormal items through the supervision platform.
[0041] Optionally, the abnormal items are sent to the supervision platform for display, including: obtaining the risk level corresponding to the abnormal items; determining the display serial number according to the risk level, sending the abnormal items to the supervision platform and displaying them in sequence according to the display serial number.
[0042] Specifically, in this embodiment, after determining the abnormal project, the abnormal project will be sent to the supervision platform. Since the number of abnormal projects determined can be multiple or non-existent, the specific number of abnormal projects determined is not limited in this embodiment. Among them, when the number of abnormal projects is multiple, since the role played by different operating projects on the normal operation of the database is the same, the greater the importance, the higher the risk level of the database when the operating project determines the fault. Since the importance of different operating projects to the operation of the database is pre-configured, it can be obtained, and the corresponding risk level corresponding to the abnormal project when a fault occurs can also be obtained. Therefore, in this embodiment, after obtaining the abnormal project and the risk level corresponding to the abnormal project, the display serial number will be determined according to the risk level. For example, the higher the risk level, the smaller the display serial number, and when displayed on the supervision platform, it can be displayed in the order of the display serial number from small to large, so that the user can intuitively obtain each abnormal project and the risk level of each abnormal project.
[0043] For example, after determining that the abnormal items are SQL statements, transactions, and table partitions, when it is determined according to the risk levels that the risk level of the SQL statement is level one, the risk level of the transaction is level two, and the risk level of the table partition is level three, that is, the risk levels increase in sequence, then the corresponding SQL statement display number is 3, the transaction display number is 2, and the table partition display number is 1, that is, the above three abnormal items are displayed on the supervision platform in the order of table partitions, transactions, and SQL statements. Of course, in this embodiment, only three abnormal items are used as an example for illustration. In actual applications, this embodiment does not limit the number of abnormal items and the specific display method of abnormal items on the supervision platform. As long as it is convenient for users to obtain abnormal items intuitively and quickly, they are all within the protection scope of this application.
[0044] Optionally, the adjustment method for abnormal items is obtained through the supervision platform, including: receiving the user's adjustment mode on the supervision platform, where the adjustment mode includes automatic adjustment and manual adjustment; when the adjustment mode is determined to be automatic adjustment, querying from the storage space of the supervision platform according to the abnormal items to obtain the adjustment method; when the adjustment mode is determined to be manual adjustment, opening the adjustment method input port, and receiving the adjustment method input by the user through the adjustment method input port.
[0045] Among them, in this embodiment, after the abnormal project is displayed on the supervision platform, the adjustment method for the abnormal project can be obtained based on the supervision platform, and the adjustment method can be obtained by automatic adjustment and manual adjustment. For example, when it is determined that the abnormal project has appeared in the history, since the adjustment method corresponding to the abnormal project has been recorded in the storage space of the supervision platform, the user can choose the automatic adjustment mode to obtain the adjustment method saved in the history from the storage space; and when it is determined that the abnormal project appears for the first time, the user can choose the manual adjustment mode for customization, that is, open the adjustment method input port, and the user can input the customized adjustment method through the input port. The specific type of the input port is not limited in this embodiment.
[0046] Step S104: adjusting the abnormal items using an adjustment method.
[0047] Specifically, in this embodiment, after obtaining the adjustment method corresponding to the abnormal item, the abnormal item can be adjusted by the adjustment method. For example, when the abnormal item is an SQL statement, the corresponding adjustment method can be to delete the specified field in the SQL statement to simplify the SQL statement; when the abnormal item is a table partition, the corresponding adjustment method can be to divide the target table into partitions according to the specified range; when the abnormal item is a table fragment, the corresponding adjustment method is to merge the number of specified types in the table to reduce the number of data blocks. Of course, this embodiment is only an example, and does not limit the specific adjustment method of the abnormal item.
[0048] In the implementation mode of the present application, the database is detected in an automated manner, and the operating items of the database are automatically detected by rule matching to find abnormal items, and the corresponding adjustment methods are obtained to automatically adjust the abnormal items, so as to quickly discover problems in the operation of the database and solve database operation problems.
[0049] Embodiment 2
[0050] Figure 2 This is a flow chart of a database detection method provided by Embodiment 2 of the present invention. This embodiment is based on the above embodiment and further includes testing the adjustment results of the abnormal items after the abnormal items are adjusted by the adjustment method. Figure 2 As shown, the method includes:
[0051] Step S201, determining the running items to be detected in the database.
[0052] Optionally, determining the running items to be tested in the database includes: displaying a project detection interface when it is determined that a database detection request has been received, wherein the project detection interface includes running items to be selected that are associated with the database operation; receiving a selection instruction input by the user in the project detection interface, and determining the running items to be tested from the project detection interface according to the selection instruction.
[0053] Step S202: determine the detection rules matched by each running item, and use the matched detection rules to detect each running item to obtain abnormal items with faults.
[0054] Optionally, a matching detection rule is used to detect each running project to obtain abnormal projects with faults, including: obtaining the project running parameters corresponding to each running project during the operation of the database; for each running project, the corresponding project running parameters are verified with reference to the matching detection rules, and when it is determined that the project running parameters hit the detection rules, it is determined that there is a fault in the running project; and the running project with faults is treated as an abnormal project.
[0055] Step S203: Send the abnormal items to the supervision platform for display, and obtain the adjustment method for the abnormal items through the supervision platform.
[0056] Optionally, the abnormal items are sent to the supervision platform for display, including: obtaining the risk level corresponding to the abnormal items; determining the display serial number according to the risk level, sending the abnormal items to the supervision platform and displaying them in sequence according to the display serial number.
[0057] Optionally, the adjustment method for abnormal items is obtained through the supervision platform, including: receiving the user's adjustment mode on the supervision platform, where the adjustment mode includes automatic adjustment and manual adjustment; when the adjustment mode is determined to be automatic adjustment, querying from the storage space of the supervision platform according to the abnormal items to obtain the adjustment method; when the adjustment mode is determined to be manual adjustment, opening the adjustment method input port, and receiving the adjustment method input by the user through the adjustment method input port.
[0058] Step S204: adjusting the abnormal items using an adjustment method.
[0059] Step S205, testing the adjustment results of the abnormal items.
[0060] Optionally, the adjustment results of the abnormal items are tested, including: re-running the database to test the adjusted abnormal items; determining whether the adjusted abnormal items pass the test, if so, generating an adjustment completion indication and sending it to the supervision platform, otherwise, generating an adjustment failure indication and sending it to the supervision platform.
[0061] Specifically, in this embodiment, after the abnormal item is adjusted by the adjustment method, the adjustment result of the abnormal item will be tested. The test time is specifically performed by re-running the database and testing the adjusted abnormal item. For example, when the abnormal item is determined to be a table fragment, and it is determined through detection that the fragmentation rate corresponding to the table fragment item after adjustment is reduced to 40%, then it is determined that the abnormal item has passed the test. If the fragmentation rate does not decrease but rises to 60% or remains unchanged, it is determined that the abnormal item has failed the test.
[0062] Among them, in order to ensure that the user can accurately determine whether the adjustment is successful, indication information will be generated according to the test results. For example, when it is determined that the test has passed, an indication of "fragmentation rate adjustment completed" is generated, and when it is determined that the test has not passed, an indication of "fragmentation rate adjustment failed" is generated. Of course, other types of indication information can also be used in this embodiment. For example, different types of lights can be used for indication. For example, a green light can be displayed when the test passes, and a red light can be displayed when the test fails. This is only an example in this embodiment. The specific type of indication information is not limited in this embodiment. As long as it is convenient for the user to accurately obtain the specific circumstances of the test, it is within the scope of protection of this application.
[0063] In the implementation mode of the present application, the database is detected in an automated manner, and the operating items of the database are automatically detected by rule matching to find abnormal items, and the corresponding adjustment methods are obtained to automatically adjust the abnormal items, so as to quickly discover problems in the operation of the database and solve database operation problems.
[0064] Embodiment 3
[0065] Figure 3 This is a schematic diagram of the structure of a database detection device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a running project determination module 310, an abnormal project determination module 320, an adjustment method acquisition module 330 and an abnormal project adjustment module 340.
[0066] The running item determination module 310 is used to determine the running items to be detected in the database.
[0067] Among them, the running items include SQL statements, transactions, table partitions, sequence tables, logs, and table fragments;
[0068] The abnormal item determination module 320 is used to determine the detection rules matched by each running item, and use the matched detection rules to detect each running item to obtain abnormal items with faults;
[0069] The adjustment method acquisition module 330 is used to send the abnormal items to the supervision platform for display, and obtain the adjustment method for the abnormal items through the supervision platform;
[0070] The abnormal item adjustment module 340 is used to adjust the abnormal items using an adjustment method.
[0071] Optionally, an operation project determination module is used to display a project detection interface when it is determined that a database detection request has been received, wherein the project detection interface includes to-be-selected operation projects associated with database operation;
[0072] Receive a selection instruction input by the user in the project detection interface, and determine the running project to be detected from the project detection interface according to the selection instruction.
[0073] Optionally, the abnormal project determination module includes: a project operation parameter acquisition unit, which is used to acquire the project operation parameters corresponding to each operation project during the operation of the database;
[0074] A rule verification unit is used to verify the corresponding project operation parameters of each running project with reference to the matching detection rules, and when it is determined that the project operation parameters hit the detection rules, it is determined that there is a fault in the running project;
[0075] The abnormal item determination unit is used to identify the operating items with faults as abnormal items.
[0076] Optionally, a project running parameter acquisition unit is used to acquire the SQL statement execution time corresponding to the SQL statement project during the database running process;
[0077] Get the number of transactions corresponding to the transaction items during database operation;
[0078] Obtain the table data volume and partition status corresponding to the table partition items during database operation;
[0079] Obtain the cache table step length corresponding to the sequence table item during database operation;
[0080] Get the error log corresponding to the log item during database operation;
[0081] Gets the table fragmentation rate corresponding to the table fragmentation item during database operation.
[0082] Optionally, the detection rule matched by the SQL statement item is that the SQL statement execution time is greater than the first value;
[0083] The detection rule matched by the transaction item is that the number of transactions is greater than the second value;
[0084] The detection rule matched by the table partition item is that the table data volume is greater than the third value and the partition status is no partition;
[0085] The detection rule matched by the sequence table item is that the cache table step length is less than the fourth value;
[0086] The detection rule corresponding to the log item is that there is a deadlock error in the error log;
[0087] The detection rule corresponding to the table fragmentation item is that the table fragmentation rate is greater than the fifth value.
[0088] Optionally, the adjustment method acquisition module includes a display unit for acquiring the risk level corresponding to the abnormal item;
[0089] The display sequence number is determined according to the risk level, and the abnormal items are sent to the supervision platform and displayed in sequence according to the display sequence number.
[0090] Optionally, the adjustment mode acquisition module includes an adjustment mode acquisition unit, which is used to receive the user's adjustment mode on the supervision platform, wherein the adjustment mode includes automatic adjustment and manual adjustment;
[0091] When the adjustment mode is determined to be automatic adjustment, the adjustment method is obtained by querying the storage space of the supervision platform according to the abnormal items;
[0092] When it is determined that the adjustment mode is manual adjustment, the adjustment mode input port is opened to receive the adjustment mode input by the user through the adjustment mode input port.
[0093] Optionally, the device further comprises a testing module for re-running the database to test the adjusted abnormal items;
[0094] Determine whether the adjusted abnormal items have passed the test. If so, generate an adjustment completion indication and send it to the supervision platform. Otherwise, generate an adjustment failure indication and send it to the supervision platform.
[0095] The telephone banking service breakpoint processing device provided in the embodiment of the present invention can execute the telephone banking service breakpoint processing method provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. The database is detected in an automated manner, and the operation items of the database are automatically detected by rule matching to find abnormal items, and the corresponding adjustment method is obtained to automatically adjust the abnormal items, so as to quickly find problems in the operation process of the database and solve the database operation problems.
[0096] Embodiment 4
[0097] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0098] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0099] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0100] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a database detection method.
[0101] In some embodiments, the detection method applied to the database may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the detection method of the database described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the detection method of the database in any other appropriate manner (e.g., by means of firmware).
[0102] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0103] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0104] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0105] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0106] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by 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), a blockchain network, and the Internet.
[0107] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0108] Embodiment 5
[0109] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the database detection method provided in any embodiment of the present application.
[0110] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0111] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0112] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A database detection method, characterized in that: include: Determine the running items to be detected in the database, wherein the running items include SQL statements, transactions, table partitions, sequence tables, logs, and table fragments; Determine the detection rules matched by each of the running items, and use the matched detection rules to detect each of the running items to obtain abnormal items with faults; Sending the abnormal item to the supervision platform for display, and obtaining the adjustment method for the abnormal item through the supervision platform; The abnormal item is adjusted using the adjustment method.
2. The method according to claim 1, characterized in that The step of determining the running items to be detected in the database includes: When it is determined that a database detection request is received, a project detection interface is displayed, wherein the project detection interface includes a selectable operation project associated with the database operation; A selection instruction input by a user in the project detection interface is received, and the running project to be detected is determined from the project detection interface according to the selection instruction.
3. The method according to claim 1, characterized in that The detecting and obtaining abnormal items with faults by using the matching detection rules for each of the running items includes: Obtaining the project operation parameters corresponding to each of the operation projects during the operation of the database; For each of the running items, the corresponding project running parameters are checked with reference to the matching detection rules, and when it is determined that the project running parameters hit the detection rules, it is determined that the running item has a fault; The operating item having a fault is regarded as the abnormal item.
4. The method according to claim 3, characterized in that The obtaining of the project operation parameters corresponding to each of the operation projects during the operation of the database includes: Get the SQL statement execution time corresponding to the SQL statement item during database operation; Get the number of transactions corresponding to the transaction items during database operation; Obtain the table data volume and partition status corresponding to the table partition items during database operation; Obtain the cache table step length corresponding to the sequence table item during database operation; Get the error log corresponding to the log item during database operation; Gets the table fragmentation rate corresponding to the table fragmentation item during database operation.
5. The method according to claim 4, characterized in that The detection rule matched by the SQL statement item is that the SQL statement execution time is greater than the first value; The detection rule matched by the transaction item is that the number of transactions is greater than a second value; The detection rule matched by the table partition item is that the table data volume is greater than a third value and the partition state is no partition; The detection rule matched by the sequence table item is that the cache table step length is less than a fourth value; The detection rule corresponding to the log item is that there is a deadlock error in the error log; The detection rule corresponding to the table fragmentation item is that the table fragmentation rate is greater than a fifth value.
6. The method according to claim 1, characterized in that The sending of the abnormal item to the supervision platform for display includes: Obtaining the risk level corresponding to the abnormal item; A display serial number is determined according to the risk level, and the abnormal items are sent to the supervision platform and displayed in sequence according to the display serial number.
7. The method according to claim 1, characterized in that The obtaining, through the regulatory platform, an adjustment method for the abnormal item includes: Receiving, on the supervision platform, an adjustment mode of the user, wherein the adjustment mode includes automatic adjustment and manual adjustment; When it is determined that the adjustment mode is automatic adjustment, querying the storage space of the supervision platform to obtain the adjustment method according to the abnormal item; When it is determined that the adjustment mode is manual adjustment, the adjustment mode input port is opened to receive the adjustment mode input by the user through the adjustment mode input port.
8. The method according to claim 5, characterized in that After the abnormal item is adjusted by the adjustment method, the method further includes: re-running the database to test the adjusted abnormal items; Determine whether the abnormal item after adjustment has passed the test. If so, generate an adjustment completion indication and send it to the supervision platform. Otherwise, generate an adjustment failure indication and send it to the supervision platform.
9. A database detection device, characterized in that: The device comprises: An operation item determination module is used to determine the operation items to be detected in the database, wherein the operation items include SQL statements, transactions, table partitions, sequence tables, logs and table fragments; An abnormal item determination module is used to determine the detection rules matched by each of the running items, and use the matched detection rules to detect each of the running items to obtain abnormal items with faults; An adjustment method acquisition module, used to send the abnormal item to the supervision platform for display, and obtain the adjustment method for the abnormal item through the supervision platform; The abnormal item adjustment module is used to adjust the abnormal item by adopting the adjustment method.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method according to any one of claims 1 to 8 when executed.
12. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.