Multi-task guarding method of photoelectric detection equipment system control software

By creating guard tasks in the photodetection device system control software, monitoring and restarting abnormal tasks, the problem of abnormal suspend or blocking during multi-task operation is solved, and the reliability and stability of the software are improved.

CN119847855APending Publication Date: 2025-04-18LUOYANG INST OF ELECTRO OPTICAL EQUIP OF AVIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411712610.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

During multi-task operation, existing photodetection equipment system control software is prone to abnormal suspension or blockage of a task, resulting in abnormal product functions, complete loss of software functions, and long-term product functions failure.

Method used

A multi-task guardian method is adopted to monitor the running status of each functional task by creating a guardian task. When a task has an abnormal operation, the task is restarted. If the restart fails, the watchdog feeds the dog and resets the control circuit to realize the restart function of the entire application software.

Benefits of technology

It effectively avoids the complete loss of software functions due to abnormal operation of a single task and the long-term failure of the product, and improves the reliability of the system control software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847855A_ABST
    Figure CN119847855A_ABST
Patent Text Reader

Abstract

The invention provides a multi-task guarding method for system control software of photoelectric detection equipment, and belongs to the technical field of photoelectric detection, in particular to the method, on the premise that original software functions and task processing logic are not changed, guarding tasks are created, the running state of each function task is monitored, and the real-time performance of the system control software of the photoelectric detection equipment is improved. When a certain task runs abnormally, the task is restarted, and when restarting of the task fails, the control circuit is reset by canceling watchdog feeding, and the restarting function of the whole application software is achieved. Through the method, the problems of complete loss of software functions and long-time function failure of products caused by abnormal operation of a single task can be effectively avoided, and the reliability of system control software is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of photoelectric detection, and in particular to a multi-task guarding method for photoelectric detection equipment system control software. Background Art

[0002] For airborne photoelectric detection equipment, the system control software functions are becoming more and more complex, and the embedded software based on single loop can no longer meet the needs of product function development. The use of multi-task application software based on real-time operating system can better complete the modular packaging of software, improve the real-time operation and software function scalability.

[0003] However, in actual use, the multi-tasking architecture may occasionally cause a task to hang abnormally or be blocked, resulting in abnormal product functions. Summary of the invention

[0004] In view of this, the present application provides a multi-task protection method for the system control software of photoelectric detection equipment, which solves the problems in the prior art, can effectively avoid the complete loss of software functions and long-term product failure due to abnormal operation of a single task, and improve the reliability of the system control software.

[0005] The multi-task guarding method of the photoelectric detection equipment system control software provided in this application adopts the following technical solution:

[0006] A multi-task guarding method for photoelectric detection equipment system control software, comprising:

[0007] Step 1, creating a daemon task for the photoelectric detection device system control software, and starting the daemon task and initializing the internal state variables;

[0008] Step 2: The daemon task sets the semaphore blocking waiting time and waits for the timing semaphore in a blocking manner. After the waiting timeout, it automatically proceeds to step 3.

[0009] Step 3, the daemon task reads the message queues sent by each functional task in turn, obtains the heartbeat information, execution cycle, and message queue sending time of each functional task, and then goes to step 4;

[0010] Step 4, traverse the running status information of each functional task, calculate the execution cycle of each functional task and the message queue update cycle, and go to step 5;

[0011] Step 5, determine whether the current functional task has any abnormal operation; if all functional tasks are running normally, jump to step 8; if there is an abnormal state functional task, jump to step 6;

[0012] Step 6, determine whether the abnormal functional task is suspended. If the functional task is suspended, restart the current functional task and determine whether it is successfully started. If it is successfully started, jump to step 8. If the abnormal functional task is not in a suspended state, jump to step 7;

[0013] Step 7, according to the message queue sending time of the abnormal task, calculate the time interval for updating the task message queue, and determine whether the update interval has timed out. If the update has timed out, the task is considered abnormal, and go to step 9; if the message queue has not timed out, go to step 8;

[0014] Step 8, feed the software to the dog, and then jump back to step 2;

[0015] Step 9, do not perform software feeding and jump back to step 2.

[0016] Optionally, in step 2, the semaphore blocking waiting time is 200ms.

[0017] Optionally, in step 7, the update timeout threshold for the functional task with a period of milliseconds is generally set to 2S.

[0018] Optionally, in step 5, the method for determining whether the current functional task has an operation abnormality specifically includes:

[0019] Compare the theoretical operation cycle of each functional task with the actual operation cycle. When the actual operation cycle is greater than 3 times the theoretical operation cycle, it is considered that the current functional task is running abnormally.

[0020] Optionally, in step 5, the method for determining whether the current functional task has an operation abnormality specifically includes:

[0021] The time when the daemon task receives the message queue sent by the current functional task is the first moment;

[0022] Compare the timestamps in the first moment and the message queue of the current functional task;

[0023] If the interval between the first moment and the timestamp is greater than a preset value, it is considered that the current functional task is running abnormally.

[0024] Optionally, the specific steps of the message queue sent by the functional task include:

[0025] Step 3.1, the functional task starts and completes the initialization of the state variables, and waits for the timing signal in a blocking manner. After the message is triggered, execute 3.2;

[0026] Step 3.2, complete the corresponding processing operations according to the original functions of the functional tasks, and then execute 3.3;

[0027] Step 3.3, call the message queue sending function, send the heartbeat, execution cycle and current time information of the current functional task through the message queue; jump to step 3.1.

[0028] In summary, this application includes the following beneficial technical effects:

[0029] The present application method, without changing the original software functions and task processing logic, monitors the running status of each functional task by creating a guard task. When a task runs abnormally, the task is restarted. When the task restart fails, the control circuit is reset by canceling the watchdog feeding, thereby realizing the restart function of the entire application software. This method can effectively avoid the problem of complete loss of software functions and long-term product failure due to abnormal operation of a single task, and improve the reliability of the system control software. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0031] Figure 1 This is a flow chart of the multi-task guarding method of the photoelectric detection equipment system control software of this application.

[0032] Figure 2 This is a flowchart of the application function task sending the running status to the guardian task. DETAILED DESCRIPTION

[0033] The embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0034] The following describes the implementation methods of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, in the absence of conflict, the following embodiments and the features in the embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work belong to the scope of protection of the present application.

[0035] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present application, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.

[0036] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. The illustrations only show the components related to the present application rather than being drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0037] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.

[0038] An embodiment of the present application provides a multi-task guarding method for photoelectric detection equipment system control software.

[0039] like Figure 1 and Figure 2 As shown, a multi-task guarding method of photoelectric detection equipment system control software includes:

[0040] Step 1: Create a daemon task for the photoelectric detection device system control software, and start the daemon task and initialize the internal state variables.

[0041] Step 2: The daemon task sets the semaphore blocking waiting time and waits for the timing semaphore in a blocking manner. After the waiting time expires, it automatically proceeds to step 3. The semaphore blocking waiting time is 200ms.

[0042] Step 3, the daemon task reads the message queue sent by each functional task in turn, obtains the heartbeat information, execution cycle, and message queue sending time of each functional task, and then goes to step 4.

[0043] Step 4, traverse the running status information of each functional task, calculate the execution cycle of each functional task and the message queue update cycle, and go to step 5.

[0044] Step 5, determine whether the current functional task has any running abnormality; if all functional tasks are running normally, jump to step 8; if there is an abnormal functional task, jump to step 6.

[0045] Step 6, determine whether the abnormal functional task is suspended. If the functional task is suspended, restart the current functional task and determine whether it is started successfully. If it is started successfully, jump to step 8. If the abnormal functional task is not in a suspended state, jump to step 7.

[0046] Step 7, according to the message queue sending time of the abnormal task, calculate the time interval for updating the task message queue, and determine whether the update interval has timed out. If the update has timed out, the task is considered abnormal, and go to step 9; if the message queue has not timed out, go to step 8. For functional tasks with a period of milliseconds, the update timeout threshold is generally set to 2S.

[0047] Step 8, perform software dog feeding, and then jump back to step 2.

[0048] Step 9, do not perform software feeding and jump back to step 2.

[0049] This application proposes a method of multi-task guarding based on message queue to solve the problem that occasional task operation anomalies in multi-task software cause the entire software function to fail. This method monitors the running status of each functional task by creating a guard task without changing the original software function and task processing logic. When a task has an abnormal operation, the task is restarted. When the task restart fails, the control circuit is reset by canceling the watchdog feeding, thereby realizing the restart function of the entire application software. This method can effectively avoid the problem of complete loss of software function and long-term product function failure due to abnormal operation of a single task, improve the reliability of system control software, and has broad application prospects and practical value.

[0050] In step 3, the specific steps of the message queue sent by the functional task include: step 3.1, the functional task starts and completes the initialization of the state variables, and waits for the timing semaphore in a blocking manner, and executes 3.2 after the message is triggered; step 3.2, completes the corresponding processing operations according to the original function of the functional task, and then executes 3.3; step 3.3, calls the message queue sending function, and sends the heartbeat, execution cycle and current time information of the current functional task through the message queue; jump to step 3.1.

[0051] In step 5, the method for determining whether the current functional task has an operation abnormality specifically includes: comparing the theoretical operation cycle of each functional task with the actual operation cycle. When the actual operation cycle is greater than 3 times the theoretical operation cycle, it is considered that the current functional task has an operation abnormality.

[0052] In step 5, the method for determining whether the current functional task has an operating abnormality specifically includes: the time when the guardian task receives the message queue sent by the current functional task is the first moment; comparing the first moment with the timestamp in the message queue of the current functional task; if the interval between the first moment and the timestamp is greater than a preset value, it is considered that the current functional task is operating abnormally.

[0053] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A multi-task guarding method for photoelectric detection equipment system control software, characterized in that: include: Step 1, creating a daemon task for the photoelectric detection device system control software, and starting the daemon task and initializing the internal state variables; Step 2: The daemon task sets the semaphore blocking waiting time and waits for the timing semaphore in a blocking manner. After the waiting timeout, it automatically proceeds to step 3. Step 3, the daemon task reads the message queues sent by each functional task in turn, obtains the heartbeat information, execution cycle, and message queue sending time of each functional task, and then goes to step 4; Step 4, traverse the running status information of each functional task, calculate the execution cycle of each functional task and the message queue update cycle, and go to step 5; Step 5: Determine whether the current function task has any operation abnormality; If all functional tasks run normally, jump to step 8. If there are abnormal functional tasks, jump to step 6. Step 6, determine whether the abnormal functional task is suspended. If the functional task is suspended, restart the current functional task and determine whether it is successfully started. If it is successfully started, jump to step 8. If the abnormal functional task is not in a suspended state, jump to step 7; Step 7, according to the message queue sending time of the abnormal task, calculate the time interval for updating the task message queue, and determine whether the update interval has timed out. If the update has timed out, the task is considered abnormal, and go to step 9; if the message queue has not timed out, go to step 8; Step 8, feed the software to the dog, and then jump back to step 2; Step 9, do not perform software feeding and jump back to step 2.

2. The multi-task guarding method of the photoelectric detection equipment system control software according to claim 1, characterized in that: In step 2, the semaphore blocking waiting time is 200ms.

3. The multi-task guarding method of photoelectric detection equipment system control software according to claim 1, characterized in that: In step 7, the update timeout threshold for the functional task with a period of milliseconds is generally set to 2S.

4. The multi-task guarding method of photoelectric detection equipment system control software according to claim 1, characterized in that: In step 5, the method for determining whether the current functional task has an abnormal operation specifically includes: Compare the theoretical operation cycle of each functional task with the actual operation cycle. When the actual operation cycle is greater than 3 times the theoretical operation cycle, it is considered that the current functional task is running abnormally.

5. The multi-task guarding method of photoelectric detection equipment system control software according to claim 4, characterized in that: In step 5, the method for determining whether the current functional task has an abnormal operation specifically includes: The time when the daemon task receives the message queue sent by the current functional task is the first moment; Compare the timestamps in the first moment and the message queue of the current functional task; If the interval between the first moment and the timestamp is greater than a preset value, it is considered that the current functional task is running abnormally.

6. The multi-task guarding method of photoelectric detection equipment system control software according to claim 4, characterized in that: The specific steps of the message queue sent by the functional task include: Step 3.1, the functional task starts and completes the initialization of the state variables, and waits for the timing signal in a blocking manner. After the message is triggered, execute 3.2; Step 3.2, complete the corresponding processing operations according to the original functions of the functional tasks, and then execute 3.3; Step 3.3, call the message queue sending function, send the heartbeat, execution cycle and current time information of the current functional task through the message queue; jump to step 3.1.