An AI-driven control system database detection method
By extracting complex features from database runtime data and analyzing logs, the database compatibility inconsistency tendency is assessed, solving the problems of incomplete detection and low efficiency in existing technologies, and achieving more accurate and flexible database compatibility detection.
Patent Information
- Application Number
- CN202511100201.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-08-07
AI Technical Summary
Existing technologies rely on predefined rules for database compatibility testing, which suffers from false positives and false negatives. The testing is not comprehensive enough and is inefficient, and it cannot effectively identify anomalies during the interactive process.
By storing database operation data, extracting complex characteristics of transactions, and combining transaction count and log analysis, assess compatibility inconsistency tendencies, and using interference operation characterization coefficients and execution efficiency deviation values to determine whether integration testing should be performed, thereby improving the accuracy and comprehensiveness of detection.
This approach enables more comprehensive and flexible database compatibility performance testing while maintaining testing efficiency, improving testing accuracy and ensuring stable interaction between the database and the application, as well as data integrity.
Smart Images

Figure CN120994551B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of control system database detection, and in particular to an AI-driven control system database detection method. BACKGROUND
[0002] Modern application control systems are usually composed of multiple modules and components, and may involve multiple programming languages and technical frameworks. These application control systems are closely integrated with databases to realize storage, query and processing of a large amount of data, and maintenance of the database is crucial. When the application system is upgraded, migrated or integrated with other systems, the compatibility of the database needs to be ensured. If the database compatibility problem occurs, it may cause data loss, query result error, system crash and other problems of the application system, and affect the normal operation of the business.
[0003] Especially, during the data migration process, database compatibility detection is more needed to ensure the integrity and consistency of the data. The data types, storage structures and index mechanisms of different database systems may be different. In order to ensure the stability and reliability of the application in different platforms and database environments, compatibility detection is needed to find and solve these differences, and ensure the smooth progress of data migration.
[0004] Chinese patent application publication No. CN117216029A discloses a data migration compatibility detection method and terminal. When the access address of the received database statement is the first database, the access address of the database statement is modified to the address of the database proxy server. In this way, the database statement originally accessing the first database can be transferred to the database proxy server for processing. The database statement is sent to the message middleware through the database proxy server, and the database statement is executed in the second database by the consumer of the message middleware. If the second database fails to execute, the database statement is stored in the database statement incompatibility list. Therefore, the database statement can be sent to the second database through the proxy server and the message middleware, and the database statement incompatibility list can be automatically generated according to the execution in the second database, thereby improving the efficiency of migration compatibility detection.
[0005] However, the prior art still has the following problems,
[0006] The evaluation dimension is single, and false positives and false negatives may occur due to the limitations of the rules. In addition, the detection is not comprehensive and the detection efficiency is not good due to the limitation of basic syntax and common data types and other simple features, and the abnormality reflected in the interactive operation process is ignored. SUMMARY
[0007] To this end, the application provides an AI-driven control system database detection method to overcome the problem of the prior art that the evaluation dimension is single and there are false positives and false negatives due to rule limitations, and the detection is not comprehensive and the detection efficiency is poor due to the limitation of basic grammar and common data types and the neglect of abnormalities reflected in the interactive running process.
[0008] To achieve the above-mentioned purpose, the application provides an AI-driven control system database detection method, which comprises:
[0009] Store the running data of a plurality of databases to extract the complex features of a plurality of transactions, wherein the complex features include the number of transaction operation commands and the number of associated forms;
[0010] Determine the compatibility imbalance tendency representation value of the database by combining the number of transactions performed on the database within a predetermined time period and the complex features of each of the transactions, and label each of the databases;
[0011] According to the labeling result, call the log record of the corresponding database for detection analysis, including analyzing the execution process of a plurality of completed transactions in the log record, determining the transaction abnormal frequency time domain segment, obtaining the processing accuracy rate of the application program interacting with the database within the transaction abnormal frequency time domain segment, and analyzing the interference running representation coefficient of the database by combining the damage degree of the data processed by the application program;
[0012] Evaluate whether the running of the database conforms to the running deviation fault tolerance threshold based on the interference running representation coefficient, obtain the execution efficiency deviation value of the same transaction, and determine whether to perform integrated testing on the database.
[0013] Further, the process of determining the compatibility imbalance tendency representation value of the database by combining the number of transactions performed on the database within a predetermined time period and the complex features of each of the transactions comprises:
[0014] The ratio of the number of transactions performed on the database to the transaction number threshold is taken as the first imbalance tendency feature;
[0015] The sum of the ratio of the mean value of the number of transaction operation commands to the mean value of the number of transaction operation commands and the ratio of the number of associated forms to the number of associated forms threshold is taken as the second imbalance tendency feature;
[0016] The weighted sum of the first imbalance tendency feature and the second imbalance tendency feature is taken as the compatibility imbalance tendency representation value.
[0017] Further, labeling each of the databases comprises:
[0018] If there is any database compatibility imbalance tendency characterization value greater than or equal to the compatibility imbalance tendency characterization threshold value, the database is marked as a compatibility imbalance database.
[0019] Further, according to the marking result, the log record of the corresponding database is called for detection analysis, including:
[0020] If the database is marked as a compatibility imbalance database, the log record of the corresponding database is called for detection analysis.
[0021] Further, the process of determining the transaction abnormal frequency time domain segment includes:
[0022] The execution process of the completed transaction is analyzed, including recording the corresponding intermediate node time of the completed transaction, and determining transaction error event data, transaction rollback event data and transaction blocking event data of the completed transaction.
[0023] Corresponding transaction error time domain curve, transaction rollback time domain curve and transaction blocking time domain curve are respectively constructed.
[0024] If the slope of any time domain segment of any of the time domain curves is greater than the slope threshold value, the time domain segment is determined as the transaction abnormal frequency time domain segment.
[0025] Further, the process of analyzing the interference operation characterization coefficient of the database includes:
[0026] The ratio of the processing accuracy threshold value to the processing accuracy of the application program interacting with the database is taken as a first interference operation feature.
[0027] The ratio of the damage degree of the data processed by the application program to the damage degree threshold value is taken as a second interference operation feature.
[0028] The sum of the first interference operation feature and the second interference operation feature is taken as the interference operation characterization coefficient.
[0029] Further, based on the interference operation characterization coefficient, it is determined whether the operation of the database conforms to the operation deviation fault tolerance threshold, including:
[0030] If the interference operation characterization coefficient of the database is greater than or equal to the interference operation characterization coefficient threshold value, the operation of the database is evaluated as not conforming to the operation deviation fault tolerance threshold.
[0031] Further, it further includes:
[0032] If there is any database operation that does not conform to the operation deviation fault tolerance threshold, the execution efficiency deviation value for the same transaction is obtained to determine whether to perform integrated testing on the database.
[0033] Further, determining whether to perform integration testing on the database comprises:
[0034] If the execution efficiency deviation value of the database performing the same transaction is greater than the execution efficiency deviation threshold value, it is determined to perform integration testing on the database.
[0035] Further, it also comprises:
[0036] The damage degree is determined based on the number of lost data packets, the number of out-of-order data packets, and the number of content error data packets.
[0037] Compared with the prior art, the application stores the running data of a plurality of databases to extract the complexity features of a plurality of transactions; determines the compatibility disorder tendency representation value of the database by combining the number of transactions performed on the database within a predetermined time period and the complexity features of the corresponding transactions, and labels each database; according to the labeling result, calls the log record of the corresponding database for detection and analysis; and based on the interference running representation coefficient, evaluates whether the running of the database meets the running deviation fault tolerance threshold, and obtains the execution efficiency deviation value for the same transaction, to determine whether to perform integration testing on the database. The application is more comprehensive and flexible in detecting the compatibility performance of the database under the premise of ensuring the detection efficiency of database compatibility exceptions, and improves the accuracy of detection.
[0038] Especially, the application considers the concurrent pressure on the database caused by the operation of the transaction, and the number of transactions for the database increases significantly within a certain time, which may lead to an increase in concurrent operations of the database. When the processing capacity of the database system is limited, too many concurrent transactions may cause resource competition, and thus problems such as performance degradation and long response time of the database may occur, and even the compatibility with other systems or applications may be affected. At the same time, the number of operations corresponding to the transaction is considered. A large number of transaction operation commands means that the logical complexity of the transaction is high. Complex transactions may require more system resources to process, and may involve multiple database objects and operation steps during the execution process. If the processing capacity of the database system for complex transactions is insufficient, execution errors or performance degradation may occur. In addition, the number of data forms associated with the transaction can indicate the complexity of the relationship between the data forms involved in the transaction. When processing associated data, the database needs to ensure the consistency and integrity of the data. If the database makes a mistake when processing multi-table associated transactions, it may lead to inconsistent data, which may affect the reading and processing of the data by the application program, and thus cause compatibility disorder. Therefore, based on the analysis of the above-mentioned characteristic features, the compatibility disorder tendency representation value is used to represent the tendency degree of the compatibility disorder of the database, which provides data support for subsequent labeling of the database. The application is more comprehensive and flexible in detecting the compatibility performance of the database under the premise of ensuring the detection efficiency of database compatibility exceptions, and improves the accuracy of detection.
[0039] Especially, when detecting and analyzing the compatibility imbalance database, the application focuses on the time domain segment when transaction anomalies frequently occur. Since the compatibility imbalance problem of the database often does not exist in isolation, it affects the normal operation of the application program interacting with it. Based on this, the running condition of the database is combined with the performance of the application program. The interaction operation behavior between the database and the application program reflects the severity of the compatibility imbalance of the database. The processing accuracy of the application program reflects the stability of the data interaction between the database and the application program, and is directly related to the normal operation of the business functions involved in the scope of the application program. If the processing accuracy is reduced, it can be explained that the compatibility imbalance problem of the database has a negative impact on the application program. The data damage degree measures the degree of damage to the integrity of the data. In serious cases, it will affect the correct processing and analysis of the data by the application program, and reduce the availability and reliability of the data. By quantitatively analyzing the damage degree of the data, the evaluation can be more accurate. Therefore, the application represents the interference influence degree of the data and the application program caused by the compatibility imbalance of the database and the severity of the compatibility imbalance of the database by interfering with the running representation coefficient, and provides data support for subsequent evaluation of whether the running of the database meets the running deviation fault tolerance threshold. The application is more comprehensive and flexible in detecting the compatibility performance of the database under the premise of ensuring the detection efficiency of the database compatibility anomaly, and improves the accuracy of the detection.
[0040] Especially, the application considers whether the compatibility imbalance of the database is within the allowed range. The execution efficiency deviation value of the same transaction directly reflects the performance stability of the database running, so as to further determine whether to perform integrated testing on the database. The application is more comprehensive and flexible in detecting the compatibility performance of the database under the premise of ensuring the detection efficiency of the database compatibility anomaly, and improves the accuracy of the detection. BRIEF DESCRIPTION OF DRAWINGS
[0041] Figure 1 The step schematic diagram of the AI-driven control system database detection method of the application embodiment;
[0042] Figure 2 The logical decision diagram for marking each database of the application embodiment;
[0043] Figure 3 The logical decision diagram for evaluating whether the running of the database meets the running deviation fault tolerance threshold of the application embodiment;
[0044] Figure 4 The logical decision diagram for determining whether to perform integrated testing on the database of the application embodiment. DETAILED DESCRIPTION
[0045] In order to make the objects and advantages of the present application more clear, the present application will be further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.
[0046] The preferred embodiments of the present application will be described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and not to limit the protection scope of the present application.
[0047] Please refer to Figure 1 As shown in the figure, it is a step schematic diagram of the AI-driven control system database detection method of the embodiment of the present application, the AI-driven control system database detection method of the embodiment of the present application comprises:
[0048] Step S1, store the running data of a plurality of databases to extract the complex features of a plurality of transactions, the complex features including the number of transaction operation commands and the number of associated forms;
[0049] Step S2, determine the compatibility disorder tendency representation value of the database in combination with the number of transactions performed on the database within a predetermined time period and the complex features of each of the transactions, and label each of the databases;
[0050] Step S3, according to the labeling result, call the log record of the corresponding database for detection analysis, including analyzing the execution process of a plurality of completed transactions in the log record, determining the transaction abnormal frequency time domain segment, obtaining the processing accuracy rate of the application program interacting with the database within the transaction abnormal frequency time domain segment, and analyzing the interference operation representation coefficient of the database in combination with the damage degree of the data processed by the application program;
[0051] Step S4, evaluate whether the running of the database conforms to the running deviation fault tolerance threshold based on the interference operation representation coefficient, obtain the execution efficiency deviation value of the same transaction, and determine whether to perform integrated testing on the database.
[0052] Specifically, the database transaction refers to a sequence of operations, which contains a group of operations on the database, the transaction is executed as a whole, and all the operations on the database contained therein are executed or not executed, based on this, in the embodiment, the number of a plurality of operations on the database required by a single transaction is taken as the number of transaction operation commands.
[0053] Specifically, for the determination of the associated form, in the embodiment, according to the corresponding document stored by the database in the design stage, the document will explicitly describe the relationship between each table, including the associated field, the associated type (such as one-to-one, one-to-many, many-to-many) and other information. By calling the document, the association between the forms in the database can be quickly and accurately understood. Of course, other ways can also be used, which will not be repeated here.
[0054] Specifically, in order to represent the case that the number of database transactions increases significantly in a short time, the predetermined time period is selected within the interval [1min, 5min].
[0055] Specifically, the process of obtaining the number of transactions performed on the database within the predetermined time period and determining the compatibility disorder tendency representation value of the database in combination with the complexity characteristics of each of the transactions includes:
[0056] The ratio of the number of transactions performed on the database to the transaction number threshold value is taken as the first disorder tendency feature;
[0057] The sum of the ratio of the transaction operation command number mean to the transaction operation command number mean threshold value and the ratio of the associated form number to the associated form number threshold value is taken as the second disorder tendency feature;
[0058] The weighted sum of the first disorder tendency feature and the second disorder tendency feature is taken as the compatibility disorder tendency representation value.
[0059] Specifically, in the actual database running process, the transaction operation command number and the associated form number can more directly and specifically reflect the complexity and association intensity of the database in the interactive process, and further reflect the influence of the compatibility disorder of the database, therefore, in the implementation, the complex characteristics are given priority, so the second disorder tendency feature calculated based on the complex characteristics is given a slightly higher weight, therefore, when the weighted sum is performed, the weight of the first disorder tendency feature is set to 0.4, and the weight of the second disorder tendency feature is set to 0.6.
[0060] In the embodiment, the purpose of setting the transaction quantity threshold, the transaction operation command quantity mean threshold and the associated form quantity threshold is to represent the case that the operation running has a greater impact on the compatibility of the database. By calling historical running data of database running for several times, transaction quantity historical data, transaction operation command quantity historical data and associated form quantity historical data of the database performed in the same predetermined time period are obtained, and the mean value of the transaction quantity mean, the transaction operation command quantity mean and the associated form quantity mean are solved. Based on the purpose of setting the above three thresholds, the transaction quantity threshold is determined as the product of the transaction quantity mean and a first deviation coefficient, the transaction operation command quantity mean threshold is determined as the product of the mean value of the transaction operation command quantity mean and a second deviation coefficient, and the associated form quantity threshold is determined as the product of the associated form quantity mean and a third deviation coefficient. The first deviation coefficient is selected in the interval [1.5, 1.8], the second deviation coefficient is selected in the interval [1.3, 1.5], and the third deviation coefficient is selected in the interval [1.4, 1.7].
[0061] Specifically, the application considers the concurrent pressure generated by the operation of the transaction on the database. The number of transactions for the database increases greatly in a certain time, which may cause an increase in concurrent operations of the database. When the processing capacity of the database system is limited, too many concurrent transactions may cause resource competition, such as competition for CPU, memory, disk I / O and other resources, and thus problems such as performance degradation, long response time and the like of the database may occur, and even the compatibility with other systems or applications may be affected. For example, an application program may have a timeout error due to waiting for a database response, which may cause compatibility imbalance;
[0062] At the same time, the number of operations corresponding to the transaction is considered. A large number of transaction operation commands means that the logical complexity of the transaction is high. Complex transactions may require more system resources for processing, and may involve multiple database objects and operation steps in the execution process. If the processing capacity of the database system for complex transactions is insufficient, execution errors or performance degradation may occur. For example, a transaction containing a large number of insert, update and delete operations may cause data inconsistency when interacting with other application programs due to insufficient optimization of the database for operations, which may reduce compatibility performance;
[0063] And the number of data forms associated with the transaction can indicate the complexity of the relationship between the data forms involved in the transaction, and when processing the associated data, the database needs to ensure the consistency and integrity of the data, if the database makes mistakes when processing multi-table associated transactions, it may cause data inconsistency, which will affect the reading and processing of the data by the application program, making the compatibility disorder, for example, in an order processing transaction involving multiple associated data forms, if the database cannot correctly handle the foreign key constraints and data update sequence between tables, it may cause the order data to be inconsistent with the related customer and product data, making the application program unable to normally display the order information;
[0064] Therefore, based on the analysis of the above-mentioned characteristic features, the compatibility disorder tendency value is used to represent the tendency degree of the compatibility disorder of the database, which provides data support for subsequent labeling of the database, and the compatibility performance detection of the database is more comprehensive and flexible under the premise of ensuring the detection efficiency of the database compatibility exception, and the detection accuracy is improved.
[0065] Specifically, please refer to Figure 2 As shown in the figure, the logic judgment diagram for labeling each database according to the embodiment of the application, the labeling of each database comprises:
[0066] If the compatibility disorder tendency value of any database is greater than or equal to the compatibility disorder tendency threshold value, the database is labeled as a compatibility disorder database.
[0067] The compatibility disorder tendency threshold value is selected in the interval [1.68, 1.74]
[0068] Specifically, according to the labeling result, the log record of the corresponding database is called for detection analysis, which comprises:
[0069] If the database is labeled as a compatibility disorder database, the log record of the corresponding database is called for detection analysis.
[0070] Specifically, the process of determining the transaction abnormal frequency time domain segment comprises:
[0071] The analysis of the execution process of the completed transaction comprises recording the corresponding intermediate node time of the completed transaction, and determining the transaction error event data, transaction rollback event data and transaction blocking event data of the completed transaction;
[0072] The corresponding transaction error time domain curve, transaction rollback time domain curve and transaction blocking time domain curve are constructed respectively;
[0073] If the slope of any time domain segment of any time domain curve is greater than the slope threshold value, the time domain segment is determined as the transaction abnormal frequency time domain segment.
[0074] In this embodiment, the corresponding time domain curve is constructed by the following method,
[0075] A rectangular coordinate system is constructed with time as the horizontal axis and transaction error events as the vertical axis.
[0076] The coordinate points of the event error events at each time are marked in the rectangular coordinate system.
[0077] The coordinate points are connected by a smooth curve to obtain the transaction error event time domain curve.
[0078] Similarly, transaction rollback event time domain curves and transaction blocking event time domain curves are constructed. In this embodiment, errors, rollbacks, and blockages that occur during database transaction processing correspond to the transaction error events, transaction rollback events, and transaction blocking events.
[0079] The transaction error event refers to an event where a transaction fails due to syntax errors, constraint conflicts, insufficient permissions, etc. during execution. The occurrence of the transaction error event can be determined based on the error code returned by the database driver, such as 1062 for unique key conflict in MySQL, 23505 for unique constraint conflict in PostgreSQL, and description information.
[0080] The transaction rollback refers to an event where all operations are undone due to explicit ROLLBACK, automatic rollback due to errors, or timeout rollback. The transaction changes from "active" to "terminated" and does not commit any data. The transaction rollback can be queried through the database log.
[0081] The transaction blocking refers to an event where a transaction holds a lock (such as a row lock or a table lock), causing other transactions to wait for the same resource. The transaction blocking relationship, including the blocking duration and the involved SQL statements, can be visualized and displayed through third-party tools, such as Navicat Monitor.
[0082] Specifically, the method for constructing each time domain curve is not limited, for example, the matlab related fitting software can be used to fit the time domain curve, which will not be repeated here.
[0083] The purpose of setting the slope threshold is to represent the situation where a number of transactions occur frequently. The slope history data of the transaction abnormal frequency time domain segment is obtained by calling the historical running data of the database running several times. Based on the purpose of setting the slope threshold, the slope mean is determined as the slope threshold.
[0084] Specifically, the process of analyzing the interference running representation coefficient of the database includes:
[0085] a ratio of the processing accuracy threshold value to a processing accuracy of an application program interacting with the database as a first interference operation feature;
[0086] a ratio of the damage degree of the data processed by the application program to a damage degree threshold value as a second interference operation feature;
[0087] a sum of the first interference operation feature and the second interference operation feature as the interference operation feature coefficient.
[0088] In the embodiment, the purpose of setting the processing accuracy threshold value and the damage degree threshold value is to represent a situation that the database compatibility disorder is relatively serious and the running interference on the data and the application program is relatively strong. By calling historical running data of a plurality of times of database running, historical data of processing accuracy of an application program associated with the database and historical data of damage degree of the data processed by the application program are obtained, a mean value of the processing accuracy and a mean value of the damage degree are solved, and based on the purpose of setting the processing accuracy threshold value and the damage degree threshold value, the processing accuracy threshold value is determined as a product of the mean value of the processing accuracy and an accuracy deviation coefficient, and the damage degree threshold value is determined as a product of the mean value of the damage degree and a damage deviation coefficient, wherein the accuracy deviation coefficient is selected in an interval [0.85, 0.9], and the damage deviation coefficient is selected in an interval [1.05, 1.1].
[0089] The processing accuracy refers to a proportion of correct processing of transaction logic and returning of expected results in the process of data interaction between the application program and the database. In the implementation, the returned results without transaction error events, transaction rollback events and transaction blocking events and other transaction abnormal events are regarded as the expected results.
[0090] Specifically, when detecting and analyzing the compatibility disorder database, the application focuses on the time domain segment in which transaction abnormalities frequently occur. Since the compatibility disorder problem of the database often does not exist in isolation, it has an impact on the normal running of the application program interacting with it. Therefore, the running condition of the database and the performance of the application program are combined, the interaction operation behavior between the database and the application program reflects the severity of the compatibility disorder of the database, and the processing accuracy of the application program reflects the stability of the data interaction between the database and the application program, which is directly related to the normal running of the business functions in the range involved by the application program. If the processing accuracy is reduced, it can be explained that the compatibility disorder problem of the database has a negative impact on the application program.
[0091] The data integrity is destroyed by measuring the degree of data damage, which seriously affects the correct processing and analysis of the application program, and reduces the availability and reliability of the data. Through quantitative analysis of the damage degree of the data, the evaluation can be more accurate. Therefore, the interference operation representation coefficient is used to represent the interference influence degree of the data and the application program caused by the compatibility disorder of the database and the severity of the compatibility disorder of the database, so as to provide data support for subsequent evaluation of whether the operation of the database meets the operation deviation fault tolerance threshold. The compatibility performance detection of the database is more comprehensive and flexible under the premise of ensuring the detection efficiency of the database compatibility exception, and the detection accuracy is improved.
[0092] Specifically, please refer to Figure 3 As shown in the figure, it is a logical decision diagram for evaluating whether the operation of the database meets the operation deviation fault tolerance threshold according to the embodiment of the application. Whether the operation of the database meets the operation deviation fault tolerance threshold is evaluated based on the interference operation representation coefficient, including:
[0093] If the interference operation representation coefficient of the database is greater than or equal to the interference operation representation coefficient threshold, the operation of the database is evaluated as not meeting the operation deviation fault tolerance threshold.
[0094] If the interference operation representation coefficient of the database is less than the interference operation representation coefficient threshold, the operation of the database is evaluated as meeting the operation deviation fault tolerance threshold.
[0095] The interference operation representation coefficient threshold is selected in the interval [2.17, 2.25].
[0096] Specifically, it also includes:
[0097] If the operation of any database does not meet the operation deviation fault tolerance threshold, the execution efficiency deviation value of the same transaction is obtained to determine whether to perform integrated testing on the database.
[0098] Specifically, please refer to Figure 4 As shown in the figure, it is a logical decision diagram for determining whether to perform integrated testing on the database according to the embodiment of the application. Whether to perform integrated testing on the database is determined, including:
[0099] If the execution efficiency deviation value of the same transaction of the database is greater than the execution efficiency deviation threshold, it is determined to perform integrated testing on the database.
[0100] If the execution efficiency deviation value of the same transaction of the database is less than or equal to the execution efficiency deviation threshold, it is determined that integrated testing is not needed on the database.
[0101] In the embodiment, the purpose of setting the execution efficiency deviation threshold is to represent the case that the stable performance of the database operation is poor, the historical operation data of the database operation is obtained by calling several times, the execution efficiency deviation value of the same transaction is obtained, the execution efficiency deviation mean is solved, and the execution efficiency deviation threshold is determined as the product of the execution efficiency deviation mean and the efficiency deviation coefficient based on the purpose of setting the execution efficiency deviation threshold, wherein the efficiency deviation coefficient is selected in the interval [1.15, 1.2].
[0102] Specifically, the application considers whether the compatibility disorder of the database is within the allowable range of the database operation, and the execution efficiency deviation value of the same transaction directly reflects the performance stability of the database operation, so as to further determine whether to perform the integration test on the database. The application is more comprehensive and flexible in detecting the compatibility performance of the database under the premise of ensuring the detection efficiency of the database compatibility exception, and improves the detection accuracy.
[0103] Specifically, it also includes:
[0104] The damage degree is determined based on the number of lost data packets, the number of out-of-order data packets, and the number of content error data packets.
[0105] In the embodiment, the damage degree is determined in the following manner, including,
[0106] The loss ratio of the number of lost data packets to the total number of data packets, the out-of-order ratio of the number of out-of-order data packets to the total number of data packets, and the content ratio of the number of content error data packets to the total number of data packets are calculated respectively.
[0107] The loss ratio, the out-of-order ratio, and the content ratio are respectively assigned corresponding weight coefficients.
[0108] The sum of the three values after assignment is taken as the damage degree.
[0109] Specifically, for the integration test method, it can be any one of the devices that can realize the corresponding functions in the prior art, which will not be described again.
[0110] If the AI-driven control system database detection method of the present application is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application or the part that essentially contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0111] So far, the technical solution of the present application has been described in combination with the preferred embodiments shown in the drawings, but those skilled in the art can easily understand that the protection scope of the present application is obviously not limited to these specific embodiments. Those skilled in the art can make equivalent changes or replacements to the related technical features without deviating from the principles of the present application, and the technical solutions after these changes or replacements will fall within the protection scope of the present application.
Claims
1. A database detection method for control systems based on AI, characterized in that, include: The system stores runtime data from several databases to extract complex features of several transactions, including the number of transaction operation commands and the number of associated forms. The compatibility mismatch tendency characterization value of the database is determined by combining the number of transactions performed on the database within a predetermined time period and the complexity characteristics of each transaction, and each database is marked accordingly. Based on the marking results, the corresponding database log records are called for detection and analysis, including analyzing the execution process of several completed transactions in the log records, determining the time domain segment where transaction anomalies frequently occur, obtaining the processing accuracy of the application interacting with the database within the time domain segment where transaction anomalies frequently occur, and analyzing the interference operation characterization coefficient of the database in combination with the degree of corruption of the data processed by the application. Based on the interference operation characterization coefficient, evaluate whether the operation of the database meets the operation deviation tolerance threshold. If the operation of any database does not meet the operation deviation tolerance threshold, obtain the execution efficiency deviation value for the same transaction to determine whether to perform integration testing on the database. The process of determining the database compatibility misalignment tendency characterization value by combining the number of transactions performed on the database within a predetermined time period with the complex characteristics of each transaction includes: The ratio of the number of transactions performed on the database to the transaction number threshold is used as the first imbalance tendency feature; The sum of the ratio of the average number of transaction operation commands to the threshold of the average number of transaction operation commands and the ratio of the number of associated forms to the threshold of the number of associated forms is used as the second disorder tendency feature. The first disorder tendency feature and the second disorder tendency feature are weighted and summed to obtain the compatibility disorder tendency characterization value; The process of analyzing the interferometric characterization coefficients of the database includes: The ratio of the processing accuracy threshold to the processing accuracy of the application that interacts with the database is used as the first interference operation feature. The ratio of the degree of corruption of the data processed by the application to the corruption threshold is used as the second interference operation feature; The sum of the first interference operation feature and the second interference operation feature is used as the interference operation characterization coefficient; Determining whether to perform integration testing on the database includes: If the execution efficiency deviation of the same transaction in the database is greater than the execution efficiency deviation threshold, then it is determined that the database should be subjected to integration testing. The processing accuracy rate refers to the proportion of times that the application correctly processes transaction logic and returns the expected results during data interaction with the database. The degree of damage is determined in the following ways, including: Calculate the loss ratio of the number of lost data packets to the total number of data packets, the out-of-order ratio of the number of out-of-order data packets to the total number of data packets, and the content ratio of the number of data packets with erroneous content to the total number of data packets, respectively. The loss ratio, out-of-order ratio, and content ratio are each assigned a corresponding weighting coefficient. The sum of the three ratios after assignment is taken as the degree of damage.
2. The AI-driven control system database detection method according to claim 1, characterized in that, Each of the aforementioned databases is labeled, including: If any database has a compatibility misalignment tendency representation value greater than or equal to the compatibility misalignment tendency representation threshold, then the database is marked as a compatibility misalignment database.
3. The AI-driven control system database detection method according to claim 2, characterized in that, Based on the marking results, the corresponding database log records are retrieved for detection and analysis, including: If a database is marked as incompatible, the corresponding database's log records will be used for detection and analysis.
4. The AI-driven control system database detection method according to claim 1, characterized in that, The process of determining the time domain segment where transaction anomalies frequently occur includes: Analyzing the execution process of completed transactions includes recording the corresponding intermediate node times of completed transactions, and determining the transaction error event data, transaction rollback event data, and transaction blocking event data of completed transactions; Construct the corresponding transaction error time domain curve, transaction rollback time domain curve, and transaction blocking time domain curve respectively; If the slope of any time-domain segment of any of the time-domain curves is greater than the slope threshold, then the time-domain segment is determined as the time-domain segment where transaction anomalies occur frequently.
5. The AI-driven control system database detection method according to claim 1, characterized in that, The evaluation of whether the operation of the database meets the operational deviation tolerance threshold based on the aforementioned interferometric operation characterization coefficients includes: If the interference operation characterization coefficient of the database is greater than or equal to the interference operation characterization coefficient threshold, then the operation of the database is evaluated as not meeting the operation deviation tolerance threshold.
6. The AI-driven control system database detection method according to claim 1, characterized in that, Also includes: The degree of corruption is determined based on the number of lost data packets, the number of out-of-order data packets, and the number of data packets with erroneous content.
Citation Information
Patent Citations
Compatibility detection method for data migration and terminal
CN117216029A
Configuration method and device of server compatible with multiple time sequence databases
CN117762510A
Cross-platform compatibility automatic testing method
CN119336650A