Camera resource sharing method and device

By performing feature extraction and multi-layer perceptron model training on historical camera video processing data, a load balancing model is obtained, which solves the problem of insufficient camera computing power in the existing video surveillance system and improves the efficiency and flexibility of video analysis.

CN119815186AActive Publication Date: 2025-04-11富盛科技股份有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510266288.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-04-11
Estimated Expiration
2045-03-07

AI Technical Summary

Technical Problem

With the increasing demand for intelligent analysis, existing video surveillance systems face the problems of insufficient computing power and high cost of cameras, which affects analysis efficiency and accuracy.

Method used

By extracting the feature of historical camera video processing data, determining hardware capability features, real-time state features, task features and performance features, combining these features to build computing power matching indicators, priority matching indicators and performance matching indicators, and using multi-layer perceptron models for model training to obtain a load balancing model. According to the model, the optimal shared camera is determined for video analysis.

Benefits of technology

It improves the efficiency and flexibility of camera video analysis, optimizes resource utilization, reduces system costs, and improves the accuracy of analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119815186A_ABST
    Figure CN119815186A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a camera resource sharing method and device, and the method comprises the steps: carrying out the feature extraction of historical camera video processing data, determining a corresponding hardware capability feature, a real-time state feature, a task feature and a performance feature, combining the hardware capability feature with the task feature to obtain a calculation power matching index, and carrying out the calculation power matching index; combining the real-time state features and the task features to obtain priority matching indexes, combining the real-time state features and the performance features to obtain performance matching indexes, constructing a data set according to the computing power matching indexes, the priority matching indexes and the performance matching indexes, and inputting the data set into a preset multi-layer perceptron model for model training, obtaining a load balancing model; after the video analysis request of the camera is received according to the load balancing model, the optimal shared camera is output, a corresponding video analysis result is obtained, and the video analysis efficiency and flexibility of the camera can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a camera resource sharing method and device. Background Art

[0002] With the rapid development of digital video technology, digital cameras have become an important tool for modern video surveillance and image analysis. Currently, most digital cameras on the market are connected to video management platforms or storage devices as video image sources and are centrally managed by these platforms. However, the analysis module used by cameras to perform video analysis functions can usually only run on a single machine, which results in the computing power of all cameras in a system not being fully utilized.

[0003] With the growing demand for intelligent analysis, existing video surveillance systems face many challenges. First, in order to meet the growing demand for intelligent analysis, the system often needs to add cameras with video analysis functions to supplement the required functions, which undoubtedly increases the cost of the system. Second, when processing large amounts of video data, the analysis module running on a single machine may have insufficient computing power, affecting the efficiency and accuracy of the analysis.

[0004] Based on the above problems, there is an urgent need for a camera resource sharing method that can overcome these challenges and improve the efficiency and flexibility of camera video analysis. Summary of the invention

[0005] In view of the problems in the prior art, the present application provides a camera resource sharing method and device, which can improve the efficiency and flexibility of camera video analysis.

[0006] In order to solve at least one of the above problems, the present application provides the following technical solutions: In a first aspect, the present application provides a camera resource sharing method, comprising: Collecting historical camera video processing data, wherein the historical camera video processing data includes historical camera hardware parameters, historical camera operation data, historical camera video task analysis data, and historical video task allocation records; Performing a feature extraction operation on the historical camera video processing data, respectively determining the corresponding hardware capability features, real-time status features, task features and performance features, performing a feature combination operation on the hardware capability features and the task features, determining the corresponding computing power matching index, performing a feature combination operation on the real-time status features and the task features, determining the corresponding priority matching index, performing a feature combination operation on the real-time status features and the performance features, determining the corresponding performance matching index, performing a data set construction operation according to the computing power matching index, the priority matching index and the performance matching index, and inputting the training data set obtained after the data set construction operation into a preset multi-layer perceptron model for model training, and determining the corresponding load balancing model; Receive a video analysis request from a camera, determine a corresponding optimal shared camera according to the video task features in the video analysis request and the load balancing model, and send the optimal shared camera information to the camera so that the camera sends the video to be analyzed to the optimal shared camera for video analysis to obtain a corresponding video analysis result.

[0007] Furthermore, the method further comprises: Poll to determine the computing power usage of the camera; If the computing power is insufficient, the video task features of the camera are extracted, and the corresponding optimal shared camera is determined according to the video task features of the camera and the load balancing model. The optimal shared camera information is sent to the camera so that the camera sends the video to be analyzed to the optimal shared camera for video analysis to obtain the corresponding video analysis result.

[0008] Furthermore, the feature extraction operation is performed on the historical camera video processing data to respectively determine the corresponding hardware capability features, real-time status features, task features and performance features, including: Performing a normalization operation on the historical camera hardware parameters in the historical camera video processing data to determine the corresponding camera hardware parameters of the same dimension, performing a feature extraction operation on the camera hardware parameters of the same dimension to determine the corresponding hardware capability characteristics, wherein the hardware capability characteristics include a comprehensive computing power index, a memory capacity index, and a network bandwidth index, and the comprehensive computing power index is used to represent the comprehensive computing power value of the CPU and the GPU; Performing a classification operation on the historical camera video task analysis data in the historical camera video processing data, and performing a feature extraction operation on the historical camera video task analysis data after the classification operation to determine corresponding task features, wherein the task features include a task difficulty index and a task priority index; A feature extraction operation is performed on the historical camera operation data and the historical video task allocation records in the historical camera video processing data to determine corresponding real-time status features and performance features, wherein the real-time status features include load indicators, resource remaining indicators, and task queue pressure indicators, and the performance characteristics include average task completion time, task delay rate, and task failure rate.

[0009] Furthermore, performing a feature combination operation on the hardware capability feature and the task feature to determine a corresponding computing power matching index includes: Performing a computing power matching operation on the comprehensive computing power index in the hardware capability feature and the task difficulty index in the task feature, wherein the comprehensive computing power index is obtained by weighted calculation based on the CPU computing power and the GPU computing power, and the task difficulty index is obtained by weighted calculation based on the video complexity, the algorithm complexity and the task size; The corresponding computing power matching index is determined according to the computing power matching value obtained after the computing power matching calculation operation, and the computing power matching index is used to characterize the matching degree between the camera and the computing power requirements of the video analysis task.

[0010] Furthermore, performing a feature combination operation on the real-time status feature and the task feature to determine a corresponding priority matching index includes: A priority matching degree calculation operation is performed on the resource remaining index in the real-time status feature and the task priority index in the task feature, wherein the resource remaining index is obtained by weighted calculation based on the CPU remaining capacity, the GPU remaining capacity and the memory remaining capacity, and the task priority index is obtained by quantifying the preset task priority; A corresponding priority matching index is determined according to the priority matching value obtained after the priority matching calculation operation, and the priority matching index is used to characterize the matching degree between the camera and the high priority requirement of the video analysis task.

[0011] Furthermore, performing a feature combination operation on the real-time status feature and the performance feature to determine a corresponding performance matching index includes: Performing a performance matching degree calculation operation on the task queue pressure index in the real-time status feature, the load index in the real-time status feature, and the comprehensive performance index obtained by weighted calculation according to the performance feature, wherein the task queue pressure index is obtained according to the queue length and the task processing time, and the load index is obtained by weighted calculation according to the current CPU or GPU usage rate; A corresponding performance matching index is determined according to the performance matching value obtained after the performance matching calculation operation, and the performance matching index is used to characterize the matching degree between the camera and the performance requirement of the video analysis task.

[0012] Furthermore, the data set construction operation is performed according to the computing power matching index, the priority matching index and the performance matching index, and the training data set obtained after the data set construction operation is input into a preset multi-layer perceptron model for model training to determine the corresponding load balancing model, including: Perform a feature vector construction operation according to the computing power matching index, the priority matching index, and the performance matching index to determine a corresponding load balancing feature vector, and perform a data set construction operation according to the load balancing feature vector and a preset optimal index label to determine a corresponding load balancing data set; A training set partitioning operation is performed on the load balancing data set to determine a corresponding training set, and the training set is input into a preset multi-layer perceptron model for model training to determine a corresponding load balancing model.

[0013] In a second aspect, the present application provides a camera resource sharing device, comprising: A parameter collection module, used to collect historical camera video processing data, wherein the historical camera video processing data includes historical camera hardware parameters, historical camera operation data, historical camera video task analysis data, and historical video task allocation records; A feature extraction and model training module is used to perform a feature extraction operation on the video processing data of the historical camera, respectively determine the corresponding hardware capability features, real-time status features, task features and performance features, perform a feature combination operation on the hardware capability features and the task features, determine the corresponding computing power matching index, perform a feature combination operation on the real-time status features and the task features, determine the corresponding priority matching index, perform a feature combination operation on the real-time status features and the performance features, determine the corresponding performance matching index, perform a data set construction operation according to the computing power matching index, the priority matching index and the performance matching index, and input the training data set obtained after the data set construction operation into a preset multi-layer perceptron model for model training to determine the corresponding load balancing model; The camera resource sharing module is used to receive a video analysis request from a camera, determine a corresponding optimal shared camera according to the video task characteristics in the video analysis request and the load balancing model, and send the optimal shared camera information to the camera so that the camera sends the video to be analyzed to the optimal shared camera for video analysis to obtain a corresponding video analysis result.

[0014] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the camera resource sharing method when executing the program.

[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the camera resource sharing method when executed by a processor.

[0016] In a fifth aspect, the present application provides a computer program product, including a computer program / instruction, which implements the steps of the camera resource sharing method when executed by a processor.

[0017] It can be seen from the above technical scheme that the present application provides a camera resource sharing method and device, which extracts features from historical camera video processing data, determines the corresponding hardware capability features, real-time status features, task features and performance features respectively, combines the hardware capability features and task features to obtain a computing power matching index, combines the real-time status features and task features to obtain a priority matching index, combines the real-time status features and performance features to obtain a performance matching index, constructs a data set according to the computing power matching index, the priority matching index and the performance matching index, and inputs the data set into a preset multi-layer perceptron model for model training to obtain a load balancing model; after receiving the video analysis request of the camera according to the load balancing model, outputs the optimal shared camera to obtain the corresponding video analysis result, thereby improving the efficiency and flexibility of the camera video analysis. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 This is one of the flow charts of the camera resource sharing method in the embodiment of the present application; Figure 2 The second flowchart of the camera resource sharing method in the embodiment of the present application; Figure 3 The third flowchart of the camera resource sharing method in the embodiment of the present application; Figure 4 FIG4 is a flow chart of the camera resource sharing method in the embodiment of the present application; Figure 5FIG5 is a flowchart of the camera resource sharing method in the embodiment of the present application; Figure 6 FIG6 is a sixth flow chart of the camera resource sharing method in the embodiment of the present application; Figure 7 FIG7 is a flow chart of the camera resource sharing method in the embodiment of the present application; Figure 8 is a structural diagram of a camera resource sharing device in an embodiment of the present application; Fig. 9 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application.

[0020] Reference numerals: Electronic device 9600, central processing unit 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver program storage unit 9144, antenna 9111, speaker 9131, microphone 9132. DETAILED DESCRIPTION

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

[0022] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0023] Considering the problem of insufficient computing power in the existing video surveillance system. The present application provides a camera resource sharing method and device, which extracts features from historical camera video processing data, determines the corresponding hardware capability features, real-time status features, task features and performance features respectively, combines the hardware capability features and task features to obtain a computing power matching index, combines the real-time status features and task features to obtain a priority matching index, combines the real-time status features and performance features to obtain a performance matching index, constructs a data set according to the computing power matching index, the priority matching index and the performance matching index, and inputs the data set into a preset multi-layer perceptron model for model training to obtain a load balancing model; after receiving the video analysis request of the camera according to the load balancing model, outputs the optimal shared camera, and obtains the corresponding video analysis result, thereby improving the efficiency and flexibility of the camera video analysis.

[0024] In order to improve the efficiency and flexibility of camera video analysis, the present application provides an embodiment of a camera resource sharing method, see Figure 1 , the camera resource sharing method specifically includes the following contents: Step S101: collecting historical camera video processing data, wherein the historical camera video processing data includes historical camera hardware parameters, historical camera operation data, historical camera video task analysis data, and historical video task allocation records; Optionally, this step is the data collection phase for training the load balancing model.

[0025] Camera hardware parameters, including CPU, GPU model, memory size, network interface, and storage.

[0026] Camera operation data, including CPU / GPU usage, current task queue length, network bandwidth usage, memory usage, and system temperature.

[0027] Camera video task analysis data, including video resolution, analysis algorithm complexity, task priority, task size, and task source.

[0028] Video task allocation records, assigned cameras, task allocation time, task completion time, task delay rate, task failure rate, and camera load changes.

[0029] The above data is the historical data recorded in previous camera processing tasks. After collecting the historical data, the data is cleaned to remove outliers and noise data.

[0030] Remove missing values: For missing hardware parameters, use the average value of similar cameras to fill in.

[0031] Remove outliers: For example, data points where CPU usage exceeds 100%.

[0032] In addition, the hardware parameters are normalized, and the CPU main frequency and GPU core number are normalized to the [0,1] interval. Then the real-time status data is standardized.

[0033] The data collection and preprocessing process in the above steps lays a solid data foundation for subsequent model training.

[0034] Step S102: performing a feature extraction operation on the historical camera video processing data, respectively determining the corresponding hardware capability features, real-time status features, task features and performance features, performing a feature combination operation on the hardware capability features and the task features, determining the corresponding computing power matching index, performing a feature combination operation on the real-time status features and the task features, determining the corresponding priority matching index, performing a feature combination operation on the real-time status features and the performance features, determining the corresponding performance matching index, performing a data set construction operation according to the computing power matching index, the priority matching index and the performance matching index, and inputting the training data set obtained after the data set construction operation into a preset multi-layer perceptron model for model training, and determining the corresponding load balancing model; Optionally, in this embodiment, feature extraction is performed on the preprocessed data set.

[0035] a. Hardware capability characteristics reflect the hardware resource status of the camera, including comprehensive computing power indicators, memory capacity indicators, and network bandwidth indicators, which are used to evaluate the basic hardware capabilities of the camera when processing tasks.

[0036] The comprehensive computing power index H is a comprehensive computing power value calculated by combining the CPU main frequency, core number, GPU core number, and video memory size.

[0037] CPU computing power: CPU main frequency × number of cores × number of threads GPU computing power: number of GPU cores × video memory size.

[0038] Comprehensive computing power: H = α × (CPU computing power) + β × (GPU computing power) Among them, α and β are weight coefficients, which are adjusted according to the actual scenario (for example, for GPU-based tasks, β can be higher).

[0039] The memory capacity index is the weighted sum of memory capacity and frequency, which can reflect the storage capacity of the camera when processing large-scale data.

[0040] The network bandwidth indicator is the inverse of the network interface bandwidth and delay. It can reflect the performance of the camera in network transmission and is particularly important for tasks that require real-time data transmission.

[0041] b. Real-time status features, which reflect the operating status of the camera at the current moment, including load indicators, resource remaining indicators, and task queue pressure indicators. These features are used to evaluate the current availability and task processing capabilities of the camera.

[0042] The resource remaining index R takes into account the remaining capacity of the memory and the remaining capacity of the video memory, and can comprehensively evaluate the current resource availability of the camera.

[0043] CPU Remaining Capacity: 1 - Current CPU usage.

[0044] GPU remaining capacity: 1 - Current GPU usage.

[0045] Remaining memory capacity: Remaining memory / Total memory.

[0046] Comprehensive resource surplus: R = μ × (CPU remaining capacity) + ν × (GPU remaining capacity) + ω × (memory remaining capacity) Among them, μ, ν, ω are weight coefficients.

[0047] The task queue pressure index QP is the product of the task queue length and the average processing time. It can reflect the load of the camera's current task queue and help evaluate the degree of task backlog.

[0048] QP = task queue length × average task processing time The load indicator LP is the weighted sum of CPU / GPU usage. It can reflect the current load of the camera and help evaluate whether it is in an overload state.

[0049] LP = μ × current CPU usage + ν × current GPU usage Current status indicator CS: CS = α × QP + β × LP Among them, α and β are weight coefficients used to balance the impact of task queue pressure and load pressure.

[0050] c. Task characteristics, including task difficulty index and task priority index. These characteristics are used to assess the complexity and importance of tasks.

[0051] The task difficulty index T is calculated by combining the video resolution, analysis algorithm complexity and task size to accurately assess the difficulty of the task.

[0052] Video complexity: resolution weight (e.g. 1080p is 1, 4K is 2) × frame rate.

[0053] Algorithm complexity: Assign weights based on the algorithm type (e.g., object detection is 1, behavior analysis is 2, and deep learning is 3).

[0054] Task size: video length (seconds).

[0055] Mission Difficulty:

[0056] in, , , is the weight coefficient.

[0057] The task priority index P is to give higher weights to high-priority tasks and quantify the task priority into a numerical value. For example, high priority is 3, medium priority is 2, and low priority is 1. It can help give priority to high-priority tasks when allocating tasks and ensure that important tasks can be processed in a timely manner.

[0058] d. Performance characteristics, which reflect the performance of the camera in historical tasks, including average task completion time, task delay rate, and task failure rate. These characteristics are used to evaluate the performance stability and reliability of the camera.

[0059] The average task completion time is the average time it takes for a camera to complete a task over a period of time.

[0060] The task delay rate is the number of task delays / total number of tasks.

[0061] The task failure rate is the number of task failures / total number of tasks.

[0062] Performance index HP: can comprehensively evaluate the performance of the camera.

[0063]

[0064] in, , , is the weight coefficient.

[0065] After extracting the above hardware capability features, real-time status features, task features and performance features, feature combination is performed. Feature combination is to integrate different types of features to better reflect the complexity and dynamics of task allocation.

[0066] Specifically, the computing power matching index (M) The matching degree between hardware capability and task difficulty is calculated to evaluate whether the hardware capability of the camera is suitable for handling specific task difficulty.

[0067] Matching degree (M): M = comprehensive computing power index (H) / task difficulty index (T) The higher the matching degree, the more suitable the camera's hardware capabilities are for handling the task. When assigning tasks, give priority to cameras with high matching degrees to ensure that the task can be completed efficiently.

[0068] Specifically, the priority matching index (U) The matching degree between resource utilization and task priority is calculated to evaluate whether the current resource utilization of the camera can meet the requirements of high-priority tasks.

[0069] Matching degree (U): U = resource remaining index (R) × task priority index (P) The higher the matching degree, the better the camera's current resource utilization can meet the needs of high-priority tasks. When allocating tasks, cameras with high matching degrees are given priority to ensure that high-priority tasks can be processed in a timely manner.

[0070] Specific, performance matching index (S) The matching degree between historical performance and current status is calculated to evaluate whether the historical performance of the camera can adapt to the pressure of the current task queue.

[0071] Matching degree (S): S = historical performance index (HP) / current status index (CS) The higher the matching degree, the better the camera's historical performance can adapt to the pressure of the current task queue. When allocating tasks, give priority to cameras with high matching degrees to ensure that tasks can be completed efficiently while avoiding overload.

[0072] It is understandable that the above-mentioned matching degree construction method can help the model further understand the relationship between indicators and better find the best shared computing power. According to the hardware capabilities, real-time status, task characteristics and performance characteristics, tasks can be accurately assigned to the most suitable cameras to improve task processing efficiency. By evaluating resource utilization and task priority, resources can be reasonably allocated to avoid resource waste, while ensuring that high-priority tasks can be processed in a timely manner. By evaluating historical performance and current status, cameras with good performance can be selected to handle tasks, reducing task delays and failure rates, and improving the overall performance of the system. Feature extraction and matching degree calculation can reflect the status and task requirements of the camera in real time, enabling the system to dynamically adapt to different task scenarios and hardware status changes.

[0073] Next, construct a feature vector based on the calculated matching degree.

[0074] Specifically, in the process of constructing the feature vector, according to the matching degree between hardware capability and task difficulty (M), the matching degree between resource utilization and task priority (U), and the matching degree between historical performance and current status (S), the feature vector can be constructed as: X=[M,U,S,] Optionally, another implementation is to use three matching degrees as feature vectors and use other indicators as auxiliary indicators, such as task priority, camera network delay, task queue length, etc., to further enrich the input of the model.

[0075] At this point, the feature vector can be constructed as: X=[M,U,S,Queue Length,Network Latency] Among them, Queue Length = task queue length, Network Latency = network delay It can be understood that any indicator that is helpful to resource utilization and sharing can be used to construct the feature vector, and the above is merely an illustrative embodiment.

[0076] Next, we use the task completion time as the target label to construct a dataset. It can be understood that predicting the task completion time can select the camera with the shortest completion time, thereby obtaining the optimal shared camera.

[0077] For example, suppose the data set is as follows:

[0078] The eigenvectors and target values ​​are as follows X = df[["M", "U", "S", "Queue Length", "Network Latency"]] y = df["Task Completion Time"] Next, the current task and the state features of the camera are combined into a feature vector and input into the trained model, which will output the optimal decision for task allocation.

[0079] Specifically, the data set is divided into a training set, a validation set, and a test set. The training set is input into a preset multi-layer perceptron model for model training, the validation set is used to adjust the model's hyperparameters, and the test set is used for final testing to evaluate the model performance, thereby obtaining a load balancing model that can be used in real application scenarios. After obtaining the corresponding video data, the model can output the optimal shared resource camera.

[0080] This step obtains a trained load balancing model, which can be used for resource balancing in subsequent camera resource sharing scenarios.

[0081] Step S103: Receive a video analysis request from a camera, determine a corresponding optimal shared camera according to the video task features in the video analysis request and the load balancing model, and send the optimal shared camera information to the camera so that the camera sends the video to be analyzed to the optimal shared camera for video analysis to obtain a corresponding video analysis result.

[0082] This step is the application of the load balancing model. Specific application scenarios are: 1. The video surveillance platform is connected to cameras with computing power and cameras without computing power. When a camera without computing power needs to perform a video analysis task, or when a video analysis task is required when the camera has computing power but the computing power is insufficient, the camera that needs computing power initiates a video analysis request to the video surveillance platform. After receiving the request, the monitoring platform performs computing power analysis based on the video task and the computing power of the cameras pre-stored on the platform, and finally sends the video task to the camera with the best shared computing power for video analysis.

[0083] 2. The video surveillance platform is connected to cameras with computing power and cameras without computing power. The platform polls and checks the computing power of the cameras. When the CPU or GPU usage rate of the server performing the video analysis task reaches a certain rate (for example, 80%), the video platform determines that the computing power is insufficient. The video tasks of the cameras with insufficient computing power are extracted, and the computing power analysis is performed based on the video tasks and the computing power of the cameras pre-stored on the platform. Finally, the video tasks are sent to the camera with the best shared computing power for video analysis.

[0084] 3. Another application scenario is that there may be no video surveillance platform. The load balancing module can be installed in the resource sharing module of the camera cluster. The camera cluster directly sends the video to be analyzed to the best shared computing power camera for video analysis through the GB 28181 protocol.

[0085] For example, the platform now receives a video analysis task request: Mission Features: Video resolution: 1080p Frame rate: 30fps Analysis Algorithms: Behavioral Analysis (Medium Complexity) Task priority: High Task size: 30 seconds Next, the platform uses the feature extraction module of the load balancing model to extract the above video task features and the camera computing power features pre-existing in the system into hardware capability features, real-time status features, task features, and historical performance features. The above features are combined to obtain the matching degree between the corresponding hardware capability and task difficulty (M), the matching degree between resource utilization and task priority (U), and the matching degree between historical performance and current status (S). The above matching degrees are input into the model for model prediction, and the camera with the shortest completion time output by the model can be obtained, that is, the optimal shared camera.

[0086] This example shows how this embodiment implements resource sharing between cameras through a load balancing model.

[0087] From the above description, it can be seen that the camera resource sharing method provided in the embodiment of the present application can determine the corresponding hardware capability characteristics, real-time status characteristics, task characteristics and performance characteristics by extracting features from historical camera video processing data, and combining the hardware capability characteristics and task characteristics to obtain a computing power matching index, combining the real-time status characteristics and task characteristics to obtain a priority matching index, and combining the real-time status characteristics and performance characteristics to obtain a performance matching index. A data set is constructed according to the computing power matching index, the priority matching index and the performance matching index, and the data set is input into a preset multi-layer perceptron model for model training to obtain a load balancing model; after receiving the video analysis request of the camera according to the load balancing model, the optimal shared camera is output to obtain the corresponding video analysis result, thereby improving the efficiency and flexibility of the camera video analysis.

[0088] In one embodiment of the camera resource sharing method of the present application, see Figure 2 , and can also include the following: Step S201: polling to determine the computing power usage of the camera; Step S202: If the computing power is insufficient, extract the video task features of the camera, determine the corresponding optimal shared camera according to the video task features of the camera and the load balancing model, and send the optimal shared camera information to the camera so that the camera sends the video to be analyzed to the optimal shared camera for video analysis to obtain the corresponding video analysis result.

[0089] This optional step describes another application scenario of this embodiment. The video surveillance platform is connected to cameras with computing power and cameras without computing power. In this case, there is no need to receive video analysis applications from the cameras. Instead, the platform polls and checks the computing power of the cameras. When the CPU or GPU usage rate of the server that performs the video analysis task reaches a certain rate (for example, 80%), the video platform determines that the computing power is insufficient, extracts the video tasks of the cameras with insufficient computing power, performs computing power analysis based on the video tasks and the computing power of the cameras pre-stored on the platform, and finally sends the video tasks to the camera with the best shared computing power for video analysis.

[0090] Specifically, resource sharing between cameras and platforms, and between cameras is achieved through the GB 28181 protocol.

[0091] Through step S202, this embodiment implements video task sharing calculation by platform polling detection.

[0092] In one embodiment of the camera resource sharing method of the present application, see Figure 3 , and can also include the following: Step S301: normalizing the historical camera hardware parameters in the historical camera video processing data to determine the corresponding camera hardware parameters of the same dimension, performing feature extraction on the camera hardware parameters of the same dimension to determine the corresponding hardware capability characteristics, wherein the hardware capability characteristics include a comprehensive computing power index, a memory capacity index, and a network bandwidth index, and the comprehensive computing power index is used to represent the comprehensive computing power value of the CPU and the GPU; Step S302: performing a classification operation on the historical camera video task analysis data in the historical camera video processing data, and performing a feature extraction operation on the historical camera video task analysis data after the classification operation to determine corresponding task features, wherein the task features include a task difficulty index and a task priority index; Step S303: Perform feature extraction operations on the historical camera operation data and historical video task allocation records in the historical camera video processing data to determine corresponding real-time status characteristics and performance characteristics, respectively, wherein the real-time status characteristics include load indicators, resource remaining indicators, and task queue pressure indicators, and the performance characteristics include average task completion time, task delay rate, and task failure rate.

[0093] Optionally, in this embodiment, this step is a process of extracting features from historical data. Before feature extraction, unified data processing is required.

[0094] Specifically, the hardware parameters in the historical camera video processing data are normalized, and the hardware parameters of different dimensions are converted to the same dimension and normalized to the range of [0, 1].

[0095] The normalization formula is:

[0096] Where x is the original data, min(x) and max(x) are the minimum and maximum values ​​of the feature respectively.

[0097] Extract hardware capability features from the normalized hardware parameters, including: The comprehensive computing power index H is a comprehensive computing power value calculated by combining the CPU main frequency, core number, GPU core number, and video memory size.

[0098] CPU computing power: CPU main frequency × number of cores × number of threads GPU computing power: number of GPU cores × video memory size.

[0099] Comprehensive computing power: H = α × (CPU computing power) + β × (GPU computing power) Among them, α and β are weight coefficients, which are adjusted according to the actual scenario (for example, for GPU-based tasks, β can be higher).

[0100] The memory capacity index is the weighted sum of memory capacity and frequency, which can reflect the storage capacity of the camera when processing large-scale data.

[0101] The network bandwidth indicator is the inverse of the network interface bandwidth and delay. It can reflect the performance of the camera in network transmission and is particularly important for tasks that require real-time data transmission.

[0102] Through comprehensive computing power indicators, memory capacity indicators and network bandwidth indicators, the hardware capabilities of the camera are comprehensively evaluated to provide a hardware foundation for subsequent load balancing decisions.

[0103] Specifically, the historical camera video task analysis data is classified, and the tasks are grouped according to attributes such as type and complexity, so as to facilitate subsequent targeted feature extraction.

[0104] Extract task features from the classified task data, including: Task difficulty index (T): Combine the video resolution, analysis algorithm complexity and task size to calculate the task difficulty value. The formula is:

[0105] in: Video complexity = resolution weight × frame rate Algorithm complexity = weight assigned according to algorithm type Task size = video duration (seconds) , , is the weight coefficient.

[0106] Task priority index (P): Quantify the task priority into a numerical value, such as high priority is 3, medium priority is 2, and low priority is 1.

[0107] Through classification, we can better understand the characteristics and requirements of different types of tasks, provide a clear framework for subsequent feature extraction, and use task difficulty indicators and task priority indicators to comprehensively evaluate the complexity and importance of tasks, providing a task-level basis for load balancing decisions.

[0108] Specifically, real-time status features and performance features are extracted from historical camera operation data and historical video task allocation records, including: Real-time status features: Load metric (LP): The weighted sum of CPU and GPU utilization, with the formula: LP = μ × (current CPU usage) + ν × (current GPU usage) Resource Remaining Index (R): Comprehensively considers the remaining capacity of CPU, GPU and memory. The formula is: R = μ × (CPU remaining capacity) + ν × (GPU remaining capacity) + ω × (memory remaining capacity) Task queue pressure index (QP): the product of the task queue length and the average processing time. The formula is: QP = task queue length × average task processing time Current state indicator (CS): Comprehensive task queue pressure and load pressure, the formula is: CS = α × QP + β × LP Through load indicators, resource remaining indicators and task queue pressure indicators, the current operating status and task processing capabilities of the camera can be comprehensively evaluated, providing real-time basis for load balancing decisions.

[0109] Performance characteristics: Average task completion time: the average time it takes for the camera to complete a task in the past period of time.

[0110] Task delay rate: number of task delays / total number of tasks.

[0111] Task failure rate: number of task failures / total number of tasks.

[0112] Performance index (HP): Comprehensively consider the average task completion time, task delay rate and task failure rate. The formula is:

[0113] The average task completion time, task delay rate, and task failure rate can be used to evaluate the historical performance of the camera and provide a performance-level basis for load balancing decisions.

[0114] Through step S303, this embodiment realizes the extraction of various indicators that affect the camera video analysis capability, provides rich feature input for the load balancing model, helps the model to allocate tasks more accurately, ensures that tasks can be completed efficiently, and avoids resource waste and overload.

[0115] In one embodiment of the camera resource sharing method of the present application, see Figure 4 , and can also include the following: Step S401: performing a computing power matching operation on the comprehensive computing power index in the hardware capability feature and the task difficulty index in the task feature, wherein the comprehensive computing power index is obtained by weighted calculation based on the CPU computing power and the GPU computing power, and the task difficulty index is obtained by weighted calculation based on the video complexity, the algorithm complexity and the task size; Step S402: determining a corresponding computing power matching index according to the computing power matching value obtained after the computing power matching calculation operation, wherein the computing power matching index is used to characterize the matching degree between the camera and the computing power requirements of the video analysis task.

[0116] Optionally, in this embodiment, computing power matching degree is calculated.

[0117] Computing power matching index (M) The matching degree between hardware capability and task difficulty is calculated to evaluate whether the hardware capability of the camera is suitable for handling specific task difficulty.

[0118] Matching degree (M): M = comprehensive computing power index (H) / task difficulty index (T) H = α × (CPU computing power) + β × (GPU computing power)

[0119] By calculating the ratio of the comprehensive computing power index to the task difficulty index, the degree of match between hardware capabilities and task requirements can be intuitively reflected.

[0120] High matching degree (M high): indicates that the hardware capabilities of the camera can well meet the task requirements, and the task assigned to the camera can be completed efficiently.

[0121] Low match (M low): indicates that the camera's hardware capabilities are insufficient to process the task, which may cause the task to execute slowly or fail.

[0122] Through step S402, this embodiment successfully constructs a computing power matching index, providing a quantitative index for the load balancing model to evaluate the degree of computing power matching between the camera and the task. When allocating tasks, cameras with high computing power matching indexes are given priority to ensure that tasks can be completed efficiently while avoiding resource waste and overload.

[0123] In one embodiment of the camera resource sharing method of the present application, see Figure 5 , and can also include the following: Step S501: performing a priority matching calculation operation on the resource remaining indicator in the real-time status feature and the task priority indicator in the task feature, wherein the resource remaining indicator is obtained by weighted calculation based on the CPU remaining capacity, the GPU remaining capacity and the memory remaining capacity, and the task priority indicator is obtained by quantifying the preset task priority; Step S502: determining a corresponding priority matching index according to the priority matching value obtained after the priority matching calculation operation, wherein the priority matching index is used to characterize the matching degree between the camera and the high priority requirement of the video analysis task.

[0124] Optionally, in this embodiment, a priority matching degree is calculated.

[0125] Priority matching index (U) The matching degree between resource utilization and task priority is calculated to evaluate whether the current resource utilization of the camera can meet the requirements of high-priority tasks.

[0126] Matching degree (U): U = resource remaining index (R) × task priority index (P) R = μ × (CPU remaining capacity) + ν × (GPU remaining capacity) + ω × (memory remaining capacity) P is a higher priority task that is given a higher weight, and the task priority is quantified into a numerical value. For example, high priority is 3, medium priority is 2, and low priority is 1.

[0127] High matching degree (U high): indicates that the camera currently has sufficient resources to process high-priority tasks, and high-priority tasks are assigned to the camera first.

[0128] Low matching degree (U low): indicates that the camera currently has limited resources and may not be able to process high-priority tasks in time, and other cameras need to be considered.

[0129] Through step S502, this embodiment successfully constructs a priority matching index, which provides a quantitative index for the load balancing model to evaluate whether the current resource utilization of the camera can meet the needs of high-priority tasks. When allocating tasks, cameras with high matching degrees are given priority to ensure that high-priority tasks can be processed in a timely manner.

[0130] In one embodiment of the camera resource sharing method of the present application, see Figure 6 , and can also include the following: Step S601: performing a performance matching degree calculation operation on the task queue pressure index in the real-time status feature, the load index in the real-time status feature, and the comprehensive performance index obtained by weighted calculation according to the performance feature, wherein the task queue pressure index is obtained according to the queue length and the task processing time, and the load index is obtained by weighted calculation according to the current CPU or GPU usage rate; Step S602: determining a corresponding performance matching index according to the performance matching value obtained after the performance matching calculation operation, wherein the performance matching index is used to characterize the matching degree between the camera and the performance requirement of the video analysis task.

[0131] Optionally, in this embodiment, a performance matching degree is calculated.

[0132] Performance matching index (S) The matching degree between historical performance and current status is calculated to evaluate whether the historical performance of the camera can adapt to the pressure of the current task queue.

[0133] Matching degree (S): S = historical performance index (HP) / current status index (CS)

[0134] CS = α × QP + β × LP QP = task queue length × average task processing time LP = μ × current CPU usage + ν × current GPU usage High match (S high): indicates that the camera's historical performance can adapt well to the pressure of the current task queue, and tasks assigned to the camera can be completed efficiently while avoiding overload.

[0135] Low match (S low): indicates that the camera's historical performance cannot adapt to the pressure of the current task queue, which may cause task backlog or failure.

[0136] Through step S602, this embodiment successfully constructs a performance matching index, providing a quantitative index for the load balancing model to evaluate whether the historical performance of the camera can adapt to the pressure of the current task queue. When allocating tasks, cameras with high matching degrees are given priority to ensure that tasks can be completed efficiently while avoiding overload.

[0137] In one embodiment of the camera resource sharing method of the present application, see Figure 7 , and can also include the following: Step S701: performing a feature vector construction operation according to the computing power matching index, the priority matching index, and the performance matching index to determine a corresponding load balancing feature vector, performing a data set construction operation according to the load balancing feature vector and a preset optimal index label to determine a corresponding load balancing data set; Step S702: performing a training set division operation on the load balancing data set to determine a corresponding training set, inputting the training set into a preset multi-layer perceptron model for model training, and determining a corresponding load balancing model.

[0138] Optionally, in this embodiment, a feature vector is constructed according to the calculated matching degree.

[0139] Specifically, in the process of constructing the feature vector, according to the matching degree between hardware capability and task difficulty (M), the matching degree between resource utilization and task priority (U), and the matching degree between historical performance and current status (S), the feature vector can be constructed as: X=[M,U,S,] Optionally, another implementation is to use three matching degrees as feature vectors and use other indicators as auxiliary indicators, such as task priority, camera network delay, task queue length, etc., to further enrich the input of the model.

[0140] At this point, the feature vector can be constructed as: X=[M,U,S,Queue Length,Network Latency] Among them, Queue Length = task queue length, Network Latency = network delay It can be understood that any indicator that is helpful to resource utilization and sharing can be used to construct the feature vector, and the above is merely an illustrative embodiment.

[0141] Next, we use the task completion time as the target label to construct a dataset. It can be understood that predicting the task completion time can select the camera with the shortest completion time, thereby obtaining the optimal shared camera.

[0142] For example, suppose the data set is as follows: The eigenvectors and target values ​​are as follows X = df[["M", "U", "S", "Queue Length", "Network Latency"]] y = df["Task Completion Time"] Next, the current task and the state features of the camera are combined into a feature vector and input into the trained model, which will output the optimal decision for task allocation.

[0143] Specifically, the data set is divided into a training set, a validation set, and a test set. The training set is input into a preset multi-layer perceptron model for model training, the validation set is used to adjust the model's hyperparameters, and the test set is used for final testing to evaluate the model performance, thereby obtaining a load balancing model that can be used in real application scenarios. After obtaining the corresponding video data, the model can output the optimal shared resource camera.

[0144] This step obtains a trained load balancing model, which can be used for resource balancing in subsequent camera resource sharing scenarios.

[0145] Through step S702, this embodiment successfully obtains a load balancing model, laying a foundation for subsequent optimal scheduling of computing power sharing between cameras through the load balancing model.

[0146] In order to improve the efficiency and flexibility of camera video analysis, the present application provides an embodiment of a camera resource sharing device for implementing all or part of the contents of the camera resource sharing method, see Figure 8 The camera resource sharing device specifically includes the following contents: A parameter collection module 10 is used to collect historical camera video processing data, wherein the historical camera video processing data includes historical camera hardware parameters, historical camera operation data, historical camera video task analysis data, and historical video task allocation records; The feature extraction and model training module 20 is used to perform feature extraction operations on the historical camera video processing data, respectively determine the corresponding hardware capability features, real-time status features, task features and performance features, perform feature combination operations on the hardware capability features and the task features, determine the corresponding computing power matching index, perform feature combination operations on the real-time status features and the task features, determine the corresponding priority matching index, perform feature combination operations on the real-time status features and the performance features, determine the corresponding performance matching index, perform a data set construction operation according to the computing power matching index, the priority matching index and the performance matching index, and input the training data set obtained after the data set construction operation into a preset multi-layer perceptron model for model training to determine the corresponding load balancing model; The camera resource sharing module 30 is used to receive a video analysis request from a camera, determine a corresponding optimal shared camera according to the video task characteristics in the video analysis request and the load balancing model, and send the optimal shared camera information to the camera so that the camera sends the video to be analyzed to the optimal shared camera for video analysis to obtain a corresponding video analysis result.

[0147] From the above description, it can be seen that the camera resource sharing device provided in the embodiment of the present application can determine the corresponding hardware capability characteristics, real-time status characteristics, task characteristics and performance characteristics by extracting features from historical camera video processing data, and combining the hardware capability characteristics and task characteristics to obtain a computing power matching index, combining the real-time status characteristics and task characteristics to obtain a priority matching index, and combining the real-time status characteristics and performance characteristics to obtain a performance matching index. A data set is constructed according to the computing power matching index, the priority matching index and the performance matching index, and the data set is input into a preset multi-layer perceptron model for model training to obtain a load balancing model; after receiving the video analysis request of the camera according to the load balancing model, the optimal shared camera is output to obtain the corresponding video analysis result, thereby improving the efficiency and flexibility of the camera video analysis.

[0148] From a hardware perspective, in order to improve the efficiency and flexibility of camera video analysis, the present application provides an embodiment of an electronic device for implementing all or part of the contents of the camera resource sharing method, and the electronic device specifically includes the following contents: Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between the camera resource sharing method and related devices such as the core business system, user terminal and related database; the logic controller can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the logic controller can be implemented with reference to the embodiment of the camera resource sharing method in the embodiment and the embodiment of the camera resource sharing method, and the contents thereof are incorporated herein, and the repeated parts are not repeated.

[0149] It is understandable that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.

[0150] In practical applications, part of the camera resource sharing method can be executed on the electronic device side as described above, or all operations can be completed in the client device. The selection can be made based on the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor.

[0151] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.

[0152] Fig. 9 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Fig. 9 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Fig. 9 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.

[0153] In one embodiment, the camera resource sharing method function may be integrated into the central processing unit 9100. The central processing unit 9100 may be configured to perform the following control: Step S101: collecting historical camera video processing data, wherein the historical camera video processing data includes historical camera hardware parameters, historical camera operation data, historical camera video task analysis data, and historical video task allocation records; Step S102: performing a feature extraction operation on the historical camera video processing data, respectively determining the corresponding hardware capability features, real-time status features, task features and performance features, performing a feature combination operation on the hardware capability features and the task features, determining the corresponding computing power matching index, performing a feature combination operation on the real-time status features and the task features, determining the corresponding priority matching index, performing a feature combination operation on the real-time status features and the performance features, determining the corresponding performance matching index, performing a data set construction operation according to the computing power matching index, the priority matching index and the performance matching index, and inputting the training data set obtained after the data set construction operation into a preset multi-layer perceptron model for model training, and determining the corresponding load balancing model; Step S103: Receive a video analysis request from a camera, determine a corresponding optimal shared camera according to the video task features in the video analysis request and the load balancing model, and send the optimal shared camera information to the camera so that the camera sends the video to be analyzed to the optimal shared camera for video analysis to obtain a corresponding video analysis result.

[0154] From the above description, it can be seen that the electronic device provided in the embodiment of the present application extracts features from historical camera video processing data to determine the corresponding hardware capability features, real-time status features, task features, and performance features, respectively, combines the hardware capability features and task features to obtain a computing power matching index, combines the real-time status features and task features to obtain a priority matching index, combines the real-time status features and performance features to obtain a performance matching index, constructs a data set based on the computing power matching index, the priority matching index, and the performance matching index, and inputs the data set into a preset multi-layer perceptron model for model training to obtain a load balancing model; after receiving the video analysis request of the camera according to the load balancing model, outputs the optimal shared camera to obtain the corresponding video analysis result, thereby improving the efficiency and flexibility of the camera video analysis.

[0155] In another embodiment, the camera resource sharing method may be configured separately from the central processing unit 9100. For example, the camera resource sharing method may be configured as a chip connected to the central processing unit 9100, and the camera resource sharing method function may be implemented through the control of the central processing unit.

[0156] like Fig. 9 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Fig. 9 In addition, the electronic device 9600 may also include Fig. 9 For components not shown, reference may be made to the prior art.

[0157] like Fig. 9 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.

[0158] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.

[0159] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.

[0160] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.

[0161] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0162] The communication module 9110 is a transmitter / receiver that sends and receives signals via the antenna 9111. The communication module 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.

[0163] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless local area network module, etc. The communication module 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the machine through the microphone 9132, and the sound stored on the machine can be played through the speaker 9131.

[0164] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the camera resource sharing method in the above embodiment, where the execution subject is a server or a client. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, all the steps of the camera resource sharing method in the above embodiment, where the execution subject is a server or a client, are implemented. For example, when the processor executes the computer program, the following steps are implemented: Step S101: collecting historical camera video processing data, wherein the historical camera video processing data includes historical camera hardware parameters, historical camera operation data, historical camera video task analysis data, and historical video task allocation records; Step S102: performing a feature extraction operation on the historical camera video processing data, respectively determining the corresponding hardware capability features, real-time status features, task features and performance features, performing a feature combination operation on the hardware capability features and the task features, determining the corresponding computing power matching index, performing a feature combination operation on the real-time status features and the task features, determining the corresponding priority matching index, performing a feature combination operation on the real-time status features and the performance features, determining the corresponding performance matching index, performing a data set construction operation according to the computing power matching index, the priority matching index and the performance matching index, and inputting the training data set obtained after the data set construction operation into a preset multi-layer perceptron model for model training, and determining the corresponding load balancing model; Step S103: Receive a video analysis request from a camera, determine a corresponding optimal shared camera according to the video task features in the video analysis request and the load balancing model, and send the optimal shared camera information to the camera so that the camera sends the video to be analyzed to the optimal shared camera for video analysis to obtain a corresponding video analysis result.

[0165] From the above description, it can be seen that the computer-readable storage medium provided in the embodiment of the present application performs feature extraction on historical camera video processing data to respectively determine the corresponding hardware capability characteristics, real-time status characteristics, task characteristics and performance characteristics, combine the hardware capability characteristics and task characteristics to obtain a computing power matching index, combine the real-time status characteristics and task characteristics to obtain a priority matching index, combine the real-time status characteristics and performance characteristics to obtain a performance matching index, construct a data set according to the computing power matching index, the priority matching index and the performance matching index, and input the data set into a preset multi-layer perceptron model for model training to obtain a load balancing model; after receiving the video analysis request of the camera according to the load balancing model, output the optimal shared camera to obtain the corresponding video analysis result, thereby improving the efficiency and flexibility of the camera video analysis.

[0166] The embodiments of the present application also provide a computer program product capable of implementing all the steps of the camera resource sharing method in the above embodiments, where the execution subject is a server or a client. When the computer program / instruction is executed by a processor, the steps of the camera resource sharing method are implemented. For example, the computer program / instruction implements the following steps: Step S101: collecting historical camera video processing data, wherein the historical camera video processing data includes historical camera hardware parameters, historical camera operation data, historical camera video task analysis data, and historical video task allocation records; Step S102: performing a feature extraction operation on the historical camera video processing data, respectively determining the corresponding hardware capability features, real-time status features, task features and performance features, performing a feature combination operation on the hardware capability features and the task features, determining the corresponding computing power matching index, performing a feature combination operation on the real-time status features and the task features, determining the corresponding priority matching index, performing a feature combination operation on the real-time status features and the performance features, determining the corresponding performance matching index, performing a data set construction operation according to the computing power matching index, the priority matching index and the performance matching index, and inputting the training data set obtained after the data set construction operation into a preset multi-layer perceptron model for model training, and determining the corresponding load balancing model; Step S103: Receive a video analysis request from a camera, determine a corresponding optimal shared camera according to the video task features in the video analysis request and the load balancing model, and send the optimal shared camera information to the camera so that the camera sends the video to be analyzed to the optimal shared camera for video analysis to obtain a corresponding video analysis result.

[0167] From the above description, it can be seen that the computer program product provided in the embodiment of the present application extracts features from historical camera video processing data, determines the corresponding hardware capability features, real-time status features, task features and performance features respectively, combines the hardware capability features and task features to obtain a computing power matching index, combines the real-time status features and task features to obtain a priority matching index, combines the real-time status features and performance features to obtain a performance matching index, constructs a data set based on the computing power matching index, the priority matching index and the performance matching index, and inputs the data set into a preset multi-layer perceptron model for model training to obtain a load balancing model; after receiving the video analysis request of the camera according to the load balancing model, outputs the optimal shared camera to obtain the corresponding video analysis result, thereby improving the efficiency and flexibility of the camera video analysis.

[0168] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0169] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0170] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0171] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0172] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A camera resource sharing method, characterized in that: Applied to a network monitoring platform, the method comprises: Collecting historical camera video processing data, wherein the historical camera video processing data includes historical camera hardware parameters, historical camera operation data, historical camera video task analysis data, and historical video task allocation records; Performing a feature extraction operation on the historical camera video processing data, respectively determining the corresponding hardware capability features, real-time status features, task features and performance features, performing a feature combination operation on the hardware capability features and the task features, determining the corresponding computing power matching index, performing a feature combination operation on the real-time status features and the task features, determining the corresponding priority matching index, performing a feature combination operation on the real-time status features and the performance features, determining the corresponding performance matching index, performing a data set construction operation according to the computing power matching index, the priority matching index and the performance matching index, and inputting the training data set obtained after the data set construction operation into a preset multi-layer perceptron model for model training, and determining the corresponding load balancing model; Receive a video analysis request from a camera, determine a corresponding optimal shared camera according to the video task characteristics in the video analysis request and the load balancing model, and send the optimal shared camera information to the camera so that the camera sends the video to be analyzed to the optimal shared camera for video analysis to obtain a corresponding video analysis result, wherein the video analysis request from the camera is a historical video file analysis request or a real-time video stream analysis request.

2. The camera resource sharing method according to claim 1, characterized in that: The method further comprises: Poll to determine the computing power usage of the camera; If the computing power is insufficient, the video task features of the camera are extracted, and the corresponding optimal shared camera is determined according to the video task features of the camera and the load balancing model. The optimal shared camera information is sent to the camera so that the camera sends the video to be analyzed to the optimal shared camera for video analysis to obtain the corresponding video analysis result.

3. The camera resource sharing method according to claim 1, characterized in that: The feature extraction operation is performed on the historical camera video processing data to respectively determine the corresponding hardware capability features, real-time status features, task features and performance features, including: Performing a normalization operation on the historical camera hardware parameters in the historical camera video processing data to determine the corresponding camera hardware parameters of the same dimension, performing a feature extraction operation on the camera hardware parameters of the same dimension to determine the corresponding hardware capability characteristics, wherein the hardware capability characteristics include a comprehensive computing power index, a memory capacity index, and a network bandwidth index, and the comprehensive computing power index is used to represent the comprehensive computing power value of the CPU and the GPU; Performing a classification operation on the historical camera video task analysis data in the historical camera video processing data, and performing a feature extraction operation on the historical camera video task analysis data after the classification operation to determine corresponding task features, wherein the task features include a task difficulty index and a task priority index; A feature extraction operation is performed on the historical camera operation data and the historical video task allocation records in the historical camera video processing data to determine corresponding real-time status features and performance features, wherein the real-time status features include load indicators, resource remaining indicators, and task queue pressure indicators, and the performance characteristics include average task completion time, task delay rate, and task failure rate.

4. The camera resource sharing method according to claim 1, characterized in that: The performing a feature combination operation on the hardware capability feature and the task feature to determine a corresponding computing power matching index includes: Performing a computing power matching operation on the comprehensive computing power index in the hardware capability feature and the task difficulty index in the task feature, wherein the comprehensive computing power index is obtained by weighted calculation based on the CPU computing power and the GPU computing power, and the task difficulty index is obtained by weighted calculation based on the video complexity, the algorithm complexity and the task size; The corresponding computing power matching index is determined according to the computing power matching value obtained after the computing power matching calculation operation, and the computing power matching index is used to characterize the matching degree between the camera and the computing power requirements of the video analysis task.

5. The camera resource sharing method according to claim 1, characterized in that: The performing a feature combination operation on the real-time status feature and the task feature to determine a corresponding priority matching index includes: A priority matching degree calculation operation is performed on the resource remaining index in the real-time status feature and the task priority index in the task feature, wherein the resource remaining index is obtained by weighted calculation based on the CPU remaining capacity, the GPU remaining capacity and the memory remaining capacity, and the task priority index is obtained by quantifying the preset task priority; A corresponding priority matching index is determined according to the priority matching value obtained after the priority matching calculation operation, and the priority matching index is used to characterize the matching degree between the camera and the high priority requirement of the video analysis task.

6. The camera resource sharing method according to claim 1, characterized in that: The performing a feature combination operation on the real-time status feature and the performance feature to determine a corresponding performance matching index includes: Performing a performance matching degree calculation operation on the task queue pressure index in the real-time status feature, the load index in the real-time status feature, and the comprehensive performance index obtained by weighted calculation according to the performance feature, wherein the task queue pressure index is obtained according to the queue length and the task processing time, and the load index is obtained by weighted calculation according to the current CPU or GPU usage rate; A corresponding performance matching index is determined according to the performance matching value obtained after the performance matching calculation operation, and the performance matching index is used to characterize the matching degree between the camera and the performance requirement of the video analysis task.

7. The camera resource sharing method according to claim 1, characterized in that: The data set construction operation is performed according to the computing power matching index, the priority matching index and the performance matching index, and the training data set obtained after the data set construction operation is input into a preset multi-layer perceptron model for model training to determine the corresponding load balancing model, including: Perform a feature vector construction operation according to the computing power matching index, the priority matching index, and the performance matching index to determine a corresponding load balancing feature vector, and perform a data set construction operation according to the load balancing feature vector and a preset optimal index label to determine a corresponding load balancing data set; A training set partitioning operation is performed on the load balancing data set to determine a corresponding training set, and the training set is input into a preset multi-layer perceptron model for model training to determine a corresponding load balancing model.

8. A camera resource sharing device, characterized in that: The device comprises: A parameter collection module, used to collect historical camera video processing data, wherein the historical camera video processing data includes historical camera hardware parameters, historical camera operation data, historical camera video task analysis data, and historical video task allocation records; A feature extraction and model training module is used to perform a feature extraction operation on the video processing data of the historical camera, respectively determine the corresponding hardware capability features, real-time status features, task features and performance features, perform a feature combination operation on the hardware capability features and the task features, determine the corresponding computing power matching index, perform a feature combination operation on the real-time status features and the task features, determine the corresponding priority matching index, perform a feature combination operation on the real-time status features and the performance features, determine the corresponding performance matching index, perform a data set construction operation according to the computing power matching index, the priority matching index and the performance matching index, and input the training data set obtained after the data set construction operation into a preset multi-layer perceptron model for model training to determine the corresponding load balancing model; A camera resource sharing module is used to receive a video analysis request from a camera, determine a corresponding optimal shared camera according to the video task characteristics in the video analysis request and the load balancing model, and send the optimal shared camera information to the camera so that the camera sends the video to be analyzed to the optimal shared camera for video analysis to obtain a corresponding video analysis result, wherein the video analysis request from the camera is a historical video file analysis request or a real-time video stream analysis request.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the camera resource sharing 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 camera resource sharing method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method for allocating and scheduling computing power resources in cross-network environment

    CN115643369A

  • Parallel acceleration and dynamic scheduling implementation method based on monitoring camera AI algorithm

    CN116863408A

  • Tunnel traffic event processing system, method, medium and equipment

    CN118135507A

  • Computing power resource calling method of intelligent camera cluster and related equipment

    CN118233736A

  • Nwdaf-based management and decision-making method for computing resources

    WO2024104284A1