AI task scheduling method and system based on video analysis algorithm
The AI task scheduling method dynamically adjusts low-priority video analysis algorithms to manage resource allocation during peak usage, optimizing server performance and reducing hardware costs.
Patent Information
- Application Number
- CN202411190537.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-13
AI Technical Summary
Existing algorithm warehouse task scheduling leads to unreasonable resource allocation during peak usage periods, increasing hardware costs and resource consumption.
An AI task scheduling method that dynamically adjusts the detection frequency and start/stop of low-priority video analysis algorithms based on server resource status, prioritizing high-priority algorithms during peak conditions.
Efficiently manages server resources by reducing low-priority algorithm load during peaks, ensuring high-priority tasks are maintained and optimizing resource utilization.
Smart Images

Figure CN119127430A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of task scheduling, and in particular to an AI task scheduling method and system based on a video analysis algorithm. Background Art
[0002] The technology of grabbing pictures through the rtsp video stream of the video device is based on the real-time streaming protocol (RTSP), which can extract continuous image frames from the video device. These image frames are received and analyzed by algorithms to detect and identify whether abnormal events have occurred.
[0003] Each video device's algorithm recognition task can be configured with a specific deployment time. During the deployment time, the algorithm will detect and recognize images. These algorithms consume server GPU and video memory resources. The resource consumption of each algorithm depends on the number of concurrent video paths and the detection frequency. In other words, the more concurrent paths the algorithm has, the more images the algorithm needs to analyze at the same time point, which will increase the video memory and GPU resources occupied. When the algorithm is not in the deployment time range, it is idle time.
[0004] For existing algorithm warehouse task scheduling, multiple copies of multiple algorithms are usually deployed based on the number of video paths to provide analysis services. This method ensures that the algorithm continuously detects the analysis paths, but it also leads to an increase in hardware costs. Summary of the invention
[0005] In order to solve at least one of the technical problems mentioned above, the present invention provides an AI task scheduling method based on a video analysis algorithm to solve the problem of unreasonable resource allocation during peak usage periods of CPU and video memory resources.
[0006] On the one hand, an AI task scheduling method based on a video analysis algorithm is provided, comprising: Determine the current operating status of server resources; If the current server resource operation status is at peak, the detection frequency of the low priority algorithm is dynamically adjusted and the start and stop of the low priority algorithm identification task is controlled according to the total computing power of the current task, the total concurrent number of the current task and the operation information of algorithms with different priorities.
[0007] Preferably, the determining the current operating status of the server resources includes: If the total computing power of the current task is greater than the first preset value and the total concurrent number of the current task is greater than the first preset value, it is determined that the current server resources are in a peak state; If the total computing power of the current task is between the first preset value and the second preset value and the total concurrent number of the current task is between the first preset value and the second preset value, it is determined that the current server resources are in a normal state; If the total computing power of the current task is less than the second preset value and the total concurrent number of the current task is less than the second preset value, it is determined that the current server resources are in an idle state.
[0008] Preferably, the different priority algorithms include: a first detection algorithm, a second detection algorithm and a third detection algorithm, wherein the priority of the first detection algorithm is greater than the priority of the second detection algorithm, which is greater than the priority of the third detection algorithm.
[0009] Preferably, if the current resource operation state is at a peak state, dynamically adjusting the capture frequency of the low priority algorithm and controlling the start and stop of the low priority algorithm identification task include: If the total computing power of the first detection algorithm is greater than the total computing power of the current task and the number of concurrent tasks of the first detection algorithm is greater than the total concurrent number of tasks of the current task; Extracting screenshots of the high warning rate device running the first detection algorithm as identification task data of the first detection algorithm, and saving the unextracted screenshots to a server cache area; Reduce the detection frequency of the second detection algorithm and keep the identification task of the second detection algorithm enabled; The video screenshot of the third detection algorithm is saved to the server cache area, and the third detection algorithm recognition task is closed.
[0010] Preferably, if the current running state of the server resources is at a peak state, dynamically adjusting the image capture frequency of the low priority algorithm and controlling the start and stop of the identification task of the low priority algorithm further includes: When the sum of the computing power of the first detection algorithm is less than the total computing power of the current task and the number of concurrent tasks of the first detection algorithm is less than the total concurrent number of the current task, if the sum of the computing power of the first detection algorithm and the sum of the computing power of the second detection algorithm is greater than the total computing power of the current task or the sum of the number of concurrent tasks of the first detection algorithm and the number of concurrent tasks of the second detection algorithm is greater than the total concurrent number of the current task; Keep the detection frequency and recognition task start status of the first detection algorithm unchanged; Extracting screenshots of the high warning rate device running the second detection algorithm as identification task data of the second detection algorithm, and saving the unextracted screenshots to a server cache area; The detection frequency of the third detection algorithm is reduced, and the identification task of the third detection algorithm is kept turned on.
[0011] Preferably, if the current running state of the server resources is at a peak state, dynamically adjusting the image capture frequency of the low priority algorithm and controlling the start and stop of the identification task of the low priority algorithm further includes: When the sum of the computing power of the first detection algorithm and the sum of the computing power of the second detection algorithm is less than the total computing power of the current task or the sum of the task concurrency of the first detection algorithm and the task concurrency of the second detection algorithm is less than the total concurrency of the current task, if the sum of the computing power of the first detection algorithm, the sum of the computing power of the second detection algorithm and the sum of the computing power of the third detection algorithm is greater than the total computing power of the current task or the sum of the task concurrency of the first detection algorithm, the task concurrency of the second detection algorithm and the task concurrency of the third detection algorithm is greater than the total concurrency of the current task; Keep the detection frequency and recognition task start status of the first detection algorithm unchanged; Keep the detection frequency and recognition task start status of the second detection algorithm unchanged; The screenshots of the high warning rate device running the third detection algorithm are extracted as the recognition task data of the third detection algorithm, and the unextracted screenshots are saved in the server cache area.
[0012] Preferably, the method further comprises: If it is detected that the current server resources switch from the peak state to the normal state, the adjustment of the detection frequency of the first, second and third detection algorithms and the start and stop state of the identification task in the peak state is reset.
[0013] Preferably, the method further comprises: If it is detected that the current server resources switch to an idle state, the recognition tasks of the first, second and third detection algorithms are controlled to process the screenshots in the server buffer area.
[0014] In the second aspect, an AI task scheduling system based on a video analysis algorithm is provided, including: A data detection unit, used to determine the operating status of the current resources; The data processing unit is used to dynamically adjust the detection frequency of the low-priority algorithm and control the start and stop of the low-priority algorithm identification task according to the total computing power of the current task, the total concurrency of the current task and the operation information of algorithms with different priorities if the current operating status of the resource is at a peak state.
[0015] According to a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to implement the AI task scheduling method based on a video analysis algorithm when executing the program stored in the memory.
[0016] The present invention discloses an AI task scheduling method and system based on a video analysis algorithm, the method comprising: judging the operating state of the current server resources; if the operating state of the current server resources is a peak state, dynamically adjusting the detection frequency of the low-priority video analysis algorithm and controlling the start and stop of the low-priority video analysis algorithm identification task according to the total computing power of the current task, the total concurrent number of the current task and the operating information of the video analysis algorithms of different priorities. The present invention realizes the efficient scheduling requirements of server resources under peak state by dynamically adjusting the detection frequency and start and stop of the low-priority video analysis algorithm.
[0017] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.
[0019] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to illustrate the technical solutions disclosed in the present invention.
[0020] Figure 1 A flowchart of an AI task scheduling method based on a video analysis algorithm provided by an embodiment of the present invention; Figure 2 A flowchart of a method for configuring concurrent computing power and the like provided in an embodiment of the present invention; Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0023] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0024] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0025] In addition, in order to better illustrate the present invention, numerous specific details are provided in the following specific embodiments. It should be understood by those skilled in the art that the present invention can be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present invention.
[0026] At present, the existing algorithm warehouse task scheduling has the problem of unreasonable resource allocation during the peak period of CPU and video memory resource usage. Therefore, the present invention aims to provide an AI task scheduling method and system based on video analysis algorithm. The present invention dynamically adjusts the detection frequency and start and stop of low-priority video analysis algorithms to achieve efficient scheduling requirements of server resources under peak conditions.
[0027] Example 1 Provides an AI task scheduling method based on video analysis algorithm, reference Figure 1 ,include: S100, determining the current operating status of the server; S200, if the current server operating status is at peak, dynamically adjust the detection frequency of the low-priority video analysis algorithm and control the start and stop of the low-priority video analysis algorithm identification task based on the total computing power of the current task, the total concurrent number of the current task and the operating information of video analysis algorithms of different priorities.
[0028] In the embodiment of the present application, the operating state of the server can be divided into peak state, normal state and idle state. By comparing the relationship between the maximum computing power and the maximum concurrency of the current server and the total computing power of the current task and the total concurrency of the current task, the operating state of the current server can be determined. In order to measure the computing power and concurrency of the server, some toolkits such as NVIDIA-SMI, Grafana and Prometheus can be used. In this embodiment, the open source service monitoring system Prometheus is used, which can monitor the GPU and video memory usage of the server and provide accurate measurement and monitoring of server resources. This application does not limit the method of determining the operating state of the current server.
[0029] In the embodiment of the present application, the operation state of the server can be subdivided into more sub-states, for example, peak state, quasi-peak state, sub-peak state, normal state and idle state.
[0030] In the embodiment of the present application, the detection frequency of the low-priority video analysis algorithm is dynamically adjusted according to the priority of different video analysis algorithms. In peak state, the detection frequency of the low-priority video analysis algorithm can be reduced to reduce its resource occupation so as to provide more computing resources for the high-priority video analysis algorithm.
[0031] Control the start and stop of the low-priority video analysis algorithm, that is, dynamically turn on and off the recognition task of the low-priority algorithm according to the current server resource situation. In peak state, the task volume of the low-priority video analysis algorithm can be suspended or reduced to avoid excessive load on the system. In idle state, the recognition task of the low-priority video analysis algorithm can be resumed according to the availability of server resources.
[0032] In one possible embodiment, reference Figure 2 Before judging the current running status of the server, it also includes: configuring computing power and concurrent paths. Specifically, S10 configures the priority of multiple video analysis algorithms, S20 configures the maximum number of concurrent paths of devices supported by a single video analysis algorithm, S30 configures the maximum computing power of the maximum supported device of a single video analysis algorithm, S40 configures the maximum and minimum range of the detection frequency of a single video analysis algorithm, and S50 configures the maximum vertical concurrency according to server resources.
[0033] Preferably, determining the current operating status of server resources includes: If the total computing power of the current task is greater than the first preset value and the total concurrent number of the current task is greater than the first preset value, it is determined that the current server resources are in a peak state; If the total computing power of the current task is between the first preset value and the second preset value and the total concurrent number of the current task is between the first preset value and the second preset value, it is determined that the current server resources are in a normal state; If the total computing power of the current task is less than the second preset value and the total concurrent number of the current task is less than the second preset value, it is determined that the current server resources are in an idle state.
[0034] It should be noted that the first preset value and the second preset value are determined as appropriate values according to the resource status and performance indicators of the server. These values can be set based on actual conditions and experience to meet the performance and load requirements of the server. In the embodiment of the present application, the first preset value is set to 90% and the second preset value is set to 80%. Taking three types of video analysis algorithms with different priorities as an example, assuming that the maximum concurrent number of the server is C, the maximum computing power is Q, and the first type of detection algorithms account for a total of , the first type of detection algorithm single device occupies computing power , the first type of detection algorithm occupies the number of concurrent , the first type of detection algorithm has Devices use the second type of detection algorithm, accounting for the total , the second type of detection algorithm single device occupies computing power , the second type of detection algorithm occupies the concurrent number , the second type of detection algorithm has Devices use the third type of detection algorithm, accounting for the total , the third type of detection algorithm single device occupies computing power , the third type of detection algorithm occupies the number of concurrent , the third type of detection algorithm has If the current task's total computing power accounts for the maximum computing power of the server, :
[0035] The ratio of the total concurrent number of current tasks to the maximum concurrent number of the server :
[0036] when and When both are greater than 90% of the first preset value, it is determined that the current server resources are at a peak state. At [80%,90%] and when When it is between the first preset value and the second preset value [80%, 90%], it is determined that the current server resources are in a normal state. and When both are less than 80% of the second preset value, it is determined that the current server resources are in an idle state.
[0037] Preferably, the video analysis algorithms of different priorities include: a first detection algorithm, a second detection algorithm and a third detection algorithm, wherein the priority of the first detection algorithm is greater than the priority of the second detection algorithm, which is greater than the priority of the third detection algorithm.
[0038] In one possible implementation, all video analysis algorithms are prioritized according to factors such as the computational time required for algorithm operation, the real-time requirements of the algorithms, and the urgency of the problems that the algorithms are intended to solve.
[0039] In the embodiment of the present application, all video analysis algorithms are divided into three priority levels, including: a first detection algorithm, a second detection algorithm and a third detection algorithm. Among them, the first detection algorithm: must be executed, and the detection frequency is relatively high. For example, for some real-time monitoring algorithms, such as video analysis, anomaly detection, etc., it is necessary to ensure that they are always running and maintain a high detection frequency so that abnormal situations can be discovered and handled in a timely manner. The second detection algorithm: the detection frequency can be reduced. For some algorithms that do not have high real-time requirements but need to ensure normal daily operation, such as data analysis, process processing, etc., their detection frequency can be appropriately reduced so that more server resources can be used by the first detection algorithm. The third detection algorithm: can be idle analysis. Algorithms that can be processed using idle server resources during server idle time and off-peak hours, such as model training, data optimization, etc. These algorithms can be executed regularly, or some load balancing technologies can be used to distribute tasks on each server to achieve parallel processing.
[0040] Preferably, if the current running state of the server resources is at a peak state, dynamically adjusting the image capture frequency of the low priority algorithm and controlling the start and stop of the low priority algorithm identification task include: If the total computing power of the first detection algorithm is greater than the total computing power of the current task and the number of concurrent tasks of the first detection algorithm is greater than the total number of concurrent tasks of the current task; Extracting screenshots of the high warning rate device running the first detection algorithm as identification task data of the first detection algorithm, and saving the unextracted screenshots to a server cache area; Reduce the detection frequency of the second detection algorithm and keep the second detection algorithm recognition task enabled; The video screenshot of the third detection algorithm is saved to the server cache area, and the third detection algorithm recognition task is closed.
[0041] In the present application embodiment, it is judged >Q& >C, do not reduce the screenshot frequency of the first detection algorithm. Based on the proportion of abnormal events detected by the device history as a weight, identify the top 90% of the devices with the highest alarm times of the first detection algorithm as high warning rate devices, extract the images of the high warning rate devices for algorithm recognition of the first detection algorithm, and save the remaining 10% of the images of non-high warning rate devices to the server cache area; reduce the detection frequency of the second detection algorithm, adjust the detection frequency to a minimum of 25 times / second, and the recognition task of the second detection algorithm runs in real time; the third detection algorithm directly saves the screenshots in the server cache area, and the third detection algorithm does not perform the recognition task.
[0042] In one possible embodiment, after the peak state adjustment measures are run, Prometheus is used to detect the pressure of the server GPU and video memory. If the total computing power of the current task accounts for the maximum proportion of the server computing power The ratio of the total concurrent number of current tasks to the maximum concurrent number of the server If it falls below 90%, the existing operation will be maintained until a new task starts or an end event triggers a phase change. If it has not dropped below 90%, the frequency adjustment operation of the second detection algorithm will be performed again. If the detection frequency of the second detection algorithm reaches 25 times / second and has not dropped below 90%, a warning will be triggered to remind the user that the server resources are insufficient.
[0043] Preferably, if the current running state of the server resources is at a peak state, dynamically adjusting the image capture frequency of the low priority algorithm and controlling the start and stop of the low priority algorithm identification task also includes: When the sum of the computing power of the first detection algorithm is less than the total computing power of the current task and the number of concurrent tasks of the first detection algorithm is less than the total concurrent number of tasks of the current task, if the sum of the computing power of the first detection algorithm and the sum of the computing power of the second detection algorithm is greater than the total computing power of the current task or the sum of the number of concurrent tasks of the first detection algorithm and the number of concurrent tasks of the second detection algorithm is greater than the total concurrent number of tasks of the current task; Keep the detection frequency and recognition task start status of the first detection algorithm unchanged; Extracting screenshots of the high warning rate device running the second detection algorithm as identification task data of the second detection algorithm, and saving the unextracted screenshots to the server cache area; Reduce the detection frequency of the third detection algorithm and keep the third detection algorithm recognition task enabled.
[0044] In this embodiment, when <Q& <C, >Q | >C, Keep the first detection algorithm running at full load. Determine the devices with the top 90% of the warning times ratio of the detection devices executing the second detection algorithm as high-warning-rate devices. Extract the pictures of the high-warning-rate devices for algorithm recognition of the second detection algorithm. Save the pictures of the remaining 10% of non-high-warning-rate devices to the server buffer; Reduce the detection frequency of the third type of algorithm and adjust the detection frequency to a minimum of 25 times per second. The recognition task of the third detection algorithm runs in real time.
[0045] In a possible embodiment, after the peak state adjustment measure operation runs, use Prometheus to detect the GPU and video memory pressure of the server. If the ratio of the total computing power of the current task to the maximum computing power of the server and the ratio of the total concurrency of the current task to the maximum concurrency of the server reach below 90%, maintain the existing operations unchanged until a new task start or end event triggers a phase change; If it has not dropped below 90%, re-perform the frequency modulation operation of the third detection algorithm. If the detection frequency of the third detection algorithm reaches 25 times per second and still has not dropped below 90%, then deactivate the recognition task of the third detection algorithm.
[0046] Preferably, if the running state of the current server resources is in the peak state, dynamically adjust the capture frequency of the low-priority algorithm and control the start and stop of the recognition task of the low-priority algorithm. It also includes: When the sum of the computing power of the first detection algorithm and the sum of the computing power of the second detection algorithm is less than the total computing power of the current task or the sum of the task concurrency of the first detection algorithm and the sum of the task concurrency of the second detection algorithm is less than the total concurrency of the current task, if the sum of the computing power of the first detection algorithm, the sum of the computing power of the second detection algorithm and the sum of the computing power of the third detection algorithm is greater than the total computing power of the current task or the sum of the task concurrency of the first detection algorithm, the sum of the task concurrency of the second detection algorithm and the sum of the task concurrency of the third detection algorithm is greater than the total concurrency of the current task; Keep the detection frequency and recognition task start state of the first detection algorithm unchanged; Keep the detection frequency and recognition task start state of the second detection algorithm unchanged; Extract the screenshots of the high-warning-rate devices running the third detection algorithm as the recognition task data of the third detection algorithm, and save the unextracted screenshots to the server buffer.
[0047] In this embodiment, when <Q& <C and >Q | >C keeps the first and second detection algorithms running at full load, identifies the top 90% of the devices with the highest alarm rate when executing the third detection algorithm as high warning rate devices, extracts images of the high warning rate devices for algorithm recognition of the third detection algorithm, and saves the remaining 10% of images of non-high warning rate devices to the server cache.
[0048] Preferably, the method further comprises: If it is detected that the current server resources switch from the peak state to the normal state, the adjustment of the detection frequency of the first, second and third detection algorithms and the start and stop state of the identification task in the peak state is reset.
[0049] Preferably, the method further comprises: If it is detected that the current server resources switch to an idle state, the recognition tasks of the first, second and third detection algorithms are controlled to process the screenshots in the server buffer area.
[0050] When the current server resources switch to the idle state, the first detection algorithm, the second detection algorithm and the third detection algorithm are started to process the recognition task of the screenshot resources stored in the server cache area. Effectively utilize the time period when the server resource utilization rate is low and the task load is light, and timely process the image data cached in the peak state but not yet recognized and processed, thereby improving the comprehensiveness and accuracy of the recognition tasks of the first detection algorithm, the second detection algorithm and the third detection algorithm.
[0051] Example 2 An AI task scheduling system based on video analysis algorithm is provided, including: A data detection unit, used to determine the current operating status of server resources; The data processing unit is used to dynamically adjust the detection frequency of the low-priority algorithm and control the start and stop of the low-priority algorithm identification task according to the total computing power of the current task, the total concurrency of the current task and the operation information of algorithms with different priorities if the current operating status of the server resources is at a peak state.
[0052] Example 3 See also Figure 3 , Figure 3 The structure diagram of an electronic device provided by an embodiment of the present invention is shown in FIG. Figure 3 The electronic device 600 shown includes: at least one processor 601, a memory 602, at least one network interface 604 and other user interfaces 603. The various components in the electronic device 600 are coupled together via a bus system 605. It is understood that the bus system 605 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 605 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 605 is not shown in FIG. Figure 3Various buses are labeled as bus system 605 .
[0053] The user interface 603 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).
[0054] It can be understood that the memory 602 in the embodiment of the present invention can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The memory 602 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0055] In some implementations, the memory 602 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 6021 and an application 6022 .
[0056] The operating system 6021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 6022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present invention can be included in the application 6022.
[0057] In an embodiment of the present invention, by calling the program or instructions stored in the memory 602, specifically, the program or instructions stored in the application 6022, the processor 601 is used to execute the steps of an AI task scheduling method based on a video analysis algorithm provided in each method embodiment.
[0058] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. An AI task scheduling method based on video analysis algorithm, characterized in that: include: Determine the current operating status of server resources; If the current server resource operation status is at peak, the detection frequency of the low priority algorithm is dynamically adjusted and the start and stop of the low priority algorithm identification task is controlled according to the total computing power of the current task, the total concurrent number of the current task and the operation information of algorithms with different priorities.
2. The AI task scheduling method based on video analysis algorithm according to claim 1 is characterized in that: The determining of the current running status of the server resources includes: If the total computing power of the current task is greater than the first preset value and the total concurrent number of the current task is greater than the first preset value, it is determined that the current server resources are in a peak state; If the total computing power of the current task is between the first preset value and the second preset value and the total concurrent number of the current task is between the first preset value and the second preset value, it is determined that the current server resources are in a normal state; If the total computing power of the current task is less than the second preset value and the total concurrent number of the current task is less than the second preset value, it is determined that the current server resources are in an idle state.
3. The AI task scheduling method based on video analysis algorithm according to claim 2 is characterized in that: The different priority algorithms include: a first detection algorithm, a second detection algorithm and a third detection algorithm, wherein the priority of the first detection algorithm is greater than the priority of the second detection algorithm, which is greater than the priority of the third detection algorithm.
4. The AI task scheduling method based on video analysis algorithm according to claim 3 is characterized in that: If the current running state of the server resources is at a peak state, dynamically adjusting the image capture frequency of the low priority algorithm and controlling the start and stop of the identification task of the low priority algorithm include: If the total computing power of the first detection algorithm is greater than the total computing power of the current task and the number of concurrent tasks of the first detection algorithm is greater than the total concurrent number of tasks of the current task; Extracting screenshots of the high warning rate device running the first detection algorithm as identification task data of the first detection algorithm, and saving the unextracted screenshots to a server cache area; Reduce the detection frequency of the second detection algorithm and keep the identification task of the second detection algorithm enabled; The video screenshot of the third detection algorithm is saved to the server cache area, and the third detection algorithm recognition task is closed.
5. The AI task scheduling method based on video analysis algorithm according to claim 3 is characterized in that: If the current running state of the server resources is at a peak state, dynamically adjusting the image capture frequency of the low priority algorithm and controlling the start and stop of the low priority algorithm identification task, further comprising: When the sum of the computing power of the first detection algorithm is less than the total computing power of the current task and the number of concurrent tasks of the first detection algorithm is less than the total concurrent number of the current task, if the sum of the computing power of the first detection algorithm and the sum of the computing power of the second detection algorithm is greater than the total computing power of the current task or the sum of the number of concurrent tasks of the first detection algorithm and the number of concurrent tasks of the second detection algorithm is greater than the total concurrent number of the current task; Keep the detection frequency and recognition task start status of the first detection algorithm unchanged; Extracting screenshots of the high warning rate device running the second detection algorithm as identification task data of the second detection algorithm, and saving the unextracted screenshots to a server cache area; The detection frequency of the third detection algorithm is reduced, and the identification task of the third detection algorithm is kept turned on.
6. The AI task scheduling method based on video analysis algorithm according to claim 3 is characterized in that: If the current running state of the server resources is at a peak state, dynamically adjusting the image capture frequency of the low priority algorithm and controlling the start and stop of the low priority algorithm identification task, further comprising: When the sum of the computing power of the first detection algorithm and the sum of the computing power of the second detection algorithm is less than the total computing power of the current task or the sum of the task concurrency of the first detection algorithm and the task concurrency of the second detection algorithm is less than the total concurrency of the current task, if the sum of the computing power of the first detection algorithm, the sum of the computing power of the second detection algorithm and the sum of the computing power of the third detection algorithm is greater than the total computing power of the current task or the sum of the task concurrency of the first detection algorithm, the task concurrency of the second detection algorithm and the task concurrency of the third detection algorithm is greater than the total concurrency of the current task; Keep the detection frequency and recognition task start status of the first detection algorithm unchanged; Keep the detection frequency and recognition task start status of the second detection algorithm unchanged; The screenshots of the high warning rate device running the third detection algorithm are extracted as the recognition task data of the third detection algorithm, and the unextracted screenshots are saved in the server cache area.
7. The AI task scheduling method based on video analysis algorithm according to claims 4 to 6 is characterized in that: The method further comprises: If it is detected that the current server resources switch from the peak state to the normal state, the adjustment of the detection frequency of the first, second and third detection algorithms and the start and stop state of the identification task in the peak state is reset.
8. The AI task scheduling method based on video analysis algorithm according to claims 4 to 6 is characterized in that: The method further comprises: If it is detected that the current server resources switch to an idle state, the recognition tasks of the first, second and third detection algorithms are controlled to process the screenshots in the server buffer area.
9. An AI task scheduling system based on video analysis algorithm, characterized in that: include: A data detection unit, used to determine the current operating status of server resources; The data processing unit is used to dynamically adjust the detection frequency of the low-priority algorithm and control the start and stop of the low-priority algorithm identification task according to the total computing power of the current task, the total concurrency of the current task and the operation information of different priority algorithms if the current operating status of the server resources is at a peak state.
10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the AI task scheduling method based on the video analysis algorithm described in claims 1 to 7 when executing the program stored in the memory.
Citation Information
Cited By
Concurrency and bandwidth double-threshold triggered video retrieval preemption scheduling method and system
CN121125653A
A concurrent and bandwidth dual threshold triggered video review pre-emption scheduling method and system
CN121125653B
