Automatic detection method and device for database connection abnormal condition, medium and product
By automatically detecting database connection anomalies, calculating performance metrics, and outputting optimization suggestions, the problem of resource waste caused by frequent short connections is solved, and efficient database anomaly management is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CETC JINCANG (BEIJING) TECH CO LTD
- Filing Date
- 2026-01-23
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, applications frequently establish and release database connections with extremely short lifespans, leading to a waste of database server resources, impacting response performance and business continuity, and lacking timely optimization methods.
By acquiring database connection data within a preset time period, performance metrics such as the average number of new connections per second and the proportion of short connections are calculated. Abnormal situations are automatically detected, and alarms and optimization suggestions are output, including measures such as establishing a connection pool.
It enables automatic detection and optimization of abnormal database connection situations, reduces reliance on manual labor, improves detection and optimization efficiency, and can quickly identify and respond to abnormal connection patterns.
Smart Images

Figure CN121833447A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of database technology, and in particular to an automatic detection method, device, medium, and product for database connection anomalies. Background Technology
[0002] In modern database service architectures, efficient and stable interaction between applications and databases is the cornerstone of business continuity. Database connections are a critical and scarce resource, and their establishment, maintenance, and destruction processes consume considerable CPU (Central Processing Unit), memory, and network resources of the database server.
[0003] In real-world database application environments, a common anomaly occurs: applications initiate and release a large number of short-lived database connections within a very short period. This abnormal connection behavior pattern causes the database server to consume significant computing resources on non-core auxiliary operations such as connection establishment, authentication, and destruction, rather than performing substantive data queries or transaction processing. This leads to a sharp decline in database response performance, limited overall processing capacity, and even service unavailability, severely impacting business systems. Current technologies require operations personnel to proactively query and rely on experience to determine the presence of this anomaly and decide whether database optimization is necessary, resulting in untimely database optimization. Summary of the Invention
[0004] One object of the present invention is to provide an automatic detection method, device, medium and product for database connection anomalies that can automatically detect database anomalies.
[0005] Specifically, the present invention provides an automatic detection method for database connection anomalies, comprising: Obtain raw data of database connections within a preset time period, the raw data including the start time and current connection status of all database connections within the preset time period; The database's preset performance indicators are calculated based on the raw data. The preset performance indicators include the average number of new connections per second and the average proportion of new short connections per second. The short connections are database connections with a lifespan of less than a preset time threshold. Based on the preset performance indicators, determine whether there are any connection anomalies in the database; If a connection anomaly is detected, an alarm message and preset optimization suggestions will be output. The alarm message includes the calculated preset performance indicators, and the preset optimization suggestions include establishing a connection pool.
[0006] Optionally, the step of determining whether there is a connection anomaly in the database based on the preset performance indicators includes: The system checks whether the average number of new connections per second has reached a first preset condition. If so, it determines that there is a connection anomaly in the database.
[0007] Optionally, the first preset condition includes the difference between the average number of new connections per second and the historical average number of new connections per second, divided by the standard deviation of the historical number of new connections per second, being greater than or equal to a preset threshold.
[0008] Optionally, the step of determining whether there is a connection anomaly in the database based on the preset performance indicators includes: The system checks whether the average rate of newly established short connections per second reaches a preset threshold. If so, it determines that there is a connection anomaly in the database.
[0009] Optionally, the raw data may also include transaction execution information corresponding to each database connection; If the short connections corresponding to slow query transactions in the short connections are detected to reach a set proportion, the preset optimization suggestions also include statement optimization suggestions for the corresponding query statements.
[0010] Optionally, the raw data may also include application information corresponding to each database connection; The alert includes information on each application's average number of new connections per second and the average percentage of new short connections per second. The preset optimization suggestions include suggestions for optimizing application code for applications with the largest number of short connections.
[0011] Optionally, the preset performance indicators also include the ratio of the total number of currently active database connections to the preset maximum allowed number of connections; The step of determining whether there is a connection anomaly in the database based on the preset performance indicators includes: The system detects whether the ratio of the current number of active database connections to the preset maximum allowed number of connections reaches a preset ratio threshold. If so, it determines that there is a connection anomaly in the database. The preset optimization suggestions include adjusting the configuration of the maximum allowed number of database connections.
[0012] According to another aspect of the present invention, a computer device is also provided, including a memory, a processor, and a computer executable program stored in the memory and running on the processor, wherein the processor, when executing the computer executable program, implements an automatic detection method for database connection anomalies according to any of the preceding claims.
[0013] According to another aspect of the present invention, a computer-readable storage medium is also provided, on which a computer-executable program is stored, which, when executed by a processor, implements an automatic detection method for database connection anomalies according to any one of the preceding claims.
[0014] According to another aspect of the present invention, a computer program product is also provided, comprising a computer executable program that, when executed by a processor, implements an automatic detection method for database connection anomalies according to any one of the preceding claims.
[0015] The automatic detection method for database connection anomalies of the present invention acquires raw database connection data within a preset time period, calculates preset performance indicators for the database based on the raw data, determines whether connection anomalies exist based on the preset performance indicators, and outputs alarm prompts and preset optimization suggestions if connection anomalies are found. The alarm prompts include the calculated preset performance indicators, and the preset optimization suggestions include establishing a connection pool. In other words, it can achieve continuous automatic detection of database connection status, identify anomalies such as a large number of short database connections, reduce reliance on manual intervention, and help improve the efficiency of database connection detection. Furthermore, by issuing alarm prompts and preset optimization suggestions when connection anomalies are determined to exist, it achieves a leap from passive monitoring to proactive operation and maintenance, which helps improve database optimization efficiency.
[0016] The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description
[0017] The following sections will describe some specific embodiments of the invention in detail by way of example and not limitation, with reference to the accompanying drawings. The same reference numerals in the drawings denote the same or similar parts or portions. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings: Figure 1 This is a schematic flowchart of an automatic detection method for database connection anomalies according to an embodiment of the present invention; Figure 2 This is a schematic flowchart of an automatic detection method for database connection anomalies according to another embodiment of the present invention; Figure 3 yes Figure 1 This is a schematic diagram of an automatic database detection system according to an embodiment of the present invention; Figure 4 This is a schematic diagram of a computer device according to an embodiment of the present invention; Figure 5This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention; Figure 6 This is a schematic diagram of a computer program product according to an embodiment of the present invention. Detailed Implementation
[0018] Those skilled in the art should understand that the embodiments described below are merely a part of the embodiments of the present invention, and not all of the embodiments of the present invention. These partial embodiments are intended to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of the present invention.
[0019] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0020] The flowcharts provided in this invention are not intended to indicate that the operations of the method will be performed in any particular order, or that all operations of the method are included in every case. Furthermore, the method may include additional operations. Within the scope of the technical concept provided by the method in this embodiment, additional variations can be made to the above method.
[0021] like Figure 1 As shown, in one embodiment, the automatic detection method for database connection anomalies includes: Step S101: Obtain the raw data of database connections within a preset time period. The raw data includes the start time and current connection status of all database connections within the preset time period. Specifically, this means obtaining all currently active and terminated database connections. For database connections with a terminated status, the lifespan of the database connection can be determined based on the end time and start time.
[0022] Step S102: Calculate the preset performance indicators of the database based on the raw data. The preset performance indicators include the average number of new connections per second and the average percentage of new short connections per second. Short connections are database connections with a lifespan of less than a preset time threshold.
[0023] Specifically, the database connection ID (Identity Document, unique identifier) can be used to determine which database connections were newly created within the preset time period. Dividing the total number of newly created database connections by the length of the preset time period yields the average number of new connections per second.
[0024] Short connections are database connections with a lifespan of less than a preset time threshold, such as 1 second. The average number of new short connections per second is obtained by dividing the total number of newly established connections with a lifespan less than the preset time threshold by the length of a preset time period. Dividing this by the average number of new connections per second gives the percentage of new short connections per second.
[0025] Step S103: Determine whether there are any connection anomalies in the database based on preset performance indicators.
[0026] Specifically, this step includes detecting whether the average number of new connections per second reaches a first preset condition. If so, it is determined that there is a connection anomaly in the database. The first preset condition includes the difference between the average number of new connections per second and the historical average number of new connections per second, divided by the standard deviation of the historical number of new connections per second, being greater than or equal to a preset threshold. The historical average number of new connections per second is obtained from the number of new database connections within one or more preset time periods in the past.
[0027] For example, the preset threshold is 3, the historical average number of new connections per second is 5, the standard deviation is 2, the average number of new connections per second in the current preset time period is 20, (20-5) / 2=7.5, 7.5 is greater than 3, and the first preset condition is met.
[0028] It should be noted that the first preset condition can also be that the average number of new connections per second reaches a set threshold.
[0029] In another scenario, this step includes detecting whether the average percentage of newly established short connections per second reaches a preset threshold. If so, it is determined that there is a connection anomaly in the database. For example, the preset threshold is 60%, and the average percentage of newly established short connections per second within the current preset time period is 85%, then the preset threshold has been reached.
[0030] It should be noted that the two detection methods mentioned above can be enabled simultaneously. When both occur, the alarm level will be increased to strongly warn of a connection anomaly.
[0031] Step S104: If a connection error occurs, output an alarm message and preset optimization suggestions.
[0032] Specifically, if a database connection anomaly is detected, an alert is output, including calculated preset performance metrics. Preset optimization suggestions include establishing a connection pool. In other words, it not only alerts the user to a past database anomaly but also provides optimization suggestions for addressing the issue.
[0033] In this embodiment, raw database connection data within a preset time period is acquired, and preset performance indicators for the database are calculated based on this data. The presence of connection anomalies is then determined based on these indicators. If anomalies are found, an alarm and preset optimization suggestions are output. The alarm includes the calculated preset performance indicators, and the optimization suggestions include establishing a connection pool. In other words, continuous automatic detection of database connection status can be achieved, identifying anomalies such as a large number of short database connections. This reduces reliance on manual intervention and improves the efficiency of database connection detection. Furthermore, issuing alarms and preset optimization suggestions upon determining the presence of connection anomalies represents a leap from passive monitoring to proactive maintenance, contributing to improved database optimization efficiency.
[0034] In addition, the raw data also includes transaction execution information for each database connection. If the proportion of short connections corresponding to slow query transactions in short connections reaches a set percentage, the preset optimization suggestions also include statement optimization suggestions for the corresponding query statements.
[0035] Specifically, if slow query transactions with a large number of timeouts are detected within short connections, targeted suggestions are output for the original query statements (SQL) of these transactions. This allows for the detection of this special case of slow queries and the output of corresponding statement optimization suggestions, further improving database optimization efficiency.
[0036] Furthermore, the raw data also includes application information for each database connection, such as the client's IP address (Internet Protocol Address) and application name. Alerts include the average number of new connections per second and the percentage of short connections created per second for each application. Pre-defined optimization suggestions include recommendations for optimizing application code for the application with the highest number of short connections.
[0037] By obtaining the application information corresponding to each database connection, we can obtain the average number of new connections per second and the average proportion of new short connections per second for each application. This allows us to output optimization code suggestions for the application with the most short connections, making the detection more accurate and facilitating the rapid location and optimization of database anomalies.
[0038] In addition, the preset performance metrics also include the ratio of the total number of currently active database connections to the preset maximum allowed connections. The step of determining whether the database has connection anomalies based on the preset performance metrics includes: detecting whether the ratio of the total number of currently active database connections to the preset maximum allowed connections reaches a preset ratio threshold; if so, it is determined that the database has connection anomalies. Preset optimization suggestions include adjusting the maximum allowed database connections configuration. This allows for a more comprehensive assessment of database anomalies.
[0039] In other words, an optimization suggestion library can be generated first, including suggestions for establishing connection pools, optimizing application code, adjusting the maximum allowed number of database connections, and optimizing statements. If connection anomalies occur, appropriate optimization suggestions are selected from the library, combined, and an optimization report is generated. The optimization report is also output when alerts and preset optimization suggestions are provided.
[0040] like Figure 2 As shown, in one embodiment, the automatic detection method for database connection anomalies generally includes: Step S201, Data Collection and Metric Calculation. Specifically, data collection includes obtaining the status, start time, and application information (client IP address and application name) of all database connections within a preset time period, as well as the transaction execution information corresponding to the database connections.
[0041] The metrics calculations include the average number of new connections per second, the average percentage of new short connections per second, the average connection lifetime, and the ratio of the total number of currently active database connections to the preset maximum allowed number of connections. The average connection lifetime is the average lifetime of all currently closed connections.
[0042] Step S202: Statistical identification of connection anomalies.
[0043] Specifically, the system checks whether the average number of new connections per second reaches a first preset condition. If so, it determines that there is a connection anomaly in the database. The first preset condition includes the difference between the average number of new connections per second and the historical average number of new connections per second, divided by the standard deviation of the historical number of new connections per second, being greater than or equal to a preset threshold.
[0044] The system checks whether the average rate of newly established short connections per second has reached a preset threshold. If so, it determines that there is a connection anomaly in the database.
[0045] If both indicators meet the conditions simultaneously, it strongly suggests that there is a connection anomaly.
[0046] In addition, it checks whether the ratio of the current total number of live database connections to the preset maximum allowed number of connections reaches a preset ratio threshold. If so, it determines that there is a connection anomaly in the database.
[0047] Step S203: Root cause analysis and optimization suggestions are generated.
[0048] Based on the application's information, identify the client IP or application name that establishes the most short connections to pinpoint the source of the problem.
[0049] Generate an optimization suggestion library: Suggestion 1: Introduce connection pooling. This is the most fundamental solution. Example text: "A large number of short connections were detected. It is strongly recommended to introduce connection pooling for the application. Connection pooling maintains a fixed set of connections for the application to reuse, thereby avoiding the frequent creation and closure of connections." Recommendation 2: Optimize application code. Example text: "A short connection storm was detected from [application name / client IP]. Please check the application's database access logic to ensure that connections are closed promptly after operations are completed, and consider reusing existing connections." Recommendation 3: Adjust database configuration. Example text: "The current number of connections is approaching the maximum connection limit. In the short term, you can consider appropriately increasing the maximum connection parameter, but in the long term, you still need to solve the problem by introducing a connection pool." Recommendation 4: SQL query optimization. If analysis reveals that short connections are accompanied by a large number of identical slow queries, the example suggestion text is: "Some short connections are executing slow queries. We recommend optimizing the following SQL statements: [Example SQL]". Step S204: Output alarm prompts and optimization suggestions. Based on the abnormal situation, select the corresponding optimization suggestions from the optimization suggestion library and combine them for output.
[0050] In this embodiment, data collection and indicator calculation enable statistical identification of connection anomalies, followed by cause analysis and optimization suggestion generation, ultimately outputting alarm prompts and optimization recommendations. This achieves automated and intelligent identification of abnormal database connections. By automatically collecting connection data and calculating multi-dimensional performance indicators, and performing comprehensive analysis based on multiple statistical dimensions, continuous proactive monitoring is achieved, significantly reducing reliance on the experience of maintenance personnel and labor costs.
[0051] By employing a comprehensive judgment logic based on multiple thresholds and indicators, combined with time series trend analysis, it is possible to effectively distinguish between normal business pressure peaks and harmful abnormal connection patterns, greatly reducing false alarms and false negatives caused by single indicators, and significantly improving the accuracy and reliability of anomaly identification. It also enables rapid location of the causes of anomalies.
[0052] Furthermore, by automatically generating targeted optimization suggestions, the system achieves a leap from passive monitoring to proactive diagnostic maintenance, shifting the response from "manual discovery and investigation" to "system early warning and decision support," significantly shortening the average time for fault location and repair. It also provides standardized and reusable solutions. By establishing a structured optimization suggestion library, the system can solidify best practices into standard outputs, avoiding the inconsistent quality of solutions that often varies from person to person in traditional methods, thus improving the standardization and maturity of the overall maintenance system.
[0053] like Figure 3 As shown, in one embodiment, the automatic database detection system includes a data acquisition module 10, an indicator calculation module 20, an anomaly detection engine 30, a suggestion generation module 40, and an alarm and report output module 50. The data acquisition module 10 is used to periodically collect raw data on database connections within a preset time period from the target database. The indicator calculation module 20 is used to calculate preset performance indicators based on the collected raw data on database connections. The anomaly detection engine 30 is used to judge the database connection status based on the preset performance indicators. The suggestion generation module 40 is used to select and combine suggestions from an optimization suggestion library to generate a final optimization report when database connection anomalies are found. The alarm and report output module 50 is used to notify the user of the detection results and optimization suggestions.
[0054] For example, when a connection anomaly is detected, the following message is output: Root cause analysis: Analysis revealed that 80% of the connections originated from application App-Service-A on IP address 192.168.1.100.
[0055] Alert Level: Severe Problem Description: An abnormal database connection was detected from application App-Service-A (IP: 192.168.1.100). In the past minute, the average rate of newly established connections reached 20 per second, of which 85% were short connections (lifetime < 1 second).
[0056] Optimization suggestions: First recommendation: Configure and enable database connection pooling for App-Service-A.
[0057] Inspect the database access code of App-Service-A to ensure that the connection is properly closed after use, and try to reuse the connection.
[0058] Monitor the total number of database connections to ensure that it does not exceed the maximum connection limit.
[0059] This embodiment also provides a computer device and a computer-readable storage medium. Figure 4 This is a schematic diagram of a computer device 10 according to an embodiment of the present invention. Figure 5 This is a schematic diagram of a computer-readable storage medium 20 according to an embodiment of the present invention.
[0060] The computer device 10 may include a memory 110, a processor 120, and a computer-executable program 11 stored on the memory 110 and running on the processor 120. When the processor 120 executes the computer-executable program 11, it implements the automatic detection method for database connection anomalies in any of the above embodiments.
[0061] The computer-readable storage medium 20 stores a computer-executable program 11 thereon, which, when executed by a processor, implements the automatic detection method for database connection anomalies in any of the above embodiments.
[0062] This embodiment also provides a computer program product. Figure 6 This is a schematic diagram of a computer program product 30 according to an embodiment of the present invention. The computer program product 30 includes a computer executable program 11, which, when executed by a processor 120, implements any of the database connection anomaly detection methods described above.
[0063] Specifically, the computer executable program 11 used to perform the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, computer instructions, computer-related instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages.
[0064] For the purposes of this embodiment, the computer-readable storage medium 20 can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, the computer-readable storage medium 20 can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0065] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system.
[0066] Computer device 10 can be, for example, a server, desktop computer, laptop computer, tablet computer, or smartphone. In some examples, computer device 10 can be a cloud acquisition node. Computer device 10 can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., that perform specific tasks or implement specific abstract data types. Computer device 10 can be implemented in a distributed cloud acquisition environment where tasks are performed by remote processing devices linked via a communication network. In a distributed cloud acquisition environment, program modules can reside on local or remote acquisition system storage media, including storage devices.
[0067] Computer device 10 may include a processor 120 adapted to execute stored instructions and a memory 110 that provides temporary storage space for the operation of said instructions during operation. Processor 120 may be a single-core processor, a multi-core processor, an acquisition cluster, or any other configuration. Memory 110 may include random access memory (RAM), read-only memory, flash memory, or any other suitable storage system.
[0068] The processor 120 can be connected via a system interconnect (e.g., PCI, PCI-Express, etc.) to an I / O interface (input / output interface) suitable for connecting the computer device 10 to one or more I / O devices (input / output devices). I / O devices may include, for example, a keyboard and indicating devices, where indicating devices may include a touchpad or touchscreen, etc. I / O devices may be built into the computer device 10 or may be external devices connected to the acquisition device.
[0069] The processor 120 may also be linked via a system interconnect to a display interface suitable for connecting the computer device 10 to a display device. The display device may include a display screen that is a built-in component of the computer device 10. The display device may also include an external computer monitor, television, or projector connected to the computer device 10. Furthermore, a network interface controller (NIC) may be adapted to connect the computer device 10 to a network via a system interconnect. In some embodiments, the NIC may use any suitable interface or protocol (such as an Internet Minicomputer System Interface) to transmit data. The network may be a cellular network, a radio network, a wide area network (WAN), a local area network (LAN), or the Internet, etc. Remote devices may connect to the computer device via the network.
[0070] Therefore, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications conforming to the principles of the present invention can be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Thus, the scope of the present invention should be understood and construed as covering all such other variations or modifications.
Claims
1. An automatic detection method for database connection anomalies, comprising: Obtain raw data of database connections within a preset time period, the raw data including the start time and current connection status of all database connections within the preset time period; The database's preset performance indicators are calculated based on the raw data. The preset performance indicators include the average number of new connections per second and the average proportion of new short connections per second. The short connections are database connections with a lifespan of less than a preset time threshold. Based on the preset performance indicators, determine whether there are any connection anomalies in the database; If a connection anomaly is detected, an alarm message and preset optimization suggestions will be output. The alarm message includes the calculated preset performance indicators, and the preset optimization suggestions include establishing a connection pool.
2. The automatic detection method for database connection anomalies according to claim 1, wherein... The step of determining whether there is a connection anomaly in the database based on the preset performance indicators includes: The system checks whether the average number of new connections per second has reached a first preset condition. If so, it determines that there is a connection anomaly in the database.
3. The automatic detection method for database connection anomalies according to claim 2, wherein... The first preset condition includes the difference between the average number of new connections per second and the historical average number of new connections per second, divided by the standard deviation of the historical number of new connections per second, being greater than or equal to a preset threshold.
4. The automatic detection method for database connection anomalies according to claim 1, wherein... The step of determining whether there is a connection anomaly in the database based on the preset performance indicators includes: The system checks whether the average rate of newly established short connections per second reaches a preset threshold. If so, it determines that there is a connection anomaly in the database.
5. The automatic detection method for database connection anomalies according to claim 1, wherein... The raw data also includes transaction execution information corresponding to each database connection; If the short connections corresponding to slow query transactions in the short connections are detected to reach a set proportion, the preset optimization suggestions also include statement optimization suggestions for the corresponding query statements.
6. The automatic detection method for database connection anomalies according to claim 1, wherein... The raw data also includes application information corresponding to each database connection; The alert includes information on each application's average number of new connections per second and the average percentage of new short connections per second. The preset optimization suggestions include suggestions for optimizing application code for applications with the largest number of short connections.
7. The automatic detection method for database connection anomalies according to claim 1, wherein... The preset performance indicators also include the ratio of the total number of currently active database connections to the preset maximum allowed number of connections; The step of determining whether there is a connection anomaly in the database based on the preset performance indicators includes: The system detects whether the ratio of the current number of active database connections to the preset maximum allowed number of connections reaches a preset ratio threshold. If so, it determines that there is a connection anomaly in the database. The preset optimization suggestions include adjusting the configuration of the maximum allowed number of database connections.
8. A computer device comprising a memory, a processor, and a computer-executable program stored in the memory and running on the processor, wherein the processor, when executing the computer-executable program, implements an automatic detection method for database connection anomalies according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer-executable program stored thereon, wherein the computer-executable program, when executed by a processor, implements the automatic detection method for database connection anomalies according to any one of claims 1 to 7.
10. A computer program product comprising a computer executable program, wherein the computer executable program, when executed by a processor, implements the automatic detection method for database connection anomalies according to any one of claims 1 to 7.