CN116956239A - Watchdog control method and device of dual-core system, medium and electronic equipment - Google Patents

Watchdog control method and device of dual-core system, medium and electronic equipment Download PDF

Info

Publication number
CN116956239A
CN116956239A CN202310054576.5A CN202310054576A CN116956239A CN 116956239 A CN116956239 A CN 116956239A CN 202310054576 A CN202310054576 A CN 202310054576A CN 116956239 A CN116956239 A CN 116956239A
Authority
CN
China
Prior art keywords
core
control core
slave
state variable
watchdog
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
CN202310054576.5A
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.)
Xinyi Information Technology Nanjing Co ltd
Original Assignee
Xinyi Information Technology Nanjing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xinyi Information Technology Nanjing Co ltd filed Critical Xinyi Information Technology Nanjing Co ltd
Priority to CN202310054576.5A priority Critical patent/CN116956239A/en
Publication of CN116956239A publication Critical patent/CN116956239A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs
    • G06F21/123Restricting unauthorised execution of programs by using dedicated hardware, e.g. dongles, smart cards, cryptographic processors, global positioning systems [GPS] devices

Abstract

The application provides a watchdog control method of a dual-core system, wherein the dual-core system comprises a master control core, a slave control core and a watchdog, and the method comprises the following steps: setting a watchdog feeding thread, setting the monitoring time of a watchdog counter as a first duration, wherein the priority of the watchdog feeding thread is higher than that of an idle thread; when the business thread of the main control core releases the schedule in the first time length, entering a dog feeding thread, reading the running state of the slave control core, judging whether the running state of the slave control core meets the set dog feeding condition, and executing the dog feeding operation if the running state of the slave control core meets the dog feeding condition; and if the dog feeding operation is not executed within the first time period, triggering the restarting of the watchdog. The method sets that only after the service thread with high priority releases the schedule, the service thread can enter the dog feeding thread, and then judges whether the running state of the slave control core meets the dog feeding condition. The dogs can be fed only when the master control core and the slave control core operate normally, otherwise, the dogs cannot be fed, and the operation state of the dual-core system is monitored under the condition that the number of hardware watchdog is unique.

Description

Watchdog control method and device of dual-core system, medium and electronic equipment
Technical Field
The application relates to the technical field of embedded systems, in particular to a watchdog control method, device, medium and electronic equipment of a dual-core system.
Background
In the embedded application field, a watchdog mechanism is generally adopted to monitor the running state of software so as to ensure that the system can be automatically reset and restored to a normal working state under the condition of no human intervention when the system is blocked due to factors such as potential errors of programs or severe environment interference.
The watchdog monitors the running condition of the system in a mode of combining software and hardware, the software running stably feeds the dog after executing specific instructions, and if the watchdog does not receive a dog feeding signal from the software within a certain period, the watchdog considers that the system is faulty and enters an interrupt processing program or forces the system to reset.
For a dual core system, when multiple watchdog hardware is provided, each core may be configured with a watchdog to monitor its respective operating state. However, when only one watchdog is provided, the dual-core system cannot be monitored by the method provided by the prior art. Thus, a new watchdog control approach is needed to address this problem.
Disclosure of Invention
The application aims to provide a watchdog control method, device, medium and electronic equipment of a dual-core system, which are used for solving the problem that the dual-core system cannot be monitored when only one watchdog is provided with hardware.
In a first aspect, the present application provides a watchdog control method of a dual-core system, where the dual-core system includes a master core, a slave core, and a watchdog, and the method includes: establishing a dog feeding thread, setting the duration corresponding to the monitoring time of a watchdog counter as a first duration, wherein the priority of the dog feeding thread is higher than that of an idle thread; when the business thread of the master control core releases the schedule in the first time period, entering a dog feeding thread, reading the running state of the slave control core, and judging whether the running state of the slave control core meets the set dog feeding condition; executing the dog feeding operation when the running state of the slave control core meets the set dog feeding condition; and triggering the watchdog to restart when the feeding operation is not executed within the first time period.
The watchdog control method of the dual-core system has the beneficial effects that: the priority of the dog feeding thread of the main control core is higher than that of the idle thread and lower than that of the service thread, so that the dog feeding thread can be accessed only after the service thread with high priority is released and scheduled, and whether the running state of the slave control core meets the set dog feeding condition is judged after the dog feeding thread is accessed. Therefore, the master control core can only feed dogs when the master control core and the slave control core operate normally, and the master control core cannot feed dogs no matter the master control core or the slave control core is blocked by threads. The watchdog control method of the dual-core system realizes the monitoring of the running state of the dual-core system under the condition that the number of hardware watchdog is unique.
In a possible embodiment, before reading the running state of the slave core, the method further includes: defining a slave core state variable, and writing the slave core state variable into an inter-core sharing area; when the slave core is subjected to thread switching or enters an idle thread, the state variable of the slave core is updated, and the updated state variable of the slave core is written into the inter-core sharing area.
In another possible embodiment, a historical state variable is set, the historical state variable being stored in the master core; reading the running state of the slave control core, and judging whether the running state of the slave control core meets the set dog feeding condition or not, wherein the method comprises the following steps of: reading the slave core state variable from the inter-core shared region; judging whether the slave core state variable is the same as the history state variable or not; when the state variable of the slave control core is different from the history state variable, the running state of the slave control core meets the set dog feeding condition; and updating the historical state variable according to the slave control core state variable.
In other possible embodiments, after determining whether the slave core state variable is the same as the history state variable, the method further includes: when the state variable of the slave control core is the same as the history state variable, the running state of the slave control core does not meet the set dog feeding condition; according to a second time length corresponding to a preset dog feeding period, after the second time length is spaced, the master control core reads the state variable of the slave control core and judges whether the state variable of the slave control core is identical to the history state variable or not, wherein the second time length is smaller than the first time length.
After performing the feeding operation, further comprising: and updating the counting time of the watchdog counter to be the first duration.
When the idle thread is executed, judging whether the main control core and the slave control core meet a deep sleep flow or not; when the master control core and the slave control core meet the deep sleep flow, closing the watchdog; and initializing the watchdog when the master control core and the slave control core exit from the deep sleep process, and re-counting the counter of the watchdog.
When the master control core and the slave control core do not meet the deep sleep process, judging whether the master control core and the slave control core meet the sleep process; when the master control core and the slave control core meet the dormancy flow, the watchdog counter pauses counting; and when the master control core and the slave control core exit from the sleep process, the watchdog counter continues to count.
In a second aspect, the present application also provides a watchdog control device of a dual-core system, where the dual-core system includes a master core, a slave core, and a watchdog, and the device includes:
the configuration determining unit is used for establishing a dog feeding thread, configuring the duration corresponding to the watchdog monitoring time of the watchdog counter as a first duration, and the priority of the dog feeding thread is higher than that of an idle thread;
the judging unit is used for entering a dog feeding thread when the business thread of the main control core releases scheduling in the first time length, reading the running state of the auxiliary control core and judging whether the running state of the auxiliary control core meets the set dog feeding condition;
the dog feeding unit is used for executing dog feeding operation when the running state of the slave control core meets the set dog feeding condition;
and the restarting unit is used for triggering the watchdog to restart when the feeding operation is not executed within the first time period.
The watchdog control means of the dual core system further comprises: the slave control core state sharing unit is used for defining a slave control core state variable and writing the slave control core state variable into an inter-core sharing area; when the slave core is subjected to thread switching or enters an idle thread, the state variable of the slave core is updated, and the updated state variable of the slave core is written into the inter-core sharing area.
The history state storage unit is used for setting a history state variable, and the history state variable is stored in the main control core;
the judging unit reads the running state of the slave control core and judges whether the running state of the slave control core meets the set dog feeding condition or not, and the judging unit is specifically used for: reading the slave core state variable from the inter-core shared region; judging whether the slave core state variable is the same as the history state variable or not; when the state variable of the slave control core is different from the history state variable, the running state of the slave control core meets the set dog feeding condition; and updating the historical state variable according to the slave control core state variable.
After the judging unit judges whether the slave core state variable is the same as the history state variable, the judging unit further comprises: when the state variable of the slave control core is the same as the history state variable, the running state of the slave control core does not meet the set dog feeding condition; according to a second time length corresponding to a preset dog feeding period, after the second time length is set, the master control core reads the state variable of the slave control core, and judges whether the state variable of the slave control core is identical to the history state variable or not, wherein the second time length is smaller than the first time length.
The watchdog control means of the dual core system further comprises: and the updating module is used for updating the counting time of the watchdog counter to be the first duration after the dog feeding operation is executed.
Further comprises: the deep sleep unit is used for judging whether the main control core and the slave control core meet a deep sleep flow or not when the idle thread is executed; when the master control core and the slave control core meet the deep sleep flow, closing the watchdog; and initializing the watchdog when the master control core and the slave control core exit from the deep sleep process, and re-counting the counter of the watchdog.
The sleep unit is used for judging whether the main control core and the slave control core meet a sleep process or not when the main control core and the slave control core do not meet a deep sleep process; when the master control core and the slave control core meet the dormancy flow, the watchdog counter pauses counting; and when the master control core and the slave control core exit from the sleep process, the watchdog counter continues to count.
In a third aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the watchdog control method of the dual core system described above.
In a fourth aspect, the present application also provides an electronic device, including: a processor and a memory; the memory is used for storing a computer program; the processor is configured to execute the computer program stored in the memory, so that the electronic device executes the watchdog control method of the dual-core system.
The advantageous effects concerning the above second to fourth aspects can be seen from the description of the above first aspect.
Drawings
Fig. 1 is a schematic flow chart of a watchdog control method of a dual-core system according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of configuration of a master control core and creation of threads according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an inter-core shared area according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a master control core thread priority provided in an embodiment of the present application;
FIG. 5 is a schematic flow chart of a dog feeding thread according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a slave core system scheduling thread according to an embodiment of the present application;
FIG. 7 is a schematic flow chart of watchdog control after a dual-core system executes an idle thread according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a watchdog control device of a dual-core system according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application. Unless otherwise defined, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs. As used herein, the word "comprising" and the like means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof without precluding other elements or items.
Aiming at the problems existing in the prior art, the embodiment of the application provides a watchdog control method, a device, a medium and electronic equipment of a dual-core system.
The embodiment provides a watchdog control method of a dual-core system, wherein the dual-core system comprises a master control core, a slave control core and a watchdog. Referring to fig. 1 of the specification, the method comprises:
s1: and establishing a dog feeding thread, setting the time length corresponding to the monitoring time of the watchdog counter as a first time length, and enabling the priority of the dog feeding thread to be higher than that of an idle thread.
In S1, referring to fig. 2 of the specification, in a possible embodiment, at the time of initializing a dual-core system, the process of configuring the master-core watchdog hardware and creating the thread is as follows: and sequentially executing variable initialization, interrupt vector table initialization, kernel initialization, system initialization, thread initialization of the inter-kernel sharing area, and then starting scheduling by the system kernel. The thread initialization comprises the steps of sequentially executing a first service thread initialization, a second service thread initialization, an nth service thread initialization and a dog feeding thread initialization, wherein n is a positive integer. The initialization of the dog feeding thread comprises the following steps: setting initial values of state variables stored in the inter-core sharing area, initializing a hardware watchdog, and creating a dog feeding thread.
Referring to fig. 3 of the drawings, the inter-core shared area is configured as a storage area for the slave cores to write the running state variables and for the master cores to read the running state variables of the slave cores therefrom.
Referring to fig. 4 of the specification, when the system is initialized, the master control core enables the duration corresponding to the monitoring time of the watchdog counter set by the watchdog counter to be the first duration. Among the various threads, the priority of the dog feeding thread is lower than that of all the service threads and higher than that of the idle thread, wherein all the service threads refer to the first service thread, the second service thread and the nth service thread. That is, the priority of the set dog feeding thread is only higher than the idle thread. In addition, the dog feeding thread is set not to participate in sleep mode (standby) wakeup.
In a possible embodiment, the first time period is set to 2 minutes.
S2: when the business thread of the main control core releases the schedule in the first time period, the business thread enters a dog feeding thread, the running state of the auxiliary control core is read, and whether the running state of the auxiliary control core meets the set dog feeding condition is judged.
In S2, in one possible embodiment, when the service thread of the master core releases the schedule within the first duration, the service thread enters into the dog feeding thread, and at this time, the dog feeding operation is not directly executed, that is, the watchdog counter is not directly reset, but it is further required to determine whether to execute the dog feeding operation according to the running state of the slave core.
In one possible embodiment, before reading the running state of the slave core, the method further includes: defining a slave control core state variable, and writing the slave control core state variable into an inter-core sharing area; when the slave cores are subjected to thread switching or enter idle threads, the state variables of the slave cores are updated, and the updated state variables of the slave cores are written into the inter-core sharing area. Thus, the state variables of the slave cores stored in the inter-core shared area can be updated in time, and represent the latest running state of the slave cores.
Referring to fig. 5 of the drawings, in one embodiment, the slave core state variable has an initial value of 0 when entering a dog feeding thread.
In a possible embodiment, a historical state variable is also provided, and the historical state variable is stored in the master control core. Reading the running state of the slave control core, and judging whether the running state of the slave control core meets the set dog feeding condition or not, wherein the method comprises the following steps: reading a slave core state variable from the inter-core shared region; judging whether the slave control core state variable is the same as the history state variable or not; when the state variable of the slave control core is different from the history state variable, the running state of the slave control core meets the set dog feeding condition; and updating the historical state variable according to the slave core state variable. It can be seen that the history state variable represents the slave core state variable obtained when the previous determination is made as to whether the running state of the slave core satisfies the set dog feeding condition.
After judging whether the slave core state variable is the same as the history state variable, the method further comprises the following steps: when the state variable of the slave control core is the same as the history state variable, the running state of the slave control core does not meet the set dog feeding condition; according to a second time length corresponding to a preset dog feeding period, the master control core reads the state variable of the slave control core after the second time length is spaced, and judges whether the state variable of the slave control core is identical to the historical state variable or not, wherein the second time length is smaller than the first time length. The second time period is set to the minimum interval between two dog feeds.
In one possible embodiment, the second time period is set to 2 seconds.
When judging, comparing the historical state variable with the read state variable of the slave control core, and obtaining the result of whether the running state of the slave control core meets the set dog feeding condition. Specifically, if the historical state variable is different from the slave core state variable, the slave core system switches the schedule, which indicates that the slave core system operates normally and meets the set dog feeding condition, the dog feeding operation can be executed. If the historical state variable is the same as the state variable of the slave control core, the running state of the slave control core is not changed but is always clamped in a certain fixed service thread, the slave control core system does not switch scheduling, and the set dog feeding condition is not met, and the dog feeding is skipped; after the second time period, the master control core reads the state variable of the slave control core to judge whether the running state of the slave control core meets the set dog feeding condition or not again. If the running state of the slave control core does not meet the set dog feeding condition all the time, the dog feeding thread cannot execute the dog feeding operation.
Referring to fig. 6 of the specification, the slave core system switching schedule refers to switching schedule among all service threads including a first service thread, a second service thread and an nth service thread and idle threads which can be scheduled when the slave core system runs.
S3: and executing the feeding operation when the running state of the slave control core meets the set feeding condition.
In S3, after performing the feeding operation, a possible embodiment further includes: the count time of the watchdog counter is updated to a first duration.
S4: and triggering the watchdog to restart when the feeding operation is not executed within the first time period.
The watchdog control method of the dual-core system of the application ensures that the watchdog thread can be accessed only after the service thread with high priority releases the schedule by setting the watchdog thread priority of the main control core to be higher than the idle thread and lower than the service thread, and judges whether the running state of the slave control core meets the set watchdog feeding condition after the watchdog thread is accessed. Therefore, the master control core can only feed dogs when the master control core and the slave control core operate normally, and the master control core cannot feed dogs no matter the master control core or the slave control core is blocked by threads. The watchdog control method of the dual-core system realizes the monitoring of the running state of the dual-core system under the condition that the number of hardware watchdog is unique.
Referring to fig. 7 of the present disclosure, in a possible embodiment, the dual-core system may further enter a deep sleep process or a sleep process, and when entering the sleep process or the sleep process, the method for controlling the gate availability includes:
when the idle thread is executed, judging whether the main control core and the slave control core meet the deep sleep flow; when the master control core and the slave control core meet the deep sleep flow, entering the deep sleep flow, and closing the watchdog; when the master control core and the slave control core exit the deep sleep process, initializing a watchdog, and re-counting a watchdog counter.
When the master control core and the slave control core do not meet the deep sleep process, judging whether the master control core and the slave control core meet the sleep process; when the master control core and the slave control core meet the dormancy flow, entering the dormancy flow, and suspending counting by a watchdog counter; when the master control core and the slave control core exit from the sleep flow, the watchdog counter continues to count.
After the dual-core system processes the business, the dual-core system needs to go to sleep, and the watchdog only needs to monitor the running state of the business thread, and after the dual-core system goes to a deep sleep flow or a dormancy flow from an idle thread, the watchdog is closed or paused. The dog feeding thread cannot wake up the system from the sleep process, after the system processes the service and enters the sleep process, even if the second time delay of the dog feeding thread expires, the system can not exit the sleep process to execute the dog feeding operation, and the first time delay can not timeout and thus the watchdog restarting can not be triggered because the watchdog counter pauses to count during entering the sleep process. After the system is awakened by the overtime event of the service thread, the watchdog counter continues to count from the last stopped value.
Referring to fig. 8 of the specification, the present embodiment further provides a watchdog control device of a dual-core system, where the device is used to implement the above method embodiment. The dual-core system comprises a master control core, a slave control core and a watchdog, and the watchdog control device of the dual-core system comprises:
the configuration determining unit 801 is configured to establish a watchdog thread, configure a duration corresponding to a watchdog monitoring time of a watchdog counter to be a first duration, and prioritize the watchdog thread over an idle thread.
And a judging unit 802, when the service thread of the master control core releases the schedule in the first time period, entering a dog feeding thread, reading the running state of the slave control core, and judging whether the running state of the slave control core meets the set dog feeding condition.
And a feeding unit 803 for performing a feeding operation when the set feeding condition is satisfied from the operation state of the control core.
A restarting unit 804, configured to trigger a watchdog restart when the feeding operation is not performed within the first duration.
In a possible embodiment, the watchdog control means of the dual-core system further comprises: the slave control core state sharing unit is used for defining a slave control core state variable and writing the slave control core state variable into the inter-core sharing area; when the slave cores are subjected to thread switching or enter idle threads, the state variables of the slave cores are updated, and the updated state variables of the slave cores are written into the inter-core sharing area.
The history state storage unit is used for setting a history state variable which is stored in the main control core.
And the updating module is used for updating the counting time of the watchdog counter to be a first duration after the dog feeding operation is executed.
In a possible embodiment, the watchdog control means of the dual-core system further comprises: the deep sleep unit is used for judging whether the main control core and the slave control core meet the deep sleep flow or not when the idle thread is executed; when the master control core and the slave control core meet the deep sleep flow, closing the watchdog; and initializing the watchdog when the master control core and the slave control core exit from the deep sleep process, and re-counting the watchdog counter.
The sleep unit is used for judging whether the main control core and the slave control core meet the sleep flow or not when the main control core and the slave control core do not meet the deep sleep flow; when the master control core and the slave control core meet the dormancy flow, the watchdog counter pauses counting; when the master control core and the slave control core exit from the sleep flow, the watchdog counter continues to count.
All relevant contents of each step related to the above method embodiment may be cited to the functional descriptions of the corresponding functional modules, which are not described herein.
In other embodiments of the present application, an electronic device is disclosed in the embodiments of the present application, as shown in fig. 9, the electronic device 900 may include: one or more processors 901; a memory 902; a display 903; one or more applications (not shown); and one or more computer programs 904, which may be coupled via one or more communication buses 905. Wherein the one or more computer programs 904 are stored in the memory 902 and configured to be executed by the one or more processors 901, the one or more computer programs comprising instructions that can be used to perform the various steps as in fig. 1 and the corresponding embodiments.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above. The specific working processes of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which are not described herein.
The functional units in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic or optical disk, and the like.
The foregoing is merely a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited to this, and any changes or substitutions within the technical scope disclosed in the embodiment of the present application should be covered in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (16)

1. A watchdog control method of a dual-core system, wherein the dual-core system includes a master core, a slave core, and a watchdog, the method comprising:
establishing a dog feeding thread, setting the duration corresponding to the monitoring time of a watchdog counter as a first duration, wherein the priority of the dog feeding thread is higher than that of an idle thread;
when the business thread of the master control core releases the schedule in the first time period, entering a dog feeding thread, reading the running state of the slave control core, and judging whether the running state of the slave control core meets the set dog feeding condition;
executing the dog feeding operation when the running state of the slave control core meets the set dog feeding condition;
and triggering the watchdog to restart when the feeding operation is not executed within the first time period.
2. The method of claim 1, further comprising, prior to reading the operational state of the slave core:
defining a slave core state variable, and writing the slave core state variable into an inter-core sharing area;
when the slave core is subjected to thread switching or enters an idle thread, the state variable of the slave core is updated, and the updated state variable of the slave core is written into the inter-core sharing area.
3. The method of claim 2, wherein a historical state variable is set, the historical state variable stored in the master core;
reading the running state of the slave control core, and judging whether the running state of the slave control core meets the set dog feeding condition or not, wherein the method comprises the following steps of:
reading the slave core state variable from the inter-core shared region;
judging whether the slave core state variable is the same as the history state variable or not;
when the state variable of the slave control core is different from the history state variable, the running state of the slave control core meets the set dog feeding condition;
and updating the historical state variable according to the slave control core state variable.
4. The method of claim 3, further comprising, after determining whether the slave core state variable is the same as the history state variable:
when the state variable of the slave control core is the same as the history state variable, the running state of the slave control core does not meet the set dog feeding condition;
according to a second time length corresponding to a preset dog feeding period, after the second time length is spaced, the master control core reads the state variable of the slave control core and judges whether the state variable of the slave control core is identical to the history state variable or not, wherein the second time length is smaller than the first time length.
5. The method of claim 1, further comprising, after performing the feeding operation:
and updating the counting time of the watchdog counter to be the first duration.
6. The method of claim 1, wherein when executing the idle thread, determining whether the master core and the slave core satisfy a deep sleep procedure;
when the master control core and the slave control core meet the deep sleep flow, closing the watchdog;
and initializing the watchdog when the master control core and the slave control core exit from the deep sleep process, and re-counting the counter of the watchdog.
7. The method of claim 6, wherein when the master core and the slave core do not satisfy a deep sleep procedure, determining whether the master core and the slave core satisfy a sleep procedure;
when the master control core and the slave control core meet the dormancy flow, the watchdog counter pauses counting;
and when the master control core and the slave control core exit from the sleep process, the watchdog counter continues to count.
8. A watchdog control device of a dual-core system, the dual-core system comprising a master core, a slave core and a watchdog, the device comprising:
the configuration determining unit is used for establishing a dog feeding thread, configuring the duration corresponding to the watchdog monitoring time of the watchdog counter as a first duration, and the priority of the dog feeding thread is higher than that of an idle thread;
the judging unit is used for entering a dog feeding thread when the business thread of the main control core releases scheduling in the first time length, reading the running state of the auxiliary control core and judging whether the running state of the auxiliary control core meets the set dog feeding condition;
the dog feeding unit is used for executing dog feeding operation when the running state of the slave control core meets the set dog feeding condition;
and the restarting unit is used for triggering the watchdog to restart when the feeding operation is not executed within the first time period.
9. The apparatus as recited in claim 8, further comprising:
the slave control core state sharing unit is used for defining a slave control core state variable and writing the slave control core state variable into an inter-core sharing area;
when the slave core is subjected to thread switching or enters an idle thread, the state variable of the slave core is updated, and the updated state variable of the slave core is written into the inter-core sharing area.
10. The apparatus as recited in claim 9, further comprising: the history state storage unit is used for setting a history state variable, and the history state variable is stored in the main control core;
the judging unit reads the running state of the slave control core and judges whether the running state of the slave control core meets the set dog feeding condition or not, and the judging unit is specifically used for:
reading the slave core state variable from the inter-core shared region;
judging whether the slave core state variable is the same as the history state variable or not;
when the state variable of the slave control core is different from the history state variable, the running state of the slave control core meets the set dog feeding condition;
and updating the historical state variable according to the slave control core state variable.
11. The apparatus according to claim 10, wherein after the judging unit judges whether the slave core state variable is the same as the history state variable, further comprising:
when the state variable of the slave control core is the same as the history state variable, the running state of the slave control core does not meet the set dog feeding condition;
according to a second time length corresponding to a preset dog feeding period, after the second time length is set, the master control core reads the state variable of the slave control core, and judges whether the state variable of the slave control core is identical to the history state variable or not, wherein the second time length is smaller than the first time length.
12. The apparatus as recited in claim 8, further comprising:
and the updating module is used for updating the counting time of the watchdog counter to be the first duration after the dog feeding operation is executed.
13. The apparatus as recited in claim 8, further comprising:
the deep sleep unit is used for judging whether the main control core and the slave control core meet a deep sleep flow or not when the idle thread is executed;
when the master control core and the slave control core meet the deep sleep flow, closing the watchdog;
and initializing the watchdog when the master control core and the slave control core exit from the deep sleep process, and re-counting the counter of the watchdog.
14. The apparatus as recited in claim 13, further comprising:
the sleep unit is used for judging whether the main control core and the slave control core meet a sleep process or not when the main control core and the slave control core do not meet a deep sleep process;
when the master control core and the slave control core meet the dormancy flow, the watchdog counter pauses counting;
and when the master control core and the slave control core exit from the sleep process, the watchdog counter continues to count.
15. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program, when executed by a processor, implements the watchdog control method of the dual-core system of any of claims 1 to 7.
16. An electronic device, comprising: a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to execute the computer program stored in the memory, so that the electronic device executes the watchdog control method of the dual-core system according to any one of claims 1 to 7.
CN202310054576.5A 2023-02-03 2023-02-03 Watchdog control method and device of dual-core system, medium and electronic equipment Pending CN116956239A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310054576.5A CN116956239A (en) 2023-02-03 2023-02-03 Watchdog control method and device of dual-core system, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310054576.5A CN116956239A (en) 2023-02-03 2023-02-03 Watchdog control method and device of dual-core system, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116956239A true CN116956239A (en) 2023-10-27

Family

ID=88455392

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310054576.5A Pending CN116956239A (en) 2023-02-03 2023-02-03 Watchdog control method and device of dual-core system, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116956239A (en)

Similar Documents

Publication Publication Date Title
US9864627B2 (en) Power saving operating system for virtual environment
KR101551611B1 (en) Method for preemptively restarting software in a multisubsystem mobile communication device to increase mean time between failures
DE112006003444B4 (en) Method and apparatus for detecting processor state transitions
US7007180B2 (en) System and method for switching a computer system to a first or second power saving mode based on whether or not there exists a timer-expiration-waiting event in an event queue
KR101629989B1 (en) Method for the deterministic execution and synchronisation of an information processing system comprising a plurality of processing cores executing system tasks
US8171321B2 (en) Method and apparatus for cost and power efficient, scalable operating system independent services
US8209559B2 (en) Low power polling techniques
US20130198540A1 (en) Dynamic Power Management in Real Time Systems
US20020007387A1 (en) Dynamically variable idle time thread scheduling
CN107491346B (en) Application task processing method, device and system
EP2677377B1 (en) Safety control device and safety control method
US11907762B2 (en) Resource conservation for containerized systems
WO2009150815A1 (en) Multiprocessor system
US7228545B2 (en) Methods and apparatus for managing the execution of a task among a plurality of autonomous processes
CN111566592A (en) Dynamic interrupt rate control in a computing system
GB2525002A (en) Data processing systems
US20090113439A1 (en) Method and Apparatus for Processing Data
CN112306652A (en) Wake-up and scheduling with context-aware functionality
EP1297432A2 (en) Method and apparatus for a scheduling driver to implement a protocol utilizing time estimates for use with a device that does not generate interrupts
CN108241522B (en) Sleep state switching method and device in virtualization environment and electronic equipment
US11169857B2 (en) System and method for reserving a portion of CPU time for host execution
CN116956239A (en) Watchdog control method and device of dual-core system, medium and electronic equipment
US7603673B2 (en) Method and system for reducing context switch times
JP2012247978A (en) Control device and control method
CN113886123B (en) Watchdog feeding method and device, electronic 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