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 :
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 :
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.
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 :
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 :
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.