Algorithm model running processing method and apparatus, and intelligent edge device
By creating multiple virtual engines and binding multiple algorithm models on edge smart devices, the problem that the device can only support one algorithm model is solved, enabling simultaneous analysis of multiple algorithm models, reducing costs, and meeting the needs of multi-algorithm model fusion. Analysis needs.
Patent Information
- Application Number
- PCT/CN2023/093032
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-05-09
- Filing Date
- 2023-05-09
- Publication Date
- 2024-09-12
AI Technical Summary
Existing edge intelligent devices can only support one algorithm model and cannot achieve simultaneous analysis of multiple algorithm models. Moreover, adding a physics engine to support multiple algorithm models is costly and unsuitable for deployment.
By obtaining multiple virtual engines on the edge intelligent device, the virtual engine is a software package of the physical engine. The number of virtual engines is greater than or equal to the number of algorithm models. Each algorithm model is bound to run on a virtual engine, and the Execute tasks on the virtual engine, limit the performance of the virtual engine according to the performance of the physical engine, and realize simultaneous analysis of multi-algorithm models.
Realizing simultaneous analysis of multi-algorithm models on edge smart devices reduces costs and meets the need for low-cost multi-algorithm model fusion analysis.
Smart Images

Figure CN2023093032_12092024_PF_FP_ABST
Abstract
Description
Algorithm model operation processing method, device and edge intelligent device Technical Field
[0001] This application relates to the field of intelligent analysis, and specifically to an algorithm model operation and processing method, device and edge intelligent device. Background Art
[0002] With the increasing popularity of open AI (Artificial Intelligence) platforms, these platforms need to support multiple algorithm models, such as those for video structured processing and image analysis. To support these models, multiple edge intelligent devices (also known as edge intelligent boxes) need to be deployed. Edge intelligent devices are used for intelligent video / image analysis, and each can only support one algorithm model. For example, an edge intelligent device might have a single physics engine, running one algorithm model on that engine to implement the functions supported by that algorithm model. Alternatively, to support multiple algorithm models, the number of physics engines in the edge intelligent device needs to be increased, with each physics engine supporting only one algorithm model. For example, an edge intelligent device might have multiple physics engines, running one algorithm model on each engine to implement the functions supported by that algorithm model. Obviously, some scenarios requiring simultaneous analysis of multiple algorithm models cannot be implemented on edge intelligent devices with a single physics engine. The high cost of deploying edge intelligent devices with multiple physics engines makes them unsuitable.
[0003] Summary of the Invention
[0004] The embodiments of the present application provide an algorithm model operation processing method, apparatus, and edge intelligent device, which can implement simultaneous analysis scenarios requiring support from multiple algorithm models on the edge intelligent device.
[0005] According to one aspect of the present application, a method for processing algorithm model operation is provided, including: obtaining at least one algorithm model, wherein the algorithm model is an artificial intelligence algorithm model; obtaining multiple virtual engines, wherein the virtual engine is an engine virtualized after software encapsulation of a physical engine, and the number of virtual engines obtained is greater than or equal to the number of algorithm models obtained; binding each algorithm model in the at least one algorithm model to run on a virtual engine, wherein one virtual engine is used to bind one algorithm model; receiving a task, and executing the task on the virtual engine based on the algorithm model.
[0006] Furthermore, executing the task based on the algorithm model on the virtual engine includes: obtaining a pre-configured predetermined order, wherein the predetermined order is used to indicate the running order of the multiple algorithm models when the multiple algorithm models cooperate to run to execute the task; based on the predetermined order, running the multiple algorithm models in sequence on the multiple virtual engines corresponding to the multiple algorithm models to execute the task; wherein, in the process of running the multiple algorithm models to execute the task, the output of the algorithm model that runs first serves as the input of the algorithm model that runs later.
[0007] Furthermore, it also includes: when executing tasks on the multiple virtual engines, limiting the performance of each of the multiple virtual engines according to the performance of the physical engine, wherein the performance of the physical engine is used to indicate the upper limit of the processing capability of the physical engine, and the performance of the virtual engine is used to indicate the upper limit of the processing capability of the virtual engine, wherein the sum of the performance of the multiple virtual engines during operation does not exceed the performance of the physical engine.
[0008] Furthermore, the tasks include video analysis tasks and / or image analysis tasks; wherein, for the video analysis task, the performance of the physical engine is to support a maximum of N-channel video analysis, where N is a positive integer; and for the image analysis task, the performance of the physical engine is to analyze a maximum of M images per unit time, where M is a positive integer.
[0009] Furthermore, the performance of each of the multiple virtual engines is limited according to the performance of the physical engine, including: when the multiple virtual engines all perform video analysis, limiting the total number of video channels opened by the multiple virtual engines to be less than or equal to N; or, when the multiple virtual engines all perform image analysis, limiting the total number of images analyzed by the multiple virtual engines per unit time to be less than or equal to M; or, limiting the maximum number of images analyzed per unit time by at least one virtual engine used for image analysis to: equivalent image processing amount * (N-N1), where N1 is less than N, N1 is greater than or equal to 0, N1 is the number of video channels opened by the virtual engine performing video analysis, and the equivalent image processing amount is the number of images that can be analyzed when the ability to process one video analysis channel is used for image analysis.
[0010] Furthermore, the method of limiting the maximum number of images that can be analyzed per unit time by at least one virtual engine for performing image analysis to: equivalent image processing amount * (N-N1) includes: configuring an image scheduling task, wherein the image scheduling task is used to send images to each virtual engine in at least one virtual engine for performing image analysis in turn; controlling the image scheduling task to send one image at a predetermined interval each time, so as to limit the maximum number of images that can be analyzed per unit time by at least one virtual engine for performing image analysis to: the equivalent image processing amount * (N-N1), wherein the predetermined time is used to indicate the time interval between sending two images, and the predetermined time is: the unit time / [the equivalent image processing amount * (N-N1)].
[0011] Furthermore, the equivalent image processing amount is: M / q*N; wherein q is a configured control coefficient, and the value range of q is 1-M / N.
[0012] Furthermore, after the task is executed on the virtual engine based on the algorithm model, the method further includes: obtaining an analysis result obtained after the virtual engine executes the task based on the algorithm model; determining whether an alarm is required for the analysis result according to a pre-configured alarm condition, and if necessary, issuing an alarm.
[0013] Furthermore, each algorithm model of the at least one algorithm model is bound to run on a virtual engine, including: obtaining an operation signal, wherein the operation signal is used to drag a first object representing the algorithm model from a first display area to a second display area, the first display area displays at least one first object, each first object corresponds to an algorithm model, and the second display area displays at least one second object, each second object corresponds to a virtual engine; in response to the operation signal, when the degree of overlap between the first object and a predetermined second object in the second display area exceeds a threshold, the algorithm model corresponding to the first object is bound to the virtual engine corresponding to the predetermined second object.
[0014] Furthermore, each algorithm model in the at least one algorithm model is bound and run on a virtual engine, including: after each algorithm model is loaded on the physical engine, creating a model handle corresponding to the loaded algorithm model; obtaining the identification information of the virtual engine to which the loaded algorithm model is to be bound; establishing a correspondence between the model handle corresponding to the loaded algorithm model and the identification information, so as to bind the loaded algorithm model to the virtual engine corresponding to the identification information.
[0015] According to another aspect of the present application, an algorithm model operation processing device is also provided, including: a first acquisition module, used to obtain at least one algorithm model, wherein the algorithm model is an artificial intelligence algorithm model; a second acquisition module, used to obtain multiple virtual engines, wherein the virtual engine is an engine virtualized after software encapsulation of a physical engine, and the number of virtual engines obtained is greater than or equal to the number of algorithm models obtained; a binding module, used to run and bind each algorithm model of the at least one algorithm model to a virtual engine, wherein one virtual engine is used to bind one algorithm model; an execution module, used to receive a task and execute the task on the virtual engine based on the algorithm model.
[0016] Furthermore, the execution module is used to obtain a pre-configured predetermined order, wherein the predetermined order is used to indicate the running order of the multiple algorithm models when the multiple algorithm models cooperate to run to execute the task; based on the predetermined order, the multiple algorithm models are run in sequence on the multiple virtual engines corresponding to the multiple algorithm models to execute the task; wherein, in the process of running the multiple algorithm models to execute the task, the output of the algorithm model that runs first is used as the input of the algorithm model that runs later; and / or,
[0017] The system further includes: a limiting module configured to limit the performance of each of the multiple virtual engines according to the performance of the physical engine when executing tasks on the multiple virtual engines, wherein the performance of the physical engine is used to indicate an upper limit value of the processing capability of the physical engine, and the performance of the virtual engine is used to indicate an upper limit value of the processing capability of the virtual engine, wherein the sum of the performance of the multiple virtual engines during operation does not exceed the performance of the physical engine; and / or
[0018] The tasks include video analysis tasks and / or image analysis tasks; wherein, for the video analysis task, the performance of the physical engine is to support a maximum of N video analysis channels, where N is a positive integer; and for the image analysis task, the performance of the physical engine is to analyze a maximum of M images per unit time, where M is a positive integer; and / or,
[0019] The limiting module is used to limit the total number of video channels opened by the multiple virtual engines to be less than or equal to N when the multiple virtual engines all perform video analysis; or, when the multiple virtual engines all perform image analysis, limit the total number of images analyzed by the multiple virtual engines per unit time to be less than or equal to M; or, limit the maximum number of images analyzed per unit time by at least one virtual engine used for image analysis to: equivalent image processing capacity*(N-N1), where N1 is less than N, N1 is greater than or equal to 0, N1 is the number of video channels opened by the virtual engine performing video analysis, and the equivalent image processing capacity is the number of images that can be analyzed when the ability to process one video channel is used for image analysis; and / or,
[0020] The limiting module is used to configure an image scheduling task, wherein the image scheduling task is used to sequentially send images to each virtual engine in at least one virtual engine for performing image analysis; control the image scheduling task to send one image each time at a predetermined interval, so as to limit the maximum number of images analyzed per unit time by the at least one virtual engine for performing image analysis to: the equivalent image processing amount * (N-N1), wherein the predetermined time is used to indicate the time interval between sending two images, and the predetermined time is: the unit time / [the equivalent image processing amount * (N-N1)]; and / or,
[0021] The equivalent image processing amount is: M / q*N, where q is a configured control coefficient and the value range of q is 1-M / N; and / or,
[0022] It also includes: an alarm module, which is used to obtain the analysis results obtained after the virtual engine executes the task based on the algorithm model; determine whether it is necessary to issue an alarm for the analysis result according to pre-configured alarm conditions, and issue an alarm if necessary; and / or,
[0023] The binding module is also used to obtain an operation signal, wherein the operation signal is used to drag a first object representing an algorithm model from a first display area to a second display area, the first display area displays at least one first object, each first object corresponds to an algorithm model, and the second display area displays at least one second object, each second object corresponds to a virtual engine; in response to the operation signal, when the degree of overlap between the first object and a predetermined second object in the second display area exceeds a threshold, the algorithm model corresponding to the first object is bound to the virtual engine corresponding to the predetermined second object; and / or,
[0024] The binding model is used to create a model handle corresponding to the loaded algorithm model after each algorithm model is loaded on the physical engine; obtain the identification information of the virtual engine to which the loaded algorithm model is to be bound; establish a corresponding relationship between the model handle corresponding to the loaded algorithm model and the identification information, so as to bind the loaded algorithm model to the virtual engine corresponding to the identification information.
[0025] According to one aspect of the present application, an edge intelligent device is also provided, including a memory and a processor, wherein the memory is used to store a program, the processor is used to run the program, and the program is used to execute the above-mentioned algorithm model operation processing method.
[0026] According to one aspect of the present application, an algorithm model operation processing system is also provided, characterized in that the algorithm model operation processing system includes an edge intelligent device and an application platform, and a user logs in to the application platform through a WEB page to manage the edge intelligent device. In particular, the application platform is used to obtain at least one algorithm model from an AI open platform and send the at least one algorithm model to the edge intelligent device, and the algorithm model is an artificial intelligence algorithm model; the application platform is used to manage the virtual engine of the edge intelligent device and process the binding relationship between the virtual engine and the algorithm model; wherein the virtual engine is an engine virtualized after software packaging of a physical engine, and the number of virtual engines obtained is greater than or equal to the number of algorithm models obtained; the binding relationship between the virtual engine and the algorithm model is: each algorithm model is bound to run on a virtual engine, and one virtual engine is used to bind one algorithm model; the application platform is used to send tasks to the edge intelligent device; the edge intelligent device is used to receive the task sent by the application platform and execute the task based on the algorithm model on the virtual engine.
[0027] Furthermore, the edge intelligent device is used to obtain the analysis results obtained by the virtual engine after executing the task based on the algorithm model after executing the task, and return the analysis results to the application platform. The application platform is used to determine whether it is necessary to issue an alarm for the analysis results based on pre-configured alarm conditions, and if necessary, issue an alarm.
[0028] Furthermore, the edge intelligent device includes: an intelligent engine subsystem for managing the virtual engine; a model package management module for adding, updating and deleting algorithm models; an engine management module for binding, updating and unbinding algorithm models; a task management module for starting and / or closing tasks; a rule management module for configuring rules, which are rules used by the algorithm model, and according to which the algorithm model performs calculations that match the rules; an IPC access management module for managing the accessed IPC and obtaining video streams from the IPC; and an intelligent alarm module for uploading alarms.
[0029] Furthermore, when the edge intelligent device executes the task based on the algorithm model on the virtual engine, it is specifically used to: obtain a pre-configured predetermined order, wherein the predetermined order is used to indicate the running order of the multiple algorithm models when the multiple algorithm models cooperate to run to execute the task; based on the predetermined order, run the multiple algorithm models in sequence on the multiple virtual engines corresponding to the multiple algorithm models to execute the task; wherein, in the process of running the multiple algorithm models to execute the task, the output of the algorithm model that runs first serves as the input of the algorithm model that runs later.
[0030] Furthermore, the edge intelligent device is further configured to, when executing tasks on the multiple virtual engines, limit the performance of each of the multiple virtual engines based on the performance of the physical engine, wherein the performance of the physical engine is used to indicate an upper limit of the processing capability of the physical engine, and the performance of the virtual engine is used to indicate an upper limit of the processing capability of the virtual engine, and wherein the sum of the performance of the multiple virtual engines during operation does not exceed the performance of the physical engine;
[0031] The tasks include video analysis tasks and / or image analysis tasks; for video analysis tasks, the performance of the physical engine is to support a maximum of N video analysis channels, where N is a positive integer; for image analysis tasks, the performance of the physical engine is to analyze a maximum of M images per unit time, where M is a positive integer;
[0032] Among them, when the edge intelligent device limits the performance of each of the multiple virtual engines according to the performance of the physical engine, it is specifically used to: when the multiple virtual engines all perform video analysis, limit the total number of video channels opened by the multiple virtual engines to be less than or equal to N; or, when the multiple virtual engines all perform image analysis, limit the total number of images analyzed by the multiple virtual engines per unit time to be less than or equal to M; or, limit the maximum number of images analyzed per unit time by at least one virtual engine used for image analysis to: equivalent image processing capacity * (N-N1), N1 is less than N, N1 is greater than or equal to 0, N1 is the number of video channels opened by the virtual engine performing video analysis, and the equivalent image processing capacity is the number of images that can be analyzed when the ability to process one video analysis is used for image analysis.
[0033] Furthermore, the edge intelligent device is also used to obtain an operation signal, and the operation signal is used to drag a first object representing an algorithm model from a first display area to a second display area, wherein the first display area displays at least one first object, each first object corresponds to an algorithm model, and the second display area displays at least one second object, each second object corresponds to a virtual engine; in response to the operation signal, when the degree of overlap between the first object and a predetermined second object in the second display area exceeds a threshold, the algorithm model corresponding to the first object is bound to the virtual engine corresponding to the predetermined second object; or, after each algorithm model is loaded on the physical engine, a model handle corresponding to the loaded algorithm model is created; identification information of the virtual engine to which the loaded algorithm model is to be bound is obtained; and a correspondence between the model handle corresponding to the loaded algorithm model and the identification information is established to bind the loaded algorithm model to the virtual engine corresponding to the identification information.
[0034] In an embodiment of the present application, at least one algorithm model is obtained, wherein the algorithm model is an artificial intelligence algorithm model; multiple virtual engines are obtained, wherein the virtual engine is a virtual engine after software encapsulation of a physical engine; each algorithm model in the at least one algorithm model is bound to run on a virtual engine, wherein one virtual engine is used to bind one algorithm model; a task is received, and the task is executed on the virtual engine based on the algorithm model. Through this application, it is possible to implement simultaneous analysis scenarios that require support from multiple algorithm models on edge intelligent devices (which can be edge intelligent devices with a physical engine), thereby enabling multiple algorithm models to run simultaneously on edge intelligent devices, meeting the needs of low-cost, multi-algorithm model fusion analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] FIG1 is a schematic diagram of a single-engine single-algorithm architecture according to an embodiment of the present application;
[0036] FIG2 is a schematic diagram of a single-engine multi-algorithm architecture according to an embodiment of the present application;
[0037] FIG3 is a flow chart of an algorithm model operation processing method according to an embodiment of the present application;
[0038] FIG4 is a schematic diagram of the overall system architecture according to an embodiment of the present application;
[0039] FIG5 is a schematic diagram of the structure of an edge intelligent device according to an embodiment of the present application;
[0040] FIG6 is a schematic diagram of the architecture of a single physics engine with multiple algorithms according to an embodiment of the present application;
[0041] FIG7 is a schematic diagram of software configuration according to an embodiment of the present application;
[0042] FIG8 is a schematic diagram of a virtual engine bound internally to an edge smart device according to an embodiment of the present application;
[0043] FIG9 is a schematic diagram of issuing tasks and rules to edge smart devices according to an embodiment of the present application;
[0044] FIG10 is a flowchart of a real-time video analysis task according to an embodiment of the present application;
[0045] FIG11 is a flowchart of a polling video analysis task according to an embodiment of the present application;
[0046] FIG12 is a flowchart of a timing capture analysis task according to an embodiment of the present application;
[0047] FIG13 is a flowchart of an offline image analysis task according to an embodiment of the present application;
[0048] FIG14 is a flowchart of an offline image scheduling task according to an embodiment of the present application. DETAILED DESCRIPTION
[0049] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0050] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0051] FIG1 is a schematic diagram of a single-engine, single-algorithm architecture according to an embodiment of the present application. As shown in FIG1 , for a single physics engine, if the engine is not virtualized at the function implementation layer, there is only one physics engine at the function implementation layer, and the UI layer (such as the AI configuration interface) also shows that there is an engine available for use. When configuring this engine, only one algorithm model (i.e., AI model package 1) can be configured. The function implementation layer is the processing logic for processing user instructions. For example, the user sends an instruction to the UI layer, the UI layer forwards the user instruction to the function implementation layer, and the function implementation layer executes the user instruction to implement the relevant function. In this embodiment, the processing process of this function implementation layer is not limited. The physics engine is the actual processing resource, which is a physical unit with image / video data processing capabilities, such as a processor or other unit, such as a GPU (Graphics Processing Unit), etc., and there is no limitation on this. Of course, the physical unit also needs to rely on necessary programs for control when performing data processing.
[0052] In this embodiment, multiple virtual engines are virtualized for a single physical engine, so that multiple algorithm models can be run through multiple virtual engines. Figure 2 is a schematic diagram of a single-engine multi-algorithm architecture according to an embodiment of the present application. As shown in Figure 2, four virtual engines 1001, 1002, 1003 and 1004 are virtualized on a single physical engine in the function implementation layer (of course, other numbers of virtual engines can also be virtualized), so that these four virtual engines can also be seen in the AI configuration interface. When configuring the algorithm model, different algorithm models can be configured for each of the four virtual engines (i.e., AI model package 1 is configured for virtual engine 1001, AI model package 2 is configured for virtual engine 1002, AI model package 3 is configured for virtual engine 1003, and AI model package 4 is configured for virtual engine 1004). Among them, the virtual engine is an engine virtualized after the physical engine is encapsulated by software. A physical engine can virtualize at least one virtual engine. The virtual engine is a virtualization unit of the physical engine. The virtual engine can load an algorithm model separately for intelligent analysis. Among them, the virtual engine after software encapsulation can be understood as: based on the data processing capability of a physical engine, it is defined as multiple capabilities using software interfaces through software, and the data processing capability of the physical engine can be used through any one or more software interfaces. The "software interface" can be equivalent to a "virtual engine". Among them, the software interface can generally be understood as: various software development APIs, etc., or it can be understood as an interactive interface between people and software. For example, in one example, the user can see the logos of N engines (i.e., virtual engines) or the entrances of the engines on the interactive interface. These displayed virtual engines are equivalent to the aforementioned "software interfaces", and the data processing capability of a physical engine can be used through these N virtual engines.
[0053] FIG3 is a flow chart of an algorithm model operation processing method according to an embodiment of the present application. FIG3 shows a process of configuring an algorithm model for a virtual engine. As shown in FIG3 , the process includes the following steps:
[0054] Step S302: Obtain at least one algorithm model, wherein the algorithm model is an artificial intelligence algorithm model.
[0055] Step S304: Acquire multiple virtual engines, wherein the virtual engine is an engine virtualized after software encapsulation of a physical engine, and the number of the acquired virtual engines is greater than or equal to the number of the acquired algorithm models.
[0056] Step S306: Bind each algorithm model in the at least one algorithm model and run them on a virtual engine, wherein one virtual engine is used to bind one algorithm model.
[0057] Step S308: receiving a task and executing the task on the virtual engine based on the bound algorithm model.
[0058] Through the above steps, it is possible to implement simultaneous analysis scenarios that require support from multiple algorithm models on edge intelligent devices (which can be edge intelligent devices with a physical engine), thereby enabling multiple algorithm models to run simultaneously on edge intelligent devices, meeting the needs of low-cost, multi-algorithm model fusion analysis.
[0059] The algorithm models in the above steps can be obtained from multiple channels, for example, from the AI open platform. These steps can be run on edge smart devices, which can obtain the algorithm models from the AI open platform. Edge smart devices can also be managed and the algorithm models can be bound to the virtual engine through industry integrated application platforms, web pages, or other clients.
[0060] Figure 4 is a schematic diagram of the overall system architecture according to an embodiment of the present application. As shown in Figure 4, the edge intelligent device can be connected to the industry integrated application platform and log in to the industry integrated application platform (referred to as the platform) through a WEB page to manage the edge intelligent device (referred to as the device). The industry integrated application platform can also obtain the algorithm model (referred to as the model) from the AI open platform, manage the model, and establish a model resource library. The industry integrated application platform can also manage the virtual engine of the edge intelligent device and process the binding relationship between the virtual engine and the model; in order to perform intelligent analysis tasks, the industry integrated application platform can also issue tasks and rules to the edge intelligent device. After performing the task, the edge intelligent device can return the analysis result to the industry integrated application platform. That is, obtain the analysis result obtained after the virtual engine performs the task based on the algorithm model; determine whether it is necessary to alarm the analysis result based on the pre-configured alarm conditions, and if necessary, alarm.
[0061] On the edge intelligent device side, FIG5 is a structural diagram of the edge intelligent device according to an embodiment of the present application. As shown in FIG5, the edge intelligent device interacts with the platform (i.e., the industry integrated application platform) and the network camera (IPC) through the protocol interface, and the intelligent engine subsystem of the edge intelligent device is used to manage the virtual engine. Between the intelligent engine subsystem and the protocol interface, there are multiple modules for management, including: a model package management module for adding, updating and deleting model packages (i.e., algorithm models); an engine management module for binding, updating and unbinding model packages; a task management module for opening and / or closing tasks; a rule management module for configuring rules (the rules are the rules used by each algorithm model, and the algorithm model performs corresponding calculations according to the rules); an IPC access management module for managing the accessed IPC and obtaining the video stream from the IPC; and an intelligent alarm module for uploading alarms.
[0062] Based on Figures 4 and 5, edge intelligent devices can be accessed through the platform (i.e., the industry integrated application platform) and the WEB, and operations such as adding, updating, deleting, binding / unbinding models to engines, and issuing task rules can be performed on edge intelligent devices. The platform adds the algorithm model to the device storage model partition, and when the algorithm model is bound to the virtual engine, it loads the algorithm model into the virtual engine for execution. The platform can issue tasks and rules, notifying the virtual engine to perform corresponding intelligent analysis of the algorithm model. The IPC access management module accesses the front-end IPC and obtains video streams or images in real time and sends them to the intelligent engine subsystem. The intelligent engine subsystem performs intelligent analysis on the results of the virtual engine analysis and reports alarms to the platform.
[0063] On the edge intelligent device side, the intelligent engine subsystem is used to manage the virtual engine. For the algorithm model, in terms of usage configuration, an algorithm model is bound to a physical engine. In this embodiment, the physical engine is encapsulated in software internally and multiple virtual engines are virtualized. This processing method is similar to the multiple logical operation cores of the CPU. Each time the platform makes a request, the edge intelligent device converts the received engine information into a virtual engine unit corresponding to the actual physical engine corresponding to the internal one, and completes the corresponding action. The advantage of this design is that it can be directly and quickly connected to the platform without modifying the external interface logic.
[0064] There are many ways to implement the binding of a virtual engine and an algorithm model. For example, the following binding method is provided in this embodiment: after each algorithm model is loaded on the physical engine, a model handle corresponding to the loaded algorithm model is created; the identification information (abbreviated as ID) of the virtual engine to which the loaded algorithm model is to be bound is obtained; a correspondence between the model handle corresponding to the loaded algorithm model and the identification information is established to bind the loaded algorithm model to the virtual engine corresponding to the identification information.
[0065] This binding method can be understood as supporting the simultaneous loading of multiple algorithm models. Each time an algorithm model is loaded on the physical engine, a model handle is created and associated with the virtual engine ID. In this way, the application layer's algorithm model rule configuration, video streaming, image sending, and other operations for a single virtual engine can be sent to the corresponding algorithm model for analysis through the association between the virtual engine ID and the algorithm model, thereby achieving single physical engine virtualization and mixed operation of multiple algorithm models.
[0066] Through the above binding method, after simulating multiple virtual engines on a single physical engine, multiple algorithm models can be loaded by simulating multiple virtual engines, so that multiple algorithm model functions can all run on a single physical engine.
[0067] Figure 6 is a schematic diagram of the architecture of a single physical engine with multiple algorithms according to an embodiment of the present application. As shown in Figure 6, the architecture mainly includes: an AI function interface (used to configure the algorithm model, bind the algorithm model to the virtual engine, etc.), an intelligent engine subsystem, a function implementation layer, and a virtual conversion layer. The virtual conversion layer exists between the AI function interface, the intelligent engine subsystem, and the function implementation layer of the edge intelligent device. Its purpose is to convert between the physical engine and the virtual engine, as well as the interaction of protocols and data. The intelligent engine subsystem virtualizes four virtual engines for a single physical engine (other numbers of virtual engines can also be virtualized), which can simultaneously load and run different algorithm models for intelligent analysis. After each virtual engine loads the algorithm model, it will create a unique operation handle for the current algorithm model. Subsequent model rule configuration and data interaction are all performed on a single handle, so the algorithm model can be associated with the virtual engine. Before engine virtualization, the edge intelligent device has only one physical engine and can only run one algorithm model at a time. Figure 6 changes the software architecture implementation method without changing the hardware architecture, which can quickly perform single physical engine multi-algorithm model analysis, expand product application scenarios, reduce product prices, and improve product competitiveness.
[0068] In order to facilitate the binding of the virtual engine and the algorithm model, a binding software interface can be provided, in which the binding can be performed by dragging. In this optional method, an operation signal can be obtained, such as receiving an operation signal from a user, wherein the operation signal is used to drag a first object representing the algorithm model from a first display area to a second display area, the first display area displays at least one first object, each first object corresponds to an algorithm model, and the second display area displays at least one second object, each second object corresponds to a virtual engine; in response to the operation signal, when the overlap between the first object and a predetermined second object in the second display area exceeds a threshold, the algorithm model corresponding to the first object is bound to the virtual engine corresponding to the predetermined second object. Figure 7 is a software configuration diagram according to an embodiment of the present application, Figure 7 shows an AI configuration page, through which the algorithm model can be configured on the virtual engine. In Figure 7, the helmet detection model in the model library can be dragged to the virtual engine (or virtual engine unit) 1001, that is, the helmet detection model is bound to the virtual engine 1001, and the pig detection model is dragged to the virtual engine 1002, that is, the pig detection model is bound to the virtual engine 1002. In Figure 7, the engines displayed to the user are all virtual engines. You can bind a single algorithm model to a virtual engine corresponding to the physical engine by dragging and dropping. For example, you can bind the helmet detection model to virtual engine 1001, the pig detection model to virtual engine 1002, the electric vehicle detection model to virtual engine 1003, and the fire passage occupied detection model to virtual engine 1004. In this way, a single physical engine can realize intelligent analysis of multiple algorithm models at the same time.
[0069] In Figure 7, you can also configure the tasks corresponding to each virtual engine. For example, in the analysis mode, you can choose real-time video analysis, polling video analysis, scheduled image analysis, offline image analysis, etc. You can also select the analysis channel, for example, IPCamera01 or IPCamera02. Figure 7 also displays whether the algorithm model on each virtual engine is running normally.
[0070] Figure 8 is a schematic diagram of the internal binding of the virtual engine in the edge intelligent device according to an embodiment of the present application. As shown in Figure 8, after the platform issues the model binding engine protocol, the network management module parses the protocol content and notifies the engine management module to bind the AI model (i.e., algorithm model) and the virtual engine unit (i.e., virtual engine). The engine management module issues an engine loading model instruction to the intelligent engine subsystem to load the algorithm model into the specified idle virtual engine.
[0071] After binding, the algorithm model can also be configured for tasks. For example, in the helmet detection model, its task can be configured as real-time video analysis, and channels for the real-time video analysis can be added. In Figure 7, channel 1 and channel 2 are configured for real-time video analysis.
[0072] FIG9 is a schematic diagram of the task and rule distribution of an edge intelligent device according to an embodiment of the present application. As shown in FIG9 , the platform distributes the task and the parameters required to execute the task (for example, the parameters can be carried in the rules) to the engine. The network management module performs protocol parsing and distributes the task to the task management module and the rule management module. The task management module distributes different tasks to different virtual engine units (i.e., virtual engines), and the rule management module distributes different rules to different virtual engine units. Each virtual engine unit starts the analysis task and performs intelligent analysis of videos and pictures according to different rules. The analysis results are reported to the platform through the intelligent alarm management module. For example, during the helmet detection process, the alarm conditions can be pre-configured: that is, if it is detected that the helmet is not worn, an alarm is issued; after the analysis, if it is found that the helmet is not worn, it is determined that an alarm is required.
[0073] Different algorithm models can be loaded onto different virtual engines, and the various algorithm models can be combined to implement analysis of various scenarios. In other words, a pre-configured predetermined order can be obtained, wherein the predetermined order is used to indicate the order in which the multiple algorithm models run in coordination when multiple algorithm models are run in coordination to perform a task. Based on the predetermined order, the multiple algorithm models are sequentially run on the multiple virtual engines corresponding to the multiple algorithm models to perform the task. In the process of running multiple algorithm models to perform a task, the output of the algorithm model that runs first serves as the input of the algorithm model that runs later.
[0074] For example, when Virtual Engine 1 detects an image of a specified part, it can send the image of the specified part to Virtual Engine 2 for further image comparison to confirm which user it is; or when Virtual Engine 1 detects a user's behavior, it can send the image to Virtual Engine 2 for further image comparison to confirm which user's behavior it is; expanding from simple AI detection, classification, and hybrid model analysis to multiple application scenarios to meet customer needs.
[0075] The configurable tasks shown in Figure 7 include video analysis tasks and image analysis tasks. Video analysis tasks include real-time video analysis tasks and polling video analysis tasks. Image analysis tasks include scheduled image capture analysis tasks and offline image analysis tasks. These tasks are described below.
[0076] Figure 10 is a flow chart of a real-time video analysis task according to an embodiment of the present application. As shown in Figure 10, for a real-time video analysis task issued by the parsing platform, if the virtual engine already has a task being analyzed, the process ends; if the virtual engine does not have a task being analyzed, task-related information (e.g., task ID, associated channels) is saved, and real-time video data of multiple associated channels is issued to the virtual engine. The results of the virtual engine analysis are received and sent to the intelligent alarm management module.
[0077] Figure 11 is a flow chart of the polling video analysis task according to an embodiment of the present application. As shown in Figure 11, the polling video analysis task issued by the analysis platform, if the virtual engine already has a task being analyzed, the process ends; if there is no task being analyzed in the virtual engine, the task-related information (such as task ID, polling interval, associated channel) is saved, and the real-time video data of the associated channel 1 is issued to the virtual engine. The results of the virtual engine analysis are received and sent to the intelligent alarm management module to determine whether the current channel analysis time reaches the polling interval. If the polling interval is reached, the next new channel associated with the task is switched for real-time video analysis.
[0078] Figure 12 is a flow chart of the scheduled screenshot analysis task according to an embodiment of the present application. As shown in Figure 12, for the scheduled screenshot task issued by the analysis platform, if the virtual engine already has a task being analyzed, the process ends. If there is no task being analyzed in the virtual engine, the task-related information (for example, task ID, polling interval, associated channel) is saved, and the screenshot data of the associated channel is issued to the virtual engine. The analysis results of the virtual engine are received and sent to the intelligent alarm management module to determine whether the current channel analysis time reaches the polling interval. If the polling interval is reached, the next new channel associated with the task is switched for image analysis.
[0079] It should be noted that since the virtual engine is virtualized on the physical engine, when executing tasks on multiple virtual engines, the performance of each of the multiple virtual engines can be limited based on the performance of the physical engine, where the performance here is used to indicate the upper limit of the engine's processing power, that is, the performance of the physical engine is used to indicate the upper limit of the physical engine's processing power, and the performance of the virtual engine is used to indicate the upper limit of the virtual engine's processing power, where the sum of the performance of multiple virtual engines during operation does not exceed the performance of the physical engine. For example, for a video analysis task, the performance of the physical engine is to support a maximum of N channels of video analysis, where N is a positive integer, or for an image analysis task, the performance of the physical engine is to analyze a maximum of M images per unit time, where M is a positive integer; under this request, the total number of video analysis channels supported by all virtual engines cannot exceed N channels, and the total number of images analyzed by all virtual engines per unit time cannot exceed M.
[0080] At this time, optionally, when multiple virtual engines are performing video analysis, the total number of video channels opened by the multiple virtual engines is limited to be less than or equal to N; or, when multiple virtual engines are performing image analysis, the total number of images analyzed by the multiple virtual engines per unit time is limited to be less than or equal to M.
[0081] The following example illustrates this. In this example, a single physical engine supports a maximum of four channels of real-time video analysis. Because virtual engines are virtualized from the physical engine, if the total computing resources of a single physical engine are sufficient for four channels of real-time video analysis, running only one virtual engine will also require four channels of computing resources. If running four virtual engines, the total computing resources of the four virtual engines corresponding to the physical engine will also be four channels. The computing resources of the four virtual engines can be dynamically adjusted. For example, if Virtual Engine 1 is bound to Algorithm Model 1 and enables one channel of real-time video analysis, Algorithm Model 2, bound to Virtual Engine 2, can also enable three channels of real-time video analysis. If Virtual Engine 1 enables four channels of real-time video analysis, the other virtual engines cannot enable real-time video analysis because all virtual engines in the single physical engine have already used four channels of computing resources. When all virtual engines in the single physical engine have already used four channels of computing resources, enabling real-time video analysis will result in an "Insufficient Engine Resources" prompt.
[0082] For tasks sent by the platform to each virtual engine, a real-time video analysis task associated with one channel will occupy one channel of real-time video analysis performance; because the polling video analysis task performs real-time video analysis on a single channel according to the associated channels, only one channel of real-time video analysis will be enabled at the same time, so the polling video task will only occupy one channel of real-time video analysis performance no matter how many channels are associated; a single physical engine supports offline image analysis performance of 16 images / second, and it is mutually exclusive with the real-time video analysis performance, that is, if 4 channels of real-time video analysis are enabled, offline image analysis can no longer be performed; the above performance limitations are for a single physical engine, In the new intelligent analysis solution, a single physical engine needs to be encapsulated and virtualized into four virtual engines. The performance limits of each task of a single virtual engine are the same as those of the physical engine, and the total analysis performance of the four virtual engines corresponding to the physical engine is the same as that of a single physical engine. For example, after virtual engine 1 enables 4-channel real-time video analysis, the other three virtual engines can no longer enable real-time video analysis or image analysis. If virtual engine 1 enables 1-channel real-time video analysis, virtual engine 2 enables 2-channel real-time video analysis, and virtual engine 3 can also enable 1-channel real-time video analysis, the total number of real-time video analysis channels enabled by the four virtual engines is 4.
[0083] Another possibility is that different virtual engines perform inconsistent tasks. For example, some virtual engines are used to perform video analysis, while others are used to perform image analysis. In this case, limiting the performance of each of the multiple virtual engines based on the performance of the physical engine also includes: when some of the multiple virtual engines perform video analysis and others perform image analysis, some virtual engines enable N1 video channels, and the maximum number of images analyzed per unit time by the other virtual engines (i.e., the at least one virtual engine used for image analysis) is limited to: equivalent image processing capacity * (N-N1), where N1 is less than N and N1 is greater than 0, and N1 is the number of video channels enabled by the virtual engine performing video analysis. When N1 is 0, all virtual engines are used for image analysis. The equivalent image processing capacity is the number of images that can be analyzed when the ability to process one video channel is used for image analysis. Optionally, the equivalent image processing capacity can be calculated based on M and N. For example, the equivalent image processing capacity can be: M / q*N; for example, M / q*N is rounded up or rounded down; where q is a configured control coefficient and the value range of q is 1-M / N. For example, the value of q can be configured based on experience as long as it is within the range of 1-M / N. If q is 1, the equivalent image processing capacity can be M / N. If q is M / N, the equivalent image processing capacity can be 1. In other words, the equivalent image processing capacity is a value within the range of 1-M / N.
[0084] In another optional method, in order to ensure that the ability of the virtual engine to analyze images does not exceed the limitations of the physical engine's capabilities, the speed of sending images to another part of the virtual engine can also be controlled according to the delay time, so as to limit the maximum number of images analyzed by the other part of the virtual engine per unit time to: equivalent image processing amount * (N-N1), where the delay time is used to indicate the time interval between sending two images, and the delay time is unit time / [equivalent image processing amount * (N-N1)].
[0085] In this optional method, a picture scheduling task (such as an offline picture scheduling task, which will be explained below using the offline picture scheduling task as an example) can be used to control the speed of sending pictures to another part of the virtual engine, and configure the offline picture scheduling task, wherein the offline picture scheduling task is used to send pictures to each virtual engine in at least one virtual engine used for picture analysis in turn; the offline picture scheduling task is controlled to send a picture at a predetermined interval (i.e., delay time) each time, so as to limit the maximum number of pictures analyzed per unit time by at least one virtual engine used for picture analysis to: equivalent picture processing amount * (N-N1), wherein the predetermined time is used to indicate the time interval between sending two pictures, and the predetermined time is: unit time / [equivalent picture processing amount * (N-N1)].
[0086] The following is an example to illustrate. In this example, as long as the physical engine has remaining real-time video analysis performance and idle virtual engines, the virtual engine's offline image task is allowed to be started. For example, for a single physical engine, it is necessary to ensure that virtual engine 1 starts 3-channel real-time video analysis, and the other three virtual engines can also start offline image tasks. Assuming that a single physical engine supports a maximum of 4-channel real-time video analysis or 16 pictures / second analysis performance, the corresponding offline image analysis performance of 1 channel of real-time video analysis can be converted to 4 pictures / second. Therefore, when the 4 virtual engines of a single physical engine have real-time video analysis tasks and offline image analysis tasks started, it is necessary to dynamically adjust the speed at which offline images are sent to the virtual engine to meet the remaining image analysis performance of the physical engine. In practice, the following two situations may be encountered:
[0087] Scenario 1: Three virtual engines perform real-time video analysis, and one virtual engine performs offline image analysis. Virtual engines 1, 2, and 3 each start one channel of real-time video analysis, occupying three channels of real-time video analysis performance. The corresponding physical engine still has one channel of real-time video analysis performance remaining. The image analysis performance is 4 images per second. Therefore, virtual engine 4 can also start the offline image analysis task, and the performance of this image analysis task needs to be limited to 4 images per second.
[0088] Case 2: All four virtual engines perform offline image analysis. Each of the four virtual engines starts an offline image analysis task. This means that the four offline image tasks together occupy 16 images per second of analysis performance.
[0089] For the above two situations, it is necessary to solve the problem of adjusting the speed of sending offline images of the virtual engine to the virtual engine in the case of one offline image task in situation 1, and the problem of sending the offline images of each task to each virtual engine in turn in the case of four offline image tasks in situation 2, as well as the problem of four offline image tasks competing for resources and uneven utilization of image analysis performance of each virtual engine.
[0090] Figure 13 is a flow chart of an offline image analysis task according to an embodiment of the present application, and Figure 14 is a flow chart of an offline image scheduling task according to an embodiment of the present application. As shown in Figures 13 and 14, when multiple offline image tasks are started to jointly occupy the image analysis performance of a single physical engine, it is necessary to add an offline image scheduling task, which can poll and schedule the offline image tasks of each virtual engine to send images to the virtual engine. In addition, when sending offline images, the offline image task dynamically adjusts the delay time uiDelayTime to control the speed of sending images to prevent multiple offline image tasks from sending too many images, resulting in insufficient virtual engine image analysis performance. At the same time, it also prevents the situation where multiple offline image tasks delay waiting and start sending images, and one offline image task keeps grabbing CPU resources to start sending images, while other offline image tasks are always in a waiting state. According to this delayed time slice polling method, the operation is as follows: the scheduling task notifies offline image task 1 to send the picture, and other offline image tasks delay and wait. After offline image task 1 sends the picture, it starts to delay and wait. After the delay, it notifies the offline image scheduling task to poll and schedule the offline image task 2 of the next virtual engine, notifies offline image task 2 to send the picture, and offline image task 2 takes over the sending of the picture. Other offline image tasks delay and wait, and then each task is polled and scheduled in turn.
[0091] The offline image task delay time uiDelayTime is calculated based on the remaining real-time video analysis performance of the single physics engine. The calculation principle is as follows:
[0092] a) iUsedChanNum is the number of real-time video analysis channels occupied by a single physics engine;
[0093] b) iResChanNum = 4 - iUsedChanNum; the number of remaining real-time video analysis channels for a single physics engine;
[0094] c) iResAnalysePicNum = iResChanNum * 4; represents the remaining image analysis performance of a single physics engine (1 channel of real-time video analysis performance corresponds to an image analysis performance of 4 images / s).
[0095] d) uiDelayTime = 1 second / iResAnalysePicNum; This is the delay time (in seconds) for sending images for multiple offline image tasks corresponding to a single physics engine, ensuring the remaining image analysis performance of a single physics engine is iResAnalysePicNum images / s. If the above uiDlelayTime is expressed in seconds, the value may be relatively small. In an optional implementation, microseconds (1 second equals 1,000,000 microseconds) can be used as the unit of uiDelayTime. In this case, uiDelayTime = 1,000,000 (microseconds) / iResAnalysePicNum, which is the delay time (in microseconds) for sending images for multiple offline image tasks corresponding to a single physics engine.
[0096] Through the above embodiment, without changing the hardware architecture, the software architecture implementation method is changed. Through a single-engine multi-algorithm solution, the physical engine is encapsulated and virtualized into multiple virtual engines. This allows for rapid single-physical engine multi-algorithm analysis, expanding product application scenarios, reducing product prices, and improving product competitiveness. In addition, each virtual engine loads a different algorithm model and can perform integrated intelligent analysis on the same video. For example, if virtual engine 1 detects a specified part, it can send the image of the specified part to virtual engine 2 for further image comparison to confirm which user it is. Expanding from simple AI detection, classification, and hybrid model analysis to multiple application scenarios to meet customer needs.
[0097] In the above embodiment, time slice polling and dynamic adjustment of the image sending speed are used to ensure that a single physical engine can start multiple offline image tasks for image analysis to meet the current engine image analysis performance.
[0098] In this embodiment, an edge intelligent device is provided, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to execute the method in the above embodiment.
[0099] The above program can be executed in a processor or stored in a memory (or computer-readable medium), which includes permanent and non-permanent, removable and non-removable media that can implement information storage by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape, disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0100] These computer programs can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram, and corresponding different steps can be implemented through different modules.
[0101] Such a device or system is provided in this embodiment. The device is called an algorithm model operation processing device, and includes: a first acquisition module for acquiring at least one algorithm model, wherein the algorithm model is an artificial intelligence algorithm model; a second acquisition module for acquiring multiple virtual engines, wherein the virtual engine is an engine virtualized after software encapsulation of a physical engine, and the number of virtual engines acquired is greater than or equal to the number of algorithm models acquired; a binding module for binding each algorithm model in the at least one algorithm model to run on a virtual engine, wherein one virtual engine is used to bind one algorithm model; an execution module for receiving a task and executing the task on the virtual engine based on the algorithm model.
[0102] The system or device is used to implement the functions of the method in the above-mentioned embodiment. Each module in the system or device corresponds to each step in the method, which has been explained in the method and will not be repeated here.
[0103] For example, it also includes: an alarm module, which is used to obtain the analysis results obtained after the virtual engine executes the task based on the algorithm model; determine whether it is necessary to alarm the analysis results according to pre-configured alarm conditions, and if necessary, issue an alarm.
[0104] For another example, the execution module is used to obtain a pre-configured predetermined order, wherein the predetermined order is used to indicate the running order of the multiple algorithm models when the multiple algorithm models cooperate to run to perform the task; based on the predetermined order, the multiple algorithm models are run in sequence on the multiple virtual engines corresponding to the multiple algorithm models to perform the task; wherein, in the process of running the multiple algorithm models to perform the task, the output of the algorithm model that runs first serves as the input of the algorithm model that runs later.
[0105] For another example, it also includes: a limitation module, which is used to limit the performance of each of the multiple virtual engines according to the performance of the physical engine when executing tasks on the multiple virtual engines, wherein the performance of the physical engine is used to indicate the upper limit value of the processing capability of the physical engine, and the performance of the virtual engine is used to indicate the upper limit value of the processing capability of the virtual engine, wherein the sum of the performance of the multiple virtual engines during operation does not exceed the performance of the physical engine.
[0106] Optionally, the task includes a video analysis task and / or an image analysis task; wherein, for the video analysis task, the performance of the physical engine is to support a maximum of N-channel video analysis, where N is a positive integer; and for the image analysis task, the performance of the physical engine is to analyze a maximum of M images per unit time, where M is a positive integer.
[0107] Optionally, the limitation module is used to limit the total number of video channels opened by the multiple virtual engines to be less than or equal to N when the multiple virtual engines all perform video analysis; or, limit the total number of pictures analyzed by the multiple virtual engines per unit time to be less than or equal to M when the multiple virtual engines all perform image analysis; or, limit the maximum number of pictures analyzed per unit time by at least one virtual engine used for image analysis to: equivalent image processing amount * (N-N1), where N1 is less than N, N1 is greater than or equal to 0, N1 is the number of video channels opened by the virtual engine performing video analysis, and the equivalent image processing amount is the number of pictures that can be analyzed when the ability to process one video analysis channel is used for image analysis.
[0108] Optionally, the restriction module is used to configure an image scheduling task, wherein the image scheduling task is used to send images to each virtual engine in at least one virtual engine used for image analysis in turn; the image scheduling task is controlled to send one image at a predetermined interval each time, so as to limit the maximum number of images analyzed per unit time by at least one virtual engine used for image analysis to: the equivalent image processing amount * (N-N1), wherein the predetermined time is used to indicate the time interval between sending two images, and the predetermined time is: the unit time / [the equivalent image processing amount * (N-N1)].
[0109] Optionally, the equivalent image processing amount is: M / q*N; where q is a configured control coefficient, and the value range of q is 1-M / N.
[0110] For another example, the binding module is also used to obtain an operation signal, wherein the operation signal is used to drag a first object representing an algorithm model from a first display area to a second display area, the first display area displays at least one first object, each first object corresponds to an algorithm model, and the second display area displays at least one second object, each second object corresponds to a virtual engine; in response to the operation signal, when the degree of overlap between the first object and a predetermined second object in the second display area exceeds a threshold, the algorithm model corresponding to the first object is bound to the virtual engine corresponding to the predetermined second object.
[0111] Optionally, the binding model is used to create a model handle corresponding to the loaded algorithm model after each algorithm model is loaded on the physical engine; obtain the identification information of the virtual engine to which the loaded algorithm model is to be bound; and establish a correspondence between the model handle corresponding to the loaded algorithm model and the identification information to bind the loaded algorithm model to the virtual engine corresponding to the identification information.
[0112] Through the above embodiments, simultaneous analysis scenarios requiring support from multiple algorithm models can be implemented on edge intelligent devices (which can be edge intelligent devices with a physical engine), thereby enabling multiple algorithm models to run simultaneously on edge intelligent devices, meeting the needs of low-cost, multi-algorithm model fusion analysis.
[0113] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. An algorithm model operation processing method, It is characterized in that include: Acquire at least one algorithm model, wherein the algorithm model is an artificial intelligence algorithm model; Acquire multiple virtual engines, wherein the virtual engine is an engine virtualized after software encapsulation of a physical engine, and the number of the acquired virtual engines is greater than or equal to the number of the acquired algorithm models; Binding each algorithm model of the at least one algorithm model to run on a virtual engine, wherein one virtual engine is used to bind one algorithm model; A task is received, and the task is executed on the virtual engine based on the algorithm model.
2. The method according to claim 1, It is characterized in that The performing the task based on the algorithm model on the virtual engine includes: Acquire a preconfigured predetermined order, where the predetermined order is used to indicate the order in which the multiple algorithm models are to be run when the multiple algorithm models are run in coordination to perform the task; Based on the predetermined order, the multiple algorithm models are sequentially run on the multiple virtual engines corresponding to the multiple algorithm models to perform the task; wherein, in the process of running the multiple algorithm models to perform the task, the output of the algorithm model that is run first serves as the input of the algorithm model that is run later.
3. The method according to claim 1, It is characterized in that Also includes: In case of executing tasks on the multiple virtual engines, the performance of each of the multiple virtual engines is limited according to the performance of the physical engine, wherein the performance of the physical engine is used to indicate the upper limit value of the processing capability of the physical engine, and the performance of the virtual engine is used to indicate the upper limit value of the processing capability of the virtual engine, wherein the sum of the performance of the multiple virtual engines during operation does not exceed the performance of the physical engine.
4. The method according to claim 3, It is characterized in that The tasks include video analysis tasks and / or image analysis tasks; wherein, for the video analysis task, the performance of the physical engine is to support a maximum of N-channel video analysis, where N is a positive integer; and for the image analysis task, the performance of the physical engine is to analyze a maximum of M images per unit time, where M is a positive integer.
5. The method according to claim 4, It is characterized in that The limiting the performance of each of the plurality of virtual engines according to the performance of the physical engine comprises: When all of the multiple virtual engines perform video analysis, the sum of the number of video channels opened by the multiple virtual engines is limited to be less than or equal to N; or When the multiple virtual engines all perform image analysis, the sum of the number of images analyzed per unit time by the multiple virtual engines is limited to be less than or equal to M; or The maximum number of images that can be analyzed per unit time by at least one virtual engine used for image analysis is limited to: equivalent image processing capacity*(N-N1), where N1 is less than N, N1 is greater than or equal to 0, N1 is the number of video channels opened by the virtual engine for video analysis, and the equivalent image processing capacity is the number of images that can be analyzed when the ability to process one video channel is used for image analysis.
6. The method according to claim 5, It is characterized in that The maximum number of images analyzed per unit time by at least one virtual engine used for image analysis is limited to: equivalent image processing amount*(N-N1), including: configuring a picture scheduling task, wherein the picture scheduling task is used to sequentially send pictures to each virtual engine of at least one virtual engine used for performing picture analysis; The image scheduling task is controlled to send a picture at a predetermined interval each time, so as to limit the maximum number of pictures analyzed per unit time by at least one virtual engine used for image analysis to: the equivalent image processing amount * (N-N1), and the predetermined time is used to indicate the time interval between sending two pictures, and the predetermined time is: the unit time / [the equivalent image processing amount * (N-N1)].
7. The method according to claim 5 or 6, It is characterized in that The equivalent image processing amount is: M / q*N, q is the configured control coefficient, and the value range of q is 1-M / N.
8. The method according to any one of claims 1 to 6, It is characterized in that After executing the task on the virtual engine based on the algorithm model, the method further includes: Obtaining an analysis result obtained after the virtual engine executes the task based on the algorithm model; Determine whether an alarm needs to be issued for the analysis result according to a pre-configured alarm condition, and issue an alarm if necessary.
9. The method according to any one of claims 1 to 6, It is characterized in that Binding each algorithm model of the at least one algorithm model to run on a virtual engine respectively includes: Acquire an operation signal, wherein the operation signal is used to drag a first object representing an algorithm model from a first display area to a second display area, the first display area displays at least one first object, each of which corresponds to an algorithm model, and the second display area displays at least one second object, each of which corresponds to a virtual engine; In response to the operation signal, when the overlap between the first object and a predetermined second object in the second display area exceeds a threshold, the algorithm model corresponding to the first object is bound to the virtual engine corresponding to the predetermined second object.
10. The method according to any one of claims 1 to 6, It is characterized in that Binding each algorithm model of the at least one algorithm model to run on a virtual engine respectively includes: After each algorithm model is loaded on the physical engine, a model handle corresponding to the loaded algorithm model is created; Obtaining identification information of the virtual engine to which the loaded algorithm model is to be bound; A correspondence between the model handle corresponding to the loaded algorithm model and the identification information is established to bind the loaded algorithm model to the virtual engine corresponding to the identification information.
11. An algorithm model operation processing device, It is characterized in that include: A first acquisition module is used to acquire at least one algorithm model, wherein the algorithm model is an artificial intelligence algorithm model; A second acquisition module is used to acquire multiple virtual engines, wherein the virtual engine is an engine virtualized after software encapsulation of a physical engine, and the number of the acquired virtual engines is greater than or equal to the number of the acquired algorithm models; A binding module, used to run and bind each algorithm model of the at least one algorithm model to a virtual engine, wherein one virtual engine is used to bind one algorithm model; The execution module is used to receive the task and execute the task on the virtual engine based on the algorithm model.
12. The device according to claim 11, It is characterized in that The execution module is used to obtain a pre-configured predetermined order, where the predetermined order is used to indicate the operation order of the multiple algorithm models when the multiple algorithm models cooperate to execute the task; Based on the predetermined order, the multiple algorithm models are sequentially run on the multiple virtual engines corresponding to the multiple algorithm models to perform the task; in the process of running the multiple algorithm models to perform the task, the output of the algorithm model that is run first is used as the input of the algorithm model that is run later; and / or, It also includes: a limiting module, which is used to limit the performance of each of the multiple virtual engines according to the performance of the physical engine when executing tasks on the multiple virtual engines, the performance of the physical engine is used to indicate the upper limit of the processing capacity of the physical engine, the performance of the virtual engine is used to indicate the upper limit of the processing capacity of the virtual engine, and the sum of the performance of the multiple virtual engines during operation does not exceed the performance of the physical engine; and / or, The tasks include video analysis tasks and / or image analysis tasks; wherein, for the video analysis task, the performance of the physical engine is to support a maximum of N-channel video analysis, where N is a positive integer; and for the image analysis task, the performance of the physical engine is to analyze a maximum of M images per unit time, where M is a positive integer; and / or, The limiting module is used to limit the sum of the number of video channels opened by the multiple virtual engines to be less than or equal to N when the multiple virtual engines all perform video analysis; or, when the multiple virtual engines all perform image analysis, limit the sum of the number of images analyzed by the multiple virtual engines per unit time to be less than or equal to M; or, The maximum number of images that can be analyzed by the virtual engine per unit time is limited to: equivalent image processing capacity*(N-N1), N1 is less than N, N1 is greater than or equal to 0, N1 is the number of video channels opened by the virtual engine for video analysis, and the equivalent image processing capacity is the number of images that can be analyzed when the ability to process one video channel is used for image analysis; and / or, The limiting module is used to configure an image scheduling task, wherein the image scheduling task is used to sequentially send images to each virtual engine in at least one virtual engine for performing image analysis; the image scheduling task is controlled to send one image at a predetermined interval each time, so as to limit the maximum number of images analyzed per unit time of at least one virtual engine for performing image analysis to: the equivalent image processing amount * (N-N1), the predetermined time is used to indicate the time interval between sending two images, and the predetermined time is: the unit time / [the equivalent image processing amount * (N-N1)]; and / or, The equivalent image processing amount is: M / q*N, q is a configured control coefficient, and the value range of q is 1-M / N; and / or, It also includes: an alarm module, which is used to obtain the analysis result obtained after the virtual engine executes the task based on the algorithm model; determine whether it is necessary to alarm the analysis result according to the pre-configured alarm condition, and if necessary, issue an alarm; and / or, The binding module is also used to obtain an operation signal, and the operation signal is used to drag a first object representing an algorithm model from a first display area to a second display area, wherein the first display area displays at least one first object, each of which corresponds to an algorithm model, and the second display area displays at least one second object, each of which corresponds to a virtual engine; in response to the operation signal, when the overlap between the first object and a predetermined second object in the second display area exceeds a threshold, the algorithm model corresponding to the first object is bound to the virtual engine corresponding to the predetermined second object; and / or, The binding model is used to create a model handle corresponding to the loaded algorithm model after each algorithm model is loaded on the physical engine; obtain the identification information of the virtual engine to which the loaded algorithm model is to be bound; and establish a corresponding relationship between the model handle corresponding to the loaded algorithm model and the identification information, so as to bind the loaded algorithm model to the virtual engine corresponding to the identification information.
13. An edge intelligent device, It is characterized in that The method comprises a memory and a processor, wherein the memory is used to store a program, the processor is used to run the program, and the program is used to execute the method according to any one of claims 1 to 10.
14. An algorithm model operation processing system, It is characterized in that The algorithm model operation processing system includes an edge intelligent device and an application platform, and a user logs in to the application platform through a WEB page to manage the edge intelligent device; wherein: The application platform is used to obtain at least one algorithm model from the AI open platform, and send the at least one algorithm model to the edge intelligent device, wherein the algorithm model is an artificial intelligence algorithm model; The application platform is used to manage the virtual engine of the edge intelligent device and process the binding relationship between the virtual engine and the algorithm model; wherein the virtual engine is an engine virtualized after software encapsulation of a physical engine, and the number of virtual engines obtained is greater than or equal to the number of algorithm models obtained; the binding relationship between the virtual engine and the algorithm model is: each algorithm model is bound and run on a virtual engine respectively, and one virtual engine is used to bind one algorithm model; The application platform is used to send tasks to the edge intelligent device; The edge intelligent device is used to receive the task issued by the application platform and execute the task based on the algorithm model on the virtual engine.
15. The system according to claim 14, It is characterized in that The edge intelligent device is used to obtain the analysis result obtained by the virtual engine after executing the task based on the algorithm model, and return the analysis result to the application platform. The application platform is used to determine whether it is necessary to issue an alarm for the analysis result according to a pre-configured alarm condition, and to issue an alarm if necessary.
16. The system according to claim 14, It is characterized in that The edge intelligent device includes: Intelligent engine subsystem, used to manage virtual engines; Model package management module, used to add, update and delete algorithm models; Engine management module, used for binding, updating and unbinding of algorithm models; A task management module is used to start and / or close a task; A rule management module, used to configure rules, wherein the rules are rules used by the algorithm model, and according to the rules, the algorithm model performs calculations matching the rules; IPC access management module, used to manage the accessed IPC and obtain the video stream from the IPC; Intelligent alarm module, used for uploading alarms.
17. The system according to claim 14, It is characterized in that When the edge intelligent device performs the task based on the algorithm model on the virtual engine, it is specifically used to: Acquire a preconfigured predetermined order, where the predetermined order is used to indicate the order in which the multiple algorithm models are to be run when the multiple algorithm models are run in coordination to perform the task; Based on the predetermined order, sequentially running the multiple algorithm models on the multiple virtual engines corresponding to the multiple algorithm models to perform the task; In the process of running the multiple algorithm models to perform the task, the output of the algorithm model that runs previously serves as the input of the algorithm model that runs later.
18. The system according to claim 14, It is characterized in that The edge intelligent device is further used to limit the performance of each of the multiple virtual engines according to the performance of the physical engine when executing tasks on the multiple virtual engines, the performance of the physical engine is used to indicate the upper limit value of the processing capability of the physical engine, the performance of the virtual engine is used to indicate the upper limit value of the processing capability of the virtual engine, and the sum of the performance of the multiple virtual engines during operation does not exceed the performance of the physical engine; The tasks include video analysis tasks and / or image analysis tasks. For video analysis tasks, the performance of the physical engine is to support N-channel video analysis at most, where N is a positive integer. For image analysis tasks, the performance of the physical engine is to analyze M images at most per unit time, where M is a positive integer. Among them, when the edge intelligent device limits the performance of each of the multiple virtual engines according to the performance of the physical engine, it is specifically used to: when the multiple virtual engines all perform video analysis, limit the total number of video channels opened by the multiple virtual engines to be less than or equal to N; or, when the multiple virtual engines all perform image analysis, limit the total number of images analyzed by the multiple virtual engines per unit time to be less than or equal to M; or, limit the maximum number of images analyzed per unit time by at least one virtual engine used for image analysis to: equivalent image processing amount * (N-N1), N1 is less than N, N1 is greater than or equal to 0, N1 is the number of video channels opened by the virtual engine performing video analysis, and the equivalent image processing amount is the number of images that can be analyzed when the ability to process one video analysis is used for image analysis.
19. The system according to claim 14, It is characterized in that The edge intelligent device is also used for: Obtain an operation signal, wherein the operation signal is used to drag a first object representing an algorithm model from a first display area to a second display area, wherein the first display area displays at least one first object, each of which corresponds to an algorithm model, and the second display area displays at least one second object, each of which corresponds to a virtual engine; in response to the operation signal, when the degree of overlap between the first object and a predetermined second object in the second display area exceeds a threshold, bind the algorithm model corresponding to the first object to the virtual engine corresponding to the predetermined second object; or, after each algorithm model is loaded on the physical engine, create a model handle corresponding to the loaded algorithm model; obtain identification information of the virtual engine to which the loaded algorithm model is to be bound; establish a correspondence between the model handle corresponding to the loaded algorithm model and the identification information, so as to bind the loaded algorithm model to the virtual engine corresponding to the identification information.
