CN113946466B - QT-based software error tracing method and device - Google Patents

QT-based software error tracing method and device Download PDF

Info

Publication number
CN113946466B
CN113946466B CN202111292041.9A CN202111292041A CN113946466B CN 113946466 B CN113946466 B CN 113946466B CN 202111292041 A CN202111292041 A CN 202111292041A CN 113946466 B CN113946466 B CN 113946466B
Authority
CN
China
Prior art keywords
error
parameter
determining
functional modules
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111292041.9A
Other languages
Chinese (zh)
Other versions
CN113946466A (en
Inventor
刘搏阳
万平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Haitong Hengxin International Finance Leasing (Tianjin) Co.,Ltd.
Original Assignee
Guangzhou Chenchuang Technology Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Chenchuang Technology Development Co ltd filed Critical Guangzhou Chenchuang Technology Development Co ltd
Priority to CN202111292041.9A priority Critical patent/CN113946466B/en
Publication of CN113946466A publication Critical patent/CN113946466A/en
Application granted granted Critical
Publication of CN113946466B publication Critical patent/CN113946466B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a QT-based software error tracing method and device, wherein the method comprises the following steps: determining an error function module in the target software; determining all transmission parameters in the error function module; calculating the error rate of all other functional modules in the parameter delivery flow of each delivery parameter; and determining error transmission parameters which enable the error functional module to generate errors in all the transmission parameters according to the error rates of all other functional modules in the parameter transmission stream of each transmission parameter. Therefore, the method and the device can determine the transmission parameters causing the errors by analyzing the error rates of other functional modules corresponding to all the transmission parameters in the wrong functional module, thereby more accurately positioning the error parameters of the software and being beneficial to realizing more accurate and more intelligent software error analysis.

Description

QT-based software error tracing method and device
Technical Field
The invention relates to the technical field of code analysis, in particular to a software error tracing method and device based on QT.
Background
With the rise of the software industry, the market demand for software development is increasing, and the demand for higher convenience of software development environment follows. Nowadays, software developers need to face more and more complex development requirements, and the amount of codes to be processed is larger and larger, so that once a software error occurs, it is also critical how to accurately identify and locate the error delivery parameters of the codes. In the prior art, the error tracing idea is generally to judge whether parameters are correct or not based on preset parameter conditions, and the time and the labor are consumed when the error tracing idea is applied to a large-scale software project which has a huge code amount and a plurality of functional modules.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method and a device for tracing software errors based on QT, which can more accurately position error parameters of software and are beneficial to realizing more accurate and more intelligent software error analysis.
In order to solve the technical problem, a first aspect of the present invention discloses a QT-based software error tracing method, which includes:
determining an error function module in the target software;
determining all transfer parameters in the error function module;
calculating the error rate of all other functional modules in the parameter delivery flow of each delivery parameter;
and determining error transmission parameters which enable the error functional module to generate errors in all the transmission parameters according to the error rates of all other functional modules in the parameter transmission stream of each transmission parameter.
As an optional implementation manner, in the first aspect of the present invention, the determining all transfer parameters in the error function module includes:
determining an error time interval when the error functional module has errors;
determining all transfer parameters for transfer in the error function module within the error time interval.
As an optional implementation manner, in the first aspect of the present invention, the calculating an error rate of all other functional modules in the parameter delivery flow of each delivery parameter includes:
for each transfer parameter, determining all other functional modules passed by the parameter transfer flow of the transfer parameter;
determining an error condition for each of the other functional modules during the error time interval;
and determining the error rate corresponding to the transmission parameter according to the error conditions of all other functional modules.
As an optional implementation manner, in the first aspect of the present invention, all other functional modules through which the parameter delivery flow that determines the delivery parameter passes include:
calculating a plurality of parameter delivery flow information of the delivery parameter in a plurality of time periods within the error time interval;
determining the parameter transfer flow information with the maximum number of the other connected functional modules in the plurality of parameter transfer flow information as a target parameter transfer flow;
all other functional modules passed through in the target parameter delivery flow are determined.
As an optional implementation manner, in the first aspect of the present invention, the determining, according to the error condition of all other functional modules, an error rate corresponding to the transfer parameter includes:
calculating the parameter transmission distance between any other functional module and the error functional module; the parameter transfer distance is the time length and/or the function boundary number which are required to pass the transfer parameter from the other functional modules to the error functional module;
calculating the distance weight of each other functional module according to the parameter transmission distance; the distance weight is inversely proportional to the parameter transfer distance;
and determining the error rate corresponding to the transmission parameter according to the error conditions of all other functional modules and the distance weight.
As an optional implementation manner, in the first aspect of the present invention, the determining, according to the error condition and the distance weight of all the other functional modules, an error rate corresponding to the transfer parameter includes:
calculating the error rate A corresponding to the transmission parameter according to the following formula 0
Figure BDA0003335159680000021
Wherein M represents the number of all the other functional modules passed through in the target parameter delivery stream, g i Represents the distance weight, n, corresponding to the ith said other functional module i Indicating the error condition corresponding to the ith other functional module, wherein the error condition is n when the other functional module has an error in the error time interval i Equal to a positive value, the error condition being that no other functional module has occurred during the error time intervalIn case of error, n i Equal to zero.
As an optional implementation manner, in the first aspect of the present invention, when the other functional module performs the same task as the error functional module in the error time interval, the positive value corresponding to the other functional module is a first positive value; when the other functional modules execute different tasks in the error time interval with the error functional module, the positive value corresponding to the other functional modules is a second positive value; the first positive value is greater than the second positive value.
As an optional implementation manner, in the first aspect of the present invention, the determining, according to the error rates of all other functional modules in the parameter delivery stream of each delivery parameter, an error delivery parameter that causes an error to occur in the erroneous functional module in all the delivery parameters includes:
screening all transmission parameters of which the corresponding error rates are greater than a preset error rate threshold value;
and/or the presence of a gas in the gas,
sorting all the transmission parameters according to the error rate from large to small, and screening out all the transmission parameters with a preset number of bits before the sorting;
and determining all screened transmission parameters as error transmission parameters which cause the error function module to generate errors.
The second aspect of the invention discloses a software error tracing device based on QT, which comprises:
the first determining module is used for determining an error function module in the target software;
a second determining module, configured to determine all transfer parameters in the error function module;
the calculation module is used for calculating the error rate of all other functional modules in the parameter transfer flow of each transfer parameter;
and a third determining module, configured to determine, according to the error rate of all other functional modules in the parameter delivery stream of each delivery parameter, an error delivery parameter that causes the error functional module to generate an error among all the delivery parameters.
As an optional implementation manner, in the second aspect of the present invention, a specific manner in which the second determining module determines all transfer parameters in the error function module includes:
determining an error time interval when the error functional module has errors;
determining all transfer parameters for transfer in the error function module within the error time interval.
As an optional implementation manner, in the second aspect of the present invention, a specific manner for the calculation module to calculate the error rate of all other functional modules in the parameter delivery flow of each delivery parameter includes:
for each transfer parameter, determining all other functional modules passed by the parameter transfer flow of the transfer parameter;
determining an error condition for each of the other functional modules during the error time interval;
and determining the error rate corresponding to the transmission parameter according to the error conditions of all other functional modules.
As an optional implementation manner, in the second aspect of the present invention, a specific manner of determining, by the calculation module, all other functional modules through which the parameter delivery flow of the delivery parameter passes includes:
calculating a plurality of parameter delivery flow information of the delivery parameter in a plurality of time periods in the error time interval;
determining the parameter transfer flow information with the largest number of the other connected functional modules in the plurality of parameter transfer flow information as a target parameter transfer flow;
all other functional modules passed through in the target parameter delivery flow are determined.
As an optional implementation manner, in the second aspect of the present invention, a specific manner in which the computing module determines the error rate corresponding to the transfer parameter according to the error condition of all other functional modules includes:
calculating a parameter transfer distance between any of the other functional modules and the error functional module; the parameter transfer distance is the time length and/or the function boundary number which are required to pass the transfer parameter from the other functional modules to the error functional module;
calculating the distance weight of each other functional module according to the parameter transmission distance; the distance weight is inversely proportional to the parameter transfer distance;
and determining the error rate corresponding to the transmission parameter according to the error conditions of all other functional modules and the distance weight.
As an optional implementation manner, in the second aspect of the present invention, a specific manner in which the calculation module determines the error rate corresponding to the transfer parameter according to the error condition and the distance weight of all other functional modules includes:
calculating the error rate A corresponding to the transmission parameter according to the following formula 0
Figure BDA0003335159680000051
Wherein, the number of all other functional modules passed in the target parameter delivery flow is represented, g i Represents the distance weight, n, corresponding to the ith other function module i Indicating the error condition corresponding to the ith other functional module, wherein the error condition is n when the other functional module has an error in the error time interval i Equal to a positive value, where the error condition is n when the other functional modules have no error in the error time interval i Equal to zero.
As an optional implementation manner, in the second aspect of the present invention, when the other functional module performs the same task as the error functional module in the error time interval, the positive value corresponding to the other functional module is a first positive value; when the other functional modules execute different tasks in the error time interval with the error functional module, the positive value corresponding to the other functional modules is a second positive value; the first positive value is greater than the second positive value.
As an optional implementation manner, in the second aspect of the present invention, the specific manner of determining, by the third determining module, an error delivery parameter that causes the error functional module to generate an error in all the delivery parameters according to the error rate of all other functional modules in the parameter delivery stream of each delivery parameter includes:
screening all transmission parameters of which the corresponding error rates are greater than a preset error rate threshold value;
and/or the presence of a gas in the atmosphere,
sorting all the transmission parameters according to the error rate from large to small, and screening out all the transmission parameters with a preset number of bits before the sorting;
and determining all screened transmission parameters as error transmission parameters which cause the error function module to generate errors.
The third aspect of the invention discloses another software error tracing device based on QT, which comprises:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program codes stored in the memory to execute part or all of the steps in the QT-based software error tracing method disclosed in the first aspect of the embodiment of the present invention.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, an error function module in target software is determined; determining all transmission parameters in the error function module; calculating the error rate of all other functional modules in the parameter transfer flow of each transfer parameter; and determining error transmission parameters which enable the error functional module to generate errors in all the transmission parameters according to the error rates of all other functional modules in the parameter transmission stream of each transmission parameter. Therefore, the method and the device can determine the transmission parameters causing the errors by analyzing the error rates of other functional modules corresponding to all the transmission parameters in the wrong functional module, thereby more accurately positioning the error parameters of the software and being beneficial to realizing more accurate and more intelligent software error analysis.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flowchart of a QT-based software error tracing method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a QT-based software error tracing apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of another QT-based software error tracing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
The terms "first," "second," and the like in the description and claims of the present invention and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, article, or article that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or article.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The invention discloses a QT-based software error tracing method and device, which can determine transmission parameters causing errors by analyzing error rates of other functional modules corresponding to all transmission parameters in the erroneous functional modules, thereby more accurately positioning the error parameters of software and being beneficial to realizing more accurate and more intelligent software error analysis. The following are detailed below.
Example one
Referring to fig. 1, fig. 1 is a schematic flowchart of a QT-based software error tracing method according to an embodiment of the present invention. The method described in fig. 1 may be applied to a corresponding software analysis terminal, a corresponding software analysis device, or a corresponding software analysis server, and the server may be a local server or a cloud server. Optionally, the software error tracing method may be implemented through programming languages such as C language or Python language, and may be implemented through programming development in a QT development environment, and through each API in the QT development environment, the parameter information or the information such as the transfer information in the method is obtained. More specifically, the visual presentation of the error tracing method of the method can be realized through a QT development environment. Specifically, as shown in fig. 1, the QT-based software error tracing method may include the following operations:
101. and determining an error function module in the target software.
Alternatively, the target software may be software code under development or software code that has already been developed. Optionally, the functional module in this embodiment, such as an error functional module or other functional modules, may be an association function set in the target software, for example, a set formed by multiple association functions for implementing the same function.
102. All transfer parameters in the error function module are determined.
Optionally, the transfer parameter may be an internal definition parameter or a macro definition parameter, and the numerical format of the transfer parameter is not limited, and generally, the transfer parameter is a macro definition parameter, which may be transferred in different functional modules, but when performing error tracing for the inside of a smaller module, it may also be an internal definition parameter.
103. And calculating the error rate of all other functional modules in the parameter delivery flow of each delivery parameter.
104. And determining the error transmission parameters which cause the error functional module to generate errors in all the transmission parameters according to the error rates of all other functional modules in the parameter transmission stream of each transmission parameter.
Therefore, the method described by the embodiment of the invention can determine the transmission parameters causing the error by analyzing the error rates of other functional modules corresponding to all the transmission parameters in the erroneous functional modules, thereby more accurately positioning the error parameters of the software and being beneficial to realizing more accurate and more intelligent software error analysis.
As an optional implementation manner, in the foregoing step, determining all the transfer parameters in the error function module includes:
determining an error time interval when an error functional module has errors;
all transfer parameters for transfer in the error function module within the error time interval are determined.
Specifically, the API of the QT development environment can be used for calling the error record of the target software to determine the error time interval of the error function module, and then the API of the QT development environment is used for calling the parameter transmission record of the error function module, so that all transmission parameters transmitted in the error function module in the error time interval can be determined.
Therefore, by implementing the optional implementation mode, all transmission parameters transmitted in the error function module in the error time interval can be determined according to the error time interval in which the error occurs in the error function module, and then the transmission parameters which may possibly occur in the error can be more accurately positioned according to the error time interval according to all the determined transmission parameters, so that the error parameters of the software can be more accurately positioned, and more accurate and more intelligent software error analysis can be favorably realized.
As an optional implementation manner, in the above step, calculating the error rate of all other functional modules in the parameter delivery flow of each delivery parameter includes:
for each transfer parameter, determining all other functional modules through which the parameter transfer flow of the transfer parameter passes;
determining an error condition of each other functional module in the error time interval;
and determining the error rate corresponding to the transmission parameter according to the error conditions of all other functional modules.
In the embodiment of the present invention, a parameter transfer flow for transferring parameters is defined as an information flow composed of a plurality of function modules or function functions passed through in the process of transferring the transfer parameters, and may be an information flow for calling execution record information of target software through an API of a QT development environment to determine all function modules or function functions including records of the target transfer parameters.
In the embodiment of the present invention, the error condition may be information about whether the other function module has an error, and the information may be acquired by calling, through an API of the QT development environment, an execution record of the other function module in the error time interval.
Therefore, by implementing the optional implementation mode, the error rate corresponding to the transmission parameter can be determined according to the error conditions of all other functional modules through which the parameter transmission flow of the transmission parameter passes, and then error positioning is performed according to the determined error rate, so that the transmission parameter which may have errors can be more accurately positioned according to the error conditions of the functional modules corresponding to different transmission parameters, and further, the error parameter of software can be more accurately positioned, which is beneficial to realizing more accurate and more intelligent software error analysis.
As an optional implementation manner, in the foregoing steps, all other functional modules through which the parameter delivery flow of the delivery parameter is determined include:
calculating a plurality of parameter delivery flow information of the delivery parameter in a plurality of time periods within an error time interval;
determining the parameter transfer flow information with the maximum number of other connected functional modules in the plurality of parameter transfer flow information as a target parameter transfer flow;
all other functional modules passed through in the target parameter delivery flow are determined.
It can be seen that, by implementing the optional implementation manner, it may be determined that the parameter transfer flow information with the largest number of other connected functional modules in the plurality of parameter transfer flow information is the target parameter transfer flow, and then all other functional modules corresponding to the transfer parameter are determined according to the target parameter transfer flow, so that the transfer parameter that may be in error may be more accurately located in the following according to the error conditions of as many functional modules corresponding to different transfer parameters as possible, and further, the error parameter of the software may be more accurately located, which is beneficial to implement more accurate and more intelligent software error analysis.
As an optional implementation manner, in the foregoing step, determining an error rate corresponding to the transfer parameter according to error conditions of all other functional modules includes:
calculating the parameter transmission distance between any other functional module and the error functional module;
calculating the distance weight of each other functional module according to the parameter transmission distance;
and determining the error rate corresponding to the transmission parameter according to the error conditions and the distance weight of all other functional modules.
Optionally, the parameter transfer distance is a length of time that the transfer parameter needs to be transferred from the other functional module to the error functional module, or a number of function boundaries, or a combination of the two, such as a weighted sum of the two. The time length or the number of function boundaries of the transfer parameter transferred from the other function module to the error function module may be calculated by calling the execution record of the transfer parameter through the API of the QT development environment, for example, a first time point at which the transfer parameter is transferred to the other function module and a second time point at which the transfer parameter is transferred to the error function module may be obtained through the API of the QT development environment, and a difference between the first time point and the second time point is calculated to obtain the time length. For another example, any one of the execution records including the complete transfer of the transfer parameter from the other function module to the error function module may be obtained through the API of the QT development environment, and the number of the function functions included therein that are passed continuously is calculated to obtain the number of function boundaries.
Optionally, the distance weight is inversely proportional to the parameter transmission distance, that is, the longer the parameter transmission distance is, the lower the distance weight corresponding to the transmission parameter is. Optionally, the sum of the distance weights of all transfer parameters should be equal to 1 to make the distribution of the weights reasonable. The specific weight determination may be performed by using an existing weight determination algorithm, which is not described herein again. By so doing, other function modules closer in transfer distance to the error function module are more highly weighted due to their error connection.
Therefore, by implementing the optional implementation mode, the distance weight of each other function module can be calculated according to the parameter transmission distance between any other function module and the error function module, and the error rate corresponding to the transmission parameter is determined according to the error condition and the distance weight, so that the error rate corresponding to the transmission parameter can be more accurately calculated by combining the distance weight, the error parameter of the software can be more accurately positioned, and more accurate and more intelligent software error analysis can be realized.
As an optional implementation manner, in the foregoing step, determining an error rate corresponding to the transfer parameter according to the error conditions and the distance weights of all other functional modules includes:
calculating the error rate A corresponding to the transmission parameter according to the following formula 0
Figure BDA0003335159680000101
Wherein the number of all other functional modules passed through in the target parameter delivery stream is indicated, g i Represents the distance weight corresponding to the ith other function module, n i Indicating the error condition corresponding to the ith other functional module, wherein the error condition is n when the other functional modules have errors in the error time interval i Equal to positive value, and the error condition is that n is the error condition of other functional modules in the error time interval i Equal to zero.
Optionally, when the other functional modules execute the same task in the error time interval as the error functional module, the positive value corresponding to the other functional modules is the first positive value; when other functional modules execute different tasks in the error time interval with the error functional module, the corresponding positive values of the other functional modules are second positive values; the first positive value is greater than the second positive value. Optionally, the same task is executed in the embodiment of the present invention, which may be defined as that in the error time interval, data association or result association exists between the executions of the two modules, for example, the two modules execute sequentially or perform calculation by using the data result of the other module or by using the same data basis, and if the definition is not satisfied, different tasks are executed. Through the setting, when the same task executed by the error function module in the error time interval has an error, the value corresponding to the error condition is higher, so that the relevance between the error rate of the transmission parameter and the error of the error function module can be reflected more accurately.
Therefore, by implementing the optional implementation mode, the error rate corresponding to the transmission parameter can be calculated according to the formula, so that the error rate corresponding to the transmission parameter can be more accurately calculated by combining the distance weight and the positive numerical values under different conditions, the error parameter of the software can be more accurately positioned, and more accurate and more intelligent software error analysis can be favorably realized.
As an optional implementation manner, in the step, determining, according to the error rates of all other functional modules in the parameter delivery stream of each delivery parameter, an error delivery parameter that causes an error to occur in the erroneous functional module in all the delivery parameters includes:
screening all transmission parameters of which the corresponding error rates are greater than a preset error rate threshold value;
and determining all screened transmission parameters as error transmission parameters which cause the error function module to generate errors.
Therefore, by implementing the optional implementation mode, all the transmission parameters with the error rates larger than the preset error rate threshold value in all the transmission parameters can be screened out and determined as error transmission parameters, so that the error parameters of the software can be more accurately positioned, more accurate and more intelligent software error analysis can be realized, and further software error analysis can be subsequently performed according to the determined error transmission parameters.
As an optional implementation manner, in the step, determining, according to the error rates of all other functional modules in the parameter delivery stream of each delivery parameter, an error delivery parameter that causes an error to occur in the erroneous functional module in all the delivery parameters includes:
sorting all transmission parameters from high to low according to the error rate, and screening out all transmission parameters with a preset number of bits before the sorting;
and determining all screened transmission parameters as error transmission parameters which cause the error function module to generate errors.
Therefore, by implementing the optional implementation mode, all transmission parameters with a preset number of bits before being ranked in all transmission parameters can be screened out and determined as error transmission parameters, so that the error parameters of the software can be more accurately positioned, more accurate and more intelligent software error analysis can be realized, and further software error analysis can be subsequently performed according to the determined error transmission parameters.
Example two
Referring to fig. 2, fig. 2 is a schematic structural diagram of a QT-based software error tracing apparatus according to an embodiment of the present invention. The apparatus described in fig. 2 may be applied to a corresponding software analysis terminal, a corresponding software analysis device, or a corresponding software analysis server, and the server may be a local server or a cloud server. Optionally, the software error tracing device can be implemented through programming languages such as C language or Python language, and can be implemented through programming development in QT development environment, and parameter information or information such as transfer information in the device can be acquired through each API in the QT development environment. More specifically, the visual presentation of the error tracing apparatus can be realized through the QT development environment. Specifically, as shown in fig. 2, the apparatus may include:
the first determining module 201 is used for determining an error function module in the target software.
Alternatively, the target software may be software code under development or software code that has already been developed. Optionally, the functional module in this embodiment, such as the error functional module or other functional modules, may be an association function set in the target software, for example, a set formed by multiple association functions for implementing the same function.
A second determining module 202, configured to determine all transfer parameters in the error function module.
Optionally, the transfer parameter may be an internal definition parameter or a macro definition parameter, and the numerical format of the transfer parameter is not limited, and generally, the transfer parameter is a macro definition parameter, which may be transferred in different functional modules, but when performing error tracing for the inside of a smaller module, it may also be an internal definition parameter.
A calculating module 203, configured to calculate error rates of all other functional modules in the parameter delivery stream of each delivery parameter;
a third determining module 204, configured to determine, according to the error rates of all other functional modules in the parameter delivery stream of each delivery parameter, an error delivery parameter that causes an error to occur in the error functional module in all delivery parameters.
Therefore, the device described by the embodiment of the invention can determine the transmission parameters causing the error by analyzing the error rates of other functional modules corresponding to all the transmission parameters in the erroneous functional modules, thereby more accurately positioning the error parameters of the software and being beneficial to realizing more accurate and more intelligent software error analysis.
As an alternative implementation, the specific manner in which the second determining module 202 determines all the transfer parameters in the error function module includes:
determining an error time interval when an error functional module has errors;
all transfer parameters for transfer in the error function module within the error time interval are determined.
Specifically, the error record of the target software can be called through the API of the QT development environment, an error time interval in which an error occurs in the error function module is determined from the error record, and then the parameter transfer record of the error function module is called through the API of the QT development environment, so that all transfer parameters transferred in the error function module in the error time interval can be determined.
Therefore, by implementing the optional implementation mode, all transmission parameters transmitted in the error function module in the error time interval can be determined according to the error time interval in which the error occurs in the error function module, and then the transmission parameters which may possibly occur in the error can be more accurately positioned according to the error time interval according to all the determined transmission parameters, so that the error parameters of the software can be more accurately positioned, and more accurate and more intelligent software error analysis can be favorably realized.
As an alternative embodiment, the specific way for the calculating module 203 to calculate the error rate of all other functional modules in the parameter delivery flow of each delivery parameter includes:
for each transfer parameter, determining all other functional modules through which the parameter transfer flow of the transfer parameter passes;
determining an error condition of each other functional module in the error time interval;
and determining the error rate corresponding to the transmission parameter according to the error conditions of all other functional modules.
In the embodiment of the present invention, a parameter transfer flow for transferring parameters is defined as an information flow composed of a plurality of function modules or function functions passed through in the process of transferring the transfer parameters, and may be an information flow for calling execution record information of target software through an API of a QT development environment to determine all function modules or function functions including records of the target transfer parameters.
In the embodiment of the present invention, the error condition may be information about whether the other function module has an error, and the information may be acquired by calling, through an API of the QT development environment, an execution record of the other function module in the error time interval.
Therefore, by implementing the optional implementation mode, the error rate corresponding to the transmission parameter can be determined according to the error conditions of all other functional modules through which the parameter transmission flow of the transmission parameter passes, and then error positioning is performed according to the determined error rate, so that the transmission parameter which may have errors can be more accurately positioned according to the error conditions of the functional modules corresponding to different transmission parameters, and further, the error parameter of software can be more accurately positioned, which is beneficial to realizing more accurate and more intelligent software error analysis.
As an alternative embodiment, the specific manner of determining, by the calculation module 203, all other functional modules through which the parameter delivery flow of the delivery parameter passes includes:
calculating a plurality of parameter delivery flow information of the delivery parameter in a plurality of time periods within an error time interval;
determining the parameter transmission flow information with the maximum number of other connected functional modules in the parameter transmission flow information as a target parameter transmission flow;
all other functional modules passed through in the target parameter delivery flow are determined.
It can be seen that, by implementing the optional implementation manner, it may be determined that the parameter transfer flow information with the largest number of other connected functional modules in the plurality of parameter transfer flow information is the target parameter transfer flow, and then all other functional modules corresponding to the transfer parameter are determined according to the target parameter transfer flow, so that the transfer parameter that may be in error may be more accurately located in the following according to the error conditions of as many functional modules corresponding to different transfer parameters as possible, and further, the error parameter of the software may be more accurately located, which is beneficial to implement more accurate and more intelligent software error analysis.
As an optional implementation manner, the specific manner of determining the error rate corresponding to the transfer parameter by the calculating module 203 according to the error conditions of all other functional modules includes:
calculating the parameter transmission distance between any other functional module and the error functional module;
calculating the distance weight of each other functional module according to the parameter transmission distance;
and determining the error rate corresponding to the transmission parameter according to the error conditions and the distance weight of all other functional modules.
Optionally, the parameter transfer distance is a length of time that the transfer parameter needs to pass from the other functional module to the error functional module, or a number of functional boundaries, or a combination of both, such as a weighted sum of both. The time length or the number of function boundaries of the transfer parameter transferred from the other function module to the error function module may be calculated by calling the execution record of the transfer parameter through the API of the QT development environment, for example, a first time point at which the transfer parameter is transferred to the other function module and a second time point at which the transfer parameter is transferred to the error function module may be obtained through the API of the QT development environment, and a difference between the first time point and the second time point is calculated to obtain the time length. For another example, any one of the execution records including the complete transfer of the transfer parameter from the other function module to the error function module may be obtained through the API of the QT development environment, and the number of function boundaries included in the execution records may be calculated to obtain the number of function boundaries.
Optionally, the distance weight is inversely proportional to the parameter transmission distance, that is, the longer the parameter transmission distance is, the lower the distance weight corresponding to the transmission parameter is. Optionally, the sum of the distance weights of all transfer parameters should be equal to 1 to make the distribution of the weights reasonable. The specific weight determination may be performed by using an existing weight determination algorithm, which is not described herein again. By so setting, other function modules closer in transfer distance to the error function module are weighted higher because their error links are higher.
Therefore, by implementing the optional implementation mode, the distance weight of each other function module can be calculated according to the parameter transmission distance between any other function module and the error function module, and the error rate corresponding to the transmission parameter is determined according to the error condition and the distance weight, so that the error rate corresponding to the transmission parameter can be more accurately calculated by combining the distance weight, the error parameter of the software can be more accurately positioned, and more accurate and more intelligent software error analysis can be realized.
As an optional implementation manner, the specific manner in which the calculating module 203 determines the error rate corresponding to the transfer parameter according to the error conditions and the distance weights of all other functional modules includes:
calculating the error rate A corresponding to the transmission parameter according to the following formula 0
Figure BDA0003335159680000151
Wherein the number of all other functional modules passed through in the target parameter delivery stream, g i Represents the distance weight corresponding to the ith other function module, n i Indicating the error condition corresponding to the ith other functional module, wherein the error condition is n when the other functional modules have errors in the error time interval i Is equal to a positive valueThe error condition is that n is the error of other functional modules in the error time interval i Equal to zero.
Optionally, when the other functional modules execute the same task in the error time interval as the error functional module, the positive value corresponding to the other functional modules is the first positive value; when other functional modules execute different tasks in the error time interval with the error functional module, the positive values corresponding to the other functional modules are second positive values; the first positive value is greater than the second positive value. Optionally, the same task is executed in the embodiment of the present invention, which may be defined as that in the error time interval, data association or result association exists between the executions of the two modules, for example, the two modules execute one after another or perform calculation by using the data result of the other module or by using the same data basis, and if the definition is not satisfied, different tasks are executed. By means of the setting, when the error functional module executes the same task in the error time interval and has an error, the value corresponding to the error condition of the error functional module is higher, and therefore the relevance between the error rate of the transmission parameter and the error of the error functional module can be reflected more accurately.
Therefore, by implementing the optional implementation mode, the error rate corresponding to the transmission parameter can be calculated according to the formula, so that the error rate corresponding to the transmission parameter can be more accurately calculated by combining the distance weight and the positive numerical values under different conditions, the error parameter of the software can be more accurately positioned, and more accurate and more intelligent software error analysis can be favorably realized.
As an alternative embodiment, the third determining module 204 determines, according to the error rate of all other functional modules in the parameter delivery stream of each delivery parameter, a specific manner of an error delivery parameter that causes an error to occur in an error functional module in all delivery parameters, including:
screening all transmission parameters of which the corresponding error rates are greater than a preset error rate threshold value;
and determining all screened transmission parameters as error transmission parameters which cause the error function module to generate errors.
Therefore, by implementing the optional implementation mode, all the transmission parameters with the error rates larger than the preset error rate threshold value in all the transmission parameters can be screened out and determined as error transmission parameters, so that the error parameters of the software can be more accurately positioned, more accurate and more intelligent software error analysis can be realized, and further software error analysis can be subsequently performed according to the determined error transmission parameters.
As an alternative embodiment, the third determining module 204 determines a specific manner of the error delivery parameter that causes the error functional module to generate an error in all the delivery parameters according to the error rate of all other functional modules in the parameter delivery stream of each delivery parameter, including:
sorting all the transmission parameters according to the error rate from large to small, and screening out all the transmission parameters with a preset number of bits before the sorting;
and determining all screened transmission parameters as error transmission parameters which cause the error function module to generate errors.
Therefore, by implementing the optional implementation mode, all transmission parameters with a preset number of bits before being ranked in all transmission parameters can be screened out and determined as error transmission parameters, so that the error parameters of the software can be more accurately positioned, more accurate and more intelligent software error analysis can be realized, and further software error analysis can be subsequently performed according to the determined error transmission parameters.
EXAMPLE III
Referring to fig. 3, fig. 3 is a schematic structural diagram of another QT-based software error tracing apparatus according to an embodiment of the present invention. As shown in fig. 3, the apparatus may include:
a memory 301 storing executable program code;
a processor 302 coupled to the memory 301;
the processor 302 calls the executable program code stored in the memory 301 to execute part or all of the steps in the QT-based software error tracing method disclosed in the embodiment of the present invention.
Example four
The embodiment of the invention discloses a computer storage medium, which stores computer instructions, and when the computer instructions are called, the computer storage medium is used for executing part or all steps in the QT-based software error tracing method disclosed by the embodiment of the invention.
The above-described embodiments of the apparatus are merely illustrative, and the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above detailed description of the embodiments, those skilled in the art will clearly understand that each embodiment may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. Based on such understanding, the above technical solutions may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, wherein the storage medium includes a Read-Only Memory (ROM), a Random Access Memory (RAM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc-Read-Only Memory (CD-ROM) or other Memory capable of storing data, a magnetic tape, or any other computer-readable medium capable of storing data.
Finally, it should be noted that: the software error tracing method and device based on QT disclosed in the embodiments of the present invention are only the preferred embodiments of the present invention, and are only used for illustrating the technical solutions of the present invention, rather than limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art; the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (7)

1. A QT-based software error tracing method is characterized by comprising the following steps:
determining an error function module in the target software;
determining all transmission parameters in the error function module;
calculating the error rate of all other functional modules in the parameter delivery flow of each delivery parameter;
determining error transmission parameters which enable the error functional module to generate errors in all the transmission parameters according to the error rates of all other functional modules in the parameter transmission flow of each transmission parameter;
the determining all transfer parameters in the error function module includes:
determining an error time interval when the error functional module has errors;
determining all transfer parameters for transfer in the error function module within the error time interval;
the calculating the error rate of all other functional modules in the parameter delivery flow of each delivery parameter comprises:
for each transfer parameter, determining all other functional modules passed by the parameter transfer flow of the transfer parameter;
determining an error condition for each of the other functional modules during the error time interval;
determining the error rate corresponding to the transmission parameter according to the error conditions of all other functional modules;
determining an error rate corresponding to the transmission parameter according to the error conditions of all other functional modules, including:
calculating a parameter transfer distance between any of the other functional modules and the error functional module; the parameter transfer distance is the time length and/or the function boundary number which are required to pass the transfer parameter from the other functional modules to the error functional module;
calculating the distance weight of each other functional module according to the parameter transmission distance; the distance weight is inversely proportional to the parameter propagation distance;
and determining the error rate corresponding to the transmission parameter according to the error conditions of all other functional modules and the distance weight.
2. The QT-based software error tracing method of claim 1, wherein the determining all other functional modules through which the parameter delivery flow of the delivery parameter passes comprises:
calculating a plurality of parameter delivery flow information of the delivery parameter in a plurality of time periods within the error time interval;
determining the parameter transfer flow information with the largest number of the other connected functional modules in the plurality of parameter transfer flow information as a target parameter transfer flow;
all other functional modules passed through in the target parameter delivery flow are determined.
3. The QT-based software error tracing method according to claim 2, wherein the determining the error rate corresponding to the transfer parameter according to the error condition and the distance weight of all other functional modules comprises:
calculating the error rate A corresponding to the transmission parameter according to the following formula 0
Figure FDA0003743346720000021
Wherein M represents the number of all the other functional modules passed through in the target parameter delivery stream, g i Represents the distance weight, n, corresponding to the ith other function module i Indicating the error condition corresponding to the ith other functional module, wherein the error condition is n when the other functional module has an error in the error time interval i Equal to a positive value, where the error condition is n when the other functional modules have no error in the error time interval i Equal to zero.
4. The QT-based software fault tracing method of claim 3, wherein when the other functional module is performing the same task as the faulty functional module in the faulty time interval, the positive value corresponding to the other functional module is a first positive value; when the other functional modules execute different tasks in the error time interval with the error functional module, the positive value corresponding to the other functional modules is a second positive value; the first positive value is greater than the second positive value.
5. The QT-based software error tracing method according to claim 2, wherein the determining, according to the error rate of all other functional modules in the parameter delivery stream of each delivery parameter, an error delivery parameter of all the delivery parameters that causes the error functional module to generate an error comprises:
screening all transmission parameters of which the corresponding error rates are larger than a preset error rate threshold value;
and/or the presence of a gas in the gas,
sorting all the transmission parameters according to the error rate from large to small, and screening out all the transmission parameters with a preset number of bits before the sorting;
and determining all screened transmission parameters as error transmission parameters which cause the error function module to generate errors.
6. A QT-based software error tracing device, characterized in that the device comprises:
the first determining module is used for determining an error function module in the target software;
a second determining module, configured to determine all transfer parameters in the error function module, including: the second determining module is used for determining an error time interval when the error functional module generates errors; the second determination module is further used for determining all transfer parameters transferred in the error function module in the error time interval;
a calculation module, configured to calculate an error rate of all other functional modules in the parameter delivery flow of each delivery parameter, including: for each transfer parameter, the calculation module is used for determining all other functional modules through which the parameter transfer flow of the transfer parameter passes;
the calculation module is further configured to:
determining an error condition for each of the other functional modules during the error time interval;
determining an error rate corresponding to the transmission parameter according to the error conditions of all other functional modules, including: calculating a parameter transfer distance between any of the other functional modules and the error functional module; the parameter transfer distance is the time length and/or the function boundary number which are required to pass the transfer parameter from the other functional modules to the error functional module;
calculating the distance weight of each other functional module according to the parameter transmission distance; the distance weight is inversely proportional to the parameter transfer distance;
determining an error rate corresponding to the transmission parameter according to the error conditions of all other functional modules and the distance weight;
and a third determining module, configured to determine, according to the error rate of all other functional modules in the parameter delivery stream of each delivery parameter, an error delivery parameter that causes the error functional module to generate an error among all the delivery parameters.
7. A QT-based software error tracing device, characterized in that the device comprises:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the QT-based software error tracing method of any of claims 1-5.
CN202111292041.9A 2021-11-03 2021-11-03 QT-based software error tracing method and device Active CN113946466B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111292041.9A CN113946466B (en) 2021-11-03 2021-11-03 QT-based software error tracing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111292041.9A CN113946466B (en) 2021-11-03 2021-11-03 QT-based software error tracing method and device

Publications (2)

Publication Number Publication Date
CN113946466A CN113946466A (en) 2022-01-18
CN113946466B true CN113946466B (en) 2022-10-14

Family

ID=79337430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111292041.9A Active CN113946466B (en) 2021-11-03 2021-11-03 QT-based software error tracing method and device

Country Status (1)

Country Link
CN (1) CN113946466B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706752A (en) * 2009-11-20 2010-05-12 中兴通讯股份有限公司 Method and device for in-situ software error positioning
JP2014160421A (en) * 2013-02-20 2014-09-04 Toyota Motor Corp Soft error analysis device and error information preparation device
CN106681843A (en) * 2015-11-05 2017-05-17 中国科学院沈阳自动化研究所 Parameter transmission method among sub-modules on the basis of assembly-type development mode loose coupling
CN110350987A (en) * 2019-06-25 2019-10-18 成都九洲迪飞科技有限责任公司 A kind of cross-platform RF index automatization test system and test method based on QT

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706752A (en) * 2009-11-20 2010-05-12 中兴通讯股份有限公司 Method and device for in-situ software error positioning
JP2014160421A (en) * 2013-02-20 2014-09-04 Toyota Motor Corp Soft error analysis device and error information preparation device
CN106681843A (en) * 2015-11-05 2017-05-17 中国科学院沈阳自动化研究所 Parameter transmission method among sub-modules on the basis of assembly-type development mode loose coupling
CN110350987A (en) * 2019-06-25 2019-10-18 成都九洲迪飞科技有限责任公司 A kind of cross-platform RF index automatization test system and test method based on QT

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"一个以指令流为参数的软件错误模型";阳道善 韩世强;《华中理工大学学报》;19950630;第23卷(第06期);第97-100页 *
一种基于关联分析与N-Gram的错误参数检测方法;李超等;《软件学报》;20180313(第08期);第71-85页 *

Also Published As

Publication number Publication date
CN113946466A (en) 2022-01-18

Similar Documents

Publication Publication Date Title
CN108388514B (en) Interface automation test method, device, equipment and computer readable storage medium
CN111104335B (en) C language defect detection method and device based on multi-level analysis
CN111475355B (en) High-speed link signal integrity evaluation method, system, terminal and storage medium
CN112181804A (en) Parameter checking method, equipment and storage medium
CN114844768A (en) Information analysis method and device and electronic equipment
CN111736951A (en) Simulation method for automatic driving, computer device, and storage medium
CN115113528A (en) Operation control method, device, equipment and medium of neural network model
CN114610608A (en) Test case processing method and device, electronic equipment and storage medium
CN113946466B (en) QT-based software error tracing method and device
CN117195568B (en) Simulation engine performance analysis method and device based on discrete event
CN117009221A (en) Processing method, device, equipment, storage medium and program product for product test
CN115203556A (en) Score prediction model training method and device, electronic equipment and storage medium
CN115437961A (en) Data processing method and device, electronic equipment and storage medium
CN114610615A (en) Project test processing method, device, equipment and storage medium
CN114546799A (en) Point burying log checking method and device, electronic equipment, storage medium and product
CN111782527A (en) Interface testing method and device, computer equipment and storage medium
CN117648696B (en) Software security testing method and device
CN116955504B (en) Data processing method and device, electronic equipment and storage medium
CN111352840B (en) Online behavior risk assessment method, device, equipment and readable storage medium
CN114911770A (en) Method, device, equipment and medium for evaluating database migration
CN115599689A (en) Test logic display method, device, equipment and storage medium
CN117609064A (en) Unit test method and device, electronic equipment and storage medium
CN114647578A (en) System test method, device, equipment and storage medium
CN115865409A (en) Code risk detection method, device, equipment and medium
CN114138280A (en) Program analysis method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20231009

Address after: 300000 Tianjin Binhai New Area Tianjin Pilot Free Trade Zone (Dongjiang Bonded Port Area), No. 6975 Asia Road, Financial and Trade Center South Zone, 1-1-2019

Patentee after: Haitong Hengxin International Finance Leasing (Tianjin) Co.,Ltd.

Address before: 510640 0601, building 07, No. 235, Gaotang Road, Tianhe District, Guangzhou City, Guangdong Province (only for office use, not for plant)

Patentee before: GUANGZHOU CHENCHUANG TECHNOLOGY DEVELOPMENT Co.,Ltd.

TR01 Transfer of patent right
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20220118

Assignee: GUANGZHOU CHENCHUANG TECHNOLOGY DEVELOPMENT Co.,Ltd.

Assignor: Haitong Hengxin International Finance Leasing (Tianjin) Co.,Ltd.

Contract record no.: X2024980000618

Denomination of invention: A software error tracing method and device based on QT

Granted publication date: 20221014

License type: Exclusive License

Record date: 20240112

EE01 Entry into force of recordation of patent licensing contract