CN-122019307-A - Task congestion processing method, device, control system, vehicle, storage medium, program product and chip system
Abstract
The present disclosure relates to a method, a device, a control system, a vehicle, a storage medium, a program product and a chip system for processing task congestion, wherein the method comprises the steps that a first processor obtains information generated during the task execution of a second processor from a shared memory; the first processor judges whether the task operated by the second processor is jammed based on the information, and the first processor outputs the jam prompt information of the second processor under the condition that the task operated by the second processor is jammed. The method is used for automatically completing the running state detection of the multi-core system.
Inventors
- MEI TAO
- ZHANG TENGFEI
Assignees
- 小米汽车科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260205
Claims (20)
- 1. The task congestion processing method is characterized by comprising the following steps of: The first processor acquires information generated during the task execution of the second processor from the shared memory; The first processor judges whether the task operated by the second processor is jammed or not based on the information; and the first processor outputs the prompting information of the congestion of the second processor under the condition that the task operated by the second processor is congested.
- 2. The task congestion processing method according to claim 1, wherein a storage address of the information of the second processor is stored in the shared memory; The first processor obtains information of the second processor from the shared memory, including: the first processor acquires the storage address of the information of the second processor from the shared memory, and acquires the information of the second processor from the storage address.
- 3. The task congestion processing method according to claim 1, wherein the information includes a set operation frequency, an actual operation duration, and an actual operation number of the periodic tasks operated by the second processor; the first processor judges whether the task operated by the second processor is congested based on the information, and the method comprises the following steps: And the first processor judges whether the periodic task operated by the second processor is jammed or not based on the set operation frequency, the actual operation time length and the actual operation times of the periodic task operated by the second processor.
- 4. The task congestion processing method according to claim 3, wherein the first processor determining whether the periodic task operated by the second processor is congested based on a set operation frequency, an actual operation duration, and an actual operation number of the periodic task operated by the second processor, includes: the first processor determines the preset operation times of the periodic tasks of the second processing operation based on the set operation frequency and the actual operation duration; and the first processor judges whether the periodic task operated by the second processor is jammed or not based on the preset operation times and the actual operation times.
- 5. The task congestion processing method according to claim 4, wherein the first processor determining whether the periodic task operated by the second processor is congested based on the preset operation number and the actual operation number includes: The first processor determines that the periodic task operated by the second processor is not jammed under the condition that the actual operation times are equal to the preset operation times; and the first processor waits for a preset time period under the condition that the actual running times are smaller than the preset running times, and if the actual running times of the periodic tasks running by the second processor are unchanged after the preset time period, the periodic tasks running by the second processor are determined to be congested.
- 6. The task congestion processing method according to claim 1, characterized in that the method further comprises: The first processor triggers a third processor to monitor whether a task operated by the second processor is congested or not under the condition that the occupancy condition of the first processor indicates that the occupancy rate of the first processor reaches a preset first occupancy rate threshold, and the occupancy rate of the third processor does not reach the preset first occupancy rate threshold.
- 7. The method for processing task congestion according to claim 6, wherein the triggering the third processor to monitor whether the task operated by the second processor is congested based on the information of the second processor in the shared memory includes: The first processor sends a first adjustment instruction to a preset fourth processor, so that the fourth processor determines the third processor based on the occupancy rate of at least one processor except the first processor and the second processor, and sends a first trigger instruction to the third processor; Or, the first processor determines the third processor based on the occupancy rate of at least one processor except the first processor and the second processor, and sends a second trigger instruction to the third processor.
- 8. The task congestion processing method according to any one of claims 1 to 7, characterized in that the method further comprises: And the first processor determines a blocking point position based on the information under the condition that the task operated by the second processor is blocked.
- 9. The task congestion processing method according to claim 8, wherein the information further includes execution context information generated when the second processor executes a periodic task; The determining the plugging point position based on the information comprises the following steps: the first processor locates, based on the execution context information, a code line where congestion occurs during execution of a task by the second processor as the location of the congestion point.
- 10. The task congestion processing method according to claim 9, characterized in that the method further comprises: and the first processor performs stack backtracking on the process of executing the task by the second processor based on the execution context information to obtain a function call chain generated during the task execution by the second processor.
- 11. The task congestion processing method according to claim 8, characterized in that the method further comprises: the first processor triggers a fifth processor to determine the position of the blocking point based on the information of the second processor in the shared memory when the occupancy condition of the first processor indicates that the occupancy rate of the first processor reaches a preset second occupancy rate threshold, and the occupancy rate of the fifth processor does not reach the preset second occupancy rate threshold.
- 12. The method of claim 11, wherein triggering the fifth processor to determine the location of the congestion point based on information of the second processor in the shared memory comprises: the first processor sends a second adjustment instruction to a preset sixth processor, so that the sixth processor determines a fifth processor based on the occupancy rate of at least one processor except the first processor and the second processor, and sends a third trigger instruction to the fifth processor; Or, the first processor determines the fifth processor based on the occupancy rate of at least one processor except the first processor and the second processor, and sends a fourth trigger instruction to the fifth processor.
- 13. A task congestion handling apparatus, comprising: The acquisition module is configured to acquire information generated during the task execution of the second processor from the shared memory by the first processor; The judging module is configured to judge whether the task operated by the second processor is jammed or not based on the information; The prompting module is configured to output prompting information of congestion of the second processor when the first processor is congested with a task operated by the second processor.
- 14. The task congestion processing device according to claim 13, wherein a storage address of the information of the second processor is stored in the shared memory; the acquisition module is further configured to: the first processor acquires the storage address of the information of the second processor from the shared memory, and acquires the information of the second processor from the storage address.
- 15. The task congestion processing device according to claim 13, wherein the information includes a set operation frequency, an actual operation duration, and an actual operation number of the periodic tasks operated by the second processor; the determination module is further configured to: And the first processor judges whether the periodic task operated by the second processor is jammed or not based on the set operation frequency, the actual operation time length and the actual operation times of the periodic task operated by the second processor.
- 16. The task congestion processing device of claim 15, wherein the determination module is further configured to: the first processor determines the preset operation times of the periodic tasks of the second processing operation based on the set operation frequency and the actual operation duration; and the first processor judges whether the periodic task operated by the second processor is jammed or not based on the preset operation times and the actual operation times.
- 17. The task congestion processing device of claim 16, wherein the determination module is further configured to: The first processor determines that the periodic task operated by the second processor is not jammed under the condition that the actual operation times are equal to the preset operation times; and the first processor waits for a preset time period under the condition that the actual running times are smaller than the preset running times, and if the actual running times of the periodic tasks running by the second processor are unchanged after the preset time period, the periodic tasks running by the second processor are determined to be congested.
- 18. The task congestion processing device according to claim 13, the task congestion processing device is characterized by further comprising: The first triggering module is configured to trigger a third process to monitor whether a task operated by the second processor is congested or not when the occupancy condition of the first processor indicates that the occupancy rate of the first processor reaches a preset first occupancy rate threshold, and the occupancy rate of the third processor does not reach the preset first occupancy rate threshold.
- 19. The task congestion handling apparatus of claim 18, wherein the first trigger module is further configured to: The first processor sends a first adjustment instruction to a preset fourth processor, so that the fourth processor determines the third processor based on the occupancy rate of at least one processor except the first processor and the second processor, and sends a first trigger instruction to the third processor; Or, the first processor determines the third processor based on the occupancy rate of at least one processor except the first processor and the second processor, and sends a second trigger instruction to the third processor.
- 20. The task congestion processing device according to any one of claims 13 to 19, further comprising: and the determining module is configured to determine a blocking point position based on the information when the first processor is congested with a task operated by the second processor.
Description
Task congestion processing method, device, control system, vehicle, storage medium, program product and chip system Technical Field The present disclosure relates to the field of vehicle control technologies, and in particular, to a task congestion processing method, device, control system, vehicle, storage medium, program product, and chip system. Background In the field of embedded control, during the process of running periodic tasks, a processor is likely to be jammed due to the fact that a certain task is trapped in a dead loop, deadlock or resource waiting, which causes abnormal running of the processor. In general, congestion problems of an embedded control system are difficult to be checked, so that a processor cannot normally operate. Disclosure of Invention To overcome the problems in the related art, the present disclosure provides a task congestion processing method, apparatus, control system, vehicle, storage medium, program product, and chip system. According to some embodiments of the present disclosure, there is provided a task congestion processing method, including: The first processor acquires information generated during the task execution of the second processor from the shared memory; The first processor judges whether the task operated by the second processor is jammed or not based on the information; and the first processor outputs the prompting information of the congestion of the second processor under the condition that the task operated by the second processor is congested. In certain implementations of the first aspect, a storage address of information of the second processor is stored in the shared memory; the obtaining the information of the second processor from the shared memory includes: And acquiring a storage address of the information of the second processor from the shared memory, and acquiring the information of the second processor from the storage address. The shared memory only stores pointers of fixed and unchanged memory addresses corresponding to the plurality of processors, and does not change the information body frequently, so that the plurality of processors can be effectively prevented from writing in frequent information to the shared memory at the same time, and the problems of data competition, read-write conflict and data consistency caused by the pointers are avoided. In certain implementations of the first aspect, the information includes a set operating frequency, an actual operating duration, and an actual number of operations of the periodic task operated by the second processor; the first processor judges whether the task operated by the second processor is congested based on the information, and the method comprises the following steps: And the first processor judges whether the periodic task operated by the second processor is jammed or not based on the set operation frequency, the actual operation time length and the actual operation times of the periodic task operated by the second processor. The method effectively avoids monitoring failure caused by single-point faults by a mode of mutually monitoring a plurality of processors, ensures continuous detection of the running state of the multiple cores in the control system, and can generate prompt information to prompt staff to perform block congestion processing when the monitored tasks are congested, so that developers can timely review code logic of congestion cores to ensure normal operation of the processors. In certain implementations of the first aspect, the determining, by the first processor, whether the periodic task operated by the second processor is congested based on the set operating frequency, the actual operating duration, and the actual number of operations of the periodic task operated by the second processor includes: the first processor determines the preset operation times of the periodic tasks of the second processing operation based on the set operation frequency and the actual operation duration; and the first processor judges whether the periodic task operated by the second processor is jammed or not based on the preset operation times and the actual operation times. By comparing the preset running times and the actual running times of the periodic tasks, the state detection of whether the second processor is jammed is converted into numerical comparison, so that the state of the running tasks of the second processor can be judged rapidly and accurately. In certain implementations of the first aspect, the determining, by the first processor, whether the periodic task operated by the second processor is congested based on the preset operation number and the actual operation number includes: The first processor determines that the periodic task operated by the second processor is not jammed under the condition that the actual operation times are equal to the preset operation times; and the first processor waits for a preset time period under the condition that the actual r