Program runtime verification method based on LTLf

Through the LTLf-based program runtime verification method, network data is used for real-time evaluation and dynamic adjustment, the problem of low timeliness of program runtime verification in the prior art is solved, and efficient and reliable dynamic verification is achieved.

CN119718892AActive Publication Date: 2025-03-28NORTHWESTERN POLYTECHNICAL UNIV
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411922800.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-03-28
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

In the prior art, the verification time of program operation is low, and data cannot be received and analyzed in real time, resulting in insufficient timeliness of problem discovery and resolution.

Method used

The LTLf-based program runtime verification method is adopted to obtain the running time evaluation value through network data, determine whether to adjust the running time efficiency, and dynamically adjust the security evaluation value through fault verification and analytical accuracy evaluation value to realize formal verification of LTLf constrained data.

Benefits of technology

It improves the timeliness of program runtime verification, realizes dynamic verification, enhances the reliability and accuracy of verification, and solves the problem of low timeliness in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718892A_ABST
    Figure CN119718892A_ABST
Patent Text Reader

Abstract

The invention discloses a program runtime verification method based on LTLf, and relates to the technical field of electric digital data processing. The program runtime verification method based on the LTLf comprises the following steps of performing timeliness evaluation; performing fault verification; analyzing the data; and performing formalized verification. According to the invention, the operation timeliness evaluation value is obtained through the network data and whether operation timeliness adjustment is carried out is determined, and then the fault verification security evaluation value is obtained through the network data and the operation timeliness evaluation value satisfying the timeliness condition and whether fault security adjustment is carried out is determined. The method comprises the following steps: packaging network data, performing data analysis on the packaged network data to obtain an analysis accuracy evaluation value, finally judging whether accuracy adjustment is performed or not based on the analysis accuracy evaluation value, and performing formalized verification on LTLf constraint data, thereby achieving the effect of improving the verification timeliness during program running, and improving the verification efficiency. The problem that in the prior art, verification timeliness is low during program running is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a program runtime verification method based on LTLf. Background Art

[0002] LTLf (Linear Temporal Logic on Finite Traces) is a formal logic language and a formal method for describing and verifying system behaviors or characteristics. It is suitable for processing event sequences that occur within a finite time, and can accurately express the logical relationships between these event sequences, and can be used to describe the constraints in the system. Formal methods are an important theoretical foundation of computer science. Based on strict mathematical and mechanized methods, they model, regulate and verify mathematical theories or computing systems, and thereby solve and improve a series of mathematical or software security problems. In recent years, with the development of formal verification techniques and tools, formal verification techniques have been introduced into many safety-critical fields, such as aerospace, rail transportation, and precision chip design. It can verify the properties of large and complex systems with minimal human intervention and accurately locate potential errors in them. As a beneficial supplement to the simulation and testing process, formal verification significantly enhances the robustness and reliability of system design. By selecting appropriate modeling tools to formally model the target system and accurately describe the system properties in a logical language, the automated process can be started to formally verify the system properties.

[0003] Existing program runtime verification mainly uses automatic search algorithms to comprehensively traverse the state space of the system model to verify whether the model satisfies the specified properties.

[0004] For example, the invention patent announcement with announcement number: CN111914250B discloses a method for verifying and controlling a Linux system script program at runtime, including: defining global variables and interface functions for storing the script file interpreter path in the kernel, adding a configuration file and a boot service in the kernel, and adding a HOOK point in the execve system call; loading the script file interpreter path into the kernel when the system starts.

[0005] For example, the invention patent with publication number: CN117034258A discloses a runtime verification method for an IoT program based on Docker, including: based on the integrity measurement architecture, hashing the container image and writing it into a measurement list; storing the measurement value in the measurement list corresponding to the target container into the vPCR module corresponding to the target container; extending the vPCR module into the trusted platform module; verifying the identity information and status information of the host platform where the target container is located, and the container is successfully started if the verification passes; obtaining the memory binary information of the corresponding process at runtime according to the container ID, the process pid in the target container, and the collection time, and constructing a memory event; and realizing the verification of the IoT program business process corresponding to the memory event by transferring the memory event received by the verification state machine end between states.

[0006] However, in the process of implementing the technical solution of the invention in the embodiments of the present application, the present application found that the above technology has at least the following technical problems:

[0007] In the prior art, since the existing methods focus on static analysis, they are unable to receive and analyze data in real time when the system is running, and thus are unable to discover and solve problems in a timely manner, resulting in the problem of low timeliness of verification when the program is running. Summary of the invention

[0008] The embodiment of the present application solves the problem of low timeliness of program runtime verification in the prior art by providing a program runtime verification method based on LTLf, thereby improving the timeliness of program runtime verification.

[0009] The embodiment of the present application provides a program runtime verification method based on LTLf, comprising the following steps: S1, obtaining a runtime effectiveness evaluation value according to network data, and judging whether to perform a runtime effectiveness adjustment based on the runtime effectiveness evaluation value; S2, obtaining a fault verification safety evaluation value according to the network data and the runtime effectiveness evaluation value that meets the timeliness condition, and judging whether to perform a fault safety adjustment based on the fault verification safety evaluation value, wherein the runtime effectiveness evaluation value is used to evaluate the timeliness during network transmission, and the fault verification safety evaluation value is used to evaluate the safety during dynamic verification based on the received network data; S3, obtaining encapsulated network data according to the network data corresponding to the fault verification safety evaluation value that meets the safety condition, performing data parsing on the encapsulated network data to obtain a parsing accuracy evaluation value, and the parsing accuracy evaluation value is used to evaluate the accuracy of the encapsulated network data during the data parsing process; S4, judging whether to perform an accuracy adjustment based on the parsing accuracy evaluation value, and performing formal verification on the LTLf constraint data corresponding to the parsing accuracy evaluation value that meets the parsing accuracy condition.

[0010] Furthermore, the specific acquisition process of the network data is as follows: obtain initial network data, the initial network data represents log data generated during operation; cache the initial network data through network transmission, and read the cached initial network data into a specified string array; encapsulate and identify the initial network data to obtain network data; the network data includes network data reception delay, encapsulation identification delay, operation fault duration, number of operation faults, operation duration, fault maintenance time, parsing compliance times and parsing compliance data volume; the parsing compliance times represents the number of times the encapsulated network data meets the preset LTLf constraint conditions after data parsing; the parsing compliance data volume represents the data volume corresponding to the encapsulated network data that meets the preset LTLf constraint conditions after data parsing the encapsulated network data.

[0011] Furthermore, the specific process of obtaining the runtime effectiveness evaluation value based on the network data is as follows: the first step is to obtain the network data reception delay deviation by performing a ratio operation on the difference between the network data reception delay and the preset reception delay threshold obtained from the database and the preset reception delay threshold; the second step is to obtain the encapsulation identification delay deviation by performing a ratio operation on the difference between the encapsulation identification delay and the preset identification threshold obtained from the database and the preset identification threshold; the third step is to obtain the runtime effectiveness evaluation value by combining the network data reception delay deviation and the encapsulation identification delay deviation.

[0012] Furthermore, the limiting expression of the runtime efficiency evaluation value is as follows:

[0013]

[0014] In the formula, SXX p represents the runtime effectiveness evaluation value corresponding to the network data in the pth preset time period, p = 1, 2, ..., m, p represents the number of the preset time period, m represents the total number of preset time periods, Indicates the network data receiving delay deviation corresponding to the network data in the pth preset time period, represents the package identification delay deviation corresponding to the network data in the pth preset time period, ΔCS represents the reference data reception delay range obtained from the database, ΔFS represents the reference package identification delay range obtained from the database, and e represents a natural constant.

[0015] Furthermore, the specific process of obtaining the fault verification safety assessment value based on the network data and the operation effectiveness evaluation value that meets the timeliness condition is as follows: obtaining the initial failure rate by performing a ratio operation on the operation failure duration and the operation duration; obtaining the operation failure deviation by performing a ratio operation on the difference between the initial failure rate and a preset failure rate threshold obtained from a database and the preset failure rate threshold; obtaining the initial failure recovery time by performing a ratio operation on the fault maintenance time and the number of operation failures; obtaining the operation failure recovery deviation by performing a ratio operation on the difference between the initial failure recovery time and the preset failure recovery time threshold obtained from the database and the preset fault recovery time threshold; obtaining the fault verification safety assessment value by combining the operation failure deviation, the operation failure recovery deviation and the operation effectiveness evaluation value that meets the timeliness condition.

[0016] Furthermore, the specific process of obtaining the analysis accuracy evaluation value by performing data analysis on the encapsulated network data is as follows: obtaining the analysis compliance ratio by performing a ratio operation on the analysis compliance times and a preset analysis times threshold obtained from a database; obtaining the analysis data volume compliance ratio by performing a ratio operation on the analysis compliance data volume and a preset analysis data volume threshold obtained from a database; and obtaining the analysis accuracy evaluation value by combining the analysis compliance ratio, the analysis data volume compliance ratio and a fault verification safety evaluation value that meets safety conditions.

[0017] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0018] 1. Determine whether to make a runtime adjustment based on the obtained runtime effectiveness evaluation value, then obtain the fault verification safety evaluation value through the network data and the runtime effectiveness evaluation value that meets the timeliness conditions and determine whether to make a fault safety adjustment, then obtain the parsing accuracy evaluation value by parsing the encapsulated network data, and finally determine whether to make an accuracy adjustment based on the parsing accuracy evaluation value, and perform formal verification on the LTLf constraint data, thereby achieving dynamic verification of program operation safety, and then achieving the improvement of the timeliness of program runtime verification, effectively solving the problem of low timeliness of program runtime verification in the prior art.

[0019] 2. By formally verifying the LTLf constraint data corresponding to the parsing accuracy evaluation value that meets the parsing accuracy conditions, if the formal constraint described in the LTLf language reaches the True state, the constraint is satisfied; if the formal constraint described in the LTLf language reaches the False state, the constraint is not satisfied, thereby improving the reliability of formal verification and further improving the accuracy of formal verification.

[0020] 3. The runtime effectiveness evaluation value is obtained by combining the network data reception delay deviation and the encapsulation identification delay deviation, and then the fault verification safety evaluation value is obtained by combining the operation fault deviation, the operation fault recovery deviation and the runtime effectiveness evaluation value that meets the timeliness conditions. Finally, the parsing accuracy evaluation value is obtained by combining the parsing compliance ratio, the parsing data volume compliance ratio and the fault verification safety evaluation value that meets the safety conditions, thereby achieving the improvement of the accuracy of obtaining program running related data, and then achieving the improvement of the reliability of program runtime verification. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A flowchart of a program runtime verification method based on LTLf provided in an embodiment of the present application;

[0022] Figure 2 An overall flow chart provided for the embodiments of the present application;

[0023] Figure 3 A statistical diagram of changes in the number of parsing matches-parsing match ratio provided in an embodiment of the present application;

[0024] Figure 4 A diagram of the verification framework provided for an embodiment of the present application. DETAILED DESCRIPTION

[0025] The embodiment of the present application solves the problem of low timeliness of program runtime verification in the prior art by providing a program runtime verification method based on LTLf. A runtime efficiency evaluation value is obtained through network data, and whether to make runtime efficiency adjustment is determined based on the runtime efficiency evaluation value. Then, a fault verification safety evaluation value is obtained through network data and a runtime efficiency evaluation value that meets the timeliness condition, and whether to make fault safety adjustment is determined based on the fault verification safety evaluation value. Then, encapsulated network data is obtained through network data corresponding to the fault verification safety evaluation value that meets the safety condition, and data is parsed on the encapsulated network data to obtain a parsing accuracy evaluation value. Finally, based on the parsing accuracy evaluation value, it is determined whether to make accuracy adjustment, and formal verification is performed on the LTLf constraint data corresponding to the parsing accuracy evaluation value that meets the parsing accuracy condition, thereby improving the timeliness of program runtime verification.

[0026] The technical solution in the embodiment of the present application is to solve the problem of low timeliness of verification when the above program is running, and the overall idea is as follows:

[0027] The runtime effectiveness evaluation value is used to determine whether to make runtime effectiveness adjustments. Then, the fault verification safety evaluation value is obtained through network data and the runtime effectiveness evaluation value that meets the timeliness conditions, and it is determined whether to make fault safety adjustments. Next, the parsing accuracy evaluation value is obtained by parsing the encapsulated network data. Finally, based on the parsing accuracy evaluation value, it is determined whether to make accuracy adjustments and formal verification, thereby achieving the effect of improving the timeliness of program runtime verification.

[0028] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0029] like Figure 1 As shown, it is a flow chart of a program runtime verification method based on LTLf provided by an embodiment of the present application, the method comprising the following steps: S1, timeliness evaluation: obtaining a runtime efficiency evaluation value according to network data, judging whether to perform runtime efficiency adjustment based on the runtime efficiency evaluation value, the runtime efficiency adjustment means adjusting the runtime efficiency evaluation value to meet the timeliness condition, and the network data is used to reflect the network transmission situation; S2, fault verification: obtaining a fault verification safety evaluation value according to the network data and the runtime efficiency evaluation value that meets the timeliness condition, judging whether to perform fault safety adjustment based on the fault verification safety evaluation value, the runtime efficiency evaluation value is used to evaluate the timeliness during network transmission, the fault verification safety evaluation value is used to evaluate the safety when performing dynamic verification according to the received network data, and the fault verification safety evaluation value is used to evaluate the safety when performing dynamic verification according to the received network data. Security adjustment means adjusting the fault verification safety assessment value to meet the security conditions; S3, data analysis: obtaining encapsulated network data according to the network data corresponding to the fault verification safety assessment value that meets the security conditions, performing data analysis on the encapsulated network data to obtain a parsing accuracy assessment value, the parsing accuracy assessment value is used to evaluate the accuracy of the encapsulated network data during the data parsing process, the encapsulated network data means the encapsulated network data, data analysis means converting the encapsulated network data into the form of LTLf constraints; S4, formal verification: judging whether to perform accuracy adjustment based on the parsing accuracy assessment value, performing formal verification on the LTLf constraint data corresponding to the parsing accuracy assessment value that meets the parsing accuracy conditions, the accuracy adjustment is used to adjust the parsing accuracy assessment value to meet the parsing accuracy conditions.

[0030] In this embodiment, network transmission is implemented by creating threads 1, 2 and 3 to optimize resource utilization and improve processing efficiency. Thread 1 and 2 are responsible for listening to and receiving data from different network ports. Both threads are configured with corresponding network sockets to listen to inbound connections of specific ports and are responsible for receiving and parsing data streams; thread 3, as a data collection and processing center, is responsible for reading data from the buffers or queues of threads 1 and 2 and performing centralized processing; at the same time, when the three threads are running concurrently, locks are needed to control access to shared resources to ensure that thread 1 and thread 2 completely receive data at the same time before thread 3 can start parsing and completing the data at that time to prevent confusion of data resources. Network transmission uses network sockets for transmission. This function is the entry point for the main program to receive external data. Its main task is to receive network data sent by the verification object and encapsulate it into an identifiable object. First, the network transmission module will set the corresponding IP (Internet Protocol) address and port number to receive the data sent by the verification object to be tested. For the data sent by the verification, the network transmission module will save the data in the cache and read it in the string array. The received data is in the form of binary UDP (User Datagram Protocol) data packets, so after receiving the data, the network transmission module will process the data packets: first, the required binary data bits are intercepted from the binary packet according to the corresponding positions of different fields, and then these binary bits are converted into corresponding data types. That is, the binary type data is decoded and mapped to a series of recognizable basic data types, such as Boolean type, floating point type, etc., to facilitate the subsequent parsing and data processing using C++ language.

[0031] It is important to understand that the runtime effectiveness evaluation value, fault verification safety evaluation value, and analysis accuracy evaluation value affect each other. The timeliness evaluation value affects the efficiency of the fault verification safety evaluation value and data analysis. The fault verification safety evaluation value affects the runtime effectiveness adjustment and the accuracy of data analysis. The timeliness evaluation value directly affects the timeliness of fault verification. The lower the timeliness evaluation value, the more likely it is that there is a delay in network transmission, which may cause a lag in fault verification, thereby affecting the accuracy of the fault verification safety evaluation value; this improves the timeliness of program runtime verification.

[0032] It should be added that the network data within a preset time period is measured by a network traffic monitor, and the specific process of obtaining the network data is as follows: obtaining the initial network data, the initial network data represents the log data generated during operation; caching the initial network data through network transmission, and reading the cached initial network data into a specified string array; encapsulating and identifying the initial network data to obtain the network data; the network data includes network data reception delay, encapsulation identification delay, operation fault duration, number of operation faults, operation duration, fault maintenance time, number of parsing compliance times and amount of parsing compliance data; the number of parsing compliance times represents the number of times the encapsulated network data meets the preset LTLf constraint conditions after data parsing; the amount of parsing compliance data represents the amount of data corresponding to the encapsulated network data that meets the preset LTLf constraint conditions after data parsing the encapsulated network data.

[0033] Furthermore, the specific process of obtaining the runtime efficiency evaluation value based on the network data is as follows: In the first step, the network data reception delay deviation (i.e., the value in the constraint expression of the runtime efficiency evaluation value) is obtained by performing a ratio operation between the difference between the network data reception delay and the preset reception delay threshold obtained from the database and the preset reception delay threshold and processing. ); the network data reception delay deviation is used to reflect the deviation of the network data reception delay within the preset time period; the second step is to perform a ratio operation between the difference between the encapsulation recognition delay and the preset recognition threshold obtained from the database and the preset recognition threshold and process the encapsulation recognition delay deviation (i.e., the value in the constraint expression of the runtime effectiveness evaluation value) ); The encapsulation identification delay is used to reflect the deviation of the encapsulation identification delay within a preset time period; the third step is to obtain a runtime effectiveness evaluation value by combining the network data reception delay deviation and the encapsulation identification delay deviation.

[0034] The constraint expression of the runtime efficiency evaluation value is as follows:

[0035]

[0036] In the formula, SXX p represents the runtime effectiveness evaluation value corresponding to the network data in the pth preset time period, p = 1, 2, ..., m, p represents the number of the preset time period, m represents the total number of preset time periods, Indicates the network data receiving delay deviation corresponding to the network data in the pth preset time period, Indicates the encapsulation identification delay deviation corresponding to the network data in the pth preset time period, Indicates the network data receiving delay corresponding to the network data in the pth preset time period, Indicates the encapsulation identification delay corresponding to the network data in the pth preset time period, Indicates the preset receiving delay threshold. represents a preset recognition threshold, ΔCS represents a reference data reception delay range obtained from a database, ΔFS represents a reference package recognition delay range obtained from a database, and e represents a natural constant.

[0037] In this embodiment, the aforementioned database is a database for storing various types of setting data established before the design of the LTLf-based program runtime verification method provided in the embodiment of the present application. The database includes but is not limited to program running time, failure time, network transmission delay, etc., and the various numerical values ​​therein are directly set by technical personnel. For example, the preset receiving delay threshold is represented by the average value of the program running verification receiving delay in the historical time period in the database, and the preset recognition threshold is represented by the average value of the program running verification recognition delay in the historical time period in the database.

[0038] The reference data reception delay range ΔCS is greater than or equal to 1 and less than or equal to In this embodiment, when the reference data reception delay range ΔCS is greater than Indicates that the network transmission delay has a great degree of interference with the runtime efficiency evaluation value, resulting in inaccurate measurement results; the reference package identification delay range ΔFS is greater than or equal to 1 and less than or equal to In this embodiment, when the reference package identification delay range ΔFS is greater than This indicates that the package identification delay has a significant impact on the runtime efficiency evaluation value, causing inaccurate measurement results.

[0039] It should be understood that the algorithm of this embodiment combines comprehensive analysis of network data to obtain a runtime efficiency evaluation value. The network data in the algorithm of this embodiment does not exist independently, but is interrelated. The longer the network data reception delay, the greater the delay encountered by the data during transmission, which may cause the receiving end to be unable to receive the complete data packet for a long time, thereby affecting the encapsulation identification. The longer the encapsulation identification delay, the greater the probability of errors in the receiving end when processing subsequent data, which in turn affects the overall data processing efficiency, which may indirectly increase the network data reception delay, resulting in a decrease in the runtime efficiency evaluation value. The parameters of the algorithm of this embodiment need to be considered together and their impact on the results.

[0040] Specifically, assuming that the network data reception delay deviation The range is 1-1.5, the package identification delay deviation The range is 1-1.5, As shown in Table 1, it is a statistical table of changes in the runtime effectiveness evaluation value provided in the embodiment of the present application:

[0041] Table 1 Statistics of changes in runtime effectiveness evaluation values

[0042]

[0043] As can be seen from the table above, as the network data reception delay deviation and package identification delay deviation As increases gradually, the runtime effectiveness evaluation value gradually decreases, which means that the timeliness during network transmission is reduced, and the accurate quantification of the timeliness during network transmission is achieved, and the timeliness of program runtime verification is improved.

[0044] Furthermore, the specific process of judging whether to make a runtime adjustment based on the runtime evaluation value is as follows: Step 1, judging whether the runtime evaluation value meets the timeliness condition, if so, no runtime adjustment is made, otherwise step 2 is executed; Step 2, dynamic routing selection is performed, when the monitored runtime evaluation value meets the timeliness condition, runtime adjustment is stopped, otherwise step 3 is executed, dynamic routing selection means avoiding congested paths through software defined network methods; Step 3, load balancing is performed, when the monitored runtime evaluation value meets the timeliness condition, runtime adjustment is stopped, otherwise an alarm is sent to the preset personnel, load balancing means avoiding overload of a single node by deploying a load balancer; the timeliness condition means a runtime evaluation value that is not lower than a preset runtime threshold obtained from a database.

[0045] In this embodiment, the preset runtime efficiency threshold is represented by the average value of the runtime efficiency evaluation value of the historical time period in the database. The software-defined network method is a new type of network architecture, which separates the network control plane from the data forwarding plane, making network control more flexible and programmable. When a path is found to be congested or faulty, the network controller will dynamically adjust the routing strategy and select one or more backup paths to avoid the congested or faulty area. The load balancer is responsible for dispersing network traffic to multiple servers or network nodes to achieve balanced distribution of traffic; the timeliness of verification during program runtime is improved.

[0046] Furthermore, the specific process of obtaining the fault verification safety evaluation value according to the network data and the operation effectiveness evaluation value that meets the timeliness condition is as follows: the initial failure rate is obtained by performing a ratio operation on the operation failure duration and the operation duration; the operation failure deviation (i.e., the value in the restriction expression of the fault verification safety evaluation value) is obtained by performing a ratio operation on the difference between the initial failure rate and the preset failure rate threshold obtained from the database and the preset failure rate threshold. ); the operation fault deviation is used to reflect the deviation of the operation fault occurring within the preset time period; the initial fault recovery time is obtained by performing a ratio operation on the fault maintenance time and the number of operation faults; the operation fault recovery deviation (i.e., the value in the restriction expression of the fault verification safety assessment value) is obtained by performing a ratio operation on the difference between the initial fault recovery time and the preset fault recovery time threshold obtained from the database and the preset fault recovery time threshold. ); the operation fault recovery deviation is used to reflect the deviation of the operation fault recovery within the preset time period; the fault verification safety assessment value is obtained by combining the operation fault deviation, the operation fault recovery deviation and the operation validity assessment value that meets the timeliness conditions.

[0047] Among them, the fault verification safety assessment value is obtained by the following method:

[0048]

[0049]

[0050] Where AQX p represents the fault verification safety assessment value corresponding to the network data in the pth preset time period, p = 1, 2, ..., m, p represents the number of the preset time period, m represents the total number of preset time periods, Indicates the running fault deviation corresponding to the network data in the pth preset time period, Indicates the running fault recovery deviation corresponding to the network data in the pth preset time period, SXX p ' represents the runtime effectiveness evaluation value that satisfies the timeliness condition corresponding to the network data in the pth preset time period, Indicates the operation fault duration corresponding to the network data in the pth preset time period, Indicates the number of operation failures corresponding to the network data in the pth preset time period, Indicates the running time corresponding to the network data in the pth preset time period, Indicates the fault maintenance time corresponding to the network data in the pth preset time period, Indicates the preset failure rate threshold, represents the preset fault recovery time threshold, ΔYG represents the reference operating fault range obtained from the database, ΔHF represents the reference average fault recovery range obtained from the database, and e represents a natural constant.

[0051] In this embodiment, the preset failure rate threshold is represented by the average value of the program operation verification failure rate in the historical time period in the database, and the preset fault recovery time threshold is represented by the average value of the program operation verification fault recovery time in the historical time period in the database; the reference operation fault range ΔYG is greater than or equal to 0. In this embodiment, when the reference operation fault range ΔYG is less than 0, it indicates that the failure rate has a large degree of interference with the fault verification safety assessment value, resulting in inaccurate measurement results; the reference average fault recovery range ΔHF is greater than or equal to 0. In this embodiment, when the reference average fault recovery range ΔHF is less than 0, it indicates that the fault recovery time has a large degree of interference with the fault verification safety assessment value, resulting in inaccurate measurement results.

[0052] It should be understood that the algorithm of this embodiment combines network data and runtime efficiency evaluation values ​​for comprehensive analysis to obtain a fault verification safety evaluation value. In the algorithm of this embodiment, network data and runtime efficiency evaluation values ​​do not exist independently, but are interrelated. An increase in the duration of operating failures and the number of failures will lead to a decrease in the efficiency of the system in processing network data, thereby reducing the runtime efficiency evaluation value. The higher the runtime efficiency evaluation value means that the system can receive and process network data faster, thereby performing fault verification more promptly, which helps to improve safety. The parameters of the algorithm of this embodiment need to jointly consider their impact on the results; this achieves accurate quantification of the safety of the evaluation when dynamically verifying based on the received network data; and achieves improved timeliness of program runtime verification.

[0053] Furthermore, the specific process of determining whether to perform fault safety adjustment based on the fault verification safety assessment value is as follows: VV1, determining whether the fault verification safety assessment value meets the security conditions, if so, no fault safety adjustment is performed, otherwise VV2 is executed; VV2, performing data encryption, when the monitored fault verification safety assessment value meets the security conditions, the fault safety adjustment is stopped, otherwise VV3 is executed, data encryption means that the encryption algorithm is used to prevent the data from being stolen and tampered with during the transmission process; VV3, performing node fault tolerance processing, when the monitored fault verification safety assessment value meets the security conditions, the fault safety adjustment is stopped, otherwise an alarm is sent to the preset personnel, node fault tolerance processing means improving the fault tolerance of network transmission through redundant nodes; the security condition means that the fault verification safety assessment value is not lower than the preset fault safety threshold obtained from the database.

[0054] In this embodiment, the preset fault safety threshold is represented by the average value of the fault verification safety assessment value in the historical time period in the database. The encryption algorithm (such as a symmetric encryption algorithm) converts the original data (plaintext) into ciphertext. Only the person or system holding the corresponding decryption key can restore the ciphertext to plaintext. During the program verification process, the data needs to be transmitted and stored between different networks. Through data encryption, it can be ensured that the data is always in an encrypted state during transmission and storage, thereby enhancing the security of the entire verification process. Node fault tolerance processing is to improve the fault tolerance of transmission by introducing redundant nodes in the network. Even if some nodes fail, the entire network can still maintain normal operation; the timeliness of verification during program runtime is improved.

[0055] Furthermore, the specific process of obtaining the analysis accuracy evaluation value by performing data analysis on the encapsulated network data is as follows: the analysis accuracy ratio (i.e., the number of analysis matches in the restricted expression of the analysis accuracy evaluation value) is obtained by performing a ratio operation with the preset analysis number threshold obtained from the database. ); the analysis compliance ratio is used to reflect the number of times the encapsulated network data is analyzed within a preset time period; the analysis data volume compliance ratio is obtained by performing a ratio operation between the analysis compliance data volume and the preset analysis data volume threshold obtained from the database (i.e., the analysis accuracy evaluation value in the limiting expression ); the parsed data volume compliance ratio is used to reflect the data volume compliance of the data parsing of the encapsulated network data within a preset time period; the parsing accuracy assessment value is obtained by combining the parsing compliance ratio, the parsing data volume compliance ratio and the fault verification safety assessment value that meets the safety conditions.

[0056] Among them, the analytical accuracy evaluation value is obtained by the following method:

[0057]

[0058] In the formula, ZQX p represents the analysis accuracy evaluation value corresponding to the network data in the pth preset time period, p = 1, 2, ..., m, p represents the number of the preset time period, m represents the total number of preset time periods, Indicates the resolution match ratio of network data in the pth preset time period. Indicates the ratio of the amount of parsed data corresponding to the network data in the pth preset time period, AQX p ' represents the fault verification safety assessment value that meets the safety condition corresponding to the network data in the pth preset time period, Indicates the number of times the network data is analyzed in the pth preset time period. Indicates the amount of data corresponding to the analysis of network data in the pth preset time period. Indicates the preset analysis times threshold. represents the preset threshold of the amount of parsed data, and e represents a natural constant.

[0059] In this embodiment, the preset analysis times threshold is represented by the average value of the program running verification analysis times in the historical time period in the database, and the preset analysis data volume threshold is represented by the average value of the program running verification analysis data volume in the historical time period in the database.

[0060] It should be added that data parsing obtains discrete or continuous numerical variables, and the FP (Formula Progression) method can only verify Boolean variables in the form of LTLf formulas, and cannot handle numerical types directly parsed. Therefore, in the process from binary data to LTLf, this application introduces arithmetic expression processing as an intermediate step. According to the value of the real-time numerical variable, the truth value of the Boolean proposition is parsed, and then the FP method is used to complete the rest of the work, thereby achieving the verification task. The currently supported arithmetic expressions can be recursively defined as follows:

[0061] exp=(e1=e2)|(e1≠e2)|(e1>e2)|(e1 <e2)|(e1≥e2)|(e1≤e2)||(e1++);

[0062] k=v1|(v1+v2)|(v1-v2)|(v1*v2)|(v1 / v2);

[0063] Among them, v i is any variable or constant. e1++ means that e1 will continue to increase, that is, the value of e1 at the next moment will be greater than that of e1 at the current moment. The remaining symbols such as '=' and '+' are operations in the sense of general arithmetic expressions. k represents an event, and e n Represents the nth event, n = 1, 2, ..., m, n represents the event number, m represents the number of events, and exp represents the introduced intermediate step processing value.

[0064] Then, select the appropriate generation rule API (Application Programming Interface) to combine these arithmetic expressions to obtain the equivalent LTLf formula. These generation rule APIs include:

[0065] API for directly generating rules

[0066] always(event / LTL_Event k)

[0067] Meaning: Event k always satisfies

[0068] conditionAlways(event cond,event / LTL_Event k)

[0069] Meaning: When condition cond is true, event k is always satisfied; that is, cond→k is always satisfied

[0070] executeByOrder(event e1,event e2,...)

[0071] Meaning: The given events e1, e2, ... must appear in the specified order

[0072] executeUnder(event / LTL_Event k,event cond)

[0073] Meaning: When event k occurs, condition cond must be true; that is, k→cond always satisfies

[0074] last_moment(event e1,event e2,...)

[0075] Meaning: At the last moment, e1, e2, ... events must all be satisfied

[0076] last_moments_seg(event e1,event e2,...)

[0077] Meaning: In the last period of time, e1, e2, ... events must all be satisfied

[0078] Helper API

[0079] e1&e2 or AND(e1,e2)

[0080] e1|e2 or OR(e1,e2)

[0081] !e1 or NOT(e1)

[0082] transition(event e1,event e2)

[0083] Using generation rules, arithmetic expressions can be easily combined into LTLf formulas. Finally, the LTLf formula generated by the API is exported as a file and used as the input of the main program for formal verification. For example, if the arithmetic expression is e1:condition=3, the formula after using the generation rule combination is always(e1), and the corresponding LTLf formula is G(e1).

[0084] It should be understood that the algorithm of this embodiment combines network data and fault verification safety assessment values ​​for comprehensive analysis to obtain a parsing accuracy assessment value. In the algorithm of this embodiment, network data and fault verification safety assessment values ​​do not exist independently, but are interrelated. An increase in the number of parsing matches and the amount of parsing match data usually means that the data parsing process has a higher accuracy, which helps to improve the safety of fault verification. A higher fault verification safety assessment value means that the system can more accurately identify and handle potential network faults, which helps to reduce data parsing errors caused by faults, thereby increasing the parsing accuracy assessment value. The parameters of the algorithm of this embodiment need to be considered together and simultaneously for their impact on the results.

[0085] Specifically, assuming that the parsing matches the number of The range is 50-100 (times), and the preset analysis times threshold Fixed to 75 (times), such as Figure 3 As shown, it is a statistical diagram of the change of the number of parsing matches-parsing match ratio provided by the embodiment of the present application, which is composed of Figure 3 As we know, as the number of parsing matches increases Gradually increases, and the parsing compliance ratio gradually increases, which means that the accuracy of the encapsulated network data in the data parsing process is gradually improved, and the accurate quantification of the accuracy of the encapsulated network data in the data parsing process is realized, thereby realizing the improvement of the timeliness of verification during program runtime.

[0086] Furthermore, the specific process of judging whether to adjust the accuracy based on the analysis accuracy evaluation value is as follows: QQ1, judging whether the analysis accuracy evaluation value meets the analysis accuracy condition, if so, no accuracy adjustment is performed, otherwise QQ2 is executed; QQ2, performing noise reduction processing, when the monitored analysis accuracy evaluation value meets the analysis accuracy condition, stop adjusting the accuracy, otherwise QQ3 is executed, noise reduction processing means correcting errors caused by noise through redundant decoding (such as Hamming code and convolutional code) at the preset receiving end through an error correction algorithm; QQ3, performing timing constraints, when the monitored analysis accuracy evaluation value meets the analysis accuracy condition, stop adjusting the accuracy, otherwise an alarm is sent to the preset personnel, and the timing constraints are used to ensure that the LTLf constraint data can effectively cover all possible paths; the analysis accuracy condition means that the analysis accuracy evaluation value is not lower than the preset analysis accuracy threshold obtained from the database.

[0087] In this embodiment, the preset resolution accuracy threshold is represented by the average value of the resolution accuracy evaluation value of the historical time period in the database. The Hamming code is a linear block code that detects and corrects single-bit errors by adding additional check bits. At the transmitting end, the original data is encoded into a Hamming code containing a check bit; at the receiving end, the check bit is calculated to detect whether there is an error and determine the location of the error, and then the error is corrected using an error correction algorithm. Convolutional code is a mnemonic encoding method that uses the correlation between data blocks for encoding. At the transmitting end, the original data is convolutionally encoded into a codeword with redundant information; at the receiving end, the errors introduced during the transmission process are corrected by algorithms such as maximum likelihood decoding. Through timing constraints, it can be ensured that all possible paths are verified within a limited time.

[0088] Furthermore, the specific process of formally verifying the LTLf constraint data corresponding to the parsing accuracy evaluation value that meets the parsing accuracy condition is as follows: if the formal constraint described in the LTLf language reaches the True state, the constraint is satisfied; if the formal constraint described in the LTLf language reaches the False state, the constraint is not satisfied; formal verification means verifying the LTLf constraint data through the FP method.

[0089] like Figure 4 As shown, it is a verification framework diagram provided in an embodiment of the present application. After obtaining the LTLf formula, the automaton can be dynamically constructed and satisfiability check can be performed through the FP (Formula Progression) method. The formalization principle of the FP method is specifically introduced below.

[0090] For an LTL f formula φ, and a non-empty finite trajectory ρ, let the progression formula be fp(φ,ρ), then fp(φ,ρ) can be recursively defined as:

[0091] –fp(tt,ρ)=tt and fp(ff,ρ)=ff;

[0092] –If p∈ρ[0], then fp(p,ρ)=tt; if Then fp(p,ρ)=ff;

[0093]

[0094] –fp(φ1∧φ2,ρ)=fp(φ1,ρ)∧fp(φ2,ρ);

[0095] –fp(φ1∨φ2,ρ)=fp(φ1,ρ)∨fp(φ2,ρ);

[0096] – If |ρ|=1, then fp(○φ,ρ)=φ; otherwise fp(○φ,ρ)=fp(φ,ρ1);

[0097] – If |ρ|=1, then fp(●φ,ρ)=φ; otherwise fp(●φ,ρ)=fp(φ,ρ1);

[0098] –fp(φ1Uφ2,ρ)=fp(φ2,ρ)∨(fp(φ1,ρ)∧fp(○(φ1Uφ2),ρ));

[0099] –fp(φ1Rφ2,ρ)=fp(φ2,ρ)∧(fp(φ1,ρ)∨fp(●(φ1Rφ2),ρ)).

[0100] Using this progressive formula, construct the automaton Aφ(2P,S,δ,s0,T) corresponding to the LTLf constraint, where:

[0101] -2P is a finite alphabet, P is an atomic proposition on φ

[0102] -S is a finite set of states,

[0103] -s0 is the initial state

[0104] -δ is the migration rule S×2P→S. For all s∈S, σ∈2P, δ(s,σ)=fp(s,σ) (here σ is considered to be a migration trajectory of length 1);

[0105] -T is a series of receiving states, where

[0106] Through the above progressive formula and the automaton constructed by it, each time according to the current state current_state, the migration trajectory edge, and the migration rule Formula_Progression, the next migration state next_state can be obtained, that is, the FP function for constructing the next migration state is: next_state=Formula_Progression(current_state,edge). When the state of next_state becomes True or False, it marks the termination of this round of the program. True means that the property is satisfied, while False means that the property is violated, which indicates that the system may have errors or abnormal behavior. At this time, it indicates that the verification of this property has obtained the result and enters the verification of the next property; the timeliness of verification during program runtime is improved.

[0107] To summarize, the embodiment of the present application obtains a runtime effectiveness evaluation value through network data and determines whether to make a runtime effectiveness adjustment, then obtains a fault verification safety evaluation value through network data and a runtime effectiveness evaluation value that satisfies the timeliness conditions and determines whether to make a fault safety adjustment, then obtains a parsing accuracy evaluation value by performing data parsing on the encapsulated network data, and finally determines whether to make an accuracy adjustment based on the parsing accuracy evaluation value, and performs formal verification on the LTLf constraint data, thereby achieving dynamic verification of program operation safety, and further achieving improvement in the timeliness of program runtime verification, effectively solving the problem of low timeliness of program runtime verification in the prior art.

[0108] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0109] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0110] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0112] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0113] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A program runtime verification method based on LTLf, characterized in that: The following steps are involved: S1, obtaining a runtime efficiency evaluation value according to network data, and determining whether to make runtime efficiency adjustment based on the runtime efficiency evaluation value; S2, obtaining a fault verification safety evaluation value according to the network data and the runtime effectiveness evaluation value that meets the timeliness condition, and judging whether to perform fault safety adjustment based on the fault verification safety evaluation value, wherein the runtime effectiveness evaluation value is used to evaluate the timeliness during network transmission, and the fault verification safety evaluation value is used to evaluate the safety during dynamic verification according to the received network data; S3, obtaining encapsulated network data according to the network data corresponding to the fault verification safety evaluation value that meets the safety condition, and performing data analysis on the encapsulated network data to obtain an analysis accuracy evaluation value, wherein the analysis accuracy evaluation value is used to evaluate the accuracy of the encapsulated network data during the data analysis process; S4, judging whether to make accuracy adjustment based on the parsing accuracy evaluation value, and performing formal verification on the LTLf constraint data corresponding to the parsing accuracy evaluation value that meets the parsing accuracy condition.

2. A program runtime verification method based on LTLf as claimed in claim 1, characterized in that: The specific process of obtaining the network data is as follows: Acquire initial network data, where the initial network data represents log data generated during operation; Cache the initial network data through network transmission, and read the cached initial network data into the specified string array; Encapsulate and identify the initial network data to obtain network data; The network data includes network data receiving delay, encapsulation identification delay, operation fault duration, operation fault number, operation duration, fault maintenance time, parsing compliance number and parsing compliance data volume; The parsing compliance number indicates the number of parsings that meet the preset LTLf constraint condition after data parsing of the encapsulated network data; The parsed compliant data volume represents the data volume corresponding to the encapsulated network data that complies with the preset LTLf constraint condition after data parsing of the encapsulated network data.

3. A program runtime verification method based on LTLf as claimed in claim 1, characterized in that: The specific process of obtaining the runtime effectiveness evaluation value based on network data is as follows: In the first step, the network data reception delay deviation is obtained by performing a ratio operation between the difference between the network data reception delay and the preset reception delay threshold obtained from the database and the preset reception delay threshold; In the second step, the difference between the package identification delay and the preset identification threshold obtained from the database is ratioed with the preset identification threshold and processed to obtain the package identification delay deviation; The third step is to obtain the runtime effectiveness evaluation value by combining the network data reception delay deviation and the encapsulation identification delay deviation.

4. A program runtime verification method based on LTLf as claimed in claim 1, characterized in that: The limiting expression of the runtime efficiency evaluation value is as follows: In the formula, SXX p represents the runtime effectiveness evaluation value corresponding to the network data in the pth preset time period, p = 1, 2, ..., m, p represents the number of the preset time period, m represents the total number of preset time periods, Indicates the network data receiving delay deviation corresponding to the network data in the pth preset time period, represents the package identification delay deviation corresponding to the network data in the pth preset time period, ΔCS represents the reference data reception delay range obtained from the database, ΔFS represents the reference package identification delay range obtained from the database, and e represents a natural constant.

5. A program runtime verification method based on LTLf as claimed in claim 1, characterized in that: The specific process of determining whether to adjust the runtime efficiency based on the runtime efficiency evaluation value is as follows: Step 1: determine whether the runtime efficiency evaluation value meets the timeliness condition. If so, no runtime efficiency adjustment is performed. Otherwise, execute step 2. Step 2: Dynamically select the route. When the monitored runtime efficiency evaluation value meets the timeliness condition, stop adjusting the runtime efficiency. Otherwise, execute step 3. Step 3: Perform load balancing. When the monitored runtime efficiency evaluation value meets the timeliness condition, stop adjusting the runtime efficiency. Otherwise, send an alarm to the preset personnel. The timeliness condition represents a runtime effectiveness evaluation value that is not lower than a preset runtime effectiveness threshold obtained from a database.

6. A program runtime verification method based on LTLf as claimed in claim 2, characterized in that: The specific process of obtaining the fault verification safety evaluation value according to the network data and the runtime evaluation value that meets the timeliness condition is as follows: The initial failure rate is obtained by performing a ratio calculation between the running failure duration and the running duration; The operation fault deviation is obtained by performing a ratio operation between the difference between the initial fault rate and the preset fault rate threshold obtained from the database and the preset fault rate threshold; The initial fault recovery time is obtained by performing a ratio calculation between the fault maintenance time and the number of operating faults; The running fault recovery deviation is obtained by performing a ratio operation between the difference between the initial fault recovery time and the preset fault recovery time threshold obtained from the database and the preset fault recovery time threshold; The fault verification safety assessment value is obtained by combining the operation fault deviation, the operation fault recovery deviation and the operation timeliness assessment value that meets the timeliness conditions.

7. A program runtime verification method based on LTLf as claimed in claim 6, characterized in that: The specific process of judging whether to perform fault safety adjustment based on the fault verification safety assessment value is as follows: VV1, determines whether the fault verification safety assessment value meets the safety condition. If so, no fault safety adjustment is performed. Otherwise, VV2 is executed; VV2, performs data encryption. When the monitored fault verification safety assessment value meets the safety condition, stops the fault safety adjustment, otherwise executes VV3; VV3, perform node fault tolerance processing. When the monitored fault verification safety assessment value meets the safety condition, stop the fault safety adjustment. Otherwise, send an alarm prompt to the preset personnel; The safety condition indicates that the fault verification safety assessment value is not lower than a preset fault safety threshold obtained from a database.

8. A program runtime verification method based on LTLf as claimed in claim 2, characterized in that: The specific process of performing data analysis on the encapsulated network data to obtain the analysis accuracy evaluation value is as follows: Obtaining an analysis coincidence ratio by performing a ratio calculation between the analysis coincidence times and a preset analysis count threshold value obtained from a database; Obtaining a parsed data volume compliance ratio by performing a ratio operation between the parsed compliance data volume and a preset parsed data volume threshold obtained from a database; The analysis accuracy evaluation value is obtained by combining the analysis compliance ratio, the analysis data volume compliance ratio and the fault verification safety evaluation value that meets the safety conditions.

9. A program runtime verification method based on LTLf as claimed in claim 8, characterized in that: The specific process of determining whether to perform accuracy adjustment based on the analytical accuracy evaluation value is as follows: QQ1, determine whether the analysis accuracy evaluation value meets the analysis accuracy condition. If so, no accuracy adjustment is performed. Otherwise, QQ2 is executed. QQ2, perform noise reduction processing. When the monitored analytical accuracy evaluation value meets the analytical accuracy condition, stop the accuracy adjustment. Otherwise, execute QQ3; QQ3, performs timing constraints, by stopping accuracy adjustment when the monitored analysis accuracy evaluation value meets the analysis accuracy condition, otherwise an alarm prompt is sent to the preset personnel; The analysis accuracy condition indicates that the analysis accuracy evaluation value is not lower than a preset analysis accuracy threshold obtained from a database.

10. A program runtime verification method based on LTLf as claimed in claim 1, characterized in that: The specific process of formally verifying the LTLf constraint data corresponding to the parsing accuracy evaluation value that meets the parsing accuracy condition is as follows: If the formal constraints described in the LTLf language reach the True state, the constraints are satisfied; If the formal constraints described in the LTLf language reach the False state, the constraints are not satisfied.

Citation Information

Patent Citations

  • A method for runtime verification and control of Linux system scripts

    CN111914250B

  • Internet of Things program runtime verification method based on Docker

    CN117034258A

  • Embedded software testing method based on AADL (Architecture Analysis and Design Language) mode time automata model

    CN102063369A

  • Method for measuring monitorability probability of properties in runtime verification

    CN111352848A

  • Index verification technology supporting quantitative evaluation of model attributes

    CN114896755A