Video micro-service deployment method, device, equipment and medium

Through the automated video microservice deployment method, the problem of low manual deployment efficiency in the existing technology is solved, intelligent multi-replica deployment is realized, and efficiency is improved.

CN119440722APending Publication Date: 2025-02-14CRSC COMM & INFORMATION GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411456423.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In the prior art, the deployment of video microservices relies on manual operations, resulting in low deployment efficiency.

Method used

By obtaining the service type identification, number to be deployed, and image files of the target video microservice, the container group pods and configuration files are automatically created on multiple nodes of the video surveillance system, and the target video microservice is deployed in each container according to the image files. .

Benefits of technology

The intelligent multi-copy deployment of video microservices has been realized, which has improved deployment efficiency and reduced human resources consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440722A_ABST
    Figure CN119440722A_ABST
Patent Text Reader

Abstract

The invention relates to the field of video micro-service deployment, and discloses a video micro-service deployment method and device, equipment and a medium, which can obtain a service type identifier, a to-be-deployed number and a mirror image file of a target video micro-service. And determining corresponding target environment variable data according to the service type identifier of the target video micro-service. Based on the to-be-deployed number and the target environment variable data, creating a plurality of container groups Pod and a configuration file of each Pod on a plurality of nodes of the video monitoring system; wherein each Pod comprises at least one container, the total number of the containers in the multiple Pods is equal to the to-be-deployed number, and the configuration file of each Pod comprises target environment variable data. And deploying the target video micro-service in each container according to the mirror image file. According to the invention, intelligent multi-copy deployment can be carried out on the target video micro-service in a video monitoring system, manpower resources consumed by manual deployment in related technologies are reduced, and the deployment efficiency of the video micro-service is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video microservice deployment, and in particular to a video microservice deployment method, device, equipment and medium. Background Art

[0002] With the development of modern society, cameras have been widely used in roads, railways, airports, schools, hospitals, etc. Cameras are generally managed by region. When an area faces hundreds or thousands of cameras, a video surveillance system is needed for unified management and maintenance.

[0003] Video surveillance systems are generally distributed architectures, involving many video microservices. In actual on-site project deployment, video microservices are generally deployed in multiple copies to enhance the high availability of the video surveillance system.

[0004] However, the related technology requires technical personnel to manually deploy video microservices, and the deployment efficiency is low. Summary of the invention

[0005] The present invention provides a video microservice deployment method, device, equipment and medium, which are used to solve the defect of manual deployment of video microservices by technicians in related technologies and low deployment efficiency, realize intelligent deployment of video microservices and improve deployment efficiency.

[0006] In a first aspect, the present invention provides a video microservice deployment method, the method comprising:

[0007] Get the service type identifier, number to be deployed, and image file of the target video microservice;

[0008] According to the service type identifier of the target video microservice, the corresponding target environment variable data is determined from a plurality of predefined environment variable data; wherein the plurality of environment variable data is obtained by mapping a plurality of configuration items of different types of video microservices;

[0009] Based on the number to be deployed and the target environment variable data, create multiple container group Pods and configuration files of each Pod on multiple nodes of the video surveillance system; wherein each of the Pods includes at least one container, the total number of containers in the multiple Pods is equal to the number to be deployed, and the configuration file of each Pod includes the target environment variable data;

[0010] According to the image file, the target video microservice is deployed in each of the containers; wherein each of the containers is used to start and run the target video microservice according to the target environment variable data in the configuration file of the Pod.

[0011] Optionally, according to the service type identifier of the target video microservice, the corresponding target environment variable data is determined from a plurality of predefined environment variable data, including:

[0012] According to the service type identifier of the target video microservice, search for corresponding multiple environment variable data in a predefined data correspondence relationship, and use all the found environment variable data as the target environment variable data;

[0013] The data correspondence relationship includes a correspondence relationship between service type identifiers of multiple types of video microservices and multiple environment variable data, and the service type identifier of each type of video microservice corresponds to one or more environment variable data.

[0014] Optionally, after deploying the target video microservice in each of the containers according to the image file, the method further includes:

[0015] Receive a configuration information update instruction for the target video microservice;

[0016] According to the configuration information update instruction of the target video microservice, the target environment variable data in the configuration file of each Pod is uniformly updated.

[0017] Optionally, the method further includes:

[0018] When the target video microservice is deployed in the node, determining whether other target video microservices have been deployed in the node;

[0019] If it is determined that no other target video microservice is deployed in the node, setting the preset external access port as the external access port uniquely corresponding to the target video microservice;

[0020] If it is determined that other target video microservices have been deployed in the node, a new external access port is created, and the new external access port is set as the external access port uniquely corresponding to the target video microservice;

[0021] The target video microservice is used to interact with an external device through a unique corresponding external access port.

[0022] Optionally, the method further includes:

[0023] After completing the deployment of the target video microservice and starting to run the target video microservice, detecting the running status of the target video microservice;

[0024] When it is detected that the running state of the target video micro service is abnormally terminated, the external access port uniquely corresponding to the target video micro service is recovered.

[0025] Optionally, when the target video microservice is a video distribution service, after deploying the target video microservice in each container according to the image file, the method further includes:

[0026] When it is determined that the total number of video playback channels is greater than the preset system load limit, the number of target video microservices to be added is determined according to the difference between the total number of video playback channels and the load limit;

[0027] Among the multiple nodes, determine at least one first node in which the number of deployed target video microservices does not reach a preset upper limit, and determine a maximum allowed total number of newly added target video microservices in the at least one first node;

[0028] If the maximum allowed total number of new additions is not less than the required number of new additions, then a number of the target video microservices whose number is the required number of new additions is newly deployed in the at least one first node;

[0029] If the maximum allowed total number of new additions is less than the required number of new additions, a new Pod is created in the at least one first node, and a number of target video microservices equal to the required number of new additions is newly deployed in the new Pod.

[0030] Optionally, when the target video microservice is a video distribution service, after deploying the target video microservice in each container according to the image file, the method further includes:

[0031] When it is determined that the total number of video playback paths is less than a preset system load lower limit, determining the number of target video microservices that can be reduced according to the difference between the total number of video playback paths and the load lower limit;

[0032] According to the number of deployments of the target video microservice in each of the nodes and the load balancing strategy, determining at least one second node for executing the video microservice scaling-down strategy from among the multiple nodes;

[0033] The target video microservices having a number that is the reducible number are deleted in the at least one second node.

[0034] In a second aspect, the present invention provides a video microservice deployment device, the device comprising:

[0035] An acquisition unit, used to acquire a service type identifier, a quantity to be deployed, and an image file of a target video microservice;

[0036] A determination unit, configured to determine corresponding target environment variable data from a plurality of predefined environment variable data according to a service type identifier of the target video microservice; wherein the plurality of environment variable data are obtained by mapping a plurality of configuration items of different types of video microservices;

[0037] A creation unit, configured to create a plurality of container groups Pods and a configuration file of each Pod on a plurality of nodes of a video surveillance system based on the number to be deployed and the target environment variable data; wherein each of the Pods includes at least one container, the total number of containers in the plurality of Pods is equal to the number to be deployed, and the configuration file of each of the Pods includes the target environment variable data;

[0038] A deployment unit is used to deploy the target video microservice in each of the containers according to the image file; wherein each of the containers is used to start and run the target video microservice according to the target environment variable data in the configuration file of the Pod.

[0039] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the video microservice deployment method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0040] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the video microservice deployment method of the first aspect or any corresponding embodiment thereof.

[0041] The video microservice deployment method, device, equipment and medium provided by the present invention can obtain the service type identification, the number to be deployed and the image file of the target video microservice. According to the service type identification of the target video microservice, the corresponding target environment variable data is determined in a plurality of predefined environment variable data; wherein the plurality of environment variable data is obtained by mapping a plurality of configuration items of different types of video microservices. Based on the number to be deployed and the target environment variable data, a plurality of container groups Pod and a configuration file of each Pod are created on a plurality of nodes of the video monitoring system; wherein each Pod includes at least one container, the total number of containers in the plurality of Pods is equal to the number to be deployed, and the configuration file of each Pod includes the target environment variable data. According to the image file, the target video microservice is deployed in each container; wherein each container is used to start and run the target video microservice according to the target environment variable data in the configuration file of the Pod. The present invention can perform intelligent multi-copy deployment of the target video microservice in the video monitoring system, reduce the human resources required for manual deployment in the related technology, and effectively improve the deployment efficiency of the video microservice. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 A flowchart of a video microservice deployment method provided by an embodiment of the present invention;

[0044] Figure 2 A video microservice configuration item processing flow chart provided in an embodiment of the present invention;

[0045] Figure 3 A flow chart of allocation of external access ports provided for related technologies;

[0046] Figure 4 A flow chart of allocation of an external access port provided by an embodiment of the present invention;

[0047] Figure 5 A schematic diagram of the structure of a video microservice deployment device provided by an embodiment of the present invention;

[0048] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] Combine the following Figure 1-Figure 4 The video microservice deployment method of the present invention is described.

[0051] like Figure 1 As shown, this embodiment proposes a first video microservice deployment method, which may include the following steps:

[0052] S101. Obtain the service type identifier, the number to be deployed, and the image file of the target video microservice.

[0053] The target video microservice may be a certain type of video microservice that needs to be deployed, such as a video distribution service, a storage service, a cache access control service, or a general database interface service.

[0054] Among them, the service type identifier of the target video microservice can uniquely identify the video microservice type to which the target video microservice belongs.

[0055] Specifically, the number of target video microservices to be deployed may be the number of target video microservices that need to be deployed in the video surveillance system. It should be noted that, in this embodiment, the target video microservice may be deployed on each node of the video surveillance system.

[0056] Specifically, the image file of the target video microservice is used to store its application and its dependent environment. In this embodiment, the target video microservice can be deployed based on the image file.

[0057] In practical applications, this embodiment can package the video microservice and its runtime environment into a Docker image file, and upload the image file to a private warehouse. When deploying a video surveillance system, this embodiment can use Kubernetes to manage the deployment, scheduling and operation of containers.

[0058] S102. Determine corresponding target environment variable data from a plurality of predefined environment variable data according to a service type identifier of the target video microservice; wherein the plurality of environment variable data are obtained by mapping a plurality of configuration items of different types of video microservices.

[0059] It should be noted that video microservices generally require some configuration information to run correctly, such as service IP, port, and database connection information. Different types of video microservices require different configuration information, so the configuration files of different video microservices are different. When deploying different types of video microservices, the technical staff needs to determine the configuration items required for each video microservice (the configuration items include corresponding configuration parameters and parameter values), and hard-code the configuration items required for the video microservice into the configuration file. The configuration items required for different types of video microservices are different, and each video microservice needs to set the corresponding configuration file. Therefore, the workload of manually deploying video microservices is large and the deployment efficiency is low.

[0060] Specifically, this embodiment can predetermine the configuration items required for different types of video microservices, and map all the configuration items to corresponding environment variable data respectively, and provide the video microservice with the configuration information required for its operation in the form of environment variable data.

[0061] The environment variable data includes corresponding environment parameters and parameter values.

[0062] Optionally, step S102 may include:

[0063] According to the service type identifier of the target video microservice, the corresponding multiple environment variable data are searched in the predefined data correspondence relationship, and all the found environment variable data are used as the target environment variable data;

[0064] The data correspondence includes the correspondence between the service type identifiers of multiple types of video microservices and multiple environment variable data, and the service type identifier of each type of video microservice corresponds to one or more environment variable data.

[0065] Specifically, in the data correspondence relationship, a service type identifier of a video microservice may correspond to one or more environment variable data.

[0066] S103. Based on the number to be deployed and the target environment variable data, create multiple container group Pods and configuration files for each Pod on multiple nodes of the video surveillance system; wherein each Pod includes at least one container, the total number of containers in the multiple Pods is equal to the number to be deployed, and the configuration file of each Pod includes the target environment variable data.

[0067] Specifically, the video monitoring system may include multiple nodes, such as a master node and a working node. In this embodiment, the target video microservice may be deployed on each node in the video monitoring system.

[0068] Optionally, the video surveillance system may be a video surveillance system deployed and generated using container orchestration technology represented by container engine Docker and container management tool Kubernetes (K8S).

[0069] Specifically, this embodiment can create multiple container group Pods and a configuration file for each Pod on multiple nodes according to the number of target video microservices to be deployed and target environment variable data.

[0070] One or more Pods can be created on a node. It should be noted that the total number of Pods created in the above multiple nodes is the total number of the above multiple Pods.

[0071] Specifically, the total number of containers of the above multiple Pods is equal to the number to be deployed.

[0072] S104. Deploy the target video microservice in each container according to the image file; wherein each container is used to start and run the target video microservice according to the target environment variable data in the configuration file of the Pod.

[0073] Specifically, this embodiment can deploy a target video microservice in each container based on the image file of the target video microservice.

[0074] It should be noted that any container can normally start and run the target video microservice deployed in the container based on the target environment variable data in the configuration file of the corresponding Pod.

[0075] It can be understood that this embodiment can realize multi-copy deployment of different types of video microservices, and can also realize batch deployment of multiple types of video microservices.

[0076] The video microservice deployment method proposed in this embodiment can obtain the service type identifier, the number to be deployed, and the image file of the target video microservice. According to the service type identifier of the target video microservice, the corresponding target environment variable data is determined in the pre-defined multiple environment variable data; wherein the multiple environment variable data is obtained by mapping multiple configuration items of different types of video microservices. Based on the number to be deployed and the target environment variable data, multiple container groups Pod and configuration files of each Pod are created on multiple nodes of the video monitoring system; wherein each Pod includes at least one container, the total number of containers in the multiple Pods is equal to the number to be deployed, and the configuration file of each Pod includes the target environment variable data. According to the image file, the target video microservice is deployed in each container; wherein each container is used to start and run the target video microservice according to the target environment variable data in the configuration file of the Pod. This embodiment can perform intelligent multi-copy deployment of the target video microservice in the video monitoring system, reduce the human resources consumed by manual deployment in related technologies, and effectively improve the deployment efficiency of video microservices.

[0077] based on Figure 1 This embodiment proposes a second video microservice deployment method, in which this embodiment can map the configuration items of the video microservice, obtain the corresponding environment variable data, and can deploy and run the video microservice based on the environment variable data.

[0078] like Figure 2 The video microservice configuration item processing flow shown in the figure, this embodiment can first edit the configuration items according to the actual situation before deploying the video microservice, and define the environment variables (i.e., environment variable data) for constructing each video microservice. The definition of the environment variable data can use the json format. For example, the video management service needs to access the database to construct the corresponding database environment variable data. The environment variable name in the environment variable data can be defined as "MY_DB_INFO", and the value of the environment variable, i.e., the parameter value, can include database connection information to determine whether it contains sensitive data. If so, the sensitive data can be encrypted using an encryption algorithm for security reasons. During the encryption process, a 16-bit random string is generated as a key. If not, decryption is not required. In order to facilitate container processing and data transmission, the parameter values ​​of the environment variables are base64 encoded. After all the environment variable data are defined, a deployment configuration file, i.e., the configuration file of the Pod, is automatically generated according to the configuration items required by each video microservice, and the environment variable data is injected into the container. After the container is started, when reading the environment variable data, the value of the environment variable, that is, the parameter value, is first base64 decoded, and then it is determined whether it contains sensitive data. If so, the sensitive data can be decrypted using the pre-generated key. If not, no decryption is required and the process ends.

[0079] This embodiment does not need to manually create a configuration file for each video microservice, but only needs to maintain the environment variable data, thereby improving the flexibility of deployment and operation. Sensitive information is transmitted through encrypted environment variables rather than hard-coded, which can further reduce the risk of information leakage.

[0080] based on Figure 1 This embodiment proposes a third video microservice deployment method. After step S104, the method may further include:

[0081] Receive configuration information update instructions for the target video microservice;

[0082] According to the configuration information update instructions for the target video microservice, the target environment variable data in the configuration file of each Pod is uniformly updated.

[0083] It should be noted that, in the related art, when the configuration items of a certain type of video microservice need to be modified, the configuration files of each video microservice of that type need to be manually updated, which is labor-intensive and has low update efficiency. This embodiment can uniformly update the target environment variable data in the configuration files of all Pods according to the configuration information update instruction of the target video microservice, without the need for manual update by technicians, and complete the intelligent batch update of the target environment variable data in all configuration files, thereby improving the update efficiency.

[0084] Related technologiesIn a containerized environment, applications and all their dependencies are encapsulated in containers, but applications in containers often require some configuration information to run correctly.Video surveillance systems are composed of a series of microservices, and different types of microservices require different configuration parameters, which leads to differences in service configuration files.

[0085] In order to avoid hard-coding the configuration information in the configuration file, this embodiment extracts all the configuration items required by the service and constructs them into environment variables. Compared with the related art, this embodiment no longer needs to maintain the configuration file of each video microservice, but only needs to maintain the environment variable data. During containerized deployment, these environment variable data are specified through the K8S deployment configuration file. When the container starts, the video surveillance system can automatically inject these environment variable data into the container, thereby realizing dynamic loading of the configuration. All configuration items required by the video microservice are converted into environment variable data, so that different copies of the same type of video microservice can share a deployment configuration file through the same environment variable data, which means that when the configuration needs to be adjusted, only the environment variable data needs to be updated, and there is no need to modify the deployment configuration file of each copy.

[0086] The video microservice deployment method proposed in this embodiment can uniformly update the target environment variable data in the configuration files of all Pods according to the configuration information update instructions of the target video microservice, without the need for manual updates by technical personnel, and complete the intelligent batch update of the target environment variable data in all configuration files, thereby improving the update efficiency.

[0087] based on Figure 1 This embodiment proposes a fourth video microservice deployment method, which may also include:

[0088] When deploying the target video microservice in a node, determine whether other target video microservices have been deployed in the node;

[0089] If it is determined that no other target video microservices are deployed in the node, the preset external access port is set as the external access port uniquely corresponding to the target video microservice;

[0090] If it is determined that other target video microservices have been deployed in the node, a new external access port is created, and the new external access port is set as the only external access port corresponding to the target video microservice;

[0091] The target video microservice is used to interact with external devices through the unique corresponding external access port.

[0092] In related technologies, in order to directly access the video microservice, the system sets the video microservice that needs external access to the host mode. In the host mode, the container group Pod does not have an independent IP address, but uses the IP of the host machine, and the port is also bound to the port on the host machine, which means that the outside world can directly access the video microservice without routing through the service of the container management tool. However, after using the host mode, when multiple copies of the video microservice are deployed on the same cluster node, if the same port is used, it will cause port conflicts, resulting in the interaction between the video microservice and the outside world.

[0093] like Figure 3As shown, in the related art, when there are multiple video distribution services of the same type VSS1, VSS2, VSS3, VSS4 and VSS5 in a Pod, the internal port of each VSS is mapped to the external port 16550. However, the use of the port mapping mechanism may cause the client to fail to obtain the video stream when playing the video. For example, the camera camera is registered and bound to VSS1. When the client tries to play the video of the camera, accessing the external port may distribute the request to other VSSs, which will cause the client to be unable to obtain the video stream from the correct VSS, resulting in failure to play the video. To solve the problem of port conflict, there can only be one copy in each Pod of the related technology. Although this approach can ensure the correct distribution of the video stream, it also brings a higher deployment and maintenance workload. In addition, this port mapping method requires manual management of the port mapping of each video microservice, and the allocated ports need to be planned in advance to avoid port conflicts. At the same time, the forwarding of video streams between different ports also increases the delay, resulting in a slower response speed for video playback, thereby affecting the user experience.

[0094] This embodiment can allocate unique corresponding external access ports to different video micro services on the node, so that the video micro service can interact with the outside through the unique corresponding external access port, thereby avoiding the problem of port conflict.

[0095] Specifically, in this embodiment, when a new container, i.e., a new service instance, is started, it will register its service ID (i.e., service type identifier) ​​and node IP with the management service CMS. When the service instance is registered, the management service will check whether there is already a service instance with the same service ID running on the node. If there are instances with the same service ID, the management service will further check the ports they use to avoid conflicts. If the same service has been deployed on the node and the same port is used, the management service will allocate an unused port to the new service instance, and the port allocation will be incremental. If the same service is not deployed, the default port can be used.

[0096] like Figure 4 As shown in the figure, the allocation of external access ports can be incrementally allocated. The external access ports corresponding to VSS1, VSS2, VSS3, VSS4 and VSS5 are 16550, 16560, 16570, 16580 and 16590 respectively. If the same service is not deployed, the default port can be used. When the video distribution service bound to the camera camera is VSS1, the camera camera can interact with VSS1 through the external access port 16550 that is unique to VSS1.

[0097] Optionally, the above method further includes:

[0098] After completing the deployment of the target video microservice and starting to run the target video microservice, detecting the running status of the target video microservice;

[0099] When it is detected that the running state of the target video microservice is abnormally terminated, the external access port uniquely corresponding to the target video microservice is recovered.

[0100] Specifically, the management service can also monitor the status of the service instances. If it detects that a service instance has terminated abnormally, its port can be released for use by other service instances, which helps to effectively utilize resources.

[0101] The video microservice deployment method proposed in this embodiment can allocate unique corresponding external access ports to different video microservices, so that different video microservices can interact with the outside through the unique corresponding external access ports, avoiding the port conflict problem that exists when the video microservice interacts with the outside in the related technology, and when a video microservice is detected to have a fault, the external access port of the video microservice can be recovered for use by other video microservices, thereby improving resource utilization.

[0102] It should be noted that in the video surveillance system, as the number of video playback paths increases, the performance and resource requirements for the distribution service and storage service will increase. Taking the distribution service as an example, when the number of video playback paths reaches the maximum carrying capacity of the distribution service, some videos will not be played normally. At the same time, when the number of video playback paths decreases, some distribution services will be idle, wasting resources. In order to solve this problem, this embodiment can provide a monitoring service to regularly check the load of the current video surveillance system, and realize elastic automatic expansion and contraction by dynamically adjusting the number of microservice replicas.

[0103] based on Figure 1 This embodiment proposes a fifth video microservice deployment method. In this method, when the target video microservice is a video distribution service, the method may further include, after step S104:

[0104] When it is determined that the total number of video playback channels is greater than the preset system load limit, the number of target video microservices that need to be added is determined based on the difference between the total number of video playback channels and the load limit;

[0105] Among the multiple nodes, determine at least one first node in which the number of deployed target video microservices does not reach a preset upper limit, and determine a maximum allowed total number of new target video microservices in the at least one first node;

[0106] If the maximum allowed total number of new additions is not less than the required number of new additions, then a number of target video microservices equal to the required number of new additions is newly deployed in at least one first node;

[0107] If the maximum allowed total number of new additions is less than the required number of new additions, a new Pod is created in at least one first node, and a number of target video microservices equal to the required number of new additions is deployed in the new Pod.

[0108] Specifically, in this embodiment, when expanding the capacity of the video microservice, there is an upper limit on the number of video microservices deployed in each Pod. This embodiment can select the corresponding Pod of a certain node for expansion based on the CPU and memory resource usage of the cluster node and whether the number of Pod replicas has reached the upper limit. When the number of video microservices deployed in the Pod of each node reaches the upper limit, a new Pod is created to expand the capacity of the video microservice.

[0109] The upper limit of the system load may be 80% of the maximum load capacity of the system.

[0110] Optionally, when the target video microservice is a video distribution service, after the target video microservice is deployed in each container according to the image file, the method further includes:

[0111] When it is determined that the total number of video playback channels is less than the preset system load lower limit, the number of target video microservices that can be reduced is determined based on the difference between the total number of video playback channels and the load lower limit;

[0112] Determine at least one second node for executing the video microservice scaling-down strategy from among the multiple nodes according to the number of deployments of the target video microservice in each node and the load balancing strategy;

[0113] In at least one second node, a number of target video microservices that can be reduced is deleted.

[0114] Specifically, when scaling down the video microservice, this embodiment selects a Pod of the node to reduce the number of service copies according to the CPU and memory resource usage of the cluster node.

[0115] In actual deployment, each distribution service can handle up to 200 video playbacks. When a video is requested to be played, a distribution service is assigned to it by comparing the current load number of the replica through the load balancing strategy.

[0116] The lower limit of the system load may be 30% of the maximum load capacity of the system.

[0117] It should be noted that when the number of video playback paths exceeds 80% of the maximum carrying capacity of the distribution service, the monitoring service will call K8S's add replica interface to cope with higher load requirements. When the number of video playback paths is less than 30% of the maximum carrying capacity of the distribution service, the monitoring service will call K8S's reduce replica interface to avoid resource waste and achieve elastic automatic expansion and contraction of microservices.

[0118] The video microservice deployment method proposed in this embodiment realizes elastic automatic expansion and contraction by dynamically adjusting the number of microservice replicas to cope with higher load requirements or avoid resource waste.

[0119] based on Figure 1 , this embodiment proposes a sixth video microservice deployment method, in which this embodiment, when adding a new video surveillance system project, can first select all video microservices that need to be deployed according to actual conditions, define the configuration items used by all services, and convert these configuration items into the form of environment variables. During containerized deployment, the values ​​of these environment variables are specified through the K8S deployment configuration file. During deployment, the number of copies of the video service can be set according to actual needs on site. When the video service needs to be accessed by the outside world, the host mode is used to replace the port mapping mechanism, and the node's IP and port are directly used to provide access to the outside world, and the service is dynamically allocated to expose the port to the outside world. After determining the deployed video service and setting the service parameters, the deployment system generates a container deployment configuration file for the Pod. This embodiment can provide a corresponding automatic deployment script for each microservice, and the deployment of the video service is realized by executing the automatic deployment script. If the video service is not fully deployed, the automatic loop execution completes the deployment.

[0120] like Figure 5 As shown, this embodiment proposes a video microservice deployment device, which includes:

[0121] An acquisition unit 101 is used to acquire a service type identifier, a quantity to be deployed, and an image file of a target video microservice;

[0122] The determination unit 102 is used to determine corresponding target environment variable data from a plurality of predefined environment variable data according to a service type identifier of the target video microservice; wherein the plurality of environment variable data are obtained by mapping a plurality of configuration items of different types of video microservices;

[0123] A creation unit 103 is used to create multiple container group Pods and configuration files of each Pod on multiple nodes of the video surveillance system based on the number to be deployed and the target environment variable data; wherein each Pod includes at least one container, the total number of containers in the multiple Pods is equal to the number to be deployed, and the configuration file of each Pod includes the target environment variable data;

[0124] The deployment unit 104 is used to deploy the target video microservice in each container according to the image file; wherein each container is used to start and run the target video microservice according to the target environment variable data in the configuration file of the Pod.

[0125] It should be noted that the processing of the acquisition unit 101, the determination unit 102, the creation unit 103 and the deployment unit 104 and the beneficial effects thereof can be respectively referred to in Figure 1 Steps S101 to S104 in the above are not described in detail.

[0126] Optionally, the determining unit 102 is further configured to:

[0127] According to the service type identifier of the target video microservice, the corresponding multiple environment variable data are searched in the predefined data correspondence relationship, and all the found environment variable data are used as the target environment variable data;

[0128] The data correspondence includes the correspondence between the service type identifiers of multiple types of video microservices and multiple environment variable data, and the service type identifier of each type of video microservice corresponds to one or more environment variable data.

[0129] Optionally, the above device further includes:

[0130] The updating unit is used to receive a configuration information update instruction for the target video microservice after the target video microservice is deployed in each container according to the image file; and uniformly update the target environment variable data in the configuration file of each Pod according to the configuration information update instruction for the target video microservice.

[0131] Optionally, the above device further includes:

[0132] The port allocation unit is used to determine whether other target video microservices have been deployed in the node when deploying the target video microservice in the node;

[0133] If it is determined that no other target video microservices are deployed in the node, the preset external access port is set as the external access port uniquely corresponding to the target video microservice;

[0134] If it is determined that other target video microservices have been deployed in the node, a new external access port is created, and the new external access port is set as the only external access port corresponding to the target video microservice;

[0135] The target video microservice is used to interact with external devices through the unique corresponding external access port.

[0136] Optionally, the above device further includes:

[0137] A recycling unit, used to detect the running status of the target video microservice after completing the deployment of the target video microservice and starting to run the target video microservice;

[0138] When it is detected that the running state of the target video microservice is abnormally terminated, the external access port uniquely corresponding to the target video microservice is recovered.

[0139] Optionally, when the target video microservice is a video distribution service, the above device further includes:

[0140] The capacity expansion unit is used to, after the target video microservice is deployed in each container according to the image file, determine the required number of target video microservices according to the difference between the total number of video playback paths and the upper limit of the load when it is determined that the total number of video playback paths is greater than the preset upper limit of the system load; among multiple nodes, determine at least one first node in which the deployed number of target video microservices does not reach the preset upper limit, and determine the maximum allowed total number of target video microservices in at least one first node; if the maximum allowed total number of new additions is not less than the required number of new additions, then deploy a number of target video microservices that is the required number of new additions in at least one first node; if the maximum allowed total number of new additions is less than the required number of new additions, create a new Pod in at least one first node, and deploy a number of target video microservices that is the required number of new additions in the new pod.

[0141] Optionally, when the target video microservice is a video distribution service, the above device further includes:

[0142] The scaling-down unit is used to, after deploying the target video microservice in each container according to the image file, determine the reducible number of the target video microservice according to the difference between the total number of video playback paths and the load lower limit when it is determined that the total number of video playback paths is less than the preset system load lower limit; determine at least one second node for executing the video microservice scaling-down strategy from a plurality of nodes according to the deployment number of the target video microservice in each node and the load balancing strategy; and delete the target video microservices whose number can be reduced in the at least one second node.

[0143] The video microservice deployment device proposed in this embodiment can obtain the service type identifier, the number to be deployed, and the image file of the target video microservice. According to the service type identifier of the target video microservice, the corresponding target environment variable data is determined in the pre-defined multiple environment variable data; wherein the multiple environment variable data are obtained by mapping multiple configuration items of different types of video microservices. Based on the number to be deployed and the target environment variable data, multiple container groups Pod and configuration files of each Pod are created on multiple nodes; wherein each Pod includes at least one container, the total number of containers in the multiple Pods is equal to the number to be deployed, and the configuration file of each Pod includes the target environment variable data. According to the image file, the target video microservice is deployed in each container; wherein each container is used to start and run the target video microservice according to the target environment variable data in the configuration file of the Pod. This embodiment can perform intelligent multi-copy deployment of the target video microservice in the video surveillance system, reduce the human resources consumed by manual deployment in related technologies, and effectively improve the deployment efficiency of video microservices.

[0144] The video microservice deployment device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0145] The embodiment of the present invention also provides a computer device having the above Figure 5 The video microservice deployment device is shown.

[0146] See also Figure 6 , a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0147] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0148] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0149] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function. The data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0150] The memory 20 may include a volatile memory, such as a random access memory. The memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive. The memory 20 may also include a combination of the above-mentioned types of memory.

[0151] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0152] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A video microservice deployment method, characterized in that: The method comprises: Get the service type identifier, number to be deployed, and image file of the target video microservice; According to the service type identifier of the target video microservice, the corresponding target environment variable data is determined from a plurality of predefined environment variable data; wherein the plurality of environment variable data is obtained by mapping a plurality of configuration items of different types of video microservices; Based on the number to be deployed and the target environment variable data, create multiple container group Pods and configuration files of each Pod on multiple nodes of the video surveillance system; wherein each of the Pods includes at least one container, the total number of containers in the multiple Pods is equal to the number to be deployed, and the configuration file of each Pod includes the target environment variable data; According to the image file, the target video microservice is deployed in each of the containers; wherein each of the containers is used to start and run the target video microservice according to the target environment variable data in the configuration file of the Pod.

2. The method according to claim 1, characterized in that According to the service type identifier of the target video microservice, the corresponding target environment variable data is determined from a plurality of predefined environment variable data, including: According to the service type identifier of the target video microservice, search for corresponding multiple environment variable data in a predefined data correspondence relationship, and use all the found environment variable data as the target environment variable data; The data correspondence relationship includes a correspondence relationship between service type identifiers of multiple types of video microservices and multiple environment variable data, and the service type identifier of each type of video microservice corresponds to one or more environment variable data.

3. The method according to claim 1, characterized in that After deploying the target video microservice in each of the containers according to the image file, the method further includes: Receive a configuration information update instruction for the target video microservice; According to the configuration information update instruction of the target video microservice, the target environment variable data in the configuration file of each Pod is uniformly updated.

4. The method according to claim 1, characterized in that: The method further comprises: When the target video microservice is deployed in the node, determining whether other target video microservices have been deployed in the node; If it is determined that no other target video microservice is deployed in the node, setting the preset external access port as the external access port uniquely corresponding to the target video microservice; If it is determined that other target video microservices have been deployed in the node, a new external access port is created, and the new external access port is set as the external access port uniquely corresponding to the target video microservice; The target video microservice is used to interact with an external device through a unique corresponding external access port.

5. The method according to claim 4, characterized in that The method further comprises: After completing the deployment of the target video microservice and starting to run the target video microservice, detecting the running status of the target video microservice; When it is detected that the running state of the target video micro service is abnormally terminated, the external access port uniquely corresponding to the target video micro service is recovered.

6. The method according to claim 1, characterized in that When the target video microservice is a video distribution service, after deploying the target video microservice in each container according to the image file, the method further includes: When it is determined that the total number of video playback channels is greater than the preset system load limit, the number of target video microservices to be added is determined according to the difference between the total number of video playback channels and the load limit; Among the multiple nodes, determine at least one first node in which the number of deployed target video microservices does not reach a preset upper limit, and determine a maximum allowed total number of newly added target video microservices in the at least one first node; If the maximum allowed total number of new additions is not less than the required number of new additions, then a number of the target video microservices whose number is the required number of new additions is newly deployed in the at least one first node; If the maximum allowed total number of new additions is less than the required number of new additions, a new Pod is created in the at least one first node, and a number of target video microservices equal to the required number of new additions is newly deployed in the new Pod.

7. The method according to claim 1, characterized in that When the target video microservice is a video distribution service, after deploying the target video microservice in each container according to the image file, the method further includes: When it is determined that the total number of video playback paths is less than a preset system load lower limit, determining the number of target video microservices that can be reduced according to the difference between the total number of video playback paths and the load lower limit; According to the number of deployments of the target video microservice in each of the nodes and the load balancing strategy, determining at least one second node for executing the video microservice scaling-down strategy from among the multiple nodes; The target video microservices having a number that is the reducible number are deleted in the at least one second node.

8. A video microservice deployment device, characterized in that: The device comprises: An acquisition unit, used to acquire a service type identifier, a quantity to be deployed, and an image file of a target video microservice; A determination unit, configured to determine corresponding target environment variable data from a plurality of predefined environment variable data according to a service type identifier of the target video microservice; wherein the plurality of environment variable data are obtained by mapping a plurality of configuration items of different types of video microservices; A creation unit, configured to create a plurality of container groups Pods and a configuration file of each Pod on a plurality of nodes of a video surveillance system based on the number to be deployed and the target environment variable data; wherein each of the Pods includes at least one container, the total number of containers in the plurality of Pods is equal to the number to be deployed, and the configuration file of each of the Pods includes the target environment variable data; A deployment unit is used to deploy the target video microservice in each of the containers according to the image file; wherein each of the containers is used to start and run the target video microservice according to the target environment variable data in the configuration file of the Pod.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the video microservice deployment method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the video microservice deployment method according to any one of claims 1 to 7.