Task processing method, device, equipment and storage medium
By combining intelligent analysis tasks and scheduling based on target analysis parameters, the problems of large network overhead and low efficiency caused by multiple real-time video analysis of the same monitoring point scene in the prior art are solved, and more efficient task processing is achieved.
Patent Information
- Application Number
- CN202211220014.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2042-09-30
AI Technical Summary
The prior art performs multiple real-time video analysis on the same monitoring point scene in intelligent analysis, resulting in large network overhead, high bandwidth usage and low efficiency.
When multiple tasks are received, tasks that meet preset aggregation conditions are merged, target tasks are generated, and resource scheduling is performed based on the analysis parameters of the target tasks to perform the analysis tasks.
By merging tasks and scheduling resources, the network overhead of multiple resource scheduling is reduced and the efficiency of task processing is improved.
Smart Images

Figure CN115665248B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of task processing technology, and in particular to a task processing method, device, equipment and storage medium. Background Art
[0002] Intelligent analysis generally refers to image visual analysis technology based on deep learning framework training, which analyzes and tracks the target appearing in the camera scene by separating the background and target in the scene. According to the different alarm rules preset by the user in the scenes of different cameras, once the target in the scene behaves in accordance with the predefined rules, the system will automatically analyze and alarm.
[0003] As intelligent recognition and analysis technology matures, it is being applied in more and more industries. Multiple industries and multiple products will issue AI intelligent analysis tasks to the same front-end monitoring point scene. The events analyzed may or may not be the same. The current intelligent analysis solution is to create an analysis task for each, and then analyze multiple tasks separately to obtain analysis results. Specifically, when a task is received, the video stream corresponding to the task is obtained for analysis. The existing technology may obtain multiple real-time videos for the same monitoring point scene and analyze them multiple times, which increases network overhead and places a heavy burden on network bandwidth.
[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of the present invention is to provide a task processing method, device, equipment and storage medium, aiming to solve the technical problem of low analysis efficiency caused by separately scheduling resources corresponding to each task to execute the task in the prior art.
[0006] To achieve the above object, the present invention provides a task processing method, which comprises the following steps:
[0007] When the received multiple tasks meet the preset aggregation condition, the multiple tasks are merged to obtain a target task, and the target analysis parameter of the target task is the result of merging the analysis parameters in the multiple tasks; the preset aggregation condition includes that the monitoring scenes to be analyzed of the multiple tasks are the same;
[0008] Resources are scheduled for the target task to execute the target task.
[0009] Exemplarily, the performing resource scheduling on the target task to execute the target task includes:
[0010] Based on the target analysis time in the target analysis parameter, obtaining the video to be analyzed corresponding to the same monitoring scene to be analyzed within the target analysis time; wherein the target analysis time is the combination of the analysis times in the multiple tasks;
[0011] Based on the target analysis parameters, video frame analysis is performed on the video to be analyzed to obtain a target task analysis result.
[0012] Exemplarily, if the analysis parameters in the multiple tasks include the same first analysis algorithm, then the target analysis parameters include the first analysis algorithm, and the step of performing video frame analysis on the video to be analyzed based on the target analysis parameters to obtain the target task analysis result includes:
[0013] Acquire an algorithm package corresponding to the target analysis parameter, wherein the algorithm package includes the first analysis algorithm;
[0014] The first analysis algorithm is used to perform video frame analysis on the video to be analyzed to obtain a first event detection result and a first event detection time corresponding to the first event detection result.
[0015] Exemplarily, the analysis parameters in the multiple tasks include different first analysis algorithms and second analysis algorithms, then the target analysis parameters include the first analysis algorithm and the second analysis algorithm, and the target analysis parameters also include a first merging time corresponding to the first analysis algorithm and a second merging time corresponding to the second analysis algorithm, the first merging time is a time set corresponding to video frames for video analysis using the first analysis algorithm, and the second merging time is a time set corresponding to video frames for video analysis using the second analysis algorithm; then the target task analysis result is obtained by performing video frame analysis on the video to be analyzed based on the target analysis parameters, including:
[0016] Acquire an algorithm package corresponding to the target analysis parameter, the algorithm package including the first analysis algorithm and the second analysis algorithm;
[0017] Using the first analysis algorithm to perform video frame analysis on the video to be analyzed within the first merging time to obtain a first event detection result and a first event detection time corresponding to the first event detection result;
[0018] The second analysis algorithm is used to perform video frame analysis on the video to be analyzed within the second merging time to obtain a second event detection result and a second event detection time corresponding to the second event detection result.
[0019] Exemplarily, the target task analysis result includes an event detection result and an event detection time; the method further includes:
[0020] Obtaining a mapping relationship between the target task and a plurality of the tasks;
[0021] According to the mapping relationship, determining each of the tasks corresponding to the target task analysis result;
[0022] According to the analysis algorithm and analysis time included in the analysis parameters in each of the tasks, the task corresponding to the event detection result and the event detection time is determined.
[0023] Exemplarily, the mapping relationship further includes an analysis result receiving end corresponding to each of the tasks; and the method further includes:
[0024] According to the mapping relationship, the event detection result and the event detection time are distributed to the target terminal corresponding to the corresponding task.
[0025] Exemplarily, to achieve the above-mentioned purpose, the present invention further provides a task processing device, the device comprising:
[0026] A task merging module is used to merge the multiple tasks received to obtain a target task when the multiple tasks meet the preset aggregation condition, wherein the target analysis parameter of the target task is obtained by merging the analysis parameters in the multiple tasks, and the preset aggregation condition includes that the monitoring scenes to be analyzed of the multiple tasks are the same;
[0027] The task execution module is used to schedule resources for the target task to execute the target task.
[0028] Exemplarily, the task execution module is further used to obtain the video to be analyzed corresponding to the same monitoring scene to be analyzed within the target analysis time based on the target analysis time in the target analysis parameter; wherein the target analysis time is the result of combining the analysis times in multiple tasks; perform video frame analysis on the video to be analyzed based on the target analysis parameter to obtain the target task analysis result;
[0029] and / or, if the analysis parameters in the plurality of tasks include the same first analysis algorithm, then the target analysis parameters include the first analysis algorithm;
[0030] The task execution module is further used to obtain an algorithm package corresponding to the target analysis parameter, the algorithm package including the first analysis algorithm; use the first analysis algorithm to perform video frame analysis on the video to be analyzed to obtain a first event detection result and a first event detection time corresponding to the first event detection result;
[0031] And / or, the analysis parameters in the multiple tasks include different first analysis algorithms and second analysis algorithms, then the target analysis parameters include the first analysis algorithm and the second analysis algorithm, and the target analysis parameters also include a first merging time corresponding to the first analysis algorithm and a second merging time corresponding to the second analysis algorithm, the first merging time being a time set corresponding to video frames that use the first analysis algorithm to perform video analysis, and the second merging time being a time set corresponding to video frames that use the second analysis algorithm to perform video analysis;
[0032] The task execution module is further used to obtain an algorithm package corresponding to the target analysis parameter, wherein the algorithm package includes the first analysis algorithm and the second analysis algorithm;
[0033] Using the first analysis algorithm to perform video frame analysis on the video to be analyzed within the first merging time to obtain a first event detection result and a first event detection time corresponding to the first event detection result;
[0034] Using the second analysis algorithm to perform video frame analysis on the video to be analyzed within the second merging time to obtain a second event detection result and a second event detection time corresponding to the second event detection result;
[0035] And / or, the task processing device is further used to obtain a mapping relationship between the target task and the plurality of tasks;
[0036] According to the mapping relationship, determining each of the tasks corresponding to the target task analysis result;
[0037] Determine the task corresponding to the event detection result and the event detection time according to the analysis algorithm and analysis time included in the analysis parameters in each of the tasks;
[0038] And / or, the mapping relationship further includes an analysis result receiving end corresponding to each of the tasks;
[0039] The task processing device is further used to distribute the event detection result and the event detection time to the target terminal corresponding to the corresponding task according to the mapping relationship.
[0040] Exemplarily, to achieve the above-mentioned purpose, the present invention also proposes a task processing device, which includes: a memory, a processor, and a task processing program stored in the memory and executable on the processor, wherein the task processing program is configured to implement the steps of the task processing method described above.
[0041] Exemplarily, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a task processing program is stored, and when the task processing program is executed by a processor, the steps of the task processing method described above are implemented.
[0042] In an embodiment of the present invention, when multiple tasks received meet preset aggregation conditions, multiple tasks are merged to obtain a target task, and the target analysis parameters of the target task are merged from the analysis parameters in the multiple tasks; the preset aggregation conditions include that the monitoring scenes to be analyzed for the multiple tasks are the same; and resources are scheduled for the target task to execute the target task. Compared with the existing method of separately scheduling the resources corresponding to each task to execute tasks, the above method in the embodiment of the present invention can merge multiple tasks that meet the preset aggregation conditions and then schedule resources for execution, thereby reducing the network overhead of multiple resource scheduling and improving the efficiency of task processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a structural diagram of a task processing device in a hardware operating environment involved in an embodiment of the present invention;
[0044] Figure 2 A schematic diagram of a flow chart of an embodiment of a task processing method of the present invention;
[0045] Figure 3 A schematic diagram of a flow chart of an embodiment of a task processing method of the present invention;
[0046] Figure 4 A schematic diagram of a flow chart of an embodiment of a task processing method of the present invention;
[0047] Figure 5 A logical architecture diagram of an embodiment of a task processing method of the present invention;
[0048] Figure 6 It is a structural block diagram of an embodiment of a task processing device of the present invention.
[0049] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0050] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0051] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the structure of a task processing device in a hardware operating environment involved in an embodiment of the present invention.
[0052] like Figure 1As shown, the task processing device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0053] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the task processing device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0054] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a task processing program.
[0055] exist Figure 1 In the task processing device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the task processing device of the present invention can be set in the task processing device, and the task processing device calls the task processing program stored in the memory 1005 through the processor 1001, and executes the task processing method provided by the embodiment of the present invention.
[0056] Based on the above task processing device, an embodiment of the present invention provides a task processing method, referring to Figure 2 , Figure 2 It is a flowchart of an embodiment of a task processing method of the present invention.
[0057] In this embodiment, the task processing method includes the following steps:
[0058] Step S10: When the received multiple tasks meet the preset aggregation conditions, the multiple tasks are merged to obtain a target task, and the target analysis parameters of the target task are merged from the analysis parameters in the multiple tasks; the preset aggregation conditions include that the monitoring scenes to be analyzed of the multiple tasks are the same.
[0059] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a mobile phone, a tablet computer, a personal computer, etc., or an electronic device or task processing device that can realize the above functions. The following takes the task processing device as an example to illustrate this embodiment and the following embodiments.
[0060] It should be noted that a task can be a minimum unit of intelligent analysis obtained by integrating information such as the type of intelligent analysis event, analysis time, analysis scene, validity period, priority, etc. according to the user's own business needs. Multiple tasks can be two or more tasks for analyzing videos sent by users to the task processing device. The users can be the same user or multiple different users. For example, task 001 can be a task sent by user A to the task processing device to detect whether there are vendors in the video collected by camera 01 from 8 to 10 o'clock; task 002 can be a task sent by user B to the task processing device to detect whether the street lights in camera 03 are turned on at 18 o'clock; task 003 can be a task sent by user C to the task processing device to detect whether there are obstacles on the road in camera 01 from 9 to 11 o'clock. Among them, detection camera 01 and detection camera 03 are the cameras to be detected corresponding to task 001 and task 002 respectively. The preset aggregation condition includes that the monitoring scenes to be analyzed of the multiple tasks are the same, that is, the cameras to be detected corresponding to the multiple tasks and the preset positions of the cameras to be detected are the same. For example, Task 001 and Task 003 both detect the video collected by Camera 01 at Preset Position 01, then it is determined that Task 001 and Task 003 meet the preset aggregation condition. The analysis parameters in the multiple tasks may include the events to be analyzed by each task and the analysis algorithm required to analyze each event. The target analysis parameters include the events to be analyzed by each task constituting the target task and the analysis algorithm required to analyze the event.
[0061] It should be understood that, because the task can be to detect whether the target behavior appears in the video collected by the camera, and some existing cameras can collect 360-degree video data around the camera, the task may only detect the video collected by the camera at a certain preset position. Therefore, the monitoring scene to be analyzed can be the scene video collected by the camera to be detected corresponding to the task when it is in a certain preset position. For example, the monitoring scene to be analyzed corresponding to the task is the video collected by the camera with camera identification 100 at the preset position identification 02.
[0062] In a specific implementation, if Task 001 and Task 003 meet the preset aggregation condition, but the detection time corresponding to Task 001 is from 8 to 9, and the detection time corresponding to Task 003 is from 15 to 16, then after the tasks are merged, there is no executable task between 9 and 15. At this time, in order to avoid re-acquiring video resources when executing Task 003 without interrupting the execution of the task, a certain amount of network bandwidth will be occupied. Therefore, the preset aggregation condition can also be the same monitoring scene to be analyzed and the detection time is continuous. For example, Task 001 and Task 003 are both to detect the video collected by Camera 01, and the detection time is from 8 to 10 and from 9 to 11 respectively. There is an overlapping detection time from 9 to 10, then it is determined that Task 001 and Task 003 meet the preset aggregation condition. If the detection time of Task 003 is from 10 to 11 o'clock, since Task 003 can be executed after Task 001, it can be determined that the detection times of Task 001 and Task 003 are continuous, which meets the preset aggregation condition. Task 001 and Task 003 can be merged for task execution. However, Task 001 and Task 002 do not correspond to the same detection camera and the detection time does not overlap, so the aggregation condition is not met. They cannot be merged into one target task for task execution.
[0063] In the specific implementation, the task execution time of Task A is from 8:00 to 10:00, and the task execution time of Task B is from 9:00 to 11:00. The monitoring scenes to be analyzed for Task A and Task B are the same, that is, Task A and Task B analyze the video collected by the same camera when it is in the same preset position. When executing Task A and Task B, because they have a common execution time, Task A and Task B can be executed at the same time during this common execution time. Therefore, in order to avoid multiple calls to video data, Task A and Task B can be merged and processed. From 8:00 to 9:00, Task A is executed alone. At 9 o'clock, there is no need to reopen the thread to obtain video resources to execute Task B. Instead, Task A and Task B are executed at the same time, thereby reducing network overhead and waste of computing power. If the execution time of Task C is 11 o'clock, and the monitoring scene to be analyzed is consistent with that of Task A, then in order to avoid multiple video calls, Task C can also be merged. When Task B is completed, Task C will continue to be executed. Therefore, it can be considered that Task C, Task B and Task A are continuous in detection time, and the monitoring scenes to be analyzed are consistent, that is, the preset aggregation conditions are met.
[0064] Merging multiple tasks to obtain a target task can be merging multiple tasks into one task, for example, Task 001 is a task to detect whether there are vendors in the video captured by camera 01 from 8 to 10 o'clock; Task 003 is a task to detect whether there are obstacles on the road captured by camera 01 from 9 to 11 o'clock. Then Task 001 and Task 003 can be merged to obtain the target task, which is to detect whether there are vendors in the video captured by camera 01 from 8 to 9 o'clock, to detect whether there are vendors in the video captured by camera 01 from 9 to 10 o'clock, and to detect whether there are obstacles on the road captured by camera 01 from 10 to 11 o'clock.
[0065] Step S20: performing resource scheduling for the target task to execute the target task.
[0066] It should be noted that resource scheduling for the target task may be to obtain the monitoring scene to be analyzed corresponding to the target task. Executing the target task may be to analyze the monitoring scene to be analyzed according to the target analysis parameters of the target task to obtain the target task analysis result. For example, the target task is to analyze whether behaviors a and b appear in the video collected by camera 01 from 8 to 9 o'clock. Then the video collected by camera 01 from 8 to 9 o'clock is the monitoring scene to be analyzed. Analyzing the monitoring scene to be analyzed based on the target task to obtain the target task analysis result may be to analyze the monitoring scene to be analyzed, determine whether behaviors a and behavior b appear in the video collected from 8 to 9 o'clock, and if so, record the time when behaviors a and behavior b appear, and generate the target task analysis result according to the behaviors that appear and the time when the behaviors appear.
[0067] Exemplarily, in order to avoid re-acquiring video resources when executing each task, resulting in a waste of network bandwidth, the step S20 may include:
[0068] Step S201: based on the target analysis time in the target analysis parameter, obtaining the video to be analyzed corresponding to the same monitoring scene to be analyzed within the target analysis time; wherein the target analysis time is the combination of the analysis times in the multiple tasks;
[0069] Step S202: performing video frame analysis on the video to be analyzed based on the target analysis parameters to obtain a target task analysis result.
[0070] It should be noted that the target analysis time may be the time for analyzing the monitoring scene to be analyzed. For example, if the target task is to analyze whether there is behavior a from 8 to 9 o'clock and whether there is behavior b from 9 to 10 o'clock in the monitoring scene to be analyzed, then the target analysis time in the target analysis parameter is from 8 to 10 o'clock. The video to be analyzed is the video from 8 to 10 o'clock in the monitoring scene to be analyzed. Performing video frame analysis on the video to be analyzed based on the target analysis parameter may be performing video frame analysis on the video to be analyzed according to the analysis algorithm in the target analysis parameter. For example, the analysis algorithm in the target analysis parameter is the vendor detection algorithm, and the video to be analyzed is the video from 8 to 10 o'clock in the monitoring scene to be analyzed. Performing video frame analysis may be detecting whether there is a vendor from 8 to 10 o'clock in the monitoring scene to be analyzed by the vendor detection algorithm. If there is a vendor, then generating the target task analysis result according to the time when the vendor is detected and the video frame where the vendor exists.
[0071] Exemplarily, the target task analysis result includes an event detection result and an event detection time, and the task processing method also includes: obtaining a mapping relationship between the target task and a plurality of the tasks; determining each of the tasks corresponding to the target task analysis result based on the mapping relationship; and determining the task corresponding to the event detection result and the event detection time based on the analysis algorithm and analysis time included in the analysis parameters of each of the tasks.
[0072] It should be noted that the event detection result may be the result of detecting the event to be analyzed in the task in the video to be analyzed. For example, the target task is to analyze whether event a and event b appear in the video collected by camera 01 from 8 to 9 o'clock. If so, an event detection result of detecting event a or event b is generated. And the detection time of event a or event b is recorded, that is, the event detection time. The mapping relationship may be a comparison relationship between the target task and multiple tasks established when merging tasks. Determining each of the tasks corresponding to the target task analysis result may be determining the task to which the target task analysis result belongs. For example, the target task is formed by merging task A, task B and task C, then each of the tasks corresponding to the target task analysis result is task A, task B and task C, and each analysis result in the target task analysis result is the analysis result of task A, task B and task C.
[0073] According to the analysis algorithm and analysis time included in the analysis parameters in each of the tasks, determining the task corresponding to the event detection result and the event detection time can be performed by matching the analysis algorithm and analysis time included in the analysis parameters in each of the tasks according to the analysis algorithm and event detection time corresponding to the event detection result to determine the task to which the event detection result belongs. For example, if the event detection result is that event a is detected, and the time when event a is detected is 8:25, among the tasks, the analysis algorithm of task A is event detection algorithm a, and the analysis time of the task is from 8 to 9 o'clock, then the task corresponding to the event detection result is task A.
[0074] Exemplarily, the mapping relationship also includes an analysis result receiving end corresponding to each of the tasks; the method also includes: distributing the event detection result and the event detection time to a target terminal corresponding to the corresponding task according to the mapping relationship.
[0075] It should be noted that the target terminal can be the recipient of the event detection result corresponding to the task, can be the user who sends the task to the task processing setting, or can be the terminal that receives the time detection result specified when sending the task.
[0076] Exemplarily, a task may include multiple events to be analyzed, for example, a task includes event a and event b to be analyzed. After analyzing different events, the receivers of the event analysis results may be different. For example, in a task, the analysis result of whether there is an event of behavior p needs to be sent to receiver S, and the analysis result of whether there is an event of behavior k needs to be sent to receiver D. Therefore, it is necessary to find the analysis result receiving end of the event analysis results corresponding to each event to be analyzed in the task according to the mapping relationship established when the task is merged, and the event analysis results can be sent to the corresponding analysis result receiving end according to the event distribution path of the analysis result receiving end. The mapping relationship may include information such as the task code, the event code in the task, the user identifier that initiates the task corresponding to the task, the target task code, the analysis result receiving end, and the event distribution path corresponding to the analysis result receiving end. For example, the mapping relationship is that target task 10 corresponds to task 001 and task 002, the users who initiate task 001 and task 002 are user 01 and user 02, the events to be analyzed corresponding to task 001 are event 200 and event 300, the events to be analyzed corresponding to task 002 are event 300 and event 400, the analysis result receiving end corresponding to event 200 is S, and the event distribution path or receiving address corresponding to the analysis result receiving end S is XXX.
[0077] Exemplarily, not all tasks issued by the user can be executed immediately. For example, the current time is 8 o'clock, and the task issued is to analyze whether there is behavior g between 9 o'clock and 10 o'clock in the surveillance video. Since the current time is earlier than the analysis start time of the analysis video, there is no surveillance data corresponding to the analysis time from 9 o'clock to 10 o'clock in the surveillance video, and the task cannot be executed. Therefore, before step S10, when multiple tasks are received, determine whether the analysis start time corresponding to the multiple tasks is not later than the current time; when the analysis start time corresponding to the multiple tasks is not later than the current time, determine whether the multiple tasks received meet the preset aggregation conditions.
[0078] It should be noted that the analysis start time can be the start time of the video analysis in the task. For example, if the task is to analyze whether there is behavior g between 8 and 9 o'clock in the surveillance video, then 8 o'clock is the analysis start time corresponding to the task. The task can only be executed when the analysis start time is later than the current time. Therefore, only tasks whose analysis start time is not later than the current time are judged to meet the preset aggregation conditions.
[0079] In this embodiment, when multiple tasks received meet the preset aggregation conditions, the multiple tasks are merged to obtain a target task, and the target analysis parameters of the target task are merged from the analysis parameters in the multiple tasks; the preset aggregation conditions include that the monitoring scenes to be analyzed for the multiple tasks are the same; and resources are scheduled for the target task to execute the target task. Compared with the existing method of separately scheduling the resources corresponding to each task to execute the task, the above method of this embodiment can merge multiple tasks that meet the preset aggregation conditions and then schedule resources for execution, thereby reducing the network overhead of multiple resource scheduling and improving the efficiency of task processing.
[0080] refer to Figure 3 , Figure 3 It is a flowchart of an embodiment of a task processing method of the present invention.
[0081] Based on the above embodiment, in this embodiment, the analysis parameters in the plurality of tasks include the same first analysis algorithm, and the target analysis parameters include the first analysis algorithm. Step S202 includes:
[0082] Step S2021: Obtain an algorithm package corresponding to the target analysis parameter, wherein the algorithm package includes the first analysis algorithm.
[0083] It should be noted that the first analysis algorithm may be an algorithm for analyzing the video to be analyzed, including a vendor detection algorithm, a garbage detection algorithm, a pedestrian detection algorithm, and a custom algorithm for detecting events in the video to be analyzed. When multiple tasks contain the same first analysis algorithm, in order to avoid calling the algorithm package separately each time a task is executed, thereby increasing network overhead, this embodiment only calls the algorithm package once when the analysis parameters in multiple tasks contain the same first analysis algorithm, and extracts the first analysis algorithm in the algorithm package to execute multiple tasks.
[0084] Step S2022: Utilize the first analysis algorithm to perform video frame analysis on the video to be analyzed, and obtain a first event detection result and a first event detection time corresponding to the first event detection result.
[0085] It should be noted that the use of the first analysis algorithm to perform video frame analysis on the video to be analyzed may be to traverse the video frames in the video to be analyzed, perform feature extraction on the traversed video frames through the first analysis algorithm to obtain feature extraction results, and determine whether there is a target feature in the video frame according to the feature extraction result; if so, it is determined that there is an event to be detected corresponding to the first analysis algorithm in the video to be analyzed, generate a first event detection result for detecting the event to be detected, and record the time when the event to be detected is detected, that is, the first event detection time.
[0086] It should be noted that the target feature may be a feature that needs to be detected by the first analysis algorithm in the target task. For example, if the analysis parameters in multiple tasks include the same first analysis algorithm, and the first analysis algorithm is an algorithm for detecting whether an open flame appears in a video, the target feature may be an open flame. When extracting features from the traversed video frames, if an open flame exists in the extracted features, it means that an open flame exists in the video to be analyzed, and a first event detection result of detecting an open flame is generated, and the time when the open flame is detected is recorded, that is, the first event detection time.
[0087] It should be understood that different warning rules can be pre-set in the task so that an alarm is triggered or prompt information is generated when the warning rules are met. The target analysis parameters of the target task can include the warning rules pre-set in each task in the target task, for example, a warning is issued when the number of pedestrians exceeds two, a warning is issued when there are cart vendors, etc. When the target feature is included in the feature extraction result, it can only be explained that there is an event corresponding to the first analysis algorithm in the video to be analyzed, and the warning condition may not be met. At this time, the first event detection result is also generated according to the feature extraction result and the warning rules in the target analysis parameters. Specifically, it can be determined whether the features appearing in the feature extraction result meet the alarm or prompt rules pre-set in the target analysis parameters. If they meet, the first event detection result including the warning information is generated. For example, the warning rule in the target analysis parameter is to issue a warning when there are more than two pedestrians. If more than two pedestrians appear in the feature extraction result, a first event detection result including the warning information is generated, and when there is only one pedestrian or no pedestrian in the feature extraction result, a first event detection result is generated in which no behavior that meets the warning rule is detected.
[0088] In this embodiment, when the analysis parameters in multiple tasks include the same first analysis algorithm, an algorithm package corresponding to the target analysis parameters is obtained, and the algorithm package includes the first analysis algorithm; the video to be analyzed is analyzed by using the first analysis algorithm to obtain a first event detection result and a first event detection time corresponding to the first event detection result.
[0089] In the specific implementation, please refer to Figure 4 , Figure 4 This is a logical architecture diagram of an embodiment of the task processing method of the present invention, referring to Figure 4 It can be seen that the task processing device in this embodiment includes a task encoding module, a task scheduling module, an intelligent analysis module, a flow acquisition module, an algorithm management module and a data distribution module. Figure 4, 01 is used to represent that the user sends task configuration information to the task encoding module. The task configuration information can be the event parameter information that the user needs to analyze. The event parameter information includes the analysis time and the event to be detected. The task encoding module performs intelligent planning based on the received task configuration information, that is, generates the task to be detected based on the task configuration information sent by the user. 02 is used to represent that the task encoding module returns the task to be detected to the user. 03 is used to represent that the user sends the task to be detected to the task scheduling module. After the task scheduling module receives the task to be detected sent by the user, 04 represents that the task scheduling module sends information to the user whether the task is successfully issued. 05 is used to represent that the task scheduling module performs task scheduling, including the merging of tasks. 06 is used to represent that the task scheduling module sends the merged task or the unmerged task to the intelligent analysis module for analysis. 07 is used to represent that the intelligent analysis module obtains the video stream corresponding to the task from the stream acquisition module, and 08 is used to represent that the stream acquisition module returns the video stream to the intelligent analysis module. 09 is used to represent that the intelligent analysis module obtains the analysis algorithm corresponding to the task from the algorithm management module, and 10 is used to represent that the algorithm management module returns the analysis algorithm corresponding to the task to the intelligent analysis module. 11 is used to represent that the intelligent analysis module analyzes the video stream according to the analysis algorithm corresponding to the task. 12 is used to represent that the intelligent analysis module sends the analysis result to the data distribution module, and 13 is used to represent that the data distribution module sends the analysis result to the user. The recipient of the analysis result is not necessarily the user who sent the task, but may be the recipient of the analysis result specified in the task. For details, please refer to the above embodiments.
[0090] In this embodiment, when the analysis parameters in multiple tasks include the same first analysis algorithm, the algorithm package is only obtained once, avoiding the waste of network and bandwidth caused by obtaining the algorithm package multiple times to analyze the task, and using the first analysis algorithm to analyze multiple tasks including the same first analysis algorithm, avoiding the need to obtain a video stream each time a task is executed, reducing network overhead, and improving task processing efficiency.
[0091] refer to Figure 5 , Figure 5 It is a flowchart of an embodiment of a task processing method of the present invention.
[0092] Based on the above embodiments, in this embodiment, the analysis parameters in the multiple tasks include different first analysis algorithms and second analysis algorithms, then the target analysis parameters include the first analysis algorithm and the second analysis algorithm, and the target analysis parameters also include a first merging time corresponding to the first analysis algorithm and a second merging time corresponding to the second analysis algorithm, the first merging time is a time set corresponding to the video frames using the first analysis algorithm for video analysis, and the second merging time is a time set corresponding to the video frames using the second analysis algorithm for video analysis, step S202 includes:
[0093] Step S2023: Obtain an algorithm package corresponding to the target analysis parameter, wherein the algorithm package includes the first analysis algorithm and the second analysis algorithm.
[0094] Step S2024: using the first analysis algorithm to perform video frame analysis on the video to be analyzed within the first merging time to obtain a first event detection result and a first event detection time corresponding to the first event detection result.
[0095] It should be noted that the various tasks that make up the target task may just be tasks that are consistent with the monitoring scene to be analyzed. If the events to be analyzed corresponding to each of them are different, the analysis algorithms used will naturally be different. However, in order to avoid calling the video stream and algorithm every time a task is executed, thereby increasing the network overhead, in this embodiment, the tasks that are consistent with the monitoring scene to be analyzed are merged for execution. The first merging time is the time set corresponding to the video frames that use the first analysis algorithm for video analysis. For example, the multiple tasks that make up the target task include task A, task B, and task C. The analysis algorithm corresponding to task A is the first analysis algorithm, and the analysis time is from 3 to 4 o'clock; the analysis algorithm corresponding to task B is the second analysis algorithm, and the analysis time is from 5 to 6 o'clock; the analysis algorithm corresponding to task C is the first analysis algorithm, and the analysis time is from 8 to 9 o'clock. In order to avoid calling the algorithm package when executing tasks A, B, and C, the algorithm package can be called only once, and the called algorithm package includes the first analysis algorithm and the second analysis algorithm. At the same time, in order to avoid calling the video stream multiple times, after analyzing task A using the first analysis algorithm, when the current time is the task execution time of task C, continue to use the first analysis algorithm to analyze task C. Then the first merged time is the task execution time of task A and the task execution time of task C, that is, 3 to 4 o'clock and 8 to 9 o'clock.
[0096] Step S2025: Use the second analysis algorithm to perform video frame analysis on the video to be analyzed within the second merging time to obtain a second event detection result and a second event detection time corresponding to the second event detection result.
[0097] It should be noted that the step of performing video frame analysis on the video to be analyzed within the second merge time using the second analysis algorithm can refer to the above step S2024, which is not repeated in this embodiment. The second event detection result is a video detection result obtained after performing video frame analysis on the video to be analyzed within the second merge time according to the second analysis algorithm.
[0098] This embodiment obtains an algorithm package corresponding to the target analysis parameter, and the algorithm package includes the first analysis algorithm and the second analysis algorithm; the first analysis algorithm is used to perform video frame analysis on the video to be analyzed within the first merge time to obtain a first event detection result, and the first event detection time corresponding to the first event detection result; the second analysis algorithm is used to perform video frame analysis on the video to be analyzed within the second merge time to obtain a second event detection result, and the second event detection time corresponding to the second event detection result. This avoids increasing network overhead by acquiring algorithm packages multiple times to analyze tasks, and the same analysis algorithm can be used to analyze multiple tasks within the merge time, avoiding multiple acquisitions of video streams corresponding to tasks with the same monitoring scene to be analyzed, thereby improving the efficiency of task processing.
[0099] Reference Figure 6 , Figure 6 It is a structural block diagram of an embodiment of a task processing device of the present invention.
[0100] like Figure 6 As shown, the task processing device proposed in the embodiment of the present invention includes:
[0101] A task merging module 10 is used to merge the multiple tasks received to obtain a target task when the multiple tasks meet a preset aggregation condition, wherein the target analysis parameter of the target task is obtained by merging the analysis parameters in the multiple tasks, and the preset aggregation condition includes that the monitoring scenes to be analyzed of the multiple tasks are the same;
[0102] The task execution module 20 is used to schedule resources for the target task to execute the target task.
[0103] In this embodiment, when multiple tasks received meet the preset aggregation conditions, the multiple tasks are merged to obtain a target task, and the target analysis parameters of the target task are merged from the analysis parameters in the multiple tasks; the preset aggregation conditions include that the monitoring scenes to be analyzed for the multiple tasks are the same; and resources are scheduled for the target task to execute the target task. Compared with the existing method of separately scheduling the resources corresponding to each task to execute the task, the above method of this embodiment can merge multiple tasks that meet the preset aggregation conditions and then schedule resources for execution, thereby reducing the network overhead of multiple resource scheduling and improving the efficiency of task processing.
[0104] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0105] In addition, for technical details that are not described in detail in this embodiment, reference can be made to the task processing method provided in any embodiment of the present invention, and will not be repeated here.
[0106] Based on the above-mentioned first embodiment of the task processing device of the present invention, a second embodiment of the task processing device of the present invention is proposed.
[0107] In this embodiment, the task execution module 20 is further used to obtain the video to be analyzed corresponding to the same monitoring scene to be analyzed within the target analysis time based on the target analysis time in the target analysis parameter; wherein the target analysis time is the analysis time in multiple tasks combined;
[0108] Based on the target analysis parameters, video frame analysis is performed on the video to be analyzed to obtain a target task analysis result.
[0109] Exemplarily, if the analysis parameters in the plurality of tasks include the same first analysis algorithm, then the target analysis parameter includes the first analysis algorithm, and the task execution module 20 is further used to obtain an algorithm package corresponding to the target analysis parameter, wherein the algorithm package includes the first analysis algorithm;
[0110] The first analysis algorithm is used to perform video frame analysis on the video to be analyzed to obtain a first event detection result and a first event detection time corresponding to the first event detection result.
[0111] Exemplarily, the analysis parameters in the multiple tasks include different first analysis algorithms and second analysis algorithms, then the target analysis parameters include the first analysis algorithm and the second analysis algorithm, and the target analysis parameters also include a first merging time corresponding to the first analysis algorithm and a second merging time corresponding to the second analysis algorithm, the first merging time being a time set corresponding to video frames for video analysis using the first analysis algorithm, and the second merging time being a time set corresponding to video frames for video analysis using the second analysis algorithm;
[0112] The task execution module 20 is further used to obtain an algorithm package corresponding to the target analysis parameter, wherein the algorithm package includes the first analysis algorithm and the second analysis algorithm;
[0113] Using the first analysis algorithm to perform video frame analysis on the video to be analyzed within the first merging time to obtain a first event detection result and a first event detection time corresponding to the first event detection result;
[0114] The second analysis algorithm is used to perform video frame analysis on the video to be analyzed within the second merging time to obtain a second event detection result and a second event detection time corresponding to the second event detection result.
[0115] Exemplarily, the task processing device is further used to obtain a mapping relationship between the target task and the plurality of tasks;
[0116] According to the mapping relationship, determining each of the tasks corresponding to the target task analysis result;
[0117] According to the analysis algorithm and analysis time included in the analysis parameters in each of the tasks, the task corresponding to the event detection result and the event detection time is determined.
[0118] Exemplarily, the task processing device is further used to distribute the event detection result and the event detection time to the target terminal corresponding to the corresponding task according to the mapping relationship.
[0119] Other embodiments or specific implementations of the task processing device of the present invention may refer to the above-mentioned method embodiments and will not be described in detail here.
[0120] Illustratively, an embodiment of the present invention further provides a storage medium, on which a task processing program is stored. When the task processing program is executed by a processor, the steps of the task processing method described above are implemented.
[0121] Exemplarily, the present invention further proposes a task processing device, the device comprising: a memory, a processor, and a task processing program stored in the memory and executable on the processor, the task processing program being configured to implement the steps of the task processing method described above.
[0122] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0123] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0125] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A task processing method, characterized in that: The task processing method comprises the following steps: When the received multiple tasks meet the preset aggregation condition, the multiple tasks are merged to obtain a target task, and the target analysis parameter of the target task is the result of merging the analysis parameters in the multiple tasks; the preset aggregation condition includes that the monitoring scenes to be analyzed of the multiple tasks are the same; Performing resource scheduling on the target task to execute the target task and obtain a target task analysis result; Wherein, the target task analysis result includes the event detection result and the event detection time; The method further comprises: Obtaining a mapping relationship between the target task and a plurality of the tasks; According to the mapping relationship, determining each of the tasks corresponding to the target task analysis result; According to the analysis algorithm and analysis time included in the analysis parameters in each of the tasks, the task corresponding to the event detection result and the event detection time is determined.
2. The task processing method according to claim 1, characterized in that: The performing resource scheduling on the target task to execute the target task and obtain the target task analysis result includes: Based on the target analysis time in the target analysis parameter, obtaining the video to be analyzed corresponding to the same monitoring scene to be analyzed within the target analysis time; wherein the target analysis time is the combination of the analysis times in the multiple tasks; Based on the target analysis parameters, video frame analysis is performed on the video to be analyzed to obtain a target task analysis result.
3. The task processing method according to claim 2, characterized in that: If the analysis parameters in the multiple tasks include the same first analysis algorithm, then the target analysis parameters include the first analysis algorithm, and the step of performing video frame analysis on the video to be analyzed based on the target analysis parameters to obtain the target task analysis result includes: Acquire an algorithm package corresponding to the target analysis parameter, wherein the algorithm package includes the first analysis algorithm; The first analysis algorithm is used to perform video frame analysis on the video to be analyzed to obtain a first event detection result and a first event detection time corresponding to the first event detection result.
4. The task processing method according to claim 2, characterized in that: The analysis parameters in the multiple tasks include different first analysis algorithms and second analysis algorithms, then the target analysis parameters include the first analysis algorithm and the second analysis algorithm, and the target analysis parameters also include a first merging time corresponding to the first analysis algorithm and a second merging time corresponding to the second analysis algorithm, the first merging time is a time set corresponding to video frames for video analysis using the first analysis algorithm, and the second merging time is a time set corresponding to video frames for video analysis using the second analysis algorithm; then the target task analysis result is obtained by performing video frame analysis on the video to be analyzed based on the target analysis parameters, including: Acquire an algorithm package corresponding to the target analysis parameter, the algorithm package including the first analysis algorithm and the second analysis algorithm; Using the first analysis algorithm to perform video frame analysis on the video to be analyzed within the first merging time to obtain a first event detection result and a first event detection time corresponding to the first event detection result; The second analysis algorithm is used to perform video frame analysis on the video to be analyzed within the second merging time to obtain a second event detection result and a second event detection time corresponding to the second event detection result.
5. The task processing method according to claim 1, characterized in that: The mapping relationship also includes the analysis result receiving end corresponding to each of the tasks; the method also includes: According to the mapping relationship, the event detection result and the event detection time are distributed to the target terminal corresponding to the corresponding task.
6. A task processing device, characterized in that: The task processing device comprises: A task merging module, used for merging a plurality of received tasks to obtain a target task when the plurality of received tasks meet a preset aggregation condition, wherein the target analysis parameter of the target task is obtained by merging the analysis parameters in the plurality of tasks, and the preset aggregation condition includes that the monitoring scenes to be analyzed of the plurality of tasks are the same; A task execution module is used to schedule resources for the target task to execute the target task and obtain the target task analysis result; Wherein, the target task analysis result includes the event detection result and the event detection time; The task processing device is also used to obtain the mapping relationship between the target task and multiple tasks; determine each of the tasks corresponding to the analysis result of the target task based on the mapping relationship; and determine the task corresponding to the event detection result and the event detection time based on the analysis algorithm and analysis time included in the analysis parameters of each task.
7. The task processing device according to claim 6, characterized in that: The task execution module is further used to obtain the video to be analyzed corresponding to the same monitoring scene to be analyzed within the target analysis time based on the target analysis time in the target analysis parameters; wherein the target analysis time is the analysis time in multiple tasks combined; perform video frame analysis on the video to be analyzed based on the target analysis parameters to obtain the target task analysis result; and / or, if the analysis parameters in the plurality of tasks include the same first analysis algorithm, then the target analysis parameters include the first analysis algorithm; The task execution module is further used to obtain an algorithm package corresponding to the target analysis parameter, the algorithm package including the first analysis algorithm; use the first analysis algorithm to perform video frame analysis on the video to be analyzed to obtain a first event detection result and a first event detection time corresponding to the first event detection result; And / or, the analysis parameters in the multiple tasks include different first analysis algorithms and second analysis algorithms, then the target analysis parameters include the first analysis algorithm and the second analysis algorithm, and the target analysis parameters also include a first merging time corresponding to the first analysis algorithm and a second merging time corresponding to the second analysis algorithm, the first merging time being a time set corresponding to video frames that use the first analysis algorithm to perform video analysis, and the second merging time being a time set corresponding to video frames that use the second analysis algorithm to perform video analysis; The task execution module is further used to obtain an algorithm package corresponding to the target analysis parameter, wherein the algorithm package includes the first analysis algorithm and the second analysis algorithm; Using the first analysis algorithm to perform video frame analysis on the video to be analyzed within the first merging time to obtain a first event detection result and a first event detection time corresponding to the first event detection result; Using the second analysis algorithm to perform video frame analysis on the video to be analyzed within the second merging time to obtain a second event detection result and a second event detection time corresponding to the second event detection result; And / or, the mapping relationship further includes an analysis result receiving end corresponding to each of the tasks; The task processing device is further used to distribute the event detection result and the event detection time to the target terminal corresponding to the corresponding task according to the mapping relationship.
8. A task processing device, characterized in that: The device comprises: a memory, a processor, and a task processing program stored in the memory and executable on the processor, wherein the task processing program is configured to implement the steps of the task processing method according to any one of claims 1 to 5.
9. A storage medium, characterized in that: The storage medium stores a task processing program, and when the task processing program is executed by the processor, the steps of the task processing method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method, device and equipment for collecting data of multiple PLCs (Programmable Logic Controller) and readable storage medium
CN114528319A
Data query method and device, electronic equipment and readable medium
CN114691944A