Scene reproduction method and device based on fault log and storage medium

By recording internal status data when software fails and reproducing the fault scenario in the simulation environment, the problem of low fault diagnosis efficiency in the existing technology is solved, a method of quickly locating the root cause of the fault is realized, and the efficiency of fault diagnosis is significantly improved.

CN118796699APending Publication Date: 2024-10-18卡斯柯信号(成都)有限公司

Patent Information

Application Number
CN202410994404.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In the existing technology, software fault diagnosis requires manual analysis of log files, which results in fault location being inefficient and easy to miss. It is particularly time-consuming when faults are complex.

Method used

By recording internal status data to fault logs when software fails, and loading these logs in the software simulation environment, the fault scenario can be accurately reproduced, allowing analysts to directly view the data status of each module to quickly locate the root cause of the problem.

Benefits of technology

It greatly reduces the analysis and derivation time, improves the efficiency of fault diagnosis, and enables analysts to quickly locate the root cause of the fault.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796699A_ABST
    Figure CN118796699A_ABST
Patent Text Reader

Abstract

The invention discloses a scene reproduction method and device based on a fault log and a storage medium, and relates to the technical field of software fault diagnosis, and the method comprises the following steps: S1, configuring a fault data table; s2, recording an alarm position and internal state data of the software to a fault log during software abnormity alarm; s3, generating a fault data assignment module; s4, positioning a fault alarm module; s5, generating a pre-execution state of the fault alarm module by using the output state of the fault data assignment module in a software simulation environment, reproducing a fault alarm scene, tracking internal abnormal state data, and positioning an abnormal data generation module; and S6, generating a pre-execution state of the abnormal data generation module by using the output state of the fault data assignment module in a software simulation environment, reproducing an abnormal data generation scene, and circulating the step to track a fault generation source. According to the method, analysts can quickly locate the root cause of the problem, the analysis and derivation time is shortened, and the fault diagnosis efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software fault diagnosis, and more specifically to a scene reproduction method, device and storage medium based on fault logs. Background Art

[0002] As the scale of software increases, diagnosing software failures is a more complex problem. For safety-critical software, if software failures are not correctly identified, it may lead to extremely serious consequences.

[0003] In the prior art, the Chinese patent publication number CN107145422B discloses a software fault alarm monitoring method, which ensures that the software always runs in the expected and determined state space by checking the preconditions, postconditions and invariants of the contract. When an abnormality is detected, the unique absolute path of the abnormal alarm information is recorded. According to the software alarm location, manual analysis and deduction of the log file is required to deduce the root cause of the fault. The manual analysis method depends on the quality of the analyst. When the problem is complicated to a certain extent, the indirect deduction method is both time-consuming and prone to omissions.

[0004] When the scene at the time of the failure can be reproduced, analysts can directly view the data status of each module of the software, which will greatly reduce the analysis and derivation time and quickly locate the root cause of the problem. Therefore, reproducing the scene at the time of the failure can improve the efficiency of fault diagnosis and become a technical problem that needs to be solved. Summary of the invention

[0005] In order to overcome the defects existing in the above-mentioned prior art, the present invention discloses a scenario reproduction method, device and storage medium based on fault log. When a software failure occurs, the present invention records the internal state data of the software into the fault log, uses the fault log to restore the internal state data at the time of the software failure, and then loads it into the software simulation environment to realize accurate scenario reproduction. Analysts can directly view the data status of each module of the software, which will greatly reduce the analysis and derivation time and quickly locate the root cause of the problem.

[0006] In order to achieve the above objectives, the technical solution adopted by the present invention is: In a first aspect, the present invention provides a scenario reproduction method based on a fault log, comprising the following steps: 1. Fault data table configuration S1. When the software is initialized, the information required to reproduce the fault scenario is configured into the fault data table; As a preferred technical solution, the information required to reproduce the fault scenario in step S1 includes: the software state of the previous cycle, the external input of this cycle, and the software state at the time of the fault in this cycle. This information is configured into the fault data table when the software is initialized.

[0007] In the present invention, the software status of the previous cycle is described using educational data; the educational data is synchronization data used for the operation of the main and standby dual systems, and can completely synchronize the operating status of the standby system to the status at the end of the previous cycle of the main system. After the educational data is assigned to the internal state of the standby system through the educational learning module, it is equivalent to the internal state of the main system at the end of the previous cycle, so that the main system and the standby system have the same starting point when running in the current cycle; the educational data is updated once at the end of each cycle, and the information is stored in the educational data global variable; the data can be used to reset the software status to the status at the end of the previous cycle, which is also equivalent to the status at the beginning of this cycle.

[0008] This cycle's external input includes all external messages received in this cycle, which are stored in the input data global variable in the order in which they are received.

[0009] The software status at the time of this cycle failure is described by the global variables of all business objects within the software.

[0010] As a preferred technical solution, the fault data table in step S1 is used to record the global variable information required for fault recovery, including: global variable name, storage address, data atom type, data number, data atom length, where: When the global variable is an array type, the data atom type is the type of an element of the array, the data atom length is the length of an element of the array, and the data number is the maximum number of storage elements of the array; When the global variable is not an array type, the data atom type is the type of the global variable, the data atom length is the length of the global variable, and the number of data is 1; The number of data multiplied by the length of the data atom is equivalent to the storage space length of the global variable.

[0011] 2. Fault log records software abnormal alarms S2. Based on the fault data table, when the software alarms abnormally, the alarm location and the internal status data of the software are recorded in the fault log; As a preferred technical solution, in step S2, when the software alarm is abnormal, the alarm position is recorded, and the alarm position description is the relative path from the top-level module of the system to the current execution module, which is represented by an ordered sequence information according to the module execution order; wherein, a member of the sequence represents the execution path description of a module, which is composed of a static module code and a dynamic module code, wherein the static module code uniquely corresponds to a module name, and the dynamic module code describes the relative position of the parent module calling the module. For details, see the description of Chinese Patent Publication No. CN107145422B.

[0012] As a preferred technical solution, in step S2, when the software abnormal alarm occurs, the internal state data of the software is recorded in the fault log, including: recording the corresponding global variables in the fault log according to the fault data table, and the recording format of each data in the fault data table in the fault log is: global variable name, data atom type, data number, data atom length, data value, where: The global variable name, data atom type, and data number in the fault log are derived from the global variable name, data atom type, and data number in the fault data table respectively; The data value in the fault log is the data obtained by multiplying the number of data copies from the storage address in the fault data table by the length of the data atom; After the recording is completed, the system is shut down to guide safety.

[0013] 3. Fault data assignment module generation S3, generating a fault data assignment module according to the fault log; As a preferred technical solution, step S3 includes: generating a corresponding assignment copy statement based on each fault data recorded in the fault log, the source address of the copy is the data value position in the fault log, the destination address of the copy is the address operation of the global variable name in the fault log, and the length of the copied data is the number of data in the fault log multiplied by the data atom length.

[0014] 4. Fault Alarm Module Positioning S4. Locate the fault alarm module according to the fault log; As a preferred technical solution, step S4 includes: parsing the sequence of alarm positions in the fault log, parsing each member of the sequence into a static module code and a dynamic module code, thereby obtaining a unique absolute path of the abnormal alarm information when the fault occurs, thereby locating the function module that generates the fault alarm.

[0015] 5. Locating abnormal data generation module S5. Use the output state of the fault data assignment module to generate the state before the fault alarm module is executed in the software simulation environment, reproduce the fault alarm scenario, track the internal abnormal state data, and locate the abnormal data generation module; As a preferred technical solution, step S5 uses the output state of the fault data assignment module in the software simulation environment to generate the state before the execution of the fault alarm module to reproduce the fault alarm scenario, including: in the software simulation environment, loading the static configuration data corresponding to the fault software, and using the software state at the moment of the fault generated by the fault data assignment module as the state before the execution of the fault alarm module, and using this as a benchmark to reproduce the fault alarm scenario, and by setting breakpoints, checking the execution status of each line of code inside the fault alarm module.

[0016] As a preferred technical solution, step S5 tracks internal abnormal status data and locates the abnormal data generation module, including: the abnormal status data is the direct cause of the fault alarm, but the abnormal status data is generated by other modules before the fault alarm module, which is called the abnormal data generation module.

[0017] 6. Trace the source of the fault S6. Use the output state of the fault data assignment module to generate the state before the abnormal data generation module is executed in the software simulation environment, reproduce the abnormal data generation scenario, and loop this step to trace the source of the fault.

[0018] As a preferred technical solution, step S6 uses the output state of the fault data assignment module in a software simulation environment to generate the state before the execution of the abnormal data generation module to reproduce the abnormal data generation scenario, including: in the software simulation environment, loading the static configuration data corresponding to the faulty software, resetting the software state to the state at the beginning of this cycle, using this as a benchmark, using the external input data of this cycle, executing to the abnormal data generation module according to the internal module timing of the software, reproducing the abnormal data generation scenario, and checking the execution status of each line of code inside the abnormal data generation module by setting breakpoints.

[0019] Among them, resetting the software state to the state at the beginning of this cycle includes: using the education data output from the fault data assignment module to reset the software state to the state at the beginning of this cycle.

[0020] Using the external input data of this cycle includes: using the input data global variable output in the fault data assignment module as the external input data stored in the receiving order of this cycle.

[0021] As a preferred technical solution, step S6 loops this step to trace the source of the fault, including: according to observing the internal state of the abnormal data generation module, if the abnormal data is caused by the preceding abnormal data, then locate the preceding abnormal data generation module, re-run the software simulation environment according to the method of step S6, load the static configuration data corresponding to the faulty software, reset the software state to the state at the end of the previous cycle, and use this as a benchmark, use the external input data of this cycle, execute to the preceding abnormal data generation module according to the software timing, and reproduce the preceding abnormal data generation scenario; by setting a breakpoint method, enter the preceding abnormal data generation module to observe the internal execution state, and continuously iterate in this way to trace the root cause of the fault.

[0022] In a second aspect, the present invention further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the scene reproduction method based on the fault log when executing the computer program.

[0023] In a third aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the scenario reproduction method based on the fault log.

[0024] Beneficial effects of the present invention: The scenario reproduction method based on fault logs provided by the present invention accurately reproduces the internal state of the software at the time of the fault according to the fault log, so that analysts can quickly locate the root cause of the problem, reduce analysis and derivation time, and improve the efficiency of fault diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 This is a flow chart of the scenario reproduction method based on fault logs of the present invention. DETAILED DESCRIPTION

[0026] The concept, specific structure and technical effects of the present invention will be clearly and completely described below in conjunction with the embodiments and drawings to fully understand the purpose, characteristics and effects of the present invention.

[0027] Example 1 A scenario reproduction method based on fault logs, such as Figure 1 As shown, the following steps are included: S1. When the software is initialized, the information required to reproduce the fault scenario is configured into the fault data table; S2. Based on the fault data table, when the software alarms abnormally, the alarm location and the internal status data of the software are recorded in the fault log; S3, generating a fault data assignment module according to the fault log; S4. Locate the fault alarm module according to the fault log; S5. Use the output state of the fault data assignment module to generate the state before the fault alarm module is executed in the software simulation environment, reproduce the fault alarm scenario, track the internal abnormal state data, and locate the abnormal data generation module; S6. Use the output state of the fault data assignment module to generate the state before the abnormal data generation module is executed in the software simulation environment, reproduce the abnormal data generation scenario, and loop this step to trace the source of the fault.

[0028] Example 2 This embodiment further explains step S1 based on embodiment 1.

[0029] In step S1, when the software is initialized, the information required for the scenario at the time of reproducing the fault is configured into the fault data table. The information required to reproduce the fault scenario includes the software state of the previous cycle, the external input of this cycle, and the software state at the time of the fault in this cycle. The above information is stored in the global variable so that the fault data table can be configured and loaded.

[0030] The software status of the previous cycle is described using educational data. Educational data is used for synchronization data during the operation of the main and standby dual systems. It can completely synchronize the operating status of the standby system to the status at the end of the previous cycle of the main system. After the educational data is assigned through the educational learning module, the internal state of the standby system is equivalent to the internal state of the main system at the end of the previous cycle, so that the main system and the standby system have the same starting point when running in this cycle. The educational data is updated once at the end of each cycle, and the information is stored in the global variable of educational data. This data can be used to reset the software status to the status at the end of the previous cycle, which is also equivalent to the status at the beginning of this cycle.

[0031] This cycle's external input includes all external messages received in this cycle, which are stored in the input data global variable in the order in which they are received.

[0032] The software status at the time of this cycle failure is described by the global variables of all business objects within the software.

[0033] In this implementation, the fault data table information includes the global variable name, storage address, data atom type, data number, and data atom length. When the global variable is an array type, the data atom type is the type of an element of the array, the data atom length is the length of an element of the array, and the data number is the maximum number of storage elements of the array. When the global variable is not an array type, the data atom type is the type of the global variable, the data atom length is the length of the global variable, and the data number is 1. The data number multiplied by the data atom length is equivalent to the storage space length of the global variable.

[0034] Example 3 This embodiment further explains step S2 based on embodiment 2.

[0035] In step S2, when a fault alarm occurs, the relative path information from the top-level module of the system to the current alarm module is recorded; and the corresponding global variables are recorded in the fault log according to the fault data table, including the global variable name, data atom type, data number, data atom length, and data value. Because recording to the fault log consumes more resources and cannot be completed within one software cycle, and considering the software-oriented safety side, the system crashes after the recording is completed.

[0036] In step S2, when the software alarm is abnormal, the alarm position is recorded. The alarm position description is the relative path from the top-level module of the system to the current execution module, which is represented by an ordered sequence information according to the module execution order. A member of the sequence represents the execution path description of a module, which is composed of "static module code" and "dynamic module code", where "static module code" uniquely corresponds to a module name, and "dynamic module code" describes the relative position of the parent module calling the module. See the description of Chinese patent publication number CN107145422B for details.

[0037] When the software alarm is abnormal in step S2, the internal state data of the software is recorded in the fault log, specifically, the corresponding global variables are recorded in the fault log according to the fault data table. The recording format of each data in the fault data table in the fault log is: global variable name, data atom type, data number, data atom length, data value. Among them, the global variable name, data atom type, and data number in the fault log are respectively derived from the "global variable name", "data atom type", and "data number" in the fault data table; the data value in the fault log is the data of "data number" copied from the "storage address" in the fault data table and multiplied by the "data atom length". After the recording is completed, the system crashes to guide safety.

[0038] Example 4 This embodiment further explains step S3 based on embodiment 3.

[0039] In step S3, a corresponding assignment copy statement is generated according to each fault data recorded in the fault log. Specifically, the source address of the copy is the "data value" position in the fault log, the destination address of the copy is the address operation of the "global variable name" in the fault log, and the length of the copied data is the "number of data" in the fault log multiplied by the "data atom length". The final combination generates a fault data assignment module.

[0040] Example 5 This embodiment further explains step S4 based on embodiment 4.

[0041] In step S4, the sequence of alarm positions in the fault log is parsed to obtain the unique absolute path of the abnormal alarm information when the fault occurs, thereby locating the function module that generates the fault alarm.

[0042] Step S4 locates the fault alarm module according to the fault log, specifically, by parsing the sequence of the alarm position of the fault log, parsing each member of the sequence into a "static module code" and a "dynamic module code", so that the sequence can obtain the unique absolute path of the abnormal alarm information when the fault occurs, thereby locating the function module that generates the fault alarm.

[0043] Example 6 This embodiment further explains step S5 based on embodiment 5.

[0044] In step S5, in the software simulation environment, the static configuration data corresponding to the faulty software is loaded, and the software state at the time of the fault generated by the fault data assignment module is used as the state before the fault alarm module is executed. The fault alarm scenario is reproduced based on this as a benchmark, and the fault alarm module is entered by setting breakpoints and other methods to observe the internal execution state. If the cause of the fault alarm is caused by some abnormal state data, the abnormal data generation module is located.

[0045] Step S5 tracks the internal abnormal state data and locates the abnormal data generation module, which specifically means that the abnormal state data is the direct cause of the fault alarm, but the abnormal state data is generated by other modules before the fault alarm module, which is called the abnormal data generation module.

[0046] Example 7 This embodiment further explains step S6 based on embodiment 6.

[0047] In step S6, in the software simulation environment, the static configuration data corresponding to the faulty software is loaded, and the system state is reset to the state at the beginning of this cycle. Based on this, the external input data of this cycle is used to execute the abnormal data generation module according to the software internal module timing, and the abnormal data generation scenario that is reproduced is observed. If the abnormal data generation is caused by a certain previous abnormal state data, the previous abnormal data generation module is located. In this way, step S6 is continuously iterated to track down the root cause of the fault.

[0048] Step S6 uses the output state of the fault data assignment module to generate the state before execution of the abnormal data generation module in the software simulation environment to reproduce the abnormal data generation scenario, which specifically means: in the software simulation environment, load the static configuration data corresponding to the faulty software, reset the software state to the state at the beginning of this cycle, and use this as a benchmark. Use the external input data of this cycle to execute to the abnormal data generation module according to the internal module timing of the software. By setting breakpoints and other methods, the execution status of each line of code in the abnormal data generation module can be viewed.

[0049] Resetting the software state to the state at the beginning of this cycle specifically means: using the education data output in the fault data assignment module, that is, the education data global variable, converting it through the education learning module and assigning it to the global variable of the business object, the software state can be reset to the state at the end of the previous cycle, which is equivalent to the state at the beginning of this cycle.

[0050] Using the external input data of this cycle specifically refers to: using the input data global variable output in the fault data assignment module as the external input data stored in the receiving order of this cycle.

[0051] Step S6 loops this step to track down the source of the fault, specifically when referring to: according to observing the internal state of the abnormal data generation module, if the abnormal data is caused by the previous abnormal data, then locate the previous abnormal data generation module, re-run the software simulation environment according to the method of step S6, load the static configuration data corresponding to the faulty software, reset the software state to the state at the end of the previous cycle, and use this as a benchmark, use the external input data of this cycle, execute to the previous abnormal data generation module according to the software timing, and enter the previous abnormal data generation module by setting breakpoints and other methods to observe the internal execution state. In this way, iterate continuously to track down the root cause of the fault.

[0052] Example 8 An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, any one of the scene reproduction methods based on the fault log in Examples 1-7 is implemented.

[0053] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for reproducing a scene based on a fault log according to any one of embodiments 1 to 7 is implemented.

[0054] The electronic device of the present invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) or loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0055] Multiple components in the device are connected to the I / O interface, including: input units, such as keyboards, mice, etc.; output units, such as various types of displays, speakers, etc.; storage units, such as disks, optical disks, etc.; and communication units, such as network cards, modems, wireless communication transceivers, etc. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunication networks.

[0056] The processing unit performs the various methods and processes described above, such as the method of the present invention. For example, in some embodiments, the method of the present invention can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of the method of the present invention described above can be performed. Alternatively, in other embodiments, the CPU can be configured to perform the method of the present invention by any other appropriate means (e.g., by means of firmware).

[0057] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0058] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0059] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0060] The above is a specific description of the implementation mode of the present invention, but the present invention is not limited to the described embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention, and these equivalents or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A scenario reproduction method based on fault logs, characterized in that: The following steps are involved: S1. When the software is initialized, the information required to reproduce the fault scenario is configured into the fault data table; S2. Based on the fault data table, when the software alarms abnormally, the alarm location and the internal status data of the software are recorded in the fault log; S3, generating a fault data assignment module according to the fault log; S4. Locate the fault alarm module according to the fault log; S5. Use the output state of the fault data assignment module to generate the state before the fault alarm module is executed in the software simulation environment, reproduce the fault alarm scenario, track the internal abnormal state data, and locate the abnormal data generation module; S6. Use the output state of the fault data assignment module to generate the state before the abnormal data generation module is executed in the software simulation environment, reproduce the abnormal data generation scenario, and loop this step to trace the source of the fault.

2. The scenario reproduction method based on fault log according to claim 1, characterized in that: The information required to reproduce the fault scenario in step S1 includes: the software status of the previous cycle, the external input of this cycle, and the software status at the time of the fault in this cycle; The fault data table in step S1 is used to record the global variable information required for fault recovery, including: global variable name, storage address, data atom type, data number, data atom length, where: When the global variable is an array type, the data atom type is the type of an element of the array, the data atom length is the length of an element of the array, and the data number is the maximum number of storage elements of the array; When the global variable is not an array type, the data atom type is the type of the global variable, the data atom length is the length of the global variable, and the number of data is 1; The number of data multiplied by the length of the data atom is equivalent to the storage space length of the global variable.

3. The scenario reproduction method based on fault log according to claim 1, characterized in that: Step S2 records the alarm position when the software alarm is abnormal. The alarm position description is the relative path from the top-level module of the system to the current execution module, which is represented by an ordered sequence information according to the module execution order; wherein a member of the sequence represents the execution path description of a module, which is composed of a static module code and a dynamic module code, wherein the static module code uniquely corresponds to a module name, and the dynamic module code describes the relative position of the parent module calling the module; Step S2 records the internal status data of the software to the fault log when the software alarm is abnormal, including: recording the corresponding global variables to the fault log according to the fault data table, and the recording format of each data in the fault data table in the fault log is: global variable name, data atom type, data number, data atom length, data value, where: The global variable name, data atom type, and data number in the fault log are derived from the global variable name, data atom type, and data number in the fault data table respectively; The data value in the fault log is the data obtained by multiplying the number of data copies from the storage address in the fault data table by the length of the data atom; After the recording is completed, the system is shut down to guide safety.

4. The scenario reproduction method based on fault log according to claim 1, characterized in that: Step S3 includes: generating a corresponding assignment copy statement according to each fault data recorded in the fault log, the source address of the copy is the data value position in the fault log, the destination address of the copy is the address operation of the global variable name in the fault log, and the length of the copied data is the number of data in the fault log multiplied by the data atom length.

5. The scenario reproduction method based on fault log according to claim 1, characterized in that: Step S4 includes: parsing the sequence of alarm positions in the fault log, parsing each member of the sequence into a static module code and a dynamic module code, thereby obtaining a unique absolute path of abnormal alarm information when a fault occurs, thereby locating the function module that generates the fault alarm.

6. The scenario reproduction method based on fault log according to claim 1, characterized in that: Step S5 uses the output state of the fault data assignment module to generate the state before the execution of the fault alarm module in the software simulation environment to reproduce the fault alarm scenario, including: in the software simulation environment, loading the static configuration data corresponding to the fault software, using the software state at the time of the fault generated by the fault data assignment module as the state before the execution of the fault alarm module, and reproducing the fault alarm scenario based on this, and checking the execution state of each line of code in the fault alarm module by setting a breakpoint method; Step S5 tracks the internal abnormal state data and locates the abnormal data generation module, including: the abnormal state data is the direct cause of the fault alarm, but the abnormal state data is generated by other modules before the fault alarm module, which is called the abnormal data generation module.

7. The scenario reproduction method based on fault log according to claim 1, characterized in that: Step S6 uses the output state of the fault data assignment module to generate the state before the execution of the abnormal data generation module in the software simulation environment, and reproduces the abnormal data generation scenario, including: in the software simulation environment, loading the static configuration data corresponding to the faulty software, resetting the software state to the state at the beginning of this cycle, using this as a benchmark, using the external input data of this cycle, executing to the abnormal data generation module according to the software internal module timing, reproducing the abnormal data generation scenario, and checking the execution state of each line of code in the abnormal data generation module by setting a breakpoint method; Wherein, resetting the software state to the state at the beginning of the current cycle includes: using the education data outputted from the fault data assignment module to reset the software state to the state at the beginning of the current cycle; Using the external input data of this cycle includes: using the input data global variable output in the fault data assignment module as the external input data stored in the receiving order of this cycle.

8. The scenario reproduction method based on fault log according to claim 7, characterized in that: Step S6 loops this step to trace the source of the fault, including: according to observing the internal state of the abnormal data generation module, if the abnormal data is caused by the preceding abnormal data, then locate the preceding abnormal data generation module, re-run the software simulation environment according to the method of step S6, load the static configuration data corresponding to the faulty software, reset the software state to the state at the end of the previous cycle, and use this as a benchmark, use the external input data of this cycle, execute to the preceding abnormal data generation module according to the software timing, and reproduce the preceding abnormal data generation scenario; by setting a breakpoint method, enter the preceding abnormal data generation module to observe the internal execution state, and continuously iterate in this way to trace the root cause of the fault.

9. An electronic device, characterized in that: It comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the scene reproduction method based on the fault log according to any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the scene reproduction method based on the fault log according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • A software fault alarm monitoring method

    CN107145422B

Cited By

  • Embedded log analysis method and device

    CN120178844A