CN118012764A - Program running detection method, device, equipment and storage medium - Google Patents

Program running detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN118012764A
CN118012764A CN202410209183.1A CN202410209183A CN118012764A CN 118012764 A CN118012764 A CN 118012764A CN 202410209183 A CN202410209183 A CN 202410209183A CN 118012764 A CN118012764 A CN 118012764A
Authority
CN
China
Prior art keywords
feeding
program
watchdog
signal
dog
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410209183.1A
Other languages
Chinese (zh)
Inventor
许心一
许美坤
张莉莎
程诚
余梓琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongfeng Motor Corp
Original Assignee
Dongfeng Motor Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dongfeng Motor Corp filed Critical Dongfeng Motor Corp
Priority to CN202410209183.1A priority Critical patent/CN118012764A/en
Publication of CN118012764A publication Critical patent/CN118012764A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a program running detection method, a program running detection device, program running detection equipment and a storage medium, and belongs to the technical field of program detection. The program operation detection system of the present invention includes: the program operation detection method is applied to the management chip and comprises the following steps: receiving self-checking information of each core in the multi-core microprocessor; when the self-checking information is normal, acquiring a dog feeding signal sent by the multi-core microprocessor; and performing watchdog program operation detection according to the watchdog feeding signal and a preset watchdog feeding strategy, realizing real-time monitoring and protection of abnormal program operation, preventing system function failure caused by faults such as program run-out, jamming, abnormal program flow and the like, and ensuring the safety of the whole vehicle.

Description

Program running detection method, device, equipment and storage medium
Technical Field
The present invention relates to the field of program detection technologies, and in particular, to a method, an apparatus, a device, and a storage medium for detecting program operation.
Background
Along with the increasing degree of automobile Electrical/Electronic, the EE (Electronic/Electronic) architecture is more and more complex, and the number of ECUs (Electric Control Unit, electronic control units) is continuously increasing; and as the system functions are continuously expanded, the resource and calculation power requirements of the main control chip are greatly increased, and the application of the multi-core microprocessor is gradually widened. However, when the system is operated, the hardware may be disabled randomly, and the control software may have loopholes, so that faults occur, personal safety is jeopardized, and serious economic loss is brought. In order to ensure safety, the running state of the program is monitored in real time, and when the running of the program is abnormal, protection treatment measures are timely taken, so that the normal functions of the system are ensured to the greatest extent.
The existing program running detection is carried out at intervals, when the program running abnormality is detected, the standby program is used for processing, but the program running state cannot be monitored in real time, so that the accuracy and the efficiency of the program running abnormality detection are lower.
Disclosure of Invention
The invention mainly aims to provide a program operation detection method, a device, equipment and a storage medium, and aims to solve the technical problems of low program operation detection efficiency and accuracy in the prior art.
In order to achieve the above object, the present invention provides a program operation detection method, a program operation detection system comprising: the program operation detection method is applied to the management chip and comprises the following steps of:
Receiving self-checking information of each core in the multi-core microprocessor;
when the self-checking information is normal, acquiring a dog feeding signal sent by the multi-core microprocessor;
and performing watchdog program operation detection according to the feeding signal and a preset feeding strategy.
Optionally, the performing watchdog program running detection according to the watchdog feeding signal and a preset watchdog feeding strategy includes:
Determining an effective feeding signal according to the feeding signal;
determining a dog feeding time window through the preset dog feeding strategy;
and performing watchdog program running detection based on the valid dog feeding signal and the dog feeding time window.
Optionally, the performing watchdog program running detection based on the valid watchdog feeding signal and the watchdog feeding time window includes:
Detecting whether the valid dog feeding signal is received in an initialization window when the dog feeding time window is the initialization window;
When the valid dog feeding signal is received in the initialization window, determining that the watchdog program runs normally;
When the fact that the effective dog feeding signal is not received in the initialization window is detected, determining that the watchdog program runs abnormally, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
Optionally, the performing watchdog program running detection based on the valid watchdog feeding signal and the watchdog feeding time window includes:
detecting whether the valid dog feeding signal is received in the dog feeding prohibition window when the dog feeding prohibition time window is the dog feeding prohibition window;
when the valid feeding dog signal is not received in the feeding inhibition window, determining that the watchdog program runs normally;
and when the valid dog feeding signal is received in the dog feeding prohibition window, determining that the watchdog program runs abnormally, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
Optionally, the performing watchdog program running detection based on the valid watchdog feeding signal and the watchdog feeding time window includes:
Detecting whether the valid dog feeding signal is received in a regular dog feeding window when the dog feeding time window is the regular dog feeding window;
determining that the watchdog program is operating normally when the valid feeding signal is received in the regular feeding window;
When the fact that the effective dog feeding signal is not received in the conventional dog feeding window is detected, determining that the watchdog program runs abnormally, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
Optionally, after the watchdog program running detection according to the watchdog feeding signal and a preset watchdog feeding strategy, the method further includes:
when the watchdog program is detected to run normally, controlling a main core in the multi-core microprocessor to execute a watchdog feeding function;
Acquiring a heartbeat signal of a secondary core in the multi-core microprocessor;
When the heartbeat signal exceeds the preset times and is unchanged, controlling the main core to stop feeding dogs, and generating a watchdog reset signal;
and controlling the multi-core microprocessor to reset based on the watchdog reset signal.
Optionally, after receiving the self-checking information of each core in the multi-core microprocessor, the method further includes:
And when the self-checking information is abnormal, generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
In addition, in order to achieve the above object, the present invention also proposes a program operation detection apparatus including:
the receiving module is used for receiving the self-checking information of each core in the multi-core microprocessor;
the acquisition module is used for acquiring the dog feeding signal sent by the multi-core microprocessor when the self-checking information is normal;
And the detection module is used for carrying out watchdog program operation detection according to the watchdog feeding signal and a preset watchdog feeding strategy.
In addition, in order to achieve the above object, the present invention also proposes a program operation detection apparatus including: a memory, a processor, and a program execution detection program stored on the memory and executable on the processor, the program execution detection program configured to implement the steps of the program execution detection method as described above.
In addition, in order to achieve the above object, the present invention also proposes a storage medium having stored thereon a program running detection program which, when executed by a processor, implements the steps of the program running detection method as described above.
The program operation detection system of the present invention includes: the management chip and the multi-core microprocessor are used for the program operation detection method, and the program operation detection method comprises the following steps: receiving self-checking information of each core in the multi-core microprocessor; when the self-checking information is normal, acquiring a dog feeding signal sent by the multi-core microprocessor; and performing watchdog program operation detection according to the watchdog feeding signal and a preset watchdog feeding strategy, realizing real-time monitoring and protection of abnormal program operation, preventing system function failure caused by faults such as program run-out, jamming, abnormal program flow and the like, and ensuring the safety of the whole vehicle.
Drawings
FIG. 1 is a schematic diagram of a program operation detection device of a hardware operation environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a first embodiment of a program operation detection method according to the present invention;
FIG. 3 is a schematic diagram of a program operation detection system according to the present invention;
FIG. 4 is a flowchart of a second embodiment of the program operation detection method of the present invention;
FIG. 5 is a timing diagram of feeding dogs according to an embodiment of the program operation detection method of the present invention;
FIG. 6 is a flowchart of a third embodiment of a program operation detection method according to the present invention;
FIG. 7 is a flowchart of a fourth embodiment of a program operation detection method according to the present invention;
FIG. 8 is a flowchart of a fifth embodiment of a program operation detection method according to the present invention;
FIG. 9 is a schematic diagram of a process for detecting according to an effective feeding signal and a feeding time window according to an embodiment of the program operation detection method of the present invention;
FIG. 10 is a flowchart of a sixth embodiment of a program operation detection method according to the present invention;
FIG. 11 is a schematic diagram illustrating operation logic of a secondary core according to an embodiment of the present invention;
FIG. 12 is a schematic diagram illustrating the operation logic of a main core according to an embodiment of the program operation detection method of the present invention;
fig. 13 is a block diagram showing the construction of a first embodiment of the program running detection apparatus of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a program operation detection device of a hardware operation environment according to an embodiment of the present invention.
As shown in fig. 1, the program operation detection device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 does not constitute a limitation of the program run detection apparatus, and may include more or less components than illustrated, or may combine certain components, or may be a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a program operation detection program may be included in the memory 1005 as one type of storage medium.
In the program running detection apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the program operation detection apparatus of the present invention may be provided in the program operation detection apparatus, which calls the program operation detection program stored in the memory 1005 through the processor 1001 and executes the program operation detection method provided by the embodiment of the present invention.
An embodiment of the present invention provides a program operation detection method, referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the program operation detection method of the present invention.
In this embodiment, the program operation detection system includes: the program operation detection method is applied to the management chip and comprises the following steps of:
Step S10: and receiving self-checking information of each core in the multi-core microprocessor.
It should be noted that, the execution body of the embodiment is a management chip in the program running detection system, and may be other chips or devices that may implement the same or similar, which is not limited in this embodiment, and the embodiment is described taking the management chip as an example.
In a specific implementation, the management chip is used for supplying power to the multi-core microprocessor and controlling modules in the multi-core microprocessor. The management chip may be an SBC power management chip, a system on chip management chip, or the like.
In this embodiment, the program running detection system includes a management chip and a multi-core microprocessor, where wireless communication is available between the management chip and the multi-core microprocessor, as shown in fig. 3, fig. 3 is a schematic diagram of an architecture of the program running detection system, the management chip includes an SPI communication module and a watchdog monitoring module, and the multi-core microprocessor includes a program running monitoring module and an SPI communication module.
The management chip has a watchdog monitoring function, the program operation monitoring module of the multi-core microprocessor is used for receiving the monitoring instruction of the management chip to perform program operation monitoring, and the SPI communication module in the management chip and the SPI communication module in the multi-core microprocessor are communicated, so that related signals, such as a dog feeding signal, a reset signal and the like, are received, the management chip is also used for supplying power to the multi-core microcontroller, and the power supply voltage can be 5V, 10V and the like, and the embodiment is not limited to the situation.
In implementations, multiple cores, e.g., 3 cores, 5 cores, etc., are included in a multi-core microprocessor, which may be selected and configured according to particular use cases. Each core in the multi-core microprocessor can be self-checked before running, so that whether the program running is abnormal or not is determined, and therefore, the management chip can generate a self-checking instruction to the multi-core microprocessor before the program running or generate a self-checking instruction to each core before the multi-core microprocessor starts working, and self-checking information of each core in the multi-core microprocessor is obtained.
The self-checking information of each core in the multi-core microprocessor can be that each core is normal, then the next step of work can be carried out, and if the self-checking information of one core is self-checking abnormality, then the protection processing of program abnormality is needed.
It should be noted that, the multi-core microprocessor is used as a master control chip of various controllers on the automobile, such as an engine controller, a motor controller, a whole vehicle controller, a battery management system, etc.
Optionally, after step S10, the method further includes: and when the self-checking information is abnormal, generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
It can be understood that when the self-checking information is a self-checking exception, it indicates that there is an abnormal operation of a certain core or a plurality of cores, a reset signal can be generated, and the reset signal is sent to the multi-core microprocessor to reset the multi-core microprocessor.
The multi-core microprocessor is an MCU microcontroller, the MCU is reset through a reset signal, all register values are restored to default values, and the program runs from the beginning.
Step S20: and when the self-checking information is normal, acquiring a dog feeding signal sent by the multi-core microprocessor.
When the self-checking information is normal, the current running condition of each program in the multi-core microprocessor is normal, and the dog feeding signal sent by the multi-core microprocessor can be received.
Step S30: and performing watchdog program operation detection according to the feeding signal and a preset feeding strategy.
In specific implementation, the multi-core microprocessor can send corresponding feeding signals in different feeding modes, and the management chip can determine effective feeding signals according to the feeding signals after receiving the feeding signals.
The preset feeding strategy can be set in advance, for example, different feeding time sequences are set according to different feeding modes, or the feeding time sequences are divided in time, so that the feeding of dogs can be scheduled in which time period, the feeding of dogs is forbidden in which time period, and the like.
It should be appreciated that the watchdog program operation in the multi-core microprocessor may be detected according to the watchdog feeding signal and a preset watchdog feeding policy, so as to determine whether the watchdog program operation is normal.
The routine operation detection system of the present embodiment includes: the management chip and the multi-core microprocessor are used for the program operation detection method, and the program operation detection method comprises the following steps: receiving self-checking information of each core in the multi-core microprocessor; when the self-checking information is normal, acquiring a dog feeding signal sent by the multi-core microprocessor; and performing watchdog program operation detection according to the watchdog feeding signal and a preset watchdog feeding strategy, realizing real-time monitoring and protection of abnormal program operation, preventing system function failure caused by faults such as program run-out, jamming, abnormal program flow and the like, and ensuring the safety of the whole vehicle.
Referring to fig. 4, fig. 4 is a flowchart illustrating a second embodiment of the program operation detection method according to the present invention.
Based on the first embodiment, the present embodiment routine operation detection method includes, at the step 30:
step S301: and determining an effective feeding signal according to the feeding signal.
It should be noted that, the effective feeding signal may be determined according to the feeding signal, for example, the feeding mode is determined first, so as to analyze the feeding mode and determine the effective feeding signal.
In this embodiment, the dog feeding mode includes two modes of feeding dogs through the IO port and feeding dogs through the SPI communication, the IO dog feeding function is simpler, only by receiving a valid IO signal in a predetermined time window according to a predetermined time sequence, the SPI communication dog feeding is more complex than the IO port dog feeding, and a verification algorithm function can be added, for example, the following verification process is selected: the multi-core microprocessor sends a watchdog starting request to the management chip, the management chip sends a random check signal (generally 8 bits) to the multi-core microprocessor after receiving the watchdog starting request, the multi-core microprocessor calculates a KEY through a check algorithm after receiving the random check signal, the KEY is sent to the management chip, the management chip compares the KEY with the KEY calculated by the self check algorithm after receiving the KEY, if the KEY is consistent with the KEY, the check is considered to pass, the valid watchdog feeding signal is confirmed, and the check algorithm can adopt CRC8541 or other algorithms. Key=random check signal & & a+ paritybit, a can be customized, for example, 0x55, there are several 1s in the paritybit representation (random check signal & & a), if the number of 1s is odd, paritybit bits are set to 0; if the number of 1s is even, paritybit bits are set to 1.
Step S302: and determining a dog feeding time window through the preset dog feeding strategy.
It should be noted that, the feeding time window may be determined according to a preset feeding policy, where the feeding time window includes an initialization window, a forbidden feeding window, and a regular feeding window. The feeding timing sequence can be determined by presetting a feeding strategy, as shown in fig. 5, fig. 5 is a schematic diagram of feeding timing sequence, different feeding modes correspond to different feeding timing sequences, and corresponding signal changes are different in different feeding time windows.
Step S303: and performing watchdog program running detection based on the valid dog feeding signal and the dog feeding time window.
In specific implementation, the watchdog program operation detection can be performed according to the valid watchdog feeding signal and the watchdog feeding time window, so that whether the watchdog program operation is abnormal or not can be rapidly determined.
The embodiment determines an effective feeding signal according to the feeding signal; determining a dog feeding time window through the preset dog feeding strategy; and performing watchdog program operation detection based on the effective dog feeding signal and the dog feeding time window, and rapidly detecting the watchdog program operation according to the dog feeding time window and the effective dog feeding signal, so as to accurately detect whether the watchdog program operation is abnormal.
Referring to fig. 6, fig. 6 is a flowchart illustrating a third embodiment of the program operation detection method according to the present invention.
Based on the above second embodiment, the present embodiment routine operation detection method includes, in the step 303:
Step S3031: and when the feeding dog time window is an initialization window, detecting whether the valid feeding dog signal is received in the initialization window.
In a specific implementation, the initialization window is an activation window, and after the management chip with the watchdog function is provided with power on, a valid watchdog feeding signal must be received in t1 for activating the watchdog function, and then the next watchdog feeding time window is entered. If the effective dog feeding signal is not received in t1, a reset signal is generated to reset the multi-core microprocessor, and then timing is repeated, and the effective dog feeding signal in t1 is continuously waited. Thus, it may be detected within the initialization window whether a valid feeding dog signal is received.
Step S3032: and when the valid dog feeding signal is received in the initialization window, determining that the watchdog program is normal in operation.
It should be noted that, when the valid feeding signal is received in the initialization window, that is, the valid feeding signal is received in t1, the watchdog function can be activated normally, and then the watchdog program is determined to run normally.
Step S3033: when the fact that the effective dog feeding signal is not received in the initialization window is detected, determining that the watchdog program runs abnormally, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
It can be understood that the valid dog feeding signal is not received in the initialization window, that is, the valid dog feeding signal is not received in t1, the watchdog program is determined to be abnormal in operation, the multi-core microprocessor needs to be reset, and a reset signal is generated to the multi-core microprocessor, so that the multi-core microprocessor is reset.
In the embodiment, when the dog feeding time window is an initialization window, whether the valid dog feeding signal is received in the initialization window is detected; when the valid dog feeding signal is received in the initialization window, determining that the watchdog program runs normally; when the effective dog feeding signal is not received in the initialization window, determining that the watchdog program is abnormal in operation, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal, the effective dog feeding signal can be detected in the initialization window, real-time monitoring and protection of the abnormal program operation can be realized, and the safety of the whole vehicle is ensured.
Referring to fig. 7, fig. 7 is a flowchart of a fourth embodiment of the program operation detection method according to the present invention.
Based on the above second embodiment, the present embodiment routine operation detection method includes, in the step 303:
Step S3031': and detecting whether the valid feeding dog signal is received in the feeding inhibition window when the feeding dog time window is the feeding inhibition window.
It should be noted that, the prohibited feeding dog window specifies that the valid feeding dog signal is not allowed in t2, and then the next feeding dog window is entered, so when the feeding dog time window is the prohibited feeding dog window, whether the valid feeding dog signal is received in the prohibited feeding dog window is detected, and whether the watchdog program is abnormal is determined.
Step S3032': and when the valid feeding dog signal is not received in the feeding inhibition window, determining that the watchdog program is normal to operate.
In the implementation, if the valid feeding signal is not received in the feeding-inhibition window, the rule that the valid feeding signal is not allowed to be received in the feeding-inhibition window is met, and the watchdog program runs normally and can enter the next feeding window.
Step S3033': and when the valid dog feeding signal is received in the dog feeding prohibition window, determining that the watchdog program runs abnormally, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
It can be appreciated that if a valid feeding signal is received in the inhibit feeding window, determining that the watchdog program is running abnormally, generating a reset signal to reset the multi-core microprocessor, and then re-timing, returning to the initialization window, and waiting for the valid feeding signal in t 1.
When the dog feeding time window is a dog feeding prohibition window, detecting whether the valid dog feeding signal is received in the dog feeding prohibition window; when the valid feeding dog signal is not received in the feeding inhibition window, determining that the watchdog program runs normally; when the valid dog feeding signal is received in the dog feeding prohibition window, determining that the operation of the watchdog program is abnormal, and generating a reset signal to the multi-core microprocessor, so that the multi-core microprocessor resets according to the reset signal, the valid dog feeding signal can be detected in the dog feeding prohibition window, real-time monitoring and protection of the abnormal operation of the program can be realized, and the safety of the whole vehicle is ensured.
Referring to fig. 8, fig. 8 is a flowchart of a fifth embodiment of the program operation detection method according to the present invention.
Based on the above second embodiment, the present embodiment routine operation detection method includes, in the step 303:
Step S3031": and detecting whether the valid dog feeding signal is received in the regular dog feeding window when the dog feeding time window is the regular dog feeding window.
It should be noted that the regular feeding window defines that a valid feeding signal must be received within t3, and then the timing is re-timed, and the cycle is repeated in the initialization window, the forbidden feeding window and the regular feeding window. If the effective dog feeding signal is not received in t3, a reset signal is generated to reset the multi-core microprocessor, and then timing is performed again, and the effective dog feeding signal in t1 is waited.
Step S3032": and when the valid dog feeding signal is received in the regular dog feeding window, determining that the watchdog program is normal.
When it is detected that a valid feeding signal is received in the regular feeding window, the watchdog program is determined to run normally, and timing is restarted, and the program returns to the initialization window to recycle.
Step S3033": when the fact that the effective dog feeding signal is not received in the conventional dog feeding window is detected, determining that the watchdog program runs abnormally, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
In specific implementation, if the valid dog feeding signal is not received in the conventional window, determining that the operation of the watchdog program is abnormal, generating a reset signal to reset the multi-core processor, and thus, re-timing and waiting for the valid dog feeding signal in t 1. As shown in fig. 9, fig. 9 is a schematic flow chart of detection according to an effective dog feeding signal and a dog feeding time window, detecting whether an effective dog feeding signal is received in t1, if yes, restarting timing, detecting whether an effective dog feeding signal is not received in t2, if yes, restarting timing, detecting whether an effective dog feeding signal is received in t3, if yes, returning to the beginning, and detecting whether an effective dog feeding signal is received in t1 again. If the valid dog feeding signal is not received in t1, a reset signal is generated, the multi-core microprocessor is reset, timing is restarted, and the step of detecting whether the valid dog feeding signal is received in t1 is returned. If the effective dog feeding signal is received in the t2, a reset signal is generated, the multi-core microprocessor is reset, and if the effective dog feeding signal is not received in the t3, the reset signal is generated, and the multi-core microprocessor is reset.
When the dog feeding time window is a conventional dog feeding window, detecting whether the valid dog feeding signal is received in the conventional dog feeding window; determining that the watchdog program is operating normally when the valid feeding signal is received in the regular feeding window; when the effective dog feeding signal is not received in the conventional dog feeding window, determining that the operation of the watchdog program is abnormal, and generating a reset signal to the multi-core microprocessor, so that the multi-core microprocessor resets according to the reset signal, the effective dog feeding signal can be detected in the conventional dog feeding window, real-time monitoring and protection of the abnormal operation of the program can be realized, and the safety of the whole vehicle is ensured.
Referring to fig. 10, fig. 10 is a flowchart of a sixth embodiment of the program operation detection method according to the present invention.
Step S31: and when the watchdog program is detected to run normally, controlling a main core in the multi-core microprocessor to execute a watchdog feeding function.
It can be appreciated that after detecting that the watchdog program is running normally, the multi-core microprocessor can be controlled to execute the watchdog feeding function.
The multi-core microprocessor comprises a plurality of cores, a main core can be arranged, cores except the main core are arranged as secondary cores, and the main core mainly performs watchdog monitoring and feeding, so that the main core can be controlled to perform the feeding function. The feeding of the dogs can be realized by turning over IO level or SPI by a multi-core microprocessor.
Step S32: and acquiring a heartbeat signal of a secondary core in the multi-core microprocessor.
It should be noted that, the normal operation of the core may be indicated by adding respective heartbeat signals to the secondary core, if the secondary core has no abnormality after self-checking, the heartbeat signals are added with a set value at each preset time interval, for example, the multi-core processor includes 1 main core and 2 secondary cores, the main core is core a, the secondary cores are core B and core C, after the self-checking of the cores B and C has no abnormality, the heartbeat signals are added with 1 every 5ms, when the maximum limit value is exceeded, the heartbeat signals are cleared, and the heartbeat signals of the cores B and C are transmitted to the core a through the inter-core information interface. Core a may transmit heartbeat signals for core B and core C to the management chip.
Step S33: and when the heartbeat signal exceeds the preset times and is unchanged, controlling the main core to stop feeding the dog, and generating a watchdog reset signal.
In a specific implementation, the management chip detects the change condition of the heartbeat signals of the core B and the core C, for example, sets preset times of 2 or 3 continuous times, if the heartbeat signals are not changed for 3 continuous times, the feeding of the dog is stopped, a watchdog reset signal is generated, and the watchdog reset system is actively triggered.
Step S34: and controlling the multi-core microprocessor to reset based on the watchdog reset signal.
In a specific implementation, watchdog reset can be performed through a watchdog reset signal, so that the multi-core microprocessor is controlled to perform reset.
It should be noted that, whether the heartbeat signal of the secondary core changes or not can be detected through each set time value of the primary core a, for example, each 20ms heartbeat signal of the secondary core is detected, in order to avoid the micro fluctuation of the program running time caused by the reasons of task preemption and the like, the set time value is longer than the time of adding the set value to the secondary core heartbeat signal, otherwise, the fault is easy to be triggered by mistake. If the dog cannot be fed according to the preset dog feeding strategy due to the abnormality of the main core, triggering a watchdog reset system, and further resetting the multi-core microprocessor.
As shown in fig. 11, fig. 11 is a schematic diagram of operation logic of the secondary core, and detects whether the secondary core self-checking has no abnormality, if so, reports a heartbeat signal every 5ms (calibratable), and judges whether the heartbeat signal is greater than a maximum limit value, if so, the heartbeat signal is cleared, and if not, the heartbeat signal is continuously acquired every 5 ms. If the secondary core self-check is abnormal, stopping reporting the heartbeat signal and waiting for the multi-core microprocessor to reset. Fig. 12 is a schematic diagram of the operation logic of the main core, initializing the main core, clearing the heartbeat signal of the secondary core, performing self-checking, determining whether the self-checking has no abnormality, stopping feeding the dog, waiting for resetting, updating the heartbeat signal of the secondary core every 20ms (calibratable) if the self-checking has no abnormality, reading the updated heartbeat signal of the secondary core every 20ms (calibratable), detecting whether the heartbeat signal has not changed beyond a preset number of times, if yes, stopping feeding the dog, waiting for resetting, and if the heartbeat signal has not changed beyond the preset number of times, returning to the step of detecting whether the self-checking has abnormality.
When the watchdog program is detected to run normally, the embodiment controls the main core in the multi-core microprocessor to execute the watchdog feeding function; acquiring a heartbeat signal of a secondary core in the multi-core microprocessor; when the heartbeat signal exceeds the preset times and is unchanged, controlling the main core to stop feeding dogs, and generating a watchdog reset signal; and controlling the multi-core microprocessor to reset based on the watchdog reset signal.
Referring to fig. 13, fig. 13 is a block diagram showing the configuration of a first embodiment of the program operation detecting apparatus of the present invention.
As shown in fig. 13, the program running detection apparatus according to the embodiment of the present invention includes:
and the receiving module 10 is used for receiving the self-checking information of each core in the multi-core microprocessor.
And the obtaining module 20 is used for obtaining the dog feeding signal sent by the multi-core microprocessor when the self-checking information is normal.
And the detection module 30 is used for performing watchdog program operation detection according to the watchdog feeding signal and a preset watchdog feeding strategy.
The receiving module of the embodiment is used for receiving the self-checking information of each core in the multi-core microprocessor; the acquisition module is used for acquiring the dog feeding signal sent by the multi-core microprocessor when the self-checking information is normal; and the detection module is used for carrying out watchdog program operation detection according to the watchdog feeding signal and a preset watchdog feeding strategy, realizing real-time monitoring and protection of program operation abnormality, preventing system function failure caused by faults such as program run-out, jamming, program flow abnormality and the like, and ensuring the safety of the whole vehicle.
In one embodiment, the detection module 30 is further configured to determine an effective feeding signal based on the feeding signal; determining a dog feeding time window through the preset dog feeding strategy; and performing watchdog program running detection based on the valid dog feeding signal and the dog feeding time window.
In an embodiment, the detecting module 30 is further configured to detect, when the feeding time window is an initializing window, whether the valid feeding signal is received in the initializing window; when the valid dog feeding signal is received in the initialization window, determining that the watchdog program runs normally; when the fact that the effective dog feeding signal is not received in the initialization window is detected, determining that the watchdog program runs abnormally, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
In an embodiment, the detecting module 30 is further configured to detect, when the feeding time window is a feeding prohibition window, whether the valid feeding signal is received in the feeding prohibition window; when the valid feeding dog signal is not received in the feeding inhibition window, determining that the watchdog program runs normally; and when the valid dog feeding signal is received in the dog feeding prohibition window, determining that the watchdog program runs abnormally, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
In one embodiment, the detecting module 30 is further configured to detect, when the feeding dog time window is a regular feeding dog window, whether the valid feeding dog signal is received in the regular feeding dog window; determining that the watchdog program is operating normally when the valid feeding signal is received in the regular feeding window; when the fact that the effective dog feeding signal is not received in the conventional dog feeding window is detected, determining that the watchdog program runs abnormally, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
In an embodiment, the detection module 30 is further configured to control a main core in the multi-core microprocessor to perform a watchdog feeding function when detecting that a watchdog program is running normally; acquiring a heartbeat signal of a secondary core in the multi-core microprocessor; when the heartbeat signal exceeds the preset times and is unchanged, controlling the main core to stop feeding dogs, and generating a watchdog reset signal; and controlling the multi-core microprocessor to reset based on the watchdog reset signal.
In an embodiment, the receiving module 10 is further configured to generate a reset signal to the multi-core microprocessor when the self-checking information is a self-checking abnormality, so that the multi-core microprocessor resets according to the reset signal.
In addition, the embodiment of the invention also provides a storage medium, wherein the storage medium stores a program running detection program, and the program running detection program realizes the steps of the program running detection method when being executed by a processor.
Because the storage medium adopts all the technical schemes of all the embodiments, the storage medium has at least all the beneficial effects brought by the technical schemes of the embodiments, and the description is omitted here.
It should be understood that the foregoing is illustrative only and is not limiting, and that in specific applications, those skilled in the art may set the invention as desired, and the invention is not limited thereto.
It should be noted that the above-described working procedure is merely illustrative, and does not limit the scope of the present invention, and in practical application, a person skilled in the art may select part or all of them according to actual needs to achieve the purpose of the embodiment, which is not limited herein.
In addition, technical details not described in detail in this embodiment may refer to the program operation detection method provided in any embodiment of the present invention, and are not described herein.
Furthermore, it should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. Read Only Memory)/RAM, magnetic disk, optical disk) and including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. A program operation detection method, characterized in that a program operation detection system includes: the program operation detection method is applied to the management chip and comprises the following steps:
Receiving self-checking information of each core in the multi-core microprocessor;
when the self-checking information is normal, acquiring a dog feeding signal sent by the multi-core microprocessor;
and performing watchdog program operation detection according to the feeding signal and a preset feeding strategy.
2. The program run detection method according to claim 1, wherein the performing watchdog program run detection according to the watchdog feeding signal and a preset watchdog feeding policy comprises:
Determining an effective feeding signal according to the feeding signal;
determining a dog feeding time window through the preset dog feeding strategy;
and performing watchdog program running detection based on the valid dog feeding signal and the dog feeding time window.
3. The program run detection method according to claim 2, wherein the performing watchdog program run detection based on the valid dog feeding signal and the dog feeding time window includes:
Detecting whether the valid dog feeding signal is received in an initialization window when the dog feeding time window is the initialization window;
When the valid dog feeding signal is received in the initialization window, determining that the watchdog program runs normally;
When the fact that the effective dog feeding signal is not received in the initialization window is detected, determining that the watchdog program runs abnormally, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
4. The program run detection method according to claim 2, wherein the performing watchdog program run detection based on the valid dog feeding signal and the dog feeding time window includes:
detecting whether the valid dog feeding signal is received in the dog feeding prohibition window when the dog feeding prohibition time window is the dog feeding prohibition window;
when the valid feeding dog signal is not received in the feeding inhibition window, determining that the watchdog program runs normally;
and when the valid dog feeding signal is received in the dog feeding prohibition window, determining that the watchdog program runs abnormally, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
5. The program run detection method according to claim 2, wherein the performing watchdog program run detection based on the valid dog feeding signal and the dog feeding time window includes:
Detecting whether the valid dog feeding signal is received in a regular dog feeding window when the dog feeding time window is the regular dog feeding window;
determining that the watchdog program is operating normally when the valid feeding signal is received in the regular feeding window;
When the fact that the effective dog feeding signal is not received in the conventional dog feeding window is detected, determining that the watchdog program runs abnormally, and generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
6. The program run detection method according to claim 1, wherein after performing watchdog program run detection according to the watchdog feeding signal and a preset watchdog feeding policy, further comprising:
when the watchdog program is detected to run normally, controlling a main core in the multi-core microprocessor to execute a watchdog feeding function;
Acquiring a heartbeat signal of a secondary core in the multi-core microprocessor;
When the heartbeat signal exceeds the preset times and is unchanged, controlling the main core to stop feeding dogs, and generating a watchdog reset signal;
and controlling the multi-core microprocessor to reset based on the watchdog reset signal.
7. The program running detection method according to any one of claims 1 to 6, further comprising, after receiving self-test information of each core in the multi-core microprocessor:
And when the self-checking information is abnormal, generating a reset signal to the multi-core microprocessor so that the multi-core microprocessor resets according to the reset signal.
8. A program operation detection apparatus, characterized in that the program operation detection apparatus comprises:
the receiving module is used for receiving the self-checking information of each core in the multi-core microprocessor;
the acquisition module is used for acquiring the dog feeding signal sent by the multi-core microprocessor when the self-checking information is normal;
And the detection module is used for carrying out watchdog program operation detection according to the watchdog feeding signal and a preset watchdog feeding strategy.
9. A program operation detection apparatus, characterized by comprising: a memory, a processor, and a program operation detection program stored on the memory and operable on the processor, the program operation detection program configured to implement the program operation detection method according to any one of claims 1 to 7.
10. A storage medium having stored thereon a program running detection program which, when executed by a processor, implements the program running detection method according to any one of claims 1 to 7.
CN202410209183.1A 2024-02-26 2024-02-26 Program running detection method, device, equipment and storage medium Pending CN118012764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410209183.1A CN118012764A (en) 2024-02-26 2024-02-26 Program running detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410209183.1A CN118012764A (en) 2024-02-26 2024-02-26 Program running detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118012764A true CN118012764A (en) 2024-05-10

Family

ID=90942671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410209183.1A Pending CN118012764A (en) 2024-02-26 2024-02-26 Program running detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118012764A (en)

Similar Documents

Publication Publication Date Title
US8495433B2 (en) Microcomputer mutual monitoring system and a microcomputer mutual monitoring method
CN107531250B (en) Vehicle safety electronic control system
CN103676722B (en) Use interrogation and the response of the security system of the watchdog timer of amendment
CN107526290B (en) Method for operating a controller
JP5244981B2 (en) Microcomputer and operation method thereof
CN102640119B (en) Method for operating a processor
JP2004259137A (en) Electronic control device
CN113946148B (en) MCU chip awakening system based on multi-ECU cooperative control
CN104011688A (en) Controller And Process Monitoring Method
CN112732474B (en) Fault processing method and device, electronic equipment and computer readable storage medium
CN112511368A (en) Service heartbeat monitoring method and related device
CN100394396C (en) Electronic control system and method having microcomputer monitoring prohibiting function
KR101448013B1 (en) Fault-tolerant apparatus and method in multi-computer for Unmanned Aerial Vehicle
CN118012764A (en) Program running detection method, device, equipment and storage medium
KR102213676B1 (en) Terminal apparatus for autosar system with arithmetic operation supervision function and arithmetic operation supervision method of autosar system
CN110554681B (en) Vehicle communication network and method
JP6502211B2 (en) Vehicle control device
CN116010158A (en) Verification device, verification system and chip device of configuration register
CN116494893A (en) Vehicle control method and device based on functional safety mechanism and central computing architecture
US10514970B2 (en) Method of ensuring operation of calculator
CN115509803A (en) Software recovery method, electronic device and storage medium
CN113946130A (en) Motor controller chip awakens system up
CN110832459B (en) Vehicle control device
JP2007283788A (en) Vehicular electronic control device
CN118152016A (en) Peripheral chip initializing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination