Asynchronous task scheduling method and system for MCU vision module

By adjusting the task waiting table and asynchronous task queue in the MCU vision module in real time, the problem of insufficient flexibility in scheduling of MCU tasks in the multi-core architecture is solved, and more flexible and adaptable task processing is achieved, and emergency response is timely.

CN119668817BActive Publication Date: 2025-05-16SHENZHEN GOLDEN VISION TECHNOLOGY DEVELOPMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510188254.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-05-16
Estimated Expiration
2045-02-20

AI Technical Summary

Technical Problem

When the existing multi-core architecture MCUs process tasks in parallel, the flexibility and adaptability of the task scheduling method is insufficient, resulting in high-priority tasks that may be delayed and cannot respond to emergencies in a timely manner.

Method used

It provides an asynchronous task scheduling method for MCU vision modules. By obtaining the video collected by the visual sensor in real time, determining whether the video needs to be added to the task waiting table, and adjusting the task waiting table in real time according to the video duration. At the same time, obtain the asynchronous task queue to determine whether the number of videos is less than the threshold. If it is less than, add videos to the asynchronous task queue from the task waiting table and the task processing failure table.

Benefits of technology

It improves the flexibility and adaptability of task scheduling, can respond to emergencies in a timely manner, and ensures that tasks with higher priority are processed at the same time, while taking into account the priority processing of tasks with waiting time exceeding the optimal waiting time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668817B_ABST
    Figure CN119668817B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology, and provides an asynchronous task scheduling method and system for an MCU visual module. The method includes obtaining videos collected by each visual sensor within a preset time period; for each visual sensor, judging whether to add the video corresponding to the visual sensor to a preset task waiting table based on the purpose and video corresponding to the visual sensor; if so, adding the video to the cell area corresponding to the visual sensor in the task waiting table; adjusting the task waiting table in real time based on the duration of each video in the task waiting table in the task waiting table; obtaining the current asynchronous task queue, and judging whether the number of the first video in the asynchronous task queue is less than a preset threshold; if less than, adding videos to the asynchronous task queue in sequence from the task waiting table and / or the preset task processing failure table. The method helps to improve the flexibility and adaptability of the task scheduling method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an asynchronous task scheduling method and system for an MCU vision module. Background Art

[0002] With the widespread popularity of smart devices and the increasing complexity of application scenarios, the application of microcontroller units (MCUs) in vision modules has become particularly important. MCU vision modules integrate multiple visual sensors to achieve multi-dimensional perception and data collection of the environment, and are widely used in smart monitoring, unmanned driving, smart manufacturing, smart medical care and other fields.

[0003] As the number of visual sensors increases, multiple tasks need to be processed in parallel. In order to cope with the demand for multi-task parallel processing, more and more MCUs are adopting multi-core architecture design to achieve parallel execution of tasks through multiple processing cores. However, when existing multi-core MCUs process tasks in parallel, they process tasks sequentially according to the order in which they are acquired. This task scheduling method lacks flexibility and adaptability, so high-priority tasks may be delayed when low-priority tasks are not completed, and emergency situations cannot be responded to in a timely manner. Summary of the invention

[0004] The present application provides an asynchronous task scheduling method and system for an MCU vision module to solve the problems raised by the above background technology.

[0005] In a first aspect, the present application provides an asynchronous task scheduling method for an MCU vision module, wherein the MCU vision module includes an MCU with a multi-core architecture and multiple vision sensors, and the method includes:

[0006] Acquire in real time the video collected by each visual sensor within a preset time period; the preset time period is a time period connected to the current moment and before the current moment;

[0007] For each of the visual sensors, based on the purpose and video corresponding to the visual sensor, determine whether to add the video corresponding to the visual sensor to a preset task waiting table; if so, identify the video based on the identification code of the visual sensor, add the video to the cell area corresponding to the visual sensor in the task waiting table, and record the duration of the video existing in the task waiting table in real time in the task waiting table;

[0008] Adjusting the task waiting table in real time based on the duration corresponding to each video in the task waiting table;

[0009] Obtaining a current asynchronous task queue, and determining whether the number of first videos in the asynchronous task queue is less than a preset threshold;

[0010] If it is less, add videos to the asynchronous task queue from the task waiting table and / or the preset task processing failure table in sequence.

[0011] In one possible implementation, the method further includes:

[0012] Real-time detection of the working status of each core of the multi-core MCU;

[0013] If there is an idle core, the video is sent to the idle core from the asynchronous task queue in sequence, and the idle core determines the processing task corresponding to the video based on the identification code on the video after receiving the video, and processes the video based on the processing task to obtain the processing result of the video;

[0014] Obtaining the video processing results of each core in real time;

[0015] For each of the video processing results, the core determines whether the video corresponding to the video processing result has been successfully processed based on the video processing result; if not, the number of processing failures of the video corresponding to the video processing result is marked, and the marked video is added to the task processing failure table, and the number of processing failures corresponding to each video in the task processing failure table decreases from top to bottom.

[0016] In a possible implementation, the visual sensor includes a face detection visual sensor, a vehicle detection visual sensor, and a behavior analysis visual sensor, and the determining whether to add the video corresponding to the visual sensor to a preset task waiting table based on the purpose and video corresponding to the visual sensor includes:

[0017] If the visual sensor is a face detection visual sensor, determine whether there is a face image in the video; if there is a face image in the video, determine to add the video to a preset task waiting table;

[0018] If the visual sensor is a vehicle detection visual sensor, determine whether there is a vehicle license plate image in the video; if there is a vehicle license plate image in the video, determine to add the video to a preset task waiting table;

[0019] If the visual sensor is a behavior analysis visual sensor, it is determined whether there is a dynamic object in the video; if there is a dynamic object in the video, it is determined to add the video to a preset task waiting table.

[0020] In a possible implementation, the real-time adjustment of the task waiting table based on the duration corresponding to each video in the task waiting table includes:

[0021] For each video in the task waiting table, a preset duration corresponding to the video is obtained based on the visual sensor corresponding to the video, and it is determined whether the duration corresponding to the video is greater than the preset duration; if greater, the video is determined to be a priority processing video, and an adjustment coefficient corresponding to the video is generated based on a preset adjustment coefficient generation algorithm;

[0022] Extracting each of the priority processing videos from the task waiting table to obtain a task waiting table containing blank cells, and arranging each of the priority processing videos in sequence based on the adjustment coefficients corresponding to each of the priority processing videos to obtain a priority processing video sequence; wherein the adjustment coefficients corresponding to each of the priority processing videos in the priority processing video sequence decrease in sequence;

[0023] Constructing a blank table; the value corresponding to the number of rows of the blank table is consistent with the value corresponding to the number of priority processing videos in the priority processing video sequence, and the number of columns of the blank table is 1;

[0024] Inserting each priority processing video in the priority processing video sequence into the blank table in sequence to obtain a priority processing video table;

[0025] The first row of the priority processing video table is connected to the last row of the urgent task processing area of ​​the task waiting table containing blank cells to insert the priority processing video table into the task waiting table, and the blank cells are deleted.

[0026] In a possible implementation, the generating the adjustment coefficient corresponding to the video based on a preset adjustment coefficient generating algorithm includes:

[0027] The duration corresponding to the video is subtracted from the preset duration corresponding to the video to obtain the duration difference, and the ratio of the duration difference to the preset duration is determined as the adjustment coefficient corresponding to the video.

[0028] In a possible implementation, sequentially adding videos from the task waiting table and / or the preset task processing failure table to the asynchronous task queue includes:

[0029] Determine whether there is a video in the emergency task processing area in the task waiting table;

[0030] If so, subtract the first video quantity from the preset threshold to obtain a difference in the first video quantity, and determine whether the difference in the first video quantity is greater than the number of videos in the emergency task processing area;

[0031] If the difference between the first video quantities is greater than the number of videos in the emergency task processing area, each video in the emergency task processing area is sequentially added to the front end of the asynchronous task queue to obtain an updated asynchronous task queue;

[0032] Determine whether there is a video in the task processing failure table;

[0033] If there is no video in the task processing failure table, add the video from the task waiting table to the end of the update asynchronous task queue in sequence;

[0034] If there are videos in the task processing failure table, subtract the number of second videos in the update asynchronous task queue from the preset threshold to obtain the difference in the number of second videos, and determine whether the difference in the number of second videos is greater than the number of videos in the task processing failure table;

[0035] If the difference between the second video quantities is greater than the number of videos in the task processing failure table, each video in the task processing failure table is sequentially added before the head end of the update asynchronous task queue, and videos are sequentially added from the task waiting table to after the end of the update asynchronous task queue;

[0036] If the difference between the second video quantities is not greater than the number of videos in the task processing failure table, the videos are added sequentially from the task processing failure table to before the head end of the update asynchronous task queue.

[0037] In a possible implementation, after determining whether the difference in the number of the first videos is greater than the difference in the number of videos in the emergency task processing area, the method further includes:

[0038] If the difference between the first video quantities is not greater than the number of videos in the emergency task processing area, each video in the emergency task processing area is sequentially added to the front end of the asynchronous task queue to obtain an updated asynchronous task queue;

[0039] Determine whether the number of second videos in the update asynchronous task queue is greater than the preset threshold;

[0040] If the number of second videos in the update asynchronous task queue is greater than the preset threshold, videos are added to the task processing failure table in reverse order starting from the end of the update asynchronous task queue until the number of second videos in the update asynchronous task queue is consistent with the preset threshold.

[0041] In a second aspect, the present application provides an asynchronous task scheduling system for an MCU vision module, wherein the MCU vision module includes an MCU with a multi-core architecture and multiple vision sensors, and the system includes:

[0042] A first acquisition module is used to acquire in real time the video collected by each visual sensor within a preset time period; the preset time period is a time period connected to the current moment and before the current moment;

[0043] A judgment module is used to judge, for each of the visual sensors, whether to add the video corresponding to the visual sensor to a preset task waiting table based on the purpose and video corresponding to the visual sensor; if so, identify the video based on the identification code of the visual sensor, add the video to the cell area corresponding to the visual sensor in the task waiting table, and record in real time in the task waiting table the duration for which the video exists in the task waiting table;

[0044] An adjustment module, used for adjusting the task waiting list in real time based on the duration corresponding to each video in the task waiting list;

[0045] A second acquisition module is used to acquire a current asynchronous task queue and determine whether the number of first videos in the asynchronous task queue is less than a preset threshold;

[0046] The video adding module is used to add videos to the asynchronous task queue in sequence from the task waiting table and / or the preset task processing failure table if the number of first videos in the asynchronous task queue is less than a preset threshold.

[0047] The present application provides an asynchronous task scheduling method and system for an MCU visual module, wherein the MCU visual module includes an MCU with a multi-core architecture and multiple visual sensors, and the method includes: acquiring in real time the videos collected by each visual sensor within a preset time period; the preset time period is a time period connected to the current moment and before the current moment; for each of the visual sensors, judging whether to add the video corresponding to the visual sensor to a preset task waiting table based on the purpose and video corresponding to the visual sensor; if so, identifying the video based on the identification code of the visual sensor, adding the video to the cell area corresponding to the visual sensor in the task waiting table, and recording in real time in the task waiting table the duration for which the video exists in the task waiting table; adjusting the task waiting table in real time based on the duration corresponding to each video in the task waiting table; acquiring the current asynchronous task queue, and judging whether the number of first videos in the asynchronous task queue is less than a preset threshold; if less than, adding videos to the asynchronous task queue in sequence from the task waiting table and / or the preset task processing failure table. The method improves the flexibility and adaptability of the task scheduling method, can respond to emergency situations in a timely manner, and can ensure that tasks with higher priority are processed first while also giving priority to tasks whose waiting time exceeds the optimal waiting time. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0049] Figure 1 A flowchart of an asynchronous task scheduling method for an MCU vision module provided in an embodiment of the present application;

[0050] Figure 2 A schematic block diagram of the structure of the asynchronous task scheduling system of the MCU vision module provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0053] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0054] It should be further understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0055] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0056] See also Figure 1 , Figure 1A schematic diagram of a flow chart of an asynchronous task scheduling method for an MCU visual module provided in an embodiment of the present application, wherein the MCU visual module includes an MCU with a multi-core architecture and multiple visual sensors, such as Figure 1 As shown, the asynchronous task scheduling method of the MCU vision module provided in the embodiment of the present application includes steps S1 to S5.

[0057] Step S1, acquiring in real time the videos collected by each visual sensor within a preset time period; the preset time period is a time period connected to the current moment and before the current moment.

[0058] It should be noted that the execution subject of this embodiment can be the asynchronous task scheduling system of the MCU vision module or a server, and the following description will be made using the server as an example.

[0059] Specifically, in this embodiment, the server first constructs an expandable task waiting table according to the task priority of each visual sensor, and the task waiting table includes multiple areas, each area is used to count the pending tasks corresponding to at least one visual sensor, and for each area of ​​the task waiting table, the priorities corresponding to each sensor in the area are consistent. The first area in the task waiting table is used to count the urgent tasks to be processed, and the task priorities corresponding to each area in the task waiting table decrease from top to bottom.

[0060] Step S2: for each of the visual sensors, determine whether to add the video corresponding to the visual sensor to a preset task waiting table based on the purpose and video corresponding to the visual sensor; if so, identify the video based on the identification code of the visual sensor, add the video to the cell area corresponding to the visual sensor in the task waiting table, and record the duration of the video existing in the task waiting table in real time in the task waiting table.

[0061] Exemplarily, the visual sensor includes a face detection visual sensor, a vehicle detection visual sensor, and a behavior analysis visual sensor, and the step of determining whether to add the video corresponding to the visual sensor to a preset task waiting table based on the purpose and video corresponding to the visual sensor includes the following steps:

[0062] If the visual sensor is a face detection visual sensor, determine whether there is a face image in the video; if there is a face image in the video, determine to add the video to a preset task waiting table.

[0063] If the visual sensor is a vehicle detection visual sensor, determine whether there is a vehicle license plate image in the video; if there is a vehicle license plate image in the video, determine to add the video to a preset task waiting table.

[0064] If the visual sensor is a behavior analysis visual sensor, it is determined whether there is a dynamic object in the video; if there is a dynamic object in the video, it is determined to add the video to a preset task waiting table.

[0065] Step S3: adjusting the task waiting table in real time based on the duration corresponding to each video in the task waiting table.

[0066] Specifically, step S3 includes the following steps:

[0067] For each video in the task waiting table, a preset duration corresponding to the video is obtained based on the visual sensor corresponding to the video, and it is determined whether the duration corresponding to the video is greater than the preset duration; if greater, the video is determined to be a priority video, and an adjustment coefficient corresponding to the video is generated based on a preset adjustment coefficient generation algorithm; wherein the preset duration is the optimal waiting duration of the task corresponding to the visual sensor, and the generation of the adjustment coefficient corresponding to the video based on the preset adjustment coefficient generation algorithm includes: subtracting the preset duration corresponding to the video from the duration corresponding to the video to obtain the difference in duration, and determining the ratio of the difference in duration to the preset duration as the adjustment coefficient corresponding to the video.

[0068] Extract each of the priority processing videos from the task waiting table to obtain a task waiting table containing blank cells, and arrange each of the priority processing videos in sequence based on the adjustment coefficient corresponding to each of the priority processing videos to obtain a priority processing video sequence; wherein the adjustment coefficient corresponding to each of the priority processing videos in the priority processing video sequence decreases in sequence.

[0069] A blank table is constructed; the numerical value corresponding to the number of rows of the blank table is consistent with the numerical value corresponding to the number of priority processing videos in the priority processing video sequence, and the number of columns of the blank table is 1.

[0070] Each priority processing video in the priority processing video sequence is inserted into the blank table in sequence to obtain a priority processing video table.

[0071] The first row of the priority processing video table is connected to the last row of the urgent task processing area of ​​the task waiting table containing blank cells to insert the priority processing video table into the task waiting table, and the blank cells are deleted.

[0072] It can be understood that the method in step S3, on the one hand, can ensure that urgent tasks are given priority, and on the other hand, while ensuring that tasks with higher priorities are given priority, it can also take into account the priority of tasks whose waiting time exceeds the optimal waiting time, thereby improving the flexibility of task scheduling and helping to improve user experience.

[0073] Step S4: Obtain the current asynchronous task queue, and determine whether the number of first videos in the asynchronous task queue is less than a preset threshold.

[0074] Step S5: adding videos to the asynchronous task queue from the task waiting table and / or the preset task processing failure table in sequence.

[0075] Specifically, step S5 includes the following steps:

[0076] Determine whether there is a video in the urgent task processing area in the task waiting table.

[0077] If so, the preset threshold is used to subtract the first video quantity to obtain the difference in the first video quantity, and it is determined whether the difference in the first video quantity is greater than the video quantity in the emergency task processing area.

[0078] If the difference in the number of the first videos is greater than the number of videos in the emergency task processing area, each video in the emergency task processing area is added sequentially before the head end of the asynchronous task queue to obtain an updated asynchronous task queue; it can be understood that at this time, the number of second videos in the updated asynchronous task queue is less than the preset threshold, and after each video in the emergency task processing area is added to the asynchronous task queue, each video in the emergency task processing area is deleted from the emergency task processing area.

[0079] Determine whether there is a video in the task processing failure table.

[0080] If there is no video in the task processing failure table, add the video from the task waiting table to the end of the update asynchronous task queue in sequence; it can be understood that after adding the video from the task waiting table to the update asynchronous task queue, the video added to the update asynchronous task queue is deleted from the task waiting table.

[0081] If there are videos in the task processing failure table, the preset threshold is used to subtract the number of second videos in the updated asynchronous task queue to obtain the difference in the number of second videos, and it is determined whether the difference in the number of second videos is greater than the number of videos in the task processing failure table.

[0082] If the difference in the number of the second videos is greater than the number of videos in the task processing failure table, each video in the task processing failure table is added in sequence before the head end of the update asynchronous task queue, and the videos are added in sequence from the task waiting table to the end of the update asynchronous task queue.

[0083] If the difference in the number of the second videos is not greater than the number of videos in the task processing failure table, the videos are added sequentially from the task processing failure table to before the head end of the update asynchronous task queue; it can be understood that after adding the videos from the task processing failure table to the update asynchronous task queue, the videos added to the update asynchronous task queue are deleted from the task processing failure table.

[0084] If the difference between the first video quantities is not greater than the number of videos in the emergency task processing area, each video in the emergency task processing area is sequentially added before the head end of the asynchronous task queue to obtain an updated asynchronous task queue.

[0085] It is determined whether the number of second videos in the update asynchronous task queue is greater than the preset threshold.

[0086] If the number of second videos in the update asynchronous task queue is greater than the preset threshold, videos are added to the task processing failure table in reverse order starting from the end of the update asynchronous task queue until the number of second videos in the update asynchronous task queue is consistent with the preset threshold.

[0087] It can be understood that the method in step S5, on the one hand, helps to ensure that emergency tasks are processed in a timely manner by determining whether there is a video in the emergency task processing area in the task waiting table, and when there is a video in the emergency task processing area, adding each video in the emergency task processing area in sequence before the head end of the asynchronous task queue. On the other hand, the asynchronous task queue is flexibly adjusted according to the status of the task processing failure table, so that the failed task can be recovered in time when the task processing fails. This dynamic management method improves the system's adaptability to unexpected situations and abnormal conditions.

[0088] The method provided in this embodiment improves the flexibility and adaptability of the task scheduling method, can respond to emergency situations in a timely manner, and can ensure that tasks with higher priority are processed first while also giving priority to tasks whose waiting time exceeds the optimal waiting time.

[0089] In some embodiments, the method further comprises the following steps:

[0090] Real-time detection of the working status of each core of the multi-core MCU.

[0091] If there is an idle core, the video is sent to the idle core from the asynchronous task queue in sequence. After receiving the video, the idle core determines the processing task corresponding to the video based on the identification code on the video, and processes the video based on the processing task to obtain the processing result of the video.

[0092] The video processing results of each of the cores are obtained in real time.

[0093] For each of the video processing results, the core determines whether the video corresponding to the video processing result has been successfully processed based on the video processing result; if not, the number of processing failures of the video corresponding to the video processing result is marked, and the marked video is added to the task processing failure table, and the number of processing failures corresponding to each video in the task processing failure table decreases from top to bottom.

[0094] The method provided in this embodiment, on the one hand, significantly improves the resource utilization of the system by real-time monitoring of the working status of each core of the multi-core MCU and intelligently allocating the videos in the asynchronous task queue to the idle cores for parallel processing. The dynamic allocation of idle cores ensures the full utilization of the multi-core architecture, speeds up the task processing speed, and enhances the responsiveness of the overall system. On the other hand, it obtains and evaluates the video processing results in real time, and promptly marks and manages the videos that have failed to be processed, thereby improving the task recovery capability and system reliability.

[0095] See also Figure 2 , Figure 2 The structure schematic block diagram of the asynchronous task scheduling system 100 of the MCU visual module provided in the embodiment of the present application, wherein the MCU visual module includes a multi-core MCU and multiple visual sensors, such as Figure 2 As shown, the asynchronous task scheduling system 100 of the MCU vision module provided in the embodiment of the present application includes:

[0096] The first acquisition module 110 is used to acquire in real time the videos collected by each visual sensor within a preset time period; the preset time period is a time period connected to the current moment and before the current moment.

[0097] The judgment module 120 is used to judge, for each of the visual sensors, whether to add the video corresponding to the visual sensor to a preset task waiting table based on the purpose and video corresponding to the visual sensor; if so, identify the video based on the identification code of the visual sensor, add the video to the cell area corresponding to the visual sensor in the task waiting table, and record the duration of the video existing in the task waiting table in real time in the task waiting table.

[0098] The adjustment module 130 is used to adjust the task waiting list in real time based on the duration corresponding to each video in the task waiting list.

[0099] The second acquisition module 140 is used to acquire the current asynchronous task queue and determine whether the number of first videos in the asynchronous task queue is less than a preset threshold.

[0100] The video adding module 150 is used to add videos to the asynchronous task queue in sequence from the task waiting table and / or the preset task processing failure table if the number of first videos in the asynchronous task queue is less than a preset threshold.

[0101] It should be noted that technicians in the relevant technical field can clearly understand that for the convenience and conciseness of description, the specific working process of the system and each module described above can refer to the process in the embodiment of the asynchronous task scheduling method of the aforementioned MCU vision module, and will not be repeated here.

[0102] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements 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. An asynchronous task scheduling method for an MCU vision module, characterized in that: The MCU vision module includes an MCU with a multi-core architecture and a plurality of vision sensors, and the method includes: Acquire in real time the video collected by each visual sensor within a preset time period; the preset time period is a time period connected to the current moment and before the current moment; For each of the visual sensors, based on the purpose and video corresponding to the visual sensor, determine whether to add the video corresponding to the visual sensor to a preset task waiting table; if so, identify the video based on the identification code of the visual sensor, add the video to the cell area corresponding to the visual sensor in the task waiting table, and record the duration of the video existing in the task waiting table in real time in the task waiting table; Adjusting the task waiting table in real time based on the duration corresponding to each video in the task waiting table; Obtaining a current asynchronous task queue, and determining whether the number of first videos in the asynchronous task queue is less than a preset threshold; If it is less than, adding videos to the asynchronous task queue from the task waiting table and / or the preset task processing failure table in sequence; The step of adjusting the task waiting table in real time based on the duration of each video in the task waiting table includes: For each video in the task waiting table, a preset duration corresponding to the video is obtained based on the visual sensor corresponding to the video, and it is determined whether the duration corresponding to the video is greater than the preset duration; if greater, the video is determined to be a priority video, and the duration corresponding to the video is subtracted from the preset duration corresponding to the video to obtain the duration difference, and the ratio of the duration difference to the preset duration is determined as the adjustment coefficient corresponding to the video; Extracting each of the priority processing videos from the task waiting table to obtain a task waiting table containing blank cells, and arranging each of the priority processing videos in sequence based on the adjustment coefficients corresponding to each of the priority processing videos to obtain a priority processing video sequence; wherein the adjustment coefficients corresponding to each of the priority processing videos in the priority processing video sequence decrease in sequence; Constructing a blank table; the value corresponding to the number of rows of the blank table is consistent with the value corresponding to the number of priority processing videos in the priority processing video sequence, and the number of columns of the blank table is 1; Inserting each priority processing video in the priority processing video sequence into the blank table in sequence to obtain a priority processing video table; The first row of the priority processing video table is connected to the last row of the urgent task processing area of ​​the task waiting table containing blank cells to insert the priority processing video table into the task waiting table, and the blank cells are deleted.

2. The asynchronous task scheduling method of the MCU visual module according to claim 1, characterized in that: The method further comprises: Real-time detection of the working status of each core of the multi-core MCU; If there is an idle core, the video is sent to the idle core from the asynchronous task queue in sequence, and the idle core determines the processing task corresponding to the video based on the identification code on the video after receiving the video, and processes the video based on the processing task to obtain the processing result of the video; Obtaining the video processing results of each core in real time; For each of the video processing results, the core determines whether the video corresponding to the video processing result has been successfully processed based on the video processing result; if not, the number of processing failures of the video corresponding to the video processing result is marked, and the marked video is added to the task processing failure table, and the number of processing failures corresponding to each video in the task processing failure table decreases from top to bottom.

3. The asynchronous task scheduling method of the MCU visual module according to claim 1, characterized in that: The visual sensor includes a face detection visual sensor, a vehicle detection visual sensor, and a behavior analysis visual sensor. The method of determining whether to add the video corresponding to the visual sensor to a preset task waiting table based on the purpose and video corresponding to the visual sensor includes: If the visual sensor is a face detection visual sensor, determine whether there is a face image in the video; if there is a face image in the video, determine to add the video to a preset task waiting table; If the visual sensor is a vehicle detection visual sensor, determine whether there is a vehicle license plate image in the video; if there is a vehicle license plate image in the video, determine to add the video to a preset task waiting table; If the visual sensor is a behavior analysis visual sensor, it is determined whether there is a dynamic object in the video; if there is a dynamic object in the video, it is determined to add the video to a preset task waiting table.

4. The asynchronous task scheduling method of the MCU visual module according to claim 2, characterized in that: The adding of videos to the asynchronous task queue from the task waiting table and / or the preset task processing failure table in sequence includes: Determine whether there is a video in the emergency task processing area in the task waiting table; If so, subtract the first video quantity from the preset threshold to obtain a difference in the first video quantity, and determine whether the difference in the first video quantity is greater than the number of videos in the emergency task processing area; If the difference between the first video quantities is greater than the number of videos in the emergency task processing area, each video in the emergency task processing area is sequentially added to the front end of the asynchronous task queue to obtain an updated asynchronous task queue; Determine whether there is a video in the task processing failure table; If there is no video in the task processing failure table, add the video from the task waiting table to the end of the update asynchronous task queue in sequence; If there are videos in the task processing failure table, subtract the number of second videos in the update asynchronous task queue from the preset threshold to obtain the difference in the number of second videos, and determine whether the difference in the number of second videos is greater than the number of videos in the task processing failure table; If the difference between the second video quantities is greater than the number of videos in the task processing failure table, each video in the task processing failure table is sequentially added before the head end of the update asynchronous task queue, and videos are sequentially added from the task waiting table to after the end of the update asynchronous task queue; If the difference between the second video quantities is not greater than the number of videos in the task processing failure table, the videos are added sequentially from the task processing failure table to before the head end of the update asynchronous task queue.

5. The asynchronous task scheduling method of the MCU visual module according to claim 4, characterized in that: After determining whether the difference in the number of the first videos is greater than the difference in the number of videos in the emergency task processing area, the method further includes: If the difference between the first video quantities is not greater than the number of videos in the emergency task processing area, each video in the emergency task processing area is sequentially added to the front end of the asynchronous task queue to obtain an updated asynchronous task queue; Determine whether the number of second videos in the update asynchronous task queue is greater than the preset threshold; If the number of second videos in the update asynchronous task queue is greater than the preset threshold, videos are added to the task processing failure table in reverse order starting from the end of the update asynchronous task queue until the number of second videos in the update asynchronous task queue is consistent with the preset threshold.

6. An asynchronous task scheduling system for an MCU vision module, characterized in that: The MCU vision module includes a multi-core MCU and multiple vision sensors, and the system includes: A first acquisition module is used to acquire in real time the video collected by each visual sensor within a preset time period; the preset time period is a time period connected to the current moment and before the current moment; A judgment module is used to judge, for each of the visual sensors, whether to add the video corresponding to the visual sensor to a preset task waiting table based on the purpose and video corresponding to the visual sensor; if so, identify the video based on the identification code of the visual sensor, add the video to the cell area corresponding to the visual sensor in the task waiting table, and record in real time in the task waiting table the duration for which the video exists in the task waiting table; An adjustment module, used for adjusting the task waiting list in real time based on the duration corresponding to each video in the task waiting list; A second acquisition module is used to acquire a current asynchronous task queue and determine whether the number of first videos in the asynchronous task queue is less than a preset threshold; A video adding module, configured to add videos to the asynchronous task queue in sequence from the task waiting table and / or a preset task processing failure table if the number of first videos in the asynchronous task queue is less than a preset threshold; The step of adjusting the task waiting table in real time based on the duration of each video in the task waiting table includes: For each video in the task waiting table, a preset duration corresponding to the video is obtained based on the visual sensor corresponding to the video, and it is determined whether the duration corresponding to the video is greater than the preset duration; if greater, the video is determined to be a priority video, and the duration corresponding to the video is subtracted from the preset duration corresponding to the video to obtain the duration difference, and the ratio of the duration difference to the preset duration is determined as the adjustment coefficient corresponding to the video; Extracting each of the priority processing videos from the task waiting table to obtain a task waiting table containing blank cells, and arranging each of the priority processing videos in sequence based on the adjustment coefficients corresponding to each of the priority processing videos to obtain a priority processing video sequence; wherein the adjustment coefficients corresponding to each of the priority processing videos in the priority processing video sequence decrease in sequence; Constructing a blank table; the value corresponding to the number of rows of the blank table is consistent with the value corresponding to the number of priority processing videos in the priority processing video sequence, and the number of columns of the blank table is 1; Inserting each priority processing video in the priority processing video sequence into the blank table in sequence to obtain a priority processing video table; The first row of the priority processing video table is connected to the last row of the urgent task processing area of ​​the task waiting table containing blank cells to insert the priority processing video table into the task waiting table, and the blank cells are deleted.

Citation Information

Patent Citations

  • An asynchronous task scheduling method and device

    CN109766172A

  • Visual inertial odometer system for multi-sensor synchronous time synchronization and time synchronization method thereof

    CN117191075A