Video processing method and device, electronic equipment and storage medium

CN117041497BActive Publication Date: 2026-08-11BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-09
Publication Date
2026-08-11

Smart Images

  • Figure CN117041497B_ABST
    Figure CN117041497B_ABST
Patent Text Reader

Abstract

This disclosure provides a video processing method, relating to the field of artificial intelligence technology, particularly to the fields of computer vision and multi-task processing technology. The specific implementation includes: generating an initial task based on event data; determining at least one execution duration based on the initial time and at least one target historical time; updating the target task set using the initial task based on the at least one execution duration and a first preset duration, to obtain an updated task set, wherein the updated task set includes a first update task corresponding to the initial time; and obtaining video stream data from the video stream address of the first update task to obtain a target video corresponding to the first update task, wherein the duration of the target video corresponding to the first update task after the initial time is greater than or equal to the first preset duration. This disclosure also provides a video processing apparatus, an electronic device, and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of Chinese patent application CN202211107308.7 (“Video Processing Method, Apparatus, Electronic Device and Storage Medium”) filed on September 9, 2022. Technical Field

[0002] This disclosure relates to the field of artificial intelligence technology, and more particularly to the fields of computer vision technology and multitasking technology. More specifically, this disclosure provides a video processing method, apparatus, electronic device, and storage medium. Background Technology

[0003] With the development of artificial intelligence technology, various sensors deployed in relevant scenarios can be used to collect data in order to detect whether a preset event has occurred in an object within that scenario. Once a preset event is detected, image acquisition devices deployed near the object can be used to capture images or record videos. Summary of the Invention

[0004] This disclosure provides a video processing method, apparatus, device, and storage medium.

[0005] According to one aspect of this disclosure, a video processing method is provided, the method comprising: generating an initial task based on event data; determining at least one execution duration based on an initial time and at least one target historical time, wherein the initial time is determined based on the time when the initial task is generated, the target historical time is determined based on the time when target tasks in a target task set are generated, the initial time is after any target historical time, the target task set includes a second target task subset, the at least one target historical time includes a second target historical time, the second target task subset includes M second target tasks, the second target tasks are target tasks to be executed, the second target historical time is determined based on the time when the second target task is generated, and M is an integer greater than or equal to 1; and using the initial task to process the video based on the at least one execution duration and a first preset duration. The target task set is updated to obtain an updated task set, wherein the updated task set includes a first update task corresponding to the initial time; and video stream data is obtained from the video stream address of the first update task to obtain a target video corresponding to the first update task, wherein the duration of the target video corresponding to the first update task after the initial time is greater than or equal to a first preset duration, wherein determining at least one execution duration based on the initial time and at least one target historical time includes: in response to determining that the video stream address information of the initial task is inconsistent with the video stream address information of N first target tasks and the video stream address information of the initial task is consistent with the video stream address information of the mth second target task, a second execution duration between the mth second target historical time and the initial time is determined, wherein m is an integer greater than 1 and less than or equal to M.

[0006] According to another aspect of this disclosure, a video processing apparatus is provided, comprising: a generation module for generating an initial task based on event data; a determination module for determining at least one execution duration based on an initial time and at least one target historical time, wherein the initial time is determined based on the time when the initial task is generated, the target historical time is determined based on the time when target tasks in a set of target tasks are generated, the initial time is after any target historical time, the set of target tasks includes a second subset of target tasks, the at least one target historical time includes a second target historical time, the second subset of target tasks includes M second target tasks, the second target tasks are target tasks to be executed, the second target historical time is determined based on the time when the second target task is generated, and M is an integer greater than or equal to 1; and an update module for determining at least one execution duration based on the initial time and at least one target historical time. The process involves: a first preset duration, updating the target task set using the initial task to obtain an updated task set, wherein the updated task set includes the first update task corresponding to the initial time; and an acquisition module, used to obtain video stream data from the video stream address of the first update task to obtain the target video corresponding to the first update task, wherein the duration of the target video corresponding to the first update task after the initial time is greater than or equal to the first preset duration. The determination module includes: a third determination submodule, used to determine the second execution duration between the m-th second target historical time and the initial time in response to the determination that the video stream address information of the initial task is inconsistent with the video stream address information of N first target tasks and the video stream address information of the initial task is consistent with the video stream address information of the m-th second target task, wherein m is an integer greater than 1 and less than or equal to M.

[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method provided according to this disclosure.

[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the methods provided according to this disclosure.

[0009] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method provided according to this disclosure.

[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0011] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0012] Figure 1 This is an exemplary system architecture diagram of a video processing method and apparatus applicable according to an embodiment of the present disclosure;

[0013] Figure 2 This is a flowchart of a video processing method according to an embodiment of the present disclosure;

[0014] Figure 3 This is a flowchart of a video processing method according to another embodiment of the present disclosure;

[0015] Figure 4 This is a task sequence diagram according to another embodiment of the present disclosure;

[0016] Figure 5 This is a block diagram of a video processing apparatus according to an embodiment of the present disclosure; and

[0017] Figure 6 A block diagram of an electronic device to which video processing methods can be applied, according to an embodiment of the present disclosure. Detailed Implementation

[0018] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0019] In relevant application scenarios (such as manufacturing plants), various sensors can be deployed. These sensors can include, for example, cameras, temperature sensors, smoke sensors, and so on. These sensors collect data. After analyzing the collected data, relevant alarm (early warning) products can send alarm signals. The software programs or hardware devices of these products can be updated or upgraded to improve the product experience.

[0020] For example, after making significant modifications to an alarm product, a video analytics module can be added, integrating the video analytics module and the alarm product into a single product. However, modifying the alarm product makes product upgrade costs difficult to control. Furthermore, adding the same video analytics module can require modifying different alarm products in different ways, leading to high deployment costs for the video analytics module. Additionally, the data processing between the video analytics module and the original alarm product is independent, meaning the newly added video analytics module cannot fully utilize alarm signals.

[0021] Figure 1 This is an exemplary system architecture diagram of a video generation method and apparatus applicable according to an embodiment of the present disclosure.

[0022] It is important to note that Figure 1 The examples shown are merely examples of system architectures that can be applied to the embodiments of this disclosure, in order to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments or scenarios.

[0023] like Figure 1 As shown, the system architecture 100 according to this embodiment may include an alarm device 110, a video processing device 120, and a server 130. The alarm device 110 can acquire raw data or data processed by the detector, and generate raw data related to the alarm signal based on these outputs. The video processing device 120 can acquire the raw data from the alarm device 110, process it, and generate a target video. The server 130 can acquire the raw data from the alarm device 110 or the target video from the video processing device 120.

[0024] In this embodiment of the disclosure, the alarm device 110 can acquire data from multiple detectors. For example, the multiple detectors may include the temperature sensor, smoke sensor, camera, etc., as described above. Furthermore, the alarm device 110 can acquire data detected by the detectors, or it can acquire data processed by the detectors. In one example, the alarm device 110 can acquire temperature data detected by the temperature sensor. In one example, the temperature sensor can determine whether the detected temperature value is greater than a preset temperature threshold, and then provide the processed temperature data to the alarm device 110.

[0025] In this embodiment, the video processing device 120 may include a data acquisition module 121, a caching module 122, a task generation module 123, a video generation module 124, and a storage module 125. For example, the data acquisition module 121 can acquire raw data from the alarm device 110, as well as event data that can be converted from the raw data to a target data format. As another example, the caching module 122 can acquire event data. The event data may include multiple event sub-data, each event sub-data corresponding to an alarm signal, and the caching module 122 can implement multiple event sub-data as a data queue. As another example, the task generation module 123 can acquire event sub-data from the caching module 122 and determine whether to generate a video recording task according to preset rules. The video recording task may instruct relevant modules to acquire video stream data from one or more video stream addresses to obtain the target video. As another example, the video generation module 124 can acquire video stream data from a video stream address. The video stream address may correspond to a camera. The camera may be deployed when the alarm device 110 is constructed, or it may be deployed when the video processing device 120 is constructed. Upon receiving a video recording task, the video generation module 124 can obtain video stream data from the video stream address of the video recording task to generate a target video and send the target video to the caching module 122 and / or the storage module 125. Alternatively, the storage module 125 can store the target video. Through this embodiment, the inclusion of a caching module reduces modifications to the alarm device 110 and lowers the cost of product upgrades.

[0026] It is understandable that the video stream address can be an address based on the Real-Time Streaming Protocol (RTSP).

[0027] In this embodiment, the video generation module 124 may include a video acquisition unit, a video analysis unit, an image rendering unit, and a video synthesis unit. For example, based on the video recording task, the video acquisition unit can obtain video stream data within a relevant time period from the video stream address and extract multiple video frame data from the video stream data. The video analysis unit can use various deep learning models to process the video frame data and obtain analysis results. Various deep learning models may include, for example, object detection models, and the analysis results may include, for example, a detection box of an object in the video frame. The image rendering unit can render the analysis results onto the video frame to obtain a rendered video frame. The video synthesis unit can synthesize a target video based on one or more rendered video frames. Through this embodiment, the performance of the alarm device 110 can be improved and the user experience enhanced by utilizing the camera and deep learning models. Furthermore, video of the time period related to the alarm signal can be automatically recorded, reducing labor costs.

[0028] The alarm device 110, video processing device 120, and server 130 can be connected via a network. The network serves as the medium for providing a communication link between the alarm device 110, video processing device 120, and server 130. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0029] Server 130 can be a server that provides various services.

[0030] It should be noted that the video processing method provided in the embodiments of this disclosure can generally be implemented by a video processing device.

[0031] Figure 2 This is a flowchart of a video processing method according to an embodiment of the present disclosure.

[0032] like Figure 2 As shown, the method 200 may include operations S210 to S240.

[0033] In operation S210, an initial task is generated based on the event data.

[0034] For example, raw data can be obtained from the alarm device 110 mentioned above, and then the raw data can be processed to obtain event data.

[0035] For example, event data can include multiple event sub-data. Event sub-data can correspond to an alarm signal. In one example, if an event sub-data in the event data indicates that the temperature of a preset object (such as a production machine) exceeds a preset temperature threshold, an initial task can be generated.

[0036] In operation S220, at least one execution duration is determined based on the initial time and at least one target historical time.

[0037] In this embodiment of the disclosure, the initial time is determined based on the time when the initial task is generated. For example, if the initial task Task_ini is generated at time t_ini, then time t_ini can be used as the initial time.

[0038] In this embodiment of the disclosure, the target historical moment is determined based on the moment when the target task in the target task set is generated. For example, the target task set may include at least one target task. As another example, if the target task Task_past1 is generated at time t_past1, then time t_past1 can be used as the target historical moment of the target task Task_past1.

[0039] In one example, time t_ini can be the 3rd second and time t_past1 can be the 1st second. Then, the waiting time Dur_ini1 between the initial task Task_ini and the target task Task_past1 can be 2 seconds.

[0040] In this embodiment of the disclosure, a comparison relationship between at least one execution duration and a first preset duration can be determined. For example, the comparison relationship may include the execution duration being less than or equal to the first preset duration. Alternatively, the comparison relationship may also include the execution duration being greater than or equal to the first preset duration.

[0041] In operation S230, based on at least one pending execution duration and a first preset duration, the target task set is updated using the initial task to obtain the updated task set.

[0042] In this embodiment of the disclosure, the method for updating the target task set can be determined based on the comparison between the execution duration and the first preset duration.

[0043] In this embodiment of the disclosure, the update task set includes a first update task corresponding to the initial time.

[0044] In the embodiments disclosed herein, the target task set can be updated in various ways.

[0045] For example, if the execution duration is less than a first preset duration, a correspondence can be established between the target task Task_past1 and the initial time t_ini. The target task Task_past1 can then be updated using the initial task Task_ini to obtain the first updated task. For instance, after executing this first updated task, the starting time of the generated target video can be the target historical time t_past1.

[0046] In operation S240, video stream data is obtained from the video stream address of the first update task to obtain the target video corresponding to the first update task.

[0047] In this embodiment of the disclosure, the duration of the target video corresponding to the first update task after the initial moment is greater than or equal to the first preset duration.

[0048] For example, video stream data can be obtained from the video stream address of the first update task to obtain the target video V_1. In one example, the duration of the target video V_1 can be 10 seconds, and the starting time of the target video V_1 can be the target historical time t_past1 (second 1). The duration after the initial time t_ini (second 3) (7 seconds) is greater than the first preset duration (5 seconds).

[0049] Through the embodiments disclosed herein, the data of the original alarm analysis platform is fully utilized to achieve data linkage, mine data value, and ensure that the video corresponding to each moment contains sufficient effective duration.

[0050] The target task set will be described in detail below with reference to relevant embodiments.

[0051] In some embodiments, the target task set may include a first target task subset. At least one target historical moment includes the first target historical moment.

[0052] In this embodiment of the disclosure, the first target task subset includes N first target tasks, where each first target task is a target task currently being executed, and the first target historical time is determined based on the time when the first target task was generated. N is an integer greater than or equal to 1. For example, the aforementioned target task Task_past1 can be a target task currently being executed and can be considered as a first target task.

[0053] In some embodiments, the target task set may include a second target task subset. At least one target historical moment includes a second target historical moment.

[0054] In this embodiment of the disclosure, the second target task subset includes M second target tasks, which are target tasks to be executed. The second target historical time is determined based on the time when the second target task was generated. M is an integer greater than or equal to 1. For example, target task Task_past2 can be a target task to be executed, and can be used as a second target task.

[0055] The following will describe in detail some implementation methods for obtaining the updated task set with reference to relevant embodiments.

[0056] Figure 3 This is a flowchart of a video generation method according to another embodiment of the present disclosure.

[0057] like Figure 3 As shown, method 300 can generate an initial task based on event data, which will be explained in detail below in conjunction with operation S310.

[0058] When operating S310, an initial task is generated based on the event data.

[0059] In embodiments of this disclosure, it can be determined whether event data indicates that a preset object has experienced a preset event at an initial time. For example, in response to determining that a sub-data item in the event data indicates that a preset object has experienced a preset event at an initial time, an initial task can be generated. As another example, in response to determining that a sub-data item in the event data indicates that a preset object has not experienced a preset event at an initial time, the time of the next sub-data item is used as the initial time, and it is determined whether the next sub-data item indicates whether a preset object has experienced a preset event at the initial time.

[0060] For example, at time T1, Task_1 is generated. At time T2, Task_2 is generated. At time T7, Task_7 is generated. At time T8, Task_8 is generated. At time T12, Task_12 is generated. At time T13, Task_13 is generated. For another example, the video stream addresses for Task_1, Task_8, Task_12, and Task_13 can be video stream address R1. The video stream address for Task_7 can be video stream address R3. In one example, time T1 can be the 1st second, time T5 can be the 5th second, time T7 can be the 7th second, time T8 can be the 8th second, time T12 can be the 12th second, and time T13 can be the 13th second. It is understandable that, for example, at time T4, no task is generated.

[0061] Next, based on the initial time and at least one target historical time, at least one execution duration can be determined, and the comparison relationship between the execution duration and a first preset duration can be determined in order to execute subsequent operations. The following will provide a detailed explanation in conjunction with operations S321 to S325.

[0062] In operation S321, determine whether the first target task exists.

[0063] In this embodiment of the disclosure, in response to determining that there is no first target task, operation S331 can be performed. In operation S331, an initial task is added to the subset of the first target tasks. For example, at time T1, task Task_1 is generated. Task Task_1 can be used as an initial task. If there is no target task being executed, task Task_1 can be added to the subset of the first target tasks as a first target task so that task Task_1 can be executed.

[0064] In this embodiment of the disclosure, operation S322 can be executed in response to determining that a first target task exists. For example, as described above, the first target task can be a target task that is currently being executed. Tasks Task_2, Task_7, Task_8, Task_12, and Task_13 are generated between time T2 and time T13, respectively. At times after time T1, for other initial tasks, it can be determined that a first target task exists. In one example, Task_2 can be considered as an initial task. At this time, Task_1 is currently being executed. For Task_2, operation S322 can be executed.

[0065] In operation S322, it is determined whether the video stream address information of the initial task is consistent with the video stream address information of the first target task.

[0066] In this embodiment of the disclosure, there can be N first target tasks. It can be determined whether the video stream address of the initial task is consistent with the video stream address of one of the N first target tasks. For example, as mentioned above, the video stream address can be an address based on a real-time video streaming protocol.

[0067] In this embodiment of the disclosure, in response to determining that the video stream address information of the initial task is consistent with the video stream address information of the nth first target task, the first execution duration between the nth first target historical time and the initial time can be determined. Next, operation S323 is executed. For example, n is an integer greater than or equal to 1 and less than or equal to N. For example, the video stream addresses of Task_1 and Task_2 are both video stream address R1. It can be determined that their video stream addresses are consistent. For Task_2, in the subset of first target tasks, there exists Task_1 as the first first target task. It can be determined that the first execution duration between time T1 and time T2 is 1 second. Next, operation S323 can be executed for Task_2.

[0068] In this embodiment of the disclosure, in response to the determination that the video stream address information of the initial task is inconsistent with the video stream address information of the N first target tasks, operation S324 can be executed. For example, at time T7, task Task_7 is generated, and task Task_7 can be used as an initial task. The video stream address R3 of task Task_7 is inconsistent with the video stream address R1 of tasks Task_1 and task Task_2, so operation S324 can be executed on task Task_7.

[0069] In operation S323, determine whether the first execution duration is less than the first preset duration.

[0070] In this embodiment of the disclosure, in response to determining that the first execution duration is less than the first preset duration, operation S332 can be executed. In operation S332, the nth first target task is updated using the initial task. For example, the first preset duration can be 5 seconds. For another example, for task Task_2, the first execution duration can be 1 second. A correspondence is established between time T2 and task Task_1 so that task Task_2 is used to update the currently executing task Task_1, resulting in task Task'_12. Task Task'_12 can serve as a first update task. Since task Task'_12 is obtained by updating task Task_1, it also corresponds to time T1. Furthermore, the first update task Task'_12 can be the currently executing task and can be a first target task within a subset of the first target tasks. The target historical time of task Task'_12 can be time T1. Through this embodiment of the disclosure, based on the comparison between the first execution duration and the first preset duration, the generated task can be merged with the currently executing task or used as a task to be executed, reducing resource consumption. Furthermore, for at least one moment corresponding to a task, the video still has a certain duration after each moment, so that each task corresponds to a video segment with a certain effective duration.

[0071] In this embodiment of the disclosure, operation S324 can be executed in response to determining that the first execution duration is greater than or equal to the first preset duration. For example, for task_8, there exists a task_12 that is the first first target task in the first target task subset. The first execution duration between time T1 and time T8 can be determined to be 7 seconds. Next, operation S324 can be executed for task_8.

[0072] In this embodiment of the disclosure, after completing a target task, a target task from a second subset of target tasks can be executed. For example, after time T11, task Task_7 from the second subset of target tasks can be executed. It is understood that for tasks Task_12 and Task_13, the first target task is Task_7. The video stream address R1 of tasks Task_12 and Task_13 is inconsistent with the video stream address R3 of task Task_7, so operation S324 can be performed on tasks Task_12 and Task_13.

[0073] In operation S324, it is determined whether the video stream address information of the initial task is consistent with the video stream address information of the second target task. For example, as described above, operation S324 can be performed on task_7. It can be understood that for task_7, the subset of the second target tasks is empty. In this case, task_7 can be added to the subset of the second target tasks.

[0074] In this embodiment of the disclosure, there can be M second target tasks. It can be determined whether the video stream address of the initial task is consistent with the video stream address of one of the M second target tasks.

[0075] In this embodiment of the disclosure, in response to the determination that the video stream address information of the initial task is inconsistent with the video stream address information of the second target task, operation S334 can be executed. In operation S334, the initial task is added to the subset of the second target tasks. For example, as described above, operation S324 can be executed for task Task_8. It is understood that for task Task_8, there exists a task Task_7 as the second target task. Since the video stream address R1 of task Task_8 is inconsistent with the video stream address R3 of task Task_7, task Task_8 can be added to the subset of the second target tasks.

[0076] In this embodiment of the disclosure, in response to determining that the video stream address information of the initial task is consistent with the video stream address information of the m-th second target task, a second execution duration between the m-th second target historical moment and the initial moment can be determined. Next, operation S325 can be executed. For example, m is an integer greater than or equal to 1 and less than or equal to M. For example, for task Task_12, there exists a task Task_8 as the first second target task. The video stream address R1 of task Task_12 is consistent with the video stream address of task Task_8, and operation S325 can be executed on task Task_12.

[0077] In operation S325, it is determined whether the second execution time is less than the first preset duration.

[0078] In this embodiment of the disclosure, in response to determining that the second execution time is less than the first preset duration, operation S333 is executed. In operation S333, the m-th second target task is updated using the initial task. For example, for task Task_12, the second execution duration can be 4 seconds. A correspondence is established between time T12 and task Task_8 so that task Task_8, which is currently being executed, is updated using task Task_12 to obtain task Task'_812. Task Task'_812 can serve as a first update task. Since task Task'_812 is obtained by updating task Task_8, task Task'_12 also corresponds to time T8. Furthermore, task Task'_812 can be a task to be executed and can serve as the first second target task in the subset of second target tasks. The target historical time of task Task'_812 can be time T8.

[0079] In this embodiment of the disclosure, in response to determining that the second execution time is greater than or equal to the first preset duration, operation S334 is executed. In operation S334, the initial task is added to the subset of the second target tasks. For example, for task Task_13, at time T13, there is a task Task_7 that is being executed, and there is also a task Task'_812 that is to be executed. As mentioned above, the video stream address of task Task_13 is different from that of task Task_7, but the video stream address of task Task_13 is the same as that of task Task'_812. After performing operations S321, S322, and S324 on task Task_13, it can be determined that the execution duration between time T13 and time T8, which is the first second target time, is 5 seconds. If operation S325 is performed on task_13, it can be determined that the second pending execution time is equal to the first preset duration. Then, operation S334 can be performed on task_13 to add it to the second target task subset as the second second target task. Through this embodiment, based on the comparison between the second pending execution time and the first preset duration, generated tasks can be merged with pending tasks or used as other pending tasks to reduce resource consumption. Furthermore, for at least one moment corresponding to a task, the video still has a certain duration after each moment, ensuring that each task corresponds to a video segment with a certain effective duration.

[0080] During operation S340, video stream data is obtained from the video stream address of the first update task to obtain the target video corresponding to the first update task.

[0081] For example, for Task'_12, video stream data can be obtained from video stream address R1 to obtain the target video Video'_12 corresponding to Task'_12. Target video Video'_12 corresponds to time T1 and time T2. The duration of target video Video'_12 can be 10 seconds, and the duration of target video Video'_12 after time T2 is 9 seconds, which is greater than the first preset duration (5 seconds).

[0082] For example, after completing the execution of Task'_12, for Task_7, video stream data can be obtained from video stream address R3 to obtain the target video Video_7 corresponding to Task_7. The target video Video_7 corresponds to time T7.

[0083] For example, for Task'_812, after completing the execution of Task_7, video stream data can be obtained from video stream address R1 to obtain the target video Video'_812 corresponding to Task'_812. The duration of the target video Video'_812 can be 10 seconds, and the duration of the target video Video'_812 after time T12 is 6 seconds, which is greater than the first preset duration (5 seconds).

[0084] For example, after completing the execution of Task'_812, for Task_13, video stream data can be obtained from video stream address R1 to obtain the target video Video_13 corresponding to Task_13. The target video Video_13 corresponds to time T13.

[0085] The embodiments disclosed herein can reduce the total number of tasks that need to be executed, thereby effectively reducing resource consumption. It also allows each task to correspond to a certain effective video duration.

[0086] It's understandable, based on the above. Figure 3 The method disclosed herein has been described in detail, and will be discussed below in conjunction with... Figure 4 The method disclosed herein will be described in further detail.

[0087] Figure 4 This is a task sequence diagram according to an embodiment of the present disclosure.

[0088] like Figure 4As shown, at time T1, in response to a sub-data item in the event data indicating that a preset object has experienced a preset event at time T1, task Task_1 can be generated. Task Task_1 can be used as the first initial task, and time t1 can be used as the first initial time. If it is determined that there is no task currently being executed, Task Task_1 can be added to the subset of first target tasks as the first target task. Furthermore, relevant hardware resources can be invoked to execute Task Task_1, starting from time T1, to obtain 10 seconds of video stream data from the video stream address R1 of Task Task_1. The target historical time for Task Task_1 can be time T1.

[0089] like Figure 4 As shown, at time T2, in response to a sub-data item in the event data indicating that a preset object has experienced a preset event at time T2, task Task_2 can be generated. Task Task_2 can serve as the second initial task, and time T2 can serve as the second initial time. As mentioned above, at time T2, task Task_1 is being executed. The video stream address of task Task_2 can also be video stream address R1, consistent with the video stream address of task Task_1. Given that the video stream addresses of task Task_2 and task Task_1 are consistent, the first execution duration between time T2 and time T1 can be determined to be 1 second. Given that the first preset duration is 5 seconds, the first execution duration of task Task_2 can be determined to be less than the first preset duration. A correspondence between time T2 and task Task_1 can be established so that task Task_2 can be used to update the currently executing task Task_1, resulting in task Task'_12. Task Task'_12 can serve as a first update task. Video stream address R1 can be used as the video stream address for Task'_12. Task'_12 is obtained by updating Task'_1, and it also corresponds to time T1. Furthermore, as mentioned above, Task'_1 is the currently executing task starting from time T1. The identifier of this currently executing task can be updated to Task'_12, and execution of the currently executing task can continue.

[0090] like Figure 4As shown, at time T3, in response to a sub-data item in the event data indicating that a preset object has experienced a preset event at time T3, task Task_3 can be generated. Task Task_3 can serve as the third initial task, and time T3 can serve as the third initial time. As mentioned above, task Task'_12 is currently executing. The video stream address of task Task_3 can also be video stream address R1, consistent with the video stream address of task Task'_12. Given that the video stream addresses of task Task_3 and task Task'_12 are consistent, the first execution duration between time T3 and time T1 can be determined to be 2 seconds. Given a first preset duration of 5 seconds, the first execution duration of task Task_3 can be determined to be less than the first preset duration. A correspondence can be established between time T3 and task Task'_12 so that task Task_3 can be used to update the currently executing task Task'_12, resulting in task Task'_123. Task Task'_123 can serve as a first update task. Task '_123 is obtained by updating Task '_12', and it also corresponds to time T1 and time T2. Video stream address R1 can be used as the video stream address for Task '_123'. Furthermore, as mentioned above, starting from time T1, Task '_1' is the currently executing task. At time T2, the identifier of this currently executing task is updated to Task '_12'. At time T3, the identifier of this currently executing task can be updated to Task '_123, and execution of the task can continue.

[0091] At time T4, based on the event data, no task was generated.

[0092] like Figure 4As shown, at time T5, in response to a sub-data event in the event data indicating that a preset object has experienced a preset event at time T5, task Task_5 can be generated. Task Task_5 can serve as the fourth initial task, and time T5 can serve as the fourth initial time. It can be determined that task Task'_123 is currently executing. The video stream address of task Task_5 can also be video stream address R1, consistent with the video stream address of task Task'_123. Given that the video stream addresses of task Task_5 and task Task'_123 are consistent, the first execution duration between time T5 and time T1 can be determined to be 4 seconds. Given that the first preset duration is 5 seconds, the first execution duration of task Task_5 can be determined to be less than the first preset duration. A correspondence is established between time T5 and task Task'_123 so that task Task_5 can be used to update the currently executing task Task'_123, resulting in task Task'_1235. Task Task'_1235 can serve as a first update task. Video stream address R1 can be used as the video stream address for Task'_1235. Task'_1235 is obtained by updating Task'_123, and Task'_1235 can also correspond to time T1, time T2, and time T3. Furthermore, as mentioned above, starting from time T1, Task_1 is the currently executing task. At time T2, the identifier of this currently executing task is updated to Task'_12. At time T3, the identifier of this currently executing task is updated to Task'_123. At time T5, the identifier of this currently executing task can be updated to Task'_1235, and execution of this task can continue.

[0093] At time T6, based on the event data, no task was generated.

[0094] At time T7, in response to a sub-data point in the event data indicating that a preset event occurred on another preset object at time T7, task Task_7 can be generated. Task Task_7 can serve as the 5th initial task, and time T7 can serve as the 5th initial time. It can be determined that task Task'_1235 is currently executing. For task Task_7, there are no tasks yet to be executed. The video stream address of task Task_7 can be video stream address R3, which is inconsistent with the video stream address of task Task'_1235. In this case, task Task_7 can be added as a task to be executed to the second target task subset. Time T7 can serve as the second target historical time for task Task_7.

[0095] like Figure 4As shown, at time T8, in response to a sub-data item in the event data indicating that a preset object has experienced a preset event at time T8, task Task_8 can be generated. Task Task_8 can be the 6th initial task, and time T8 can be the 6th initial time. It can be determined that task Task'_1235 is being executed. The video stream address of task Task_8 can also be video stream address R1, consistent with the video stream address of task Task'_1235. Given that the video stream addresses of task Task_8 and task Task'_1235 are consistent, the first execution duration between time T8 and time T1 can be determined to be 7 seconds. Given that the first preset duration is 5 seconds, the first execution duration of task Task_8 can be determined to be longer than the first preset duration. For task Task_8, there is a task Task_7 to be executed. Since the video stream address of task Task_8 is inconsistent with the video stream address of task Task_7, task Task_8 can be added to the second target task subset as another first update task. Time T8 can be used as the second target historical time of Task_8.

[0096] At time T9, based on the event data, no task was generated.

[0097] like Figure 4 As shown, at time T10, in response to a sub-data item in the event data indicating that a preset event occurred on another preset object at time T10, task Task_10 can be generated. Task Task_10 can serve as the 7th initial task, and time T10 can serve as the 7th initial time. It can be determined that task Task'_1235 is executing. The video stream address of task Task_10 can be video stream address R2, which is inconsistent with the video stream address of task Task'_1235, and inconsistent with the video stream addresses of task Task_7 or task Task_8. Task Task_10 can be added to the subset of the second target tasks as another first update task.

[0098] At time T11, based on the event data, no task was generated. Furthermore, at time T11, task '_1235' was completed, yielding the target video 'Video'_1235. The target video 'Video'_1235 can have a duration of 10 seconds. Within the target video 'Video'_1235, the duration after time T2 can be 9 seconds, the duration after time T3 can be 8 seconds, and the duration after time T5 can be 6 seconds, all exceeding the first preset duration. At time T11, using the available hardware resources, task 'Task_7' can be executed, retrieving a 10-second video stream from the video stream address R3 of task 'Task_7'.

[0099] like Figure 4 As shown, at time T12, in response to a sub-data event in the event data indicating that a preset object has experienced a preset event at time T12, task Task_12 can be generated. Task Task_12 can serve as the 8th initial task, and time T12 can serve as the 8th initial time. It can be determined that task Task_7 is currently executing. The video stream address of task Task_12 can be video stream address R1, which is inconsistent with the video stream addresses of tasks Task_7 and Task_10, but consistent with the video stream address of task Task_8. Given that the video stream addresses of task Task_12 and task Task_8 are consistent, the second execution duration between time T12 and time T8 can be determined to be 4 seconds. Given that the first preset duration is 5 seconds, the second execution duration of task Task_12 can be determined to be less than the first preset duration. A correspondence between time T12 and task Task_8 can be established so that task Task_8 can be updated using task Task_12 to obtain task Task'_812. Task '_812 can be used as a first update task. Task '_812 is obtained by updating Task '8', and it also corresponds to time T8. Video stream address R1 can be used as the video stream address for Task '_812'. Furthermore, as mentioned above, Task '8' is a pending task, and its identifier can be updated to Task '_812.

[0100] like Figure 4 As shown, at time T13, in response to a sub-data item in the event data indicating that a preset object has experienced a preset event at time T13, task Task_13 can be generated. Task Task_13 can be the 9th initial task, and time T12 can be the 9th initial time. It can be determined that task Task_7 is currently executing. The video stream address of task Task_13 can be video stream address R1, which is inconsistent with the video stream addresses of tasks Task_7 and Task_10, but consistent with the video stream address of task Task'_812. Given that the video stream addresses of task Task_13 and task Task'_812 are consistent, the second execution duration between time T13 and time T8 can be determined to be 5 seconds. Given that the first preset duration is 5 seconds, the second execution duration of task Task_12 can be determined to be equal to the first preset duration. Task Task_13 can be added to the second target task subset as another task to be executed.

[0101] In some embodiments, taking time T8 as an example, at time T8, the target task set may include a first target task subset and a second target task subset. At this time, the first target task subset includes Task'_1235 as a first target task. The second target task subset includes Task_7 as a second target task. As described above, after adding Task_8 as a first update task to the second target task subset, the update task set may include both the first and second target task subsets. The first target task subset includes Task'_1235 as a first target task. The second target task subset includes Task_7 as a second target task and Task_8 as a first update task. In some embodiments, taking time T10 as an example, at time T10, the target task set may include both the first and second target task subsets. At this time, the first target task subset includes Task'_1235 as a first target task. The second target task subset includes Task_7 as a second target task and Task_8 as a second target task. As mentioned above, after adding Task_10 as a first update task to the second target task subset, the update task set can include both the first and second target task subsets. The first target task subset includes Task'_1235, which is the first target task. The second target task subset includes Task_7 and Task_8, which are both second target tasks, and Task_10, which is the first update task.

[0102] In some embodiments, the duration of the target video is a second preset duration, which is longer than the first preset duration. For example, the second preset duration can be 10 seconds, and the first preset duration can be 5 seconds.

[0103] It is understood that the above description uses N=1 as an example to illustrate the method of this disclosure in detail. In other embodiments, multiple different threads may be used to execute different first objective tasks simultaneously, in which case N is an integer greater than 1.

[0104] It's understandable. You can also manually add some tasks to the target task set. The manually added tasks can be the second update task.

[0105] Figure 5 This is a block diagram of a video processing apparatus according to an embodiment of the present disclosure.

[0106] like Figure 5 As shown, the device 500 may include a generation module 510, a determination module 520, an update module 530, and an acquisition module 540.

[0107] The generation module 510 is used to generate the initial task based on the event data.

[0108] The determination module 520 is used to determine at least one execution duration based on the initial time and at least one target historical time. For example, the initial time is determined based on the time when the initial task was generated, and the target historical time is determined based on the time when the target task in the target task set was generated.

[0109] The update module 530 is used to update the target task set using the initial task based on at least one pending execution duration and a first preset duration, to obtain an updated task set. For example, the updated task set includes the first update task corresponding to the initial time.

[0110] The acquisition module 540 is used to obtain video stream data from the video stream address of the first update task to obtain the target video corresponding to the first update task. For example, the duration of the target video corresponding to the first update task after the initial moment is greater than or equal to a first preset duration.

[0111] In some embodiments, the target task set includes at least one of a first target task subset and a second target task subset, and at least one target historical moment includes at least one of a first target historical moment and a second target historical moment. The first target task subset includes N first target tasks, which are target tasks being executed. The first target historical moment is determined based on the moment when the first target task was generated, and N is an integer greater than or equal to 1. The second target task subset includes M second target tasks, which are target tasks to be executed. The second target historical moment is determined based on the moment when the second target task was generated, and M is an integer greater than or equal to 1.

[0112] In some embodiments, the determining module includes: a first determining submodule, configured to determine a first execution duration between the historical time of the nth first target and the initial time in response to determining that the video stream address information of the initial task is consistent with the video stream address information of the nth first target task, wherein n is an integer greater than 1 and less than or equal to N.

[0113] In some embodiments, the nth first target task corresponds to at least one historical moment including the nth first target historical moment, and the update module includes: a first update submodule, configured to update the nth first target task using the initial task in response to determining that the first execution duration is less than or equal to the first preset duration, to obtain the first updated task.

[0114] In some embodiments, the determining module includes: a second determining submodule, configured to determine a second execution duration between the m-th second target historical moment and the initial moment in response to determining that the first execution duration is greater than or equal to the first preset duration and that the video stream address information of the initial task is consistent with the video stream address information of the m-th second target task, wherein m is an integer greater than 1 and less than or equal to M.

[0115] In some embodiments, the determining module includes: a third determining submodule, configured to determine a second execution duration between the historical time of the m-th second target and the initial time in response to determining that the video stream address information of the initial task is inconsistent with the video stream address information of N first target tasks and that the video stream address information of the initial task is consistent with the video stream address information of the m-th second target task, wherein m is an integer greater than 1 and less than or equal to M.

[0116] In some embodiments, the m-th second target task corresponds to at least one historical moment including the m-th second target historical moment, and the update module includes: a second update submodule, configured to update the m-th second target task using the initial task in response to determining that the second execution duration is less than the first preset duration, to obtain a first update task.

[0117] In some embodiments, the update module includes: a first obtaining submodule, configured to, in response to determining that the second execution duration is greater than or equal to the first preset duration, use the initial task as the first update task; and a first adding submodule, configured to add the first update task to the target task set to obtain an update task set.

[0118] In some embodiments, the determining module includes: a second obtaining submodule, configured to, in response to determining that the video stream address information of the initial task is inconsistent with the video stream address information of N first target tasks and the video stream address information of the initial task is inconsistent with the video stream address information of M second target tasks, take the initial task as the first update task; and a second adding submodule, configured to add the first update task to the target task set to obtain the update task set.

[0119] In some embodiments, the generation module includes a generation submodule, configured to generate an initial task in response to determining that at least one preset object has experienced a preset event at an initial time based on event data.

[0120] In some embodiments, the generation module includes: an acquisition submodule for acquiring raw detection data; and a conversion submodule for converting the raw detection data into event data in a target data format.

[0121] In some embodiments, the duration of the target video is a second preset duration, which is longer than the first preset duration.

[0122] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0123] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0124] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0125] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0126] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0127] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as video processing methods. For example, in some embodiments, the video processing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the video processing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform video processing methods by any other suitable means (e.g., by means of firmware).

[0128] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0129] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0130] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0131] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) monitor or an LCD (liquid crystal display)) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0132] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0133] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.

[0134] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0135] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A video processing method, comprising: Generate the initial task based on the event data; Based on an initial time and at least one target historical time, at least one execution duration is determined, wherein the initial time is determined based on the time when the initial task is generated, the target historical time is determined based on the time when the target tasks in the target task set are generated, the initial time is after any of the target historical times, the target task set includes a second target task subset, at least one target historical time includes a second target historical time, the second target task subset includes M second target tasks, the second target tasks are target tasks to be executed, the second target historical time is determined based on the time when the second target task is generated, and M is an integer greater than or equal to 1; Based on at least one of the pending execution durations and a first preset duration, the target task set is updated using the initial task to obtain an updated task set, wherein the updated task set includes a first update task corresponding to the initial time; and Video stream data is obtained from the video stream address of the first update task to obtain the target video corresponding to the first update task, wherein the duration of the target video corresponding to the first update task after the initial time is greater than or equal to the first preset duration. The step of determining at least one execution duration based on the initial time and at least one target historical time includes: In response to determining that the video stream address information of the initial task is inconsistent with the video stream address information of all N first target tasks, and that the video stream address information of the initial task is consistent with the video stream address information of the m-th second target task, a second execution duration is determined between the m-th second target historical moment and the initial moment, where m is an integer greater than or equal to 1 and less than or equal to M, the m-th second target task corresponds to at least one historical moment including the m-th second target historical moment, N is an integer greater than or equal to 1, and the first target task is the target task currently being executed. The step of updating the target task set using the initial task based on at least one of the execution durations and a first preset duration to obtain an updated task set includes: In response to determining that the second execution duration is less than the first preset duration, the m-th second target task is updated using the initial task to obtain the first updated task.

2. The method of claim 1, wherein, The target task set further includes a first target task subset, and at least one target historical moment also includes a first target historical moment. The first target task subset includes N first target tasks, and the first target historical time is determined based on the time when the first target task was generated.

3. The method of claim 2, wherein, The step of determining at least one execution duration based on the initial time and at least one target historical time further includes: In response to determining that the video stream address information of the initial task is consistent with the video stream address information of the nth first target task, a first execution duration between the nth first target historical moment and the initial moment is determined, where n is an integer greater than or equal to 1 and less than or equal to N.

4. The method of claim 3, wherein, The nth first target task corresponds to at least one historical moment including the historical moment of the nth first target. The step of updating the target task set using the initial task to obtain the updated task set includes: In response to determining that the first execution duration is less than the first preset duration, the nth first target task is updated using the initial task to obtain the first updated task.

5. The method of claim 3, wherein, The step of determining at least one execution duration based on the initial time and at least one target historical time includes: In response to determining that the first execution duration is greater than or equal to the first preset duration and that the video stream address information of the initial task is consistent with the video stream address information of the m-th second target task, a second execution duration between the m-th second target historical moment and the initial moment is determined, where m is an integer greater than or equal to 1 and less than or equal to M.

6. The method of claim 1 or 5, wherein, The step of updating the target task set using the initial task based on at least one of the execution durations and a first preset duration to obtain the updated task set includes: In response to determining that the second execution duration is greater than or equal to the first preset duration, the initial task is designated as the first update task; and The first update task is added to the target task set to obtain the update task set.

7. The method of claim 2, wherein, The step of determining at least one execution duration based on the initial time and at least one target historical time includes: In response to determining that the video stream address information of the initial task is inconsistent with the video stream address information of all N first target tasks and the video stream address information of the initial task is inconsistent with the video stream address information of all M second target tasks, the initial task is designated as the first update task; and The first update task is added to the target task set to obtain the update task set.

8. The method of claim 1, wherein, The process of generating the initial task based on event data includes: In response to the determination of event data indicating that at least one preset object has experienced a preset event at the initial time, the initial task is generated.

9. The method of claim 1, wherein, The process of generating the initial task based on event data includes: Obtain raw detection data; and The raw detection data is converted into event data in the target data format.

10. The method of claim 1, wherein, The duration of the target video is a second preset duration, which is longer than the first preset duration.

11. A video processing apparatus, comprising: The generation module is used to generate initial tasks based on event data; A determination module is configured to determine at least one execution duration based on an initial time and at least one target historical time, wherein the initial time is determined based on the time when the initial task is generated, the target historical time is determined based on the time when target tasks in a target task set are generated, the initial time is after any of the target historical times, the target task set includes a second target task subset, at least one target historical time includes a second target historical time, the second target task subset includes M second target tasks, the second target tasks are target tasks to be executed, the second target historical time is determined based on the time when the second target task is generated, and M is an integer greater than or equal to 1; An update module is configured to update the target task set using the initial task based on at least one of the pending execution durations and a first preset duration, to obtain an updated task set, wherein the updated task set includes a first update task corresponding to the initial time; and The acquisition module is used to obtain video stream data from the video stream address of the first update task, and obtain the target video corresponding to the first update task, wherein the duration of the target video corresponding to the first update task after the initial time is greater than or equal to the first preset duration. The determining module includes: The third determining submodule is configured to, in response to determining that the video stream address information of the initial task is inconsistent with the video stream address information of all N first target tasks and that the video stream address information of the initial task is consistent with the video stream address information of the m-th second target task, determine a second execution duration between the m-th second target historical moment and the initial moment, where m is an integer greater than or equal to 1 and less than or equal to M, the m-th second target task corresponds to at least one historical moment including the m-th second target historical moment, N is an integer greater than or equal to 1, and the first target task is the target task currently being executed. The update module includes: The second update submodule is used to update the m-th second target task using the initial task in response to determining that the second execution duration is less than the first preset duration, so as to obtain the first update task.

12. The apparatus of claim 11, wherein, The target task set further includes a first target task subset, and at least one target historical moment also includes a first target historical moment. The first target task subset includes N first target tasks, which are target tasks that are currently being executed. The first target historical time is determined based on the time when the first target task was generated, and N is an integer greater than or equal to 1.

13. The apparatus of claim 12, wherein, The determining module further includes: The first determining submodule is configured to determine a first execution duration between the nth first target historical moment and the initial moment in response to determining that the video stream address information of the initial task is consistent with the video stream address information of the nth first target task, where n is an integer greater than or equal to 1 and less than or equal to N.

14. The apparatus of claim 13, wherein, The nth first target task corresponds to at least one historical moment including the historical moment of the nth first target. The update module includes: The first update submodule is configured to update the nth first target task using the initial task in response to determining that the first execution duration is less than the first preset duration, thereby obtaining the first update task.

15. The apparatus of claim 13, wherein, The determining module includes: The second determining submodule is used to determine the second execution duration between the m-th second target historical moment and the initial moment in response to determining that the first execution duration is greater than or equal to the first preset duration and that the video stream address information of the initial task is consistent with the video stream address information of the m-th second target task, where m is an integer greater than or equal to 1 and less than or equal to M.

16. The apparatus of claim 11 or 15, wherein, The update module includes: A first acquisition submodule is configured to, in response to determining that the second execution duration is greater than or equal to the first preset duration, use the initial task as the first update task; and The first addition submodule is used to add the first update task to the target task set to obtain the update task set.

17. The apparatus of claim 12, wherein, The determining module includes: The second obtaining submodule is configured to, in response to determining that the video stream address information of the initial task is inconsistent with the video stream address information of all N first target tasks and the video stream address information of the initial task is inconsistent with the video stream address information of all M second target tasks, designate the initial task as the first updating task; and The second addition submodule is used to add the first update task to the target task set to obtain the update task set.

18. The apparatus of claim 11, wherein, The generation module includes: A generation submodule is used to generate the initial task in response to a determination of event data indicating that at least one preset object has experienced a preset event at the initial time.

19. The apparatus of claim 11, wherein, The generation module includes: The acquisition submodule is used to acquire raw detection data; and The conversion submodule is used to convert the raw detection data into event data in the target data format.

20. The apparatus of claim 11, wherein, The duration of the target video is a second preset duration, which is longer than the first preset duration.

21. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 10.

22. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 10.

23. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Task execution time obtaining method and device, and electronic equipment

    CN109345887A

  • Video generation method and device, electronic equipment and storage medium

    CN114554110A