Integration Method, Device, Computer Equipment, Readable Storage Medium and Program Product of Computer Vision Algorithm

By generating container task details, allocating resources and registering algorithm services, computer vision algorithms are automatically integrated, and the algorithm integration flexibility problem of smart monitoring platform is solved, plug-and-play and improve ductility.

CN118606006BActive Publication Date: 2025-08-05BEIJING PACTERA JINXIN TECH LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410865940.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2025-08-05
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

The algorithm integration flexibility of the smart monitoring platform is poor, resulting in insufficient ductility, and R&D personnel need to manually develop new computer vision algorithms to adapt.

Method used

By obtaining the algorithm files and parameter configuration files of the target computer vision algorithm, generating container task details, asynchronously allocating resources, downloading basic images and starting containers, registering algorithm services, and realizing plug-and-play algorithms.

Benefits of technology

The algorithm integration process is simplified, labor and time costs are reduced, the flexibility and efficiency of algorithm integration are improved, and the ductility of the smart monitoring platform is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606006B_ABST
    Figure CN118606006B_ABST
Patent Text Reader

Abstract

The present application relates to an integration method, apparatus, computer equipment, computer-readable storage medium, and computer program product for a computer vision algorithm. The method includes: obtaining an algorithm file and a parameter configuration file of a target computer vision algorithm service; generating at least one container task detail according to the container parameters and algorithm parameters in the parameter configuration file and storing it in a container task detail table; obtaining a target container task detail from the container task detail table by asynchronously starting a task, allocating target resources to the target container task detail, downloading a base image of a target computer vision algorithm service from an image repository to a target server, creating and starting a target container based on the target resources, downloading the algorithm file to the base image, running an inference script in the base image to start the target computer vision algorithm service, and registering the target computer vision algorithm in a registration center. The use of this method can improve the scalability of the intelligent monitoring platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for integrating computer vision algorithms. Background Art

[0002] With the rapid development of deep learning technology, the application of computer vision algorithms in smart surveillance has become a trend. Building on existing camera management capabilities, the smart surveillance platform integrates various computer vision algorithms to enable real-time analysis of surveillance video in various scenarios, including smart parks, petrochemicals, and safe production. It also generates real-time alarms based on anomalies detected by analysis. The smart surveillance platform connects to cameras via the network and integrates computer vision algorithms used in real-world scenarios. The system periodically extracts video frames from the cameras, feeds them into the integrated computer vision algorithms for analysis, and generates alarms.

[0003] In related technologies, because different algorithms require different input and output parameters, and because of the wide variety of algorithm frameworks and dependent environments, R&D personnel often pre-develop and adapt computer vision algorithms within smart monitoring platforms. They also rationally allocate GPU (graphics processing unit) resources to these algorithms to integrate them into the smart monitoring platform. This means that integrating new computer vision algorithms into smart monitoring platforms requires the involvement of R&D personnel to develop and adapt the new algorithms within the smart monitoring platform.

[0004] It can be seen that the algorithm integration method of the smart monitoring platform in the relevant technology has poor flexibility, which leads to poor scalability of the smart monitoring platform. Summary of the Invention

[0005] Based on this, it is necessary to provide a computer vision algorithm integration method, device, computer equipment, computer-readable storage medium and computer program product that can improve the algorithm integration flexibility of the smart monitoring platform and improve the scalability of the smart monitoring platform to address the above technical problems.

[0006] In a first aspect, the present application provides a method for integrating computer vision algorithms, the method comprising:

[0007] Obtain an algorithm file and a parameter configuration file of a target computer vision algorithm service, wherein the algorithm file includes an inference script and a target computer vision algorithm;

[0008] In response to an activation operation for the target computer vision algorithm service, generating at least one container task detail according to the container parameters and algorithm parameters in the parameter configuration file, and storing the at least one container task detail in a container task detail table;

[0009] Acquire target container task details from the container task detail table by asynchronously starting a task, and allocate target resources to the target container task details;

[0010] Download the base image of the target computer vision algorithm service from the image repository to the target server, create and start the target container based on the target resources, and download the algorithm file to the base image;

[0011] The inference script is run in the base image to start the target computer vision algorithm service and register the target computer vision algorithm in a registration center.

[0012] In one embodiment, obtaining the algorithm file and parameter configuration file of the target computer vision algorithm service includes:

[0013] Get the data compression package of the target computer vision algorithm service;

[0014] Decompressing the data compression package to obtain the algorithm file and parameter configuration file of the target computer vision algorithm service;

[0015] Generate a container parameter configuration table based on the container parameters in the parameter configuration file, and generate an algorithm parameter configuration table based on the algorithm parameters in the parameter configuration file;

[0016] The algorithm file is uploaded to the target server, and the download address of the algorithm file is recorded in the algorithm parameter configuration table.

[0017] In one embodiment, generating at least one container task detail according to the container parameters and algorithm parameters in the parameter configuration file includes:

[0018] According to the download address of the algorithm file in the algorithm parameter configuration table, and the container configuration information and instance number N recorded in the container parameter configuration table, N container task details are generated. The container task details include task status, container status, the container configuration information, and the download address of the algorithm file.

[0019] In one embodiment, allocating target resources to the target container task details includes:

[0020] Collecting statistics on the resource information of each server and obtaining candidate servers that meet the resource screening conditions from each server;

[0021] A target GPU whose GPU memory availability satisfies a GPU memory screening condition is determined from the GPUs of the candidate servers, and the target GPU is used as a target resource for starting the target computer vision algorithm container.

[0022] In one embodiment, registering the target computer vision algorithm in a registration center includes:

[0023] Register the IP address and port information of the target computer vision algorithm in the registration center.

[0024] In one embodiment, the method further comprises:

[0025] Receiving a service request for scheduling the target computer vision algorithm service, the service request including target request parameters, the target request parameters being configured based on the algorithm request parameters in the algorithm parameter configuration table;

[0026] According to the service identifier of the target computer vision algorithm service, the IP address and port information of the target computer vision algorithm are obtained from the registration center, and the target computer vision algorithm service is called through the IP address and port information to process the target request parameters, and the processing result is obtained and fed back.

[0027] In one embodiment, the task status includes: pending execution status, entering running status, pending completion status, and completion status, and the method further includes:

[0028] After the container task details are generated, the task status of the container task details is recorded in the container task details table as a pending state;

[0029] The asynchronous task obtains a target container task detail in a pending state from the container task detail table, and after starting a target container according to the target container task detail, changes the task state of the container task detail in the container task detail table to an entering running state;

[0030] In response to a deactivation operation on the target computer vision algorithm service, changing the task status of the container task details in the container task list that are in a pending state and in a running state to a pending state;

[0031] By asynchronously deactivating the task, the container task corresponding to the container task detail whose task status is to be ended in the container task detail table is ended, and the task status of the container task detail in the container task detail table is changed to ended.

[0032] In one embodiment, the parameter configuration file includes algorithm service configuration parameters and algorithm service container operating parameters; wherein, the algorithm service configuration parameters include the algorithm identifier of the target computer vision algorithm, the service identifier of the target computer vision algorithm service, and algorithm request parameters; the algorithm service container operating parameters include resource constraints, number of instances, image identifier, and path mapping parameters when the target container of the target computer vision algorithm is started.

[0033] In a second aspect, the present application further provides an integrated device for a computer vision algorithm, the device comprising:

[0034] An acquisition module is used to obtain an algorithm file and a parameter configuration file of a target computer vision algorithm service, wherein the algorithm file includes an inference script and a target computer vision algorithm;

[0035] a generating module configured to generate, in response to an activation operation for the target computer vision algorithm service, at least one container task detail according to the container parameters and the algorithm parameters in the parameter configuration file, and store the at least one container task detail in a container task detail table;

[0036] A resource allocation module is used to obtain target container task details from the container task detail table by asynchronously starting a task, and allocate target resources to the target container task details;

[0037] A download module is used to download the base image of the target computer vision algorithm service from the image repository to the target server, create and start the target container based on the target resource, and download the algorithm file to the base image;

[0038] A registration module is used to run the inference script in the basic image to start the target computer vision algorithm service and register the target computer vision algorithm in a registration center.

[0039] In one embodiment, the acquisition module is further configured to:

[0040] Get the data compression package of the target computer vision algorithm service;

[0041] Decompressing the data compression package to obtain the algorithm file and parameter configuration file of the target computer vision algorithm service;

[0042] Generate a container parameter configuration table based on the container parameters in the parameter configuration file, and generate an algorithm parameter configuration table based on the algorithm parameters in the parameter configuration file;

[0043] The algorithm file is uploaded to the target server, and the download address of the algorithm file is recorded in the algorithm parameter configuration table.

[0044] In one embodiment, the generating module is further configured to:

[0045] According to the download address of the algorithm file in the algorithm parameter configuration table, and the container configuration information and instance number N recorded in the container parameter configuration table, N container task details are generated. The container task details include task status, container status, the container configuration information, and the download address of the algorithm file.

[0046] In one embodiment, the resource allocation module is further configured to:

[0047] Collecting statistics on the resource information of each server and obtaining candidate servers that meet the resource screening conditions from each server;

[0048] A target GPU whose GPU memory availability satisfies a GPU memory screening condition is determined from the GPUs of the candidate servers, and the target GPU is used as a target resource for starting the target computer vision algorithm container.

[0049] In one embodiment, the registration module is further configured to:

[0050] Register the IP address and port information of the target computer vision algorithm in the registration center.

[0051] In one embodiment, the apparatus further comprises:

[0052] The receiving module is further configured to receive a service request for scheduling the target computer vision algorithm service, wherein the service request includes target request parameters, and the target request parameters are configured based on the algorithm request parameters in the algorithm parameter configuration table;

[0053] The scheduling module is used to obtain the IP address and port information of the target computer vision algorithm from the registration center according to the service identifier of the target computer vision algorithm service, call the target computer vision algorithm service through the IP address and port information to process the target request parameters, and obtain and feedback the processing results.

[0054] In one embodiment, the task status includes: a waiting state, a running state, a waiting state, and a finished state. The device further includes: a task status management module, the task status management module being configured to:

[0055] After the container task details are generated, the task status of the container task details is recorded in the container task details table as a pending state;

[0056] The asynchronous task obtains a target container task detail in a pending state from the container task detail table, and after starting a target container according to the target container task detail, changes the task state of the container task detail in the container task detail table to an entering running state;

[0057] In response to a deactivation operation on the target computer vision algorithm service, changing the task status of the container task details in the container task list that are in a pending state and in a running state to a pending state;

[0058] By asynchronously deactivating the task, the container task corresponding to the container task detail whose task status is to be ended in the container task detail table is ended, and the task status of the container task detail in the container task detail table is changed to ended.

[0059] In one embodiment, the parameter configuration file includes algorithm service configuration parameters and algorithm service container operating parameters; wherein, the algorithm service configuration parameters include the algorithm identifier of the target computer vision algorithm, the service identifier of the target computer vision algorithm service, and algorithm request parameters; the algorithm service container operating parameters include resource constraints, number of instances, image identifier, and path mapping parameters when the target container of the target computer vision algorithm is started.

[0060] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any one of the above methods when executing the computer program.

[0061] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements any of the above methods when executed by a processor.

[0062] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which implements any of the above methods when executed by a processor.

[0063] The above-mentioned computer vision algorithm integration method, apparatus, computer device, computer-readable storage medium, and computer program product obtain the algorithm file and parameter configuration file of the target computer vision algorithm service, then, in response to an activation operation for the target computer vision algorithm service, generate at least one container task detail based on the container parameters and algorithm parameters in the parameter configuration file, and store the at least one container task detail in a container task detail table. The target container task detail is obtained from the container task detail table by asynchronously starting a task, and target resources are allocated to the target container task detail. The base image of the target computer vision algorithm service is downloaded from the image repository to the target server. The target container is created and started based on the target resources. The algorithm file is downloaded to the base image, and the inference script is run in the base image to start the target computer vision algorithm service. The target computer vision algorithm is then registered with a registration center for subsequent callers to call. That is, by adopting the computer vision algorithm integration method, apparatus, computer equipment, computer-readable storage medium and computer program product provided by the embodiments of the present disclosure, the target computer vision algorithm can be automatically integrated into the smart monitoring platform by uploading the algorithm file and parameter configuration file of the target computer vision algorithm service to the smart monitoring platform. There is no need for R&D personnel to manually develop and adapt the new computer vision algorithm on the smart monitoring platform, which simplifies the algorithm integration process of the smart monitoring platform, reduces the labor cost and time cost of the algorithm integration process, and increases the flexibility and efficiency of algorithm integration, thereby greatly improving the scalability of the smart monitoring platform.

[0064] Furthermore, the computer vision algorithm integration method provided in this case enables plug-and-play implementation of the algorithm through the one-click import of compressed files containing the algorithm and parameter configuration files, reducing the complexity of integrating the algorithm into the smart monitoring platform. At least one container task detail is generated from the parameter configuration file, and container creation is controlled by the container task detail. Since each algorithm instance corresponds to a table record of a container task detail, independent control can be achieved at the algorithm instance level. Furthermore, multiple instances of the same algorithm can be started and stopped independently, greatly improving the flexibility of algorithm startup and shutdown. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0066] Figure 1 Schematic diagram of the architecture of a smart monitoring platform in one embodiment;

[0067] Figure 2 1 is a flow chart of a method for integrating computer vision algorithms in one embodiment;

[0068] Figure 3 is a schematic diagram of an integration method of computer vision algorithms in one embodiment;

[0069] Figure 4 1 is a flow chart of step 202 in a method for integrating computer vision algorithms in one embodiment;

[0070] Figure 5 1 is a flow chart of step 206 in a method for integrating computer vision algorithms in one embodiment;

[0071] Figure 6 is a schematic diagram of an integration method of computer vision algorithms in one embodiment;

[0072] Figure 7 is a schematic diagram of an integration method of computer vision algorithms in one embodiment;

[0073] Figure 8 1 is a flow chart of a method for integrating computer vision algorithms in one embodiment;

[0074] Figure 9 1 is a schematic diagram of the transition of task states in an integrated method of computer vision algorithms in one embodiment;

[0075] Figure 10 is a schematic diagram of an integration method of computer vision algorithms in one embodiment;

[0076] Figure 11 is a schematic diagram of an integration method of computer vision algorithms in one embodiment;

[0077] Figure 12 is a schematic diagram of an integration method of computer vision algorithms in one embodiment;

[0078] Figure 13 is a structural block diagram of an integrated device for a computer vision algorithm in one embodiment;

[0079] Figure 14 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0080] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0081] The computer vision algorithm integration method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Figure 1 As shown, in the architecture of the smart monitoring platform in the embodiment of the present application, the system layer relies on Docker containers to shield operating system differences. Algorithm services and application services register themselves with a registration center. The application layer routes to the algorithm services of the next layer through the registration center's load balancing. The application services include algorithm management services and container management services. The algorithm management service manages the configuration of integrated algorithms, and the container management service manages the startup and shutdown of algorithm containers. External and internal systems obtain inference services through the application layer. The smart monitoring platform can be implemented through terminals or servers. Terminals can include, but are not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart car devices, projectors, etc. Portable wearable devices can include smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices can include virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.

[0082] In an exemplary embodiment, Figure 2 As shown, a method for integrating computer vision algorithms is provided, which is described by taking the method applied to a server as an example, and includes the following steps 202 to 210. Among them:

[0083] Step 202 : Obtain an algorithm file and a parameter configuration file of a target computer vision algorithm service. The algorithm file includes an inference script and a target computer vision algorithm.

[0084] In the disclosed embodiments, for the target computer vision algorithm, the operating environment of the target computer vision algorithm can be pre-built as a universal base image. For example, the environment and dependencies in which the inference framework of the target computer vision algorithm runs can be packaged into a Docker image (base image) and uploaded to the image repository. Among them, algorithms with different architectures can be packaged with different base images. If the base image required by the inference framework of the target computer vision algorithm already exists in the image repository, the base image can be directly used without repeatedly building the base image.

[0085] In this way, when algorithms of different architectures need to be run, the running conditions can be met by replacing the basic image of the corresponding framework. The basic image is relatively lightweight, and loading and replacement are relatively simple and convenient, which can improve the integration speed of the algorithm.

[0086] In the embodiment of the present disclosure, the target computer vision algorithm and reasoning script can be encapsulated into the algorithm file of the target computer vision algorithm service, and the target computer vision algorithm service can be managed using the Web server gateway interface. Figure 3 As shown in the figure, a PyTorch inference script is written in Python, and the inference script is run to call the target computer vision algorithm for inference. With the help of Flask, the target computer vision algorithm and the inference script are encapsulated as a target computer vision algorithm service. This can solve the problem of inconsistent languages between the caller and the algorithm service when providing the corresponding algorithm service to the outside world.

[0087] For example, taking the commonly used web server gateway interface Gunicorn as an example, Gunicorn sets the number of threads for the algorithm service to 3 and the number of processes to 1, which can greatly improve the algorithm reasoning performance and reduce the problem of excessive CPU (Central Processing Unit) usage of the algorithm service due to a large number of requests.

[0088] Taking the PyTorch-based algorithm as an example, the PyTorch-trained computer vision algorithm model file, the invoked inference script, the Flask service script, the Gunicorn control script, and other complete execution script files are placed in a unified folder to obtain the algorithm file. This lays the foundation for direct execution after downloading the algorithm file from the base image. In the disclosed embodiment, the differentiation between algorithms is resolved by the algorithm itself, and only a standardized HTTP (Hypertext Transfer Protocol) inference interface is provided externally.

[0089] In the embodiment of the present disclosure, the base image has a built-in run.sh script (startup script), and run.sh is used as the startup command when the base image is running. It is used to receive the algorithm file download address and algorithm startup command parameters, and download the algorithm file through the received algorithm file download address. After the algorithm file is downloaded, the algorithm service is started according to the startup command parameters, which can solve the problem of dynamically running different algorithms according to the received parameters in the same type of base image.

[0090] In the embodiment of the present disclosure, the algorithm service configuration parameters and the algorithm service container operation parameters of the target computer vision algorithm service can be pre-written to obtain a parameter configuration file.

[0091] In an exemplary embodiment, the parameter configuration file includes algorithm service configuration parameters and algorithm service container operating parameters; wherein, the algorithm service configuration parameters include the algorithm identifier of the target computer vision algorithm, the service identifier of the target computer vision algorithm service, and the algorithm request parameters; the algorithm service container operating parameters include the resource constraints, number of instances, image identifier, and path mapping parameters when the target container of the target computer vision algorithm is started.

[0092] The parameter configuration file compiled by the present invention, the algorithm service configuration parameters play the role of configuring the algorithm, and the algorithm service container operation parameters play the role of configuring the conditions and number of algorithm operation containers. Among them, the resource constraints when the target container is started can include CPU, memory, GPU memory, GPU utilization, number of instances, image name, and path mapping parameters, among which CPU, memory, GPU memory, and GPU utilization parameters; the number of instances is used to configure the number of instances to start this algorithm service, dynamically matching the number of instances required by the algorithm service; the image identifier specifies the basic image of the operating environment when the algorithm service is started; the path mapping configuration is used to configure the mapping between the host machine and the container.

[0093] The algorithm identifier and service identifier constitute the algorithm service identifier of the target computer vision algorithm service; the algorithm request parameters configure the necessary parameters for requesting the algorithm service interface, which are used to dynamically control the algorithm threshold. Among them, the algorithm request parameters can be used to standardize the input and output parameters of the inference interface of the target computer vision algorithm service, so as to provide corresponding algorithm services to the smart monitoring platform through the HTTP inference interface.

[0094] Algorithm request parameters standardize the input and output parameters of the HTTP inference interface. For example, input parameters include the algorithm threshold, image download address, image converted to base64 string, detection area coordinates, and exclusion area coordinates. Standard output parameters include request success, response status code, response message, detected target coordinates, and inference alarm content. The standardized input and output of the algorithm interface parameters facilitate unified processing logic for algorithm service callers, addressing the differences in how different algorithms access the smart monitoring platform. By establishing algorithm input standards, output standards, and service method requirements, compatible access to any algorithm can be achieved, greatly improving the scalability of the smart monitoring platform.

[0095] Finally, the algorithm file and parameter configuration file are compressed together into a data compression package, and the data compression package is imported into the smart monitoring platform.

[0096] In an exemplary embodiment, referring to Figure 4 As shown, the above step 202 can be implemented through steps 402 to 408, wherein:

[0097] Step 402: Obtain a data compression package of the target computer vision algorithm service;

[0098] Step 404: decompress the data compressed package to obtain the algorithm file and parameter configuration file of the target computer vision algorithm service;

[0099] Step 406: Generate a container parameter configuration table based on the container parameters in the parameter configuration file, and generate an algorithm parameter configuration table based on the algorithm parameters in the parameter configuration file;

[0100] Step 408: Upload the algorithm file to the target server, and record the download address of the algorithm file in the algorithm parameter configuration table.

[0101] In the disclosed embodiment, using the commonly used zip compression method as an example, the algorithm file and parameter configuration file of the target computer vision algorithm service are placed in the same folder. This folder is then compressed into a zip file to reduce the file size and speed up the import process. The packaged zip file is imported into the algorithm import module of the smart monitoring platform, and the parameter configuration file and algorithm file are decompressed internally by the smart monitoring platform.

[0102] The decompressed parameter configuration file is further parsed to obtain the algorithm service configuration parameters (algorithm file for short) and the algorithm service container operation parameters (container parameters), the algorithm parameters are stored in the algorithm parameter configuration table, the container configuration interface of the container management service is called, and the container parameters are stored in the container parameter configuration table. In the embodiment of the present disclosure, the algorithm parameter configuration table and the container parameter configuration table are obtained by parsing the JSON parameter file after one-click import, without the need for manual configuration, which simplifies the operation when configuring the algorithm. The decompressed algorithm file can be uploaded to the target server for storage, and the download address of the algorithm file can be written into the algorithm parameter configuration table, laying the foundation for downloading and running the algorithm file when the subsequent container is started.

[0103] In the embodiment of the present disclosure, by one-click importing of compressed files of algorithm files and parameter configuration files, plug-and-play of the algorithm is achieved, reducing the complexity of the integrated algorithm of the smart monitoring platform.

[0104] Step 204 , in response to the activation operation for the target computer vision algorithm service, generates at least one container task detail according to the container parameters and algorithm parameters in the parameter configuration file, and stores the at least one container task detail in the container task detail table.

[0105] In the embodiment of the present disclosure, after the target computer vision algorithm is imported into the intelligent monitoring platform, the corresponding target computer vision algorithm service can be displayed in the algorithm service list displayed in the display interface of the algorithm management center. The user can trigger the enable button after selecting the target computer vision algorithm service in the display interface. After receiving the user's enable operation for the target computer vision algorithm service, a plurality of container task details to be executed can be generated in response to the enable operation according to the container parameters and algorithm parameters of the target computer vision algorithm service, and stored in the container task details table, wherein the container task details are used to describe how to configure and start the container for the algorithm service, that is, to guide the startup and creation of subsequent containers.

[0106] In an exemplary embodiment, the above step 204 may include the following steps:

[0107] According to the download address of the algorithm file in the algorithm parameter configuration table, and the container configuration information and instance number N recorded in the container parameter configuration table, N container task details are generated. The container task details include the task status, container status, the container configuration information, and the download address of the algorithm file.

[0108] In the embodiment of the present disclosure, in response to the user's activation operation for the target computer vision algorithm in the algorithm management center, the container management service's create container task details interface is called, and based on the container configuration information, the number of instances N, and the download address of the algorithm file in the algorithm parameter configuration table recorded in the container parameter configuration table, the container startup parameter field is encapsulated, and N container task details are generated and recorded in the container task details table. Each algorithm instance corresponds to a record in the container task details table, and each record contains the task status, container status, container configuration information, and the download address of the algorithm file. By having one algorithm instance correspond to one table record, independent control at the algorithm instance level is achieved, and the start and stop of multiple instances of the same algorithm can be independent of each other.

[0109] Step 206: Obtain target container task details from the container task details table by asynchronously starting the task, and allocate target resources to the target container task details;

[0110] Step 208: Download the base image of the target computer vision algorithm service from the image repository to the target server, create and start the target container based on the target resources, and download the algorithm file to the base image;

[0111] Step 210: Run the inference script in the base image to start the target computer vision algorithm service and register the target computer vision algorithm in the registration center.

[0112] In the disclosed embodiment, the asynchronous start task obtains the target container task details to be started from the container task details table, and then calls the routing selector interface to allocate target resources for the target container task details.

[0113] In an exemplary embodiment, referring to Figure 5 As shown, in step 206, allocating target resources to the target container task details may include steps 502 to 504.

[0114] Step 502: Count the resource information of each server and obtain candidate servers that meet the resource screening conditions from each server;

[0115] Step 504 : Determine a target GPU whose GPU memory availability satisfies the GPU memory screening condition from the GPUs of the candidate servers, and use the target GPU as the target resource for starting the target computer vision algorithm container.

[0116] For example, if Figure 6 As shown, server resource information is counted, including statistics on multiple dimensions of resources such as GPU, CPU, and memory. Servers are sorted based on their remaining resources, and the server with the least resources is selected as a candidate server. For example, the resource information is counted by executing Linux commands. CPU information is obtained using the command iostat -c -o JSON 1 3, memory information is obtained using free -m |grep 'memory' | awk '{print $2"|"$3"|"$7}', and GPU information is obtained using nvidia-smi -q -x.

[0117] In an example, the resource filtering conditions can be set as follows: CPU usage < 80%, free memory > container memory requirement parameter M, free GPU memory > container memory requirement parameter K, GPU idle rate > GPU usage parameter L, etc. Servers that meet the resource filtering conditions are selected as candidate servers, and a list of graphics cards on all candidate servers that meet the conditions is summarized. The GPU memory is sorted in reverse order, and the GPU with the largest free GPU memory is selected as the target GPU. The target GPU is then used as the target resource for starting the target computer vision algorithm container.

[0118] In the disclosed embodiment, GPU resource screening is performed in combination with container parameter requirements. Through an automatic routing selection strategy, it is possible to solve the problem that video memory allocation requires human participation when the algorithm service is started. This can greatly improve the integration efficiency of the algorithm and the scalability of the smart monitoring platform.

[0119] In an exemplary embodiment, referring to Figure 7As shown in the figure, after determining the target resources, you can set up the corresponding container instance based on the algorithm parameter configuration table and the container parameter configuration table. For example, call the Docker API to create a container startup instance, set the base image identifier used by the algorithm, add CPU and memory usage limits, configure port mapping parameters and path mapping parameters, and set the transfer parameters required by the run.sh script built into the base image, including the IP address of the registration center, the IP address and port information for accessing the target computer vision algorithm service, the GPU number used by the target computer vision algorithm service, and the download address of the target computer vision algorithm and inference script.

[0120] The Docker API is called to download the base image from the image repository based on the base image identifier into the locally created Docker environment. The container startup command run.sh is then called to start the target container. In the disclosed embodiment, Docker shields the underlying differences in operating systems, allowing the same base image to run on Windows, Linux, and Mac.

[0121] After the target container is started, you can execute the run.sh internal commands in sequence to download the algorithm file to the base image based on the download address of the algorithm file. Use the target resource specified by the GPU number to run the downloaded algorithm file and start the target computer vision algorithm service.

[0122] The embodiment of the present disclosure can control the start and stop of algorithm containers based on the Docker API. Because computing servers are usually composed of several clusters, the target resources selected by the routing selector will appear on different servers. Through the Docker API, the algorithm container can be remotely started and stopped on the target server, solving the problem of starting and stopping algorithm containers across servers.

[0123] In an exemplary embodiment, in step 210, registering the target computer vision algorithm with the registration center may include:

[0124] Register the IP address and port information of the target computer vision algorithm in the registration center.

[0125] In the embodiment of the present disclosure, after the target computer vision algorithm service is started, the algorithm itself will be registered to the registration center according to the parameters of the registration center passed by the run.sh script to complete the container startup. By registering the algorithm service with the help of the registration center, load balancing between multiple instances of the same algorithm service can be achieved. When it is necessary to increase the inference throughput of the algorithm service, rapid capacity expansion can be achieved by increasing the number of corresponding algorithm instances. For example, when the number of examples is 3, the target computer vision algorithm can be registered 3 times in the registration center for the same algorithm service. The 3 registrations correspond to the service identifier of the same target computer vision algorithm service, and correspond to different algorithm IP addresses and port information. In the subsequent process of calling the target computer vision algorithm service, load balancing between different instances of the same target computer vision algorithm service can be achieved through different algorithm IP addresses and port information.

[0126] The above-mentioned computer vision algorithm integration method obtains the algorithm file and parameter configuration file of the target computer vision algorithm service, then generates at least one container task detail based on the container parameters and algorithm parameters in the parameter configuration file in response to an activation operation for the target computer vision algorithm service, and stores the at least one container task detail in a container task detail table. The method asynchronously starts a task to obtain the target container task detail from the container task detail table, allocates target resources to the target container task detail, downloads the base image of the target computer vision algorithm service from the image repository to the target server, creates and starts the target container based on the target resources, downloads the algorithm file to the base image, runs the inference script in the base image to start the target computer vision algorithm service, and registers the target computer vision algorithm with a registration center for subsequent callers. By adopting the computer vision algorithm integration method provided by the embodiment of the present disclosure, the target computer vision algorithm can be automatically integrated into the smart monitoring platform by uploading the algorithm file and parameter configuration file of the target computer vision algorithm service to the smart monitoring platform. There is no need for R&D personnel to manually develop and adapt the new computer vision algorithm on the smart monitoring platform, which simplifies the process of integrating algorithms on the smart monitoring platform, reduces the labor cost and time cost of the algorithm integration process, and increases the flexibility and efficiency of algorithm integration, thereby greatly improving the scalability of the smart monitoring platform.

[0127] In an exemplary embodiment, referring to Figure 8 As shown, the above method may further include:

[0128] Step 802: Receive a service request for scheduling a target computer vision algorithm service, where the service request includes target request parameters, which are configured based on algorithm request parameters in an algorithm parameter configuration table.

[0129] Step 804: According to the service identifier of the target computer vision algorithm service, the IP address and port information of the target computer vision algorithm are obtained from the registration center, and the target computer vision algorithm service is called through the IP address and port information to process the target request parameters, and the processing result is obtained and fed back.

[0130] In the disclosed embodiment, the algorithm request parameters of the target computer vision algorithm are stored in the algorithm parameter configuration table. When using the target computer vision algorithm, the intelligent monitoring platform can first obtain the algorithm parameter configuration table and configure the target request parameters based on the algorithm request parameters of the request algorithm interface recorded in the algorithm parameter configuration table, supplement the necessary request parameters, or attach the extracted video frame converted into a base64 string. The integrated method of the computer vision algorithm provided by the disclosed embodiment solves the need for personalized request parameters for the algorithm service. The image parameters passed to the algorithm are base64 strings, which solves the problem that images cannot be transmitted in HTTP requests.

[0131] Based on the service identifier of the target computer vision algorithm service carried in the service request, the target computer vision algorithm service's load balancing algorithm IP address and port information can be obtained from the registration center. The target request parameters are then passed to the target computer vision algorithm service through the HTTP interface specified by the algorithm IP address and port information for data processing. The corresponding processing results are then obtained and fed back, thus invoking the target computer vision algorithm service. The intelligent monitoring platform simultaneously waits for the processing results, determines whether an alarm exists, and stores the processing results in the alarm log table.

[0132] In the embodiment of the present disclosure, the interaction between the caller and the algorithm service is completed through an HTTP interface with standardized input and output, which shields the language differences between the caller and the algorithm service implementer, and any algorithm that conforms to the standard input and output can be connected to the smart monitoring platform.

[0133] In an exemplary embodiment, the task status includes: a pending state, a running state, a pending state, and a finished state. The method further includes:

[0134] After the container task details are generated, the task status of the container task details is recorded in the container task details table as pending;

[0135] The asynchronous task obtains the target container task details in the pending state from the container task details table, starts the target container according to the target container task details, and changes the task state of the container task details in the container task details table to the running state;

[0136] In response to a deactivation operation on the target computer vision algorithm service, the task status of the container task details in the pending state and the running state in the container task detail table is changed to the pending state;

[0137] By asynchronously deactivating the task, the container task corresponding to the container task detail whose task status is to be ended in the container task detail table is ended, and the task status of the container task detail is changed to ended in the container task detail table.

[0138] For example, the task state transition is as follows: Figure 9 As shown. After the container task details are generated, the task enters the pending state, and the task status of the container task details is recorded as the pending state (ready state) in the container task details table. A scheduled task is started asynchronously. Every preset time (for example, 10 seconds), a container task detail record with a pending state is selected from the container task details table, and the Docker start API is called to start the container. The task status of the container task in the container task details table is changed to the running state (running state). When the algorithm service needs to be terminated, for example, when a user deactivates the target computer vision algorithm service in the algorithm management center, the task status of the container task details in the pending state or the running state is changed to the waiting state (clean state) in the container task details table.

[0139] Reference Figure 10 As shown, the asynchronous stop task obtains the container task details with the task status of "to be ended" from the container task details table every preset time (for example, 10s), calls the Docker end API, ends the container task corresponding to the container task details, and updates the task status corresponding to the container task details in the container task details table to the end state (stop state). In the embodiment of the present disclosure, the problem that the start and stop of the algorithm container is difficult to be controlled by the platform is solved through the changes of four states.

[0140] The container status synchronizes the actual running status of the container. The container uploads the actual status to this field through the callback interface to resolve the inconsistency between the data in the table and the actual status. The necessary parameters during container runtime are used to configure the container and start the command. When the container starts, it selects the base image based on the necessary parameters, sets the parameters, and starts the container. This is used to determine which image to use to start which algorithm service.

[0141] When the update algorithm configuration table is enabled, the task is not actually started. The actual startup is completed by the asynchronous task of the algorithm container, which obtains a detailed record of the container task to be started from the container task detail table every few seconds. Because the deactivation time of the synchronous container is affected by the number of instances, the more instances there are, the slower the deactivation, which affects the user experience. In this embodiment, a pending state is added. The start and stop of the container are controlled by the asynchronous task. This solves the problem of response timeouts due to slow algorithm startup and can provide a better user experience.

[0142] In order to enable those skilled in the art to better understand the embodiments of the present disclosure, the embodiments of the present disclosure are described below with reference to specific examples.

[0143] Reference Figure 11 As shown, the operating environment of the computer vision algorithm can be constructed as a general algorithm service basic image; the computer vision algorithm model and reasoning script are encapsulated into a Web algorithm service, the Web server gateway interface is used to manage the Web algorithm service, the input and output parameters of the algorithm service reasoning interface are standardized, and the reasoning service is provided to the smart monitoring platform through the HTTP interface. All scripts and model files required for the algorithm service runtime constitute an algorithm file; the algorithm service configuration parameters and the algorithm service container operation parameters are written as a parameter configuration file; the algorithm file and the parameter configuration file are compressed together into a compressed file, the compressed file is imported into the smart monitoring platform, the parameter configuration file and the algorithm file are parsed, and stored, and the algorithm enters the waiting state.

[0144] Combine Figure 12 As shown, in the algorithm management center, the enable button of the algorithm is triggered, and according to the configured container parameters and algorithm parameters, multiple container task details to be executed are generated and stored in the table. The task execution timer and asynchronous task timing obtain the tasks to be executed from the container task detail table, and the routing selector selects the optimal GPU to start the algorithm container; when calling the algorithm inference service, first assemble the standardized request parameters, obtain the address of the algorithm service from the registration center, call the API of the algorithm service corresponding to the address, and return the standard result after inference; after using the algorithm, click the algorithm disable button in the algorithm management center, the task status is marked as the cleanup status, and the container is stopped through the asynchronous task to release the resources occupied by the container.

[0145] The algorithm integration method of the computer vision algorithm provided by the embodiment of the present disclosure can realize the plug-and-play of the algorithm, and can solve the problem that the server needs to modify the code adaptation when the new algorithm is accessed; through the automatic routing selection strategy, it can solve the problem that the video memory allocation requires human participation when the algorithm service is started; by formulating the algorithm input standard, output standard, and service mode requirements, it can achieve compatibility with the access of any algorithm.

[0146] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0147] Based on the same inventive concept, the embodiments of the present application also provide a computer vision algorithm integration device for implementing the aforementioned computer vision algorithm integration method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in the embodiments of one or more computer vision algorithm integration devices provided below can be found in the limitations of the computer vision algorithm integration method above and will not be repeated here.

[0148] In an exemplary embodiment, Figure 13 As shown, an integrated device for a computer vision algorithm is provided, including: an acquisition module 1302, a generation module 1304, a resource allocation module 1306, a download module 1308 and a registration module 1310, wherein:

[0149] An acquisition module 1302 is configured to acquire an algorithm file and a parameter configuration file of a target computer vision algorithm service, wherein the algorithm file includes an inference script and a target computer vision algorithm;

[0150] A generating module 1304 is configured to generate at least one container task detail in response to an activation operation for the target computer vision algorithm service, based on the container parameters and algorithm parameters in the parameter configuration file, and store the at least one container task detail in a container task detail table;

[0151] The resource allocation module 1306 is configured to obtain target container task details from the container task details table by asynchronously starting a task, and allocate target resources to the target container task details;

[0152] A download module 1308 is configured to download a base image of the target computer vision algorithm service from an image repository to a target server, create and start a target container based on the target resources, and download the algorithm file to the base image;

[0153] The registration module 1310 is configured to run the inference script in the base image to start the target computer vision algorithm service and register the target computer vision algorithm in a registration center.

[0154] By adopting the computer vision algorithm integration device provided by the embodiment of the present disclosure, the target computer vision algorithm can be automatically integrated into the smart monitoring platform by uploading the algorithm file and parameter configuration file of the target computer vision algorithm service to the smart monitoring platform. This eliminates the need for R&D personnel to manually develop and adapt the new computer vision algorithm on the smart monitoring platform, simplifying the process of integrating the algorithm into the smart monitoring platform, reducing the labor and time costs of the algorithm integration process, and making the algorithm integration more flexible and efficient, thereby greatly improving the scalability of the smart monitoring platform. In addition, the computer vision algorithm integration device provided in this case can achieve plug-and-play of the algorithm by one-click importing the compressed files of the algorithm file and parameter configuration file, thereby reducing the complexity of the algorithm integration into the smart monitoring platform. At least one container task detail is generated through the parameter configuration file, and the container creation is controlled by the container task detail. Since one algorithm instance corresponds to a table record of one container task detail, independent control at the algorithm instance level can be achieved, and the start and stop of multiple instances of the same algorithm can be achieved independently, greatly improving the flexibility of algorithm start and stop.

[0155] In one embodiment, the acquisition module 1302 is further configured to:

[0156] Get the data compression package of the target computer vision algorithm service;

[0157] Decompressing the data compression package to obtain the algorithm file and parameter configuration file of the target computer vision algorithm service;

[0158] Generate a container parameter configuration table based on the container parameters in the parameter configuration file, and generate an algorithm parameter configuration table based on the algorithm parameters in the parameter configuration file;

[0159] The algorithm file is uploaded to the target server, and the download address of the algorithm file is recorded in the algorithm parameter configuration table.

[0160] In one embodiment, the generating module 1304 is further configured to:

[0161] According to the download address of the algorithm file in the algorithm parameter configuration table, and the container configuration information and instance number N recorded in the container parameter configuration table, N container task details are generated. The container task details include task status, container status, the container configuration information, and the download address of the algorithm file.

[0162] In one embodiment, the resource allocation module 1306 is further configured to:

[0163] Collecting statistics on the resource information of each server and obtaining candidate servers that meet the resource screening conditions from each server;

[0164] A target GPU whose GPU memory availability satisfies a GPU memory screening condition is determined from the GPUs of the candidate servers, and the target GPU is used as a target resource for starting the target computer vision algorithm container.

[0165] In one embodiment, the registration module 1310 is further configured to:

[0166] Register the IP address and port information of the target computer vision algorithm in the registration center.

[0167] In one embodiment, the apparatus further comprises:

[0168] The receiving module is further configured to receive a service request for scheduling the target computer vision algorithm service, wherein the service request includes target request parameters, and the target request parameters are configured based on the algorithm request parameters in the algorithm parameter configuration table;

[0169] The scheduling module is used to obtain the IP address and port information of the target computer vision algorithm from the registration center according to the service identifier of the target computer vision algorithm service, call the target computer vision algorithm service through the IP address and port information to process the target request parameters, and obtain and feedback the processing results.

[0170] In one embodiment, the task status includes: a waiting state, a running state, a waiting state, and a finished state. The device further includes: a task status management module, the task status management module being configured to:

[0171] After the container task details are generated, the task status of the container task details is recorded in the container task details table as a pending state;

[0172] The asynchronous task obtains a target container task detail in a pending state from the container task detail table, and after starting a target container according to the target container task detail, changes the task state of the container task detail in the container task detail table to an entering running state;

[0173] In response to a deactivation operation on the target computer vision algorithm service, changing the task status of the container task details in the container task list that are in a pending state and in a running state to a pending state;

[0174] By asynchronously deactivating the task, the container task corresponding to the container task detail whose task status is to be ended in the container task detail table is ended, and the task status of the container task detail in the container task detail table is changed to ended.

[0175] In one embodiment, the parameter configuration file includes algorithm service configuration parameters and algorithm service container operating parameters; wherein, the algorithm service configuration parameters include the algorithm identifier of the target computer vision algorithm, the service identifier of the target computer vision algorithm service, and algorithm request parameters; the algorithm service container operating parameters include resource constraints, number of instances, image identifier, and path mapping parameters when the target container of the target computer vision algorithm is started.

[0176] Each module in the integrated device for the aforementioned computer vision algorithm can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0177] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 14 As shown. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless means, and the wireless means can be implemented via Wi-Fi, a mobile cellular network, near-field communication (NFC), or other technologies. When executed by the processor, the computer program implements a method for integrating computer vision algorithms. The display unit of the computer device is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.

[0178] Those skilled in the art will understand that Figure 14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0179] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0180] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0181] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0182] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0183] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

[0184] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0185] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for integrating computer vision algorithms, characterized in that: Applied to the smart monitoring platform, the method includes: Obtain a data compression package of a target computer vision algorithm service; decompress the data compression package to obtain an algorithm file and a parameter configuration file of the target computer vision algorithm service; generate a container parameter configuration table based on the container parameters in the parameter configuration file, and generate an algorithm parameter configuration table based on the algorithm parameters in the parameter configuration file; upload the algorithm file to a target server, and record a download address of the algorithm file in the algorithm parameter configuration table, wherein the algorithm file includes an inference script and a target computer vision algorithm; In response to an activation operation for the target computer vision algorithm service, generating at least one container task detail according to the container parameters and algorithm parameters in the parameter configuration file, and storing the at least one container task detail in a container task detail table, wherein the container task detail is used to describe how to configure and start a container for the algorithm service, and the container task detail includes a task status, a container status, container configuration information, and a download address for the algorithm file; Acquire target container task details from the container task detail table by asynchronously starting a task, and allocate target resources to the target container task details; Downloading the base image of the target computer vision algorithm service from the image repository to the target server, creating and starting a target container based on the target resources, and downloading the algorithm file to the base image, wherein the base image has a built-in startup script, the startup script is used to receive the download address of the algorithm file, and download the algorithm file through the received download address of the algorithm file; The inference script is run in the base image to start the target computer vision algorithm service and register the target computer vision algorithm in a registration center.

2. The method according to claim 1, characterized in that Generating at least one container task detail according to the container parameters and algorithm parameters in the parameter configuration file includes: Generate N container task details according to the download address of the algorithm file in the algorithm parameter configuration table, and the container configuration information and the number of instances N recorded in the container parameter configuration table, where N is a positive integer.

3. The method according to claim 1 or 2, characterized in that The allocating target resources to the target container task details includes: Collecting statistics on the resource information of each server and obtaining candidate servers that meet the resource screening conditions from each server; A target GPU whose GPU memory availability satisfies a GPU memory screening condition is determined from the GPUs of the candidate servers, and the target GPU is used as a target resource for starting the target computer vision algorithm container.

4. The method according to claim 2, characterized in that Registering the target computer vision algorithm in a registration center includes: Register the IP address and port information of the target computer vision algorithm in the registration center.

5. The method according to claim 4, characterized in that The method further comprises: Receiving a service request for scheduling the target computer vision algorithm service, the service request including target request parameters, the target request parameters being configured based on the algorithm request parameters in the algorithm parameter configuration table; According to the service identifier of the target computer vision algorithm service, the IP address and port information of the target computer vision algorithm are obtained from the registration center, and the target computer vision algorithm service is called through the IP address and port information to process the target request parameters, and the processing result is obtained and fed back.

6. The method according to claim 2, characterized in that The task status includes: waiting to be executed, entering running, waiting to end, and ending. The method further includes: After the container task details are generated, the task status of the container task details is recorded in the container task details table as a pending state; The asynchronous task obtains a target container task detail in a pending state from the container task detail table, and after starting a target container according to the target container task detail, changes the task state of the container task detail in the container task detail table to an entering running state; In response to a deactivation operation on the target computer vision algorithm service, changing the task status of the container task details in the container task list that are in a pending state and in a running state to a pending state; By asynchronously deactivating the task, the container task corresponding to the container task detail whose task status is to be ended in the container task detail table is ended, and the task status of the container task detail in the container task detail table is changed to ended.

7. The method according to claim 1, characterized in that The parameter configuration file includes algorithm service configuration parameters and algorithm service container operating parameters; wherein, the algorithm service configuration parameters include the algorithm identifier of the target computer vision algorithm, the service identifier of the target computer vision algorithm service, and algorithm request parameters; the algorithm service container operating parameters include resource constraints, number of instances, image identifier, and path mapping parameters when the target container of the target computer vision algorithm is started.

8. An integrated device for computer vision algorithms, characterized in that: Applied to the smart monitoring platform, the device includes: An acquisition module is configured to acquire a data compression package of a target computer vision algorithm service; decompress the data compression package to obtain an algorithm file and a parameter configuration file of the target computer vision algorithm service; generate a container parameter configuration table based on container parameters in the parameter configuration file, and generate an algorithm parameter configuration table based on algorithm parameters in the parameter configuration file; upload the algorithm file to a target server, and record a download address of the algorithm file in the algorithm parameter configuration table, wherein the algorithm file includes an inference script and a target computer vision algorithm; a generation module, configured to, in response to an activation operation for the target computer vision algorithm service, generate at least one container task detail based on the container parameters and algorithm parameters in the parameter configuration file, and store the at least one container task detail in a container task detail table, wherein the container task detail is used to describe how to configure and start a container for the algorithm service, and the container task detail includes a task status, a container status, container configuration information, and a download address for the algorithm file; A resource allocation module is used to obtain target container task details from the container task detail table by asynchronously starting a task, and allocate target resources to the target container task details; A download module is used to download the base image of the target computer vision algorithm service from the image repository to the target server, create and start the target container based on the target resource, and download the algorithm file to the base image, wherein the base image has a built-in startup script, and the startup script is used to receive the download address of the algorithm file and download the algorithm file through the received download address of the algorithm file; A registration module is used to run the inference script in the basic image to start the target computer vision algorithm service and register the target computer vision algorithm in a registration center.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Docker-based remote sensing intelligent processing algorithm management method

    CN112527319A