Edge box optimization method and device, storage medium, and electronic device

By receiving and analyzing the load data of the edge box and automatically adjusting the binding relationship of the camera, the problem of uneven utilization of the edge box is solved, and the balanced distribution of load and the improvement of video stream processing efficiency is achieved.

CN113687947BActive Publication Date: 2025-03-28BOE TECHNOLOGY GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110981773.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-25
Publication Date
2025-03-28
Estimated Expiration
2041-08-25

AI Technical Summary

Technical Problem

In the prior art, the utilization rate of edge boxes is uneven, and the camera cannot be automatically redistributed according to the operation load of edge boxes, resulting in unbalanced load of edge boxes.

Method used

By receiving the load data reported by the edge box, calculate the current load rate, and determine whether it is greater than the load rate of other edge boxes. When a new pending video stream appears, assign a new binding relationship to the camera, binding it to other edge boxes with lower loads.

Benefits of technology

The load optimization of edge boxes is achieved, reducing the load of high-load edge boxes, while improving the utilization rate of other edge boxes, and improving the camera binding and video stream processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113687947B_ABST
    Figure CN113687947B_ABST
Patent Text Reader

Abstract

The present disclosure is about an optimization method and device, storage medium, and electronic device for an edge box, and relates to the field of artificial intelligence technology. The method includes: receiving current load data reported by the current edge box; calculating the current load rate of the current edge box according to the number of currently running video channels and CPU occupancy, and judging whether the current load rate is greater than other load rates of other edge boxes corresponding to the current edge box; when it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box, assigning a new binding relationship to the camera that generates the new video stream to be processed; based on the new binding relationship, binding the camera that generates the new video stream to be processed to the other edge boxes, so as to optimize the first edge box and other edge boxes. The present disclosure solves the problem of uneven utilization of edge boxes.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the popularization of related technologies such as the Internet of Things and artificial intelligence, the way of running artificial intelligence algorithms on central servers has problems such as long latency, high network load, high cost, and low security performance. In order to solve this problem, the method of transferring the calculation of artificial intelligence algorithms from the central server to the edge is adopted.

[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0004] The purpose of the present disclosure is to provide an edge box optimization method, an edge box optimization device, a computer-readable storage medium, and an electronic device, thereby at least to a certain extent overcoming the problem of uneven utilization of edge boxes caused by limitations and defects of related technologies.

[0005] According to one aspect of the present disclosure, there is provided an edge box optimization method, which is configured in a central server, and the edge box optimization method includes:

[0006] Receive current load data reported by the current edge box; wherein the current load data includes the number of video channels currently running in the current edge box and the CPU occupancy rate;

[0007] Calculate the current load rate of the current edge box according to the number of currently running video channels and the CPU occupancy rate, and determine whether the current load rate is greater than other load rates of other edge boxes corresponding to the current edge box;

[0008] When it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box, a new binding relationship is assigned to a camera that generates the new video stream to be processed;

[0009] Based on the new binding relationship, the camera that generates the new video stream to be processed is bound to the other edge boxes to optimize the first edge box and the other edge boxes.

[0010] In an exemplary embodiment of the present disclosure, the current load rate of the current edge box is calculated according to the number of currently running video paths and the CPU occupancy rate, including:

[0011] Obtain the total number of video channels that the current edge box can support, and calculate the ratio of the currently running video channels to the total number of video channels;

[0012] The current load rate of the current edge box is calculated according to the path ratio and the first weight value of the path ratio, the CPU occupancy rate and the second weight value of the CPU occupancy rate.

[0013] In an exemplary embodiment of the present disclosure, the edge box optimization method further includes:

[0014] Receiving a first registration request sent by the current edge box and / or the other edge boxes;

[0015] Parsing the first registration request to obtain first attribute information of the current edge box and / or other edge boxes; wherein the first attribute information includes one or more of a box name, a MAC address, a computing power, and a total number of video channels that can be supported;

[0016] The current edge box and / or the other edge boxes are registered according to the first attribute information.

[0017] In an exemplary embodiment of the present disclosure, the edge box optimization method further includes:

[0018] Receive a second registration request sent by the camera, and parse the second registration request to obtain second attribute information of the camera; wherein the second attribute information includes one or more of a camera name, an IP address, a port address, a stream address, and a bound algorithm category;

[0019] The camera is registered according to the second attribute information.

[0020] In an exemplary embodiment of the present disclosure, the edge box optimization method further includes:

[0021] Calculate the number of first cameras that the current edge box can accommodate according to the computing power of the current edge box and the total number of video channels that can be supported; and / or

[0022] Calculate the number of second cameras that can be accommodated by the other edge boxes according to the computing power of the other edge boxes and the total number of video channels that can be supported;

[0023] Establishing a binding relationship between the camera and the current edge box and / or the other edge boxes according to the number of the first cameras and / or the number of the second cameras, the MAC address, the port address, and the IP address;

[0024] The camera is bound to the current edge box and / or other edge boxes based on the binding relationship, and the binding relationship is sent to the current edge box and / or other edge boxes.

[0025] According to one aspect of the present disclosure, there is provided an edge box optimization method, which is configured in an edge box. The edge box optimization method includes:

[0026] According to the binding relationship between the current edge box and the camera, determine the camera bound to the current edge box, and detect whether a video frame including the target object appears in the current video stream captured by the camera;

[0027] When a video frame including a target object is detected in the current video stream, the current video stream is used as a video stream to be processed, and a video path is run to process the video stream to be processed;

[0028] Calculate the number of currently running video channels in the current edge box, and generate current load data according to the number of currently running video channels and the CPU occupancy rate generated by processing the video stream to be processed;

[0029] The current load data is reported to the central server, so that the central server calculates the current load rate of the current edge box according to the current load data, and optimizes the current edge box and other edge boxes corresponding to the current edge box according to the current load rate.

[0030] In an exemplary embodiment of the present disclosure, processing the video stream to be processed includes:

[0031] Pulling the video stream to be processed according to the stream address of the camera, and decoding the video stream to be processed to obtain multiple frames of image frames to be identified;

[0032] According to the algorithm category bound to the camera, the algorithm model corresponding to the algorithm category in the current edge box is called, and the image frame to be identified is identified using the algorithm model to obtain a current identification result; wherein the algorithm model includes at least one of a face recognition algorithm, a face gender and age algorithm, and a head detection algorithm.

[0033] In an exemplary embodiment of the present disclosure, the face recognition algorithm is used to recognize the image frame to be recognized to obtain a current recognition result, including:

[0034] Using a preset face detection and key point positioning tool, detecting a face region to be identified in the image frame to be identified;

[0035] Extracting key points of the face to be identified in the image frame to be identified in the face area to be identified, and calculating features of the face to be identified based on the key points of the face to be identified;

[0036] A feature comparison is performed on the facial features to be identified and the original facial features in a preset feature value library to obtain the current recognition result.

[0037] In an exemplary embodiment of the present disclosure, feature comparison is performed on the face features to be recognized and the original face features in a preset feature value library to obtain the current recognition result, including:

[0038] Calculating the Euclidean distance between the face feature to be identified and the original face feature in the feature value library in the current edge box;

[0039] According to the Euclidean distance, a similarity comparison result between the facial features to be identified and the original facial features is obtained.

[0040] In an exemplary embodiment of the present disclosure, the edge box optimization method further includes:

[0041] Determine whether the similarity comparison result is greater than a preset threshold;

[0042] If so, generating a successful identification message according to the similarity comparison result, and reporting the successful identification message to the central server;

[0043] If not, the facial features to be identified are broadcasted to the other edge boxes, and the facial features to be identified are identified in the other edge boxes to obtain other identification results.

[0044] In an exemplary embodiment of the present disclosure, the edge box optimization method further includes:

[0045] If any other recognition result is a successful recognition, then the other successful recognition result is reported to the central server;

[0046] Extracting original facial features corresponding to the facial features to be identified from feature value libraries in other edge boxes corresponding to other identification results that have been successfully identified;

[0047] The feature value library in the current edge box is updated using the original face features.

[0048] In an exemplary embodiment of the present disclosure, the edge box optimization method further includes:

[0049] If all other recognition results are recognition failures, the facial features to be recognized are reported to the central server so that the central server recognizes the facial features to be recognized.

[0050] According to one aspect of the present disclosure, there is provided an optimization device for an edge box, which is configured on a central server, and the optimization device for the edge box includes:

[0051] A load data receiving module, used to receive current load data reported by the current edge box; wherein the current load data includes the number of video channels currently running in the current edge box and the CPU occupancy rate;

[0052] A first calculation module, configured to calculate a current load rate of the current edge box according to the number of currently running video channels and the CPU occupancy rate, and determine whether the current load rate is greater than other load rates of other edge boxes corresponding to the current edge box;

[0053] A first binding relationship allocation module is used to allocate a new binding relationship for a camera that generates a new video stream to be processed when it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box;

[0054] The first camera binding module is used to bind the camera that generates the new video stream to be processed to the other edge boxes based on the new binding relationship, so as to optimize the first edge box and the other edge boxes.

[0055] According to one aspect of the present disclosure, there is provided an optimization device for an edge box, which is configured in an edge box, and the optimization device for the edge box includes:

[0056] A camera determination module, used to determine the camera bound to the current edge box according to the binding relationship between the current edge box and the camera, and detect whether a video frame including a target object appears in the current video stream shot by the camera;

[0057] A first video stream processing module is used to, when detecting that a video frame including a target object appears in the current video stream, use the current video stream as a video stream to be processed, and run a video path to process the video stream to be processed;

[0058] A load data generating module, used for calculating the number of currently running video channels in the current edge box, and generating current load data according to the number of currently running video channels and the CPU occupancy rate generated by processing the video stream to be processed;

[0059] A load data reporting module is used to report the current load data to the central server so that the central server calculates the current load rate of the current edge box according to the current load data, and optimizes the current edge box and other edge boxes corresponding to the current edge box according to the current load rate.

[0060] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the edge box optimization method described in any one of the above items is implemented.

[0061] According to one aspect of the present disclosure, there is provided an electronic device, including:

[0062] Processor; and

[0063] A memory, configured to store executable instructions of the processor;

[0064] The processor is configured to execute any one of the above-mentioned edge box optimization methods by executing the executable instructions.

[0065] An edge box optimization method provided by the embodiment of the present disclosure, on the one hand, can calculate the current load rate of the current edge box according to the number of currently running video channels and the CPU occupancy rate, and judge whether the current load rate is greater than other load rates of other edge boxes corresponding to the current edge box; and when it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box, a new binding relationship is assigned to the camera that generates the new video stream to be processed; finally, based on the new binding relationship, the camera that generates the new video stream to be processed is bound to other edge boxes, and then the new video stream to be processed can be processed by other edge boxes, thereby realizing the optimization of the first edge box and other edge boxes, solving the problem in the prior art that the camera cannot be automatically reallocated to other edge boxes according to the computing load of the edge box, thereby causing uneven utilization of the edge boxes, reducing the load of the current edge box, and improving the utilization of other edge boxes; on the other hand, the camera that generates the new video stream to be processed can be automatically bound to other edge boxes based on the new binding relationship, thereby improving the binding efficiency of the camera, and thereby improving the processing efficiency of the new video stream to be processed.

[0066] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0068] Figure 1A diagram schematically shows an example scenario of performing calculations in an edge box.

[0069] Figure 2 A flowchart of a method for optimizing an edge box on a central server side according to an exemplary embodiment of the present disclosure is schematically shown.

[0070] Figure 3 A block diagram of an edge box optimization system according to an exemplary embodiment of the present disclosure is schematically shown.

[0071] Figure 4 A flowchart of a registration method for an edge box according to an exemplary embodiment of the present disclosure is schematically shown.

[0072] Figure 5 A flowchart of a camera registration method according to an exemplary embodiment of the present disclosure is schematically shown.

[0073] Figure 6 A flowchart schematically illustrates a method for establishing a binding relationship between an edge box and a camera according to an exemplary embodiment of the present disclosure.

[0074] Figure 7 An example diagram schematically illustrates an original binding relationship according to an example embodiment of the present disclosure.

[0075] Figure 8 An example diagram schematically illustrates a reallocated binding relationship according to an example embodiment of the present disclosure.

[0076] Fig. 9 A flowchart of a method for optimizing an edge box on an edge box side according to an exemplary embodiment of the present disclosure is schematically shown.

[0077] Fig.10 A flowchart of a method for processing a video stream to be processed according to an exemplary embodiment of the present disclosure is schematically shown.

[0078] Fig.11 An example diagram of facial contour key points according to an example embodiment of the present disclosure is schematically shown.

[0079] Fig.12 A flowchart of another edge box optimization method according to an exemplary embodiment of the present disclosure is schematically shown.

[0080] Fig.13 A diagram schematically shows an example scene of facial feature comparison according to an example embodiment of the present disclosure.

[0081] Fig.14 A block diagram schematically shows an optimization device for an edge box on a central server side according to an exemplary embodiment of the present disclosure.

[0082] Fig.15 A block diagram schematically shows an edge box optimization device at an edge box side according to an exemplary embodiment of the present disclosure.

[0083] Fig.16 An electronic device for implementing the above-mentioned edge box optimization method according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0084] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0085] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0086] In some edge box computing methods, the main implementation is as follows: First, manually allocate different numbers of cameras according to the computing power of each edge box on the central server side, and when a face is detected in the camera, the video stream generated by the camera is processed in the edge box. For details, refer to Figure 1 As shown in the figure, taking the bank branch application scenario as an example, Figure 1After assigning cameras to edge boxes in the network site, it may happen that the three cameras assigned to edge box 1 need to perform calculations at the same time, while the cameras of other edge boxes are not turned on or no one enters the camera screen to trigger edge computing. As a result, edge box 1 is fully loaded, while edge boxes 2 and 3 are idle, that is, the load of edge box 1 is too high, while the utilization of edge boxes 2 and 3 is low. Therefore, the above method cannot automatically reallocate cameras to other edge boxes according to the computing load of the edge boxes, resulting in uneven utilization of edge boxes.

[0087] Based on this, this exemplary embodiment first provides an edge box optimization method, which can be run on a central server, a server cluster or a cloud server, etc. Of course, those skilled in the art can also run the method disclosed in this disclosure on other platforms as required, and this exemplary embodiment does not specifically limit this. Figure 2 As shown, the edge box optimization method may include the following steps:

[0088] Step S210. Receive current load data reported by the current edge box; wherein the current load data includes the number of video channels currently running in the current edge box and the CPU occupancy rate;

[0089] Step S220. Calculate the current load rate of the current edge box according to the number of currently running video channels and the CPU occupancy rate, and determine whether the current load rate is greater than other load rates of other edge boxes corresponding to the current edge box;

[0090] Step S230. When it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box, a new binding relationship is assigned to the camera that generates the new video stream to be processed;

[0091] Step S240: Bind the camera that generates the new video stream to be processed to the other edge boxes based on the new binding relationship, so as to optimize the first edge box and the other edge boxes.

[0092] In the above-mentioned edge box optimization method, on the one hand, since the current load rate of the current edge box can be calculated according to the number of currently running video channels and the CPU occupancy rate, and it is determined whether the current load rate is greater than other load rates of other edge boxes corresponding to the current edge box; and when it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box, a new binding relationship is assigned to the camera that generates the new video stream to be processed; finally, based on the new binding relationship, the camera that generates the new video stream to be processed is bound to other edge boxes, and then the new video stream to be processed can be processed by other edge boxes, thereby realizing the optimization of the first edge box and other edge boxes, solving the problem in the prior art that the camera cannot be automatically reallocated to other edge boxes according to the computing load of the edge box, thereby causing uneven utilization of the edge boxes, reducing the load of the current edge box, and at the same time improving the utilization of other edge boxes; on the other hand, the camera that generates the new video stream to be processed can be automatically bound to other edge boxes based on the new binding relationship, thereby improving the binding efficiency of the camera, and thereby improving the processing efficiency of the new video stream to be processed.

[0093] Hereinafter, the edge box optimization method according to the exemplary embodiment of the present disclosure will be explained and illustrated in detail with reference to the accompanying drawings.

[0094] First, the purpose of the invention of the exemplary embodiment of the present disclosure is explained and illustrated. Specifically, the exemplary embodiment of the present disclosure provides an optimization method for an AI edge computing intelligent system, by placing the front-end algorithm model into the AI ​​chip at the edge box end; when the system is initially running, all edge boxes and cameras are registered on the central server, the cameras are manually bound to different boxes, and the binding relationship is sent to the edge box; for the connected camera, the edge box will collect the image of the camera, run the algorithm at the edge end to realize face recognition, face age and gender recognition, headcount and other AI functions, and regularly report the computing load of the current box to the central server; the central server automatically reallocates the remaining cameras to the edge box according to the computing load of the box, ensuring that all edge boxes are evenly distributed with computing tasks; the feature value library of the central server is distributed to each edge end, and the face feature value comparison is first performed on the local edge end, and if there is no result, it is broadcast to other edge ends for feature value comparison, and finally if there is no result, it is reported to the central server for feature value comparison. The present invention optimizes the allocation of computing tasks by calculating the load capacity of edge devices in real time on a cloud central server, thereby fully tapping the computing power of edge devices; and improves the speed of facial feature comparison by optimizing the comparison of the facial feature library, thereby ensuring the real-time performance of face recognition.

[0095] Next, the optimization system of the edge box of the exemplary embodiment of the present disclosure is explained and illustrated. Figure 3As shown, the optimization system of the edge box may include a central server 310, an edge box 320, and a camera 330. The central server is connected to the edge box and the camera, respectively, and the edge box is connected to the camera; the central server and the edge box are respectively used to implement the edge box optimization method recorded in the exemplary embodiment of the present disclosure, and the camera is used to produce a video stream. At the same time, the edge boxes (edge ​​box 1, edge box 2, ..., edge box j, etc.) included in the exemplary embodiment of the present disclosure may include multiple edge boxes, each with different computing power, and of course, some may be the same and some may be different; the camera may also include multiple cameras (camera 1, camera 2, ..., camera k, etc.), and the cameras bound to the same edge box produce different video streams.

[0096] Furthermore, the registration process of the edge box, the registration process of the camera, and the process of establishing the binding relationship in the exemplary embodiment of the present disclosure are explained and illustrated.

[0097] First, refer to Figure 4 As shown, the registration process of the edge box in the central server may include the following steps:

[0098] Step S410, receiving a first registration request sent by the current edge box and / or the other edge boxes;

[0099] Step S420: parsing the first registration request to obtain first attribute information of the current edge box and / or other edge boxes; wherein the first attribute information includes one or more of a box name, a MAC address, computing power, and a total number of video channels that can be supported;

[0100] Step S430: register the current edge box and / or the other edge boxes according to the first attribute information.

[0101] Figure 4 In the schematically illustrated embodiment, the registration of the edge box is completed by registering the first attribute information of the edge box in the central server; wherein the first attribute information of the edge box may include the box name of the edge box, the MAC (Media Access Control) address, computing power, the maximum number of video channels that can be supported, and the like. The higher the box computing power, the higher the number of video channels supported; for example, assuming that edge box 1 supports 4 video channels, edge box 2 supports 8 video channels, and edge box 3 supports 2 video channels. Furthermore, after the registration of the edge box is completed, a corresponding number of cameras can be allocated to it according to the computing power of the edge box, thereby completing the processing of the video stream generated by the camera in the edge box, so as to achieve the purpose of improving the processing efficiency of the video stream.

[0102] Secondly, refer to Figure 5 As shown, the camera registration process in the central server may include the following steps:

[0103] Step S510, receiving a second registration request sent by a camera, and parsing the second registration request to obtain second attribute information of the camera; wherein the second attribute information includes one or more of a camera name, an IP address, a port address, a stream address, and a bound algorithm category;

[0104] Step S520: register the camera according to the second attribute information.

[0105] Figure 5 In the schematically shown embodiment, the registration of the camera is completed by registering the second attribute information of the camera in the central server registration; wherein the second attribute information may include the camera name, IP (Internet Protocol) address, port, stream address, bound algorithm category and other information. Among them, the stream address is the standard network video stream address, and the edge box can decode the video frame by frame (image frame to be identified) according to the stream address; the algorithm category bound to the camera refers to the function of the video stream of the camera, which may include face recognition or face gender age recognition or head detection, etc. Further, after the registration of the camera is completed, the corresponding edge box can be assigned to the camera, and then the video stream produced by the camera can be processed in the edge box.

[0106] Finally, reference Figure 6 As shown, the process of establishing the binding relationship between the camera and the edge box may include the following steps:

[0107] Step S610, calculating the number of first cameras that the current edge box can accommodate according to the computing power of the current edge box and the total number of video channels that can be supported; and / or

[0108] Step S620, calculating the number of second cameras that can be accommodated by the other edge boxes according to the computing power of the other edge boxes and the total number of video channels that can be supported;

[0109] Step S630, establishing a binding relationship between the camera and the current edge box and / or the other edge boxes according to the number of the first cameras and / or the number of the second cameras, the MAC address, the port address, and the IP address;

[0110] Step S640: Bind the camera with the current edge box and / or other edge boxes based on the binding relationship, and send the binding relationship to the current edge box and / or other edge boxes.

[0111] exist Figure 6 In the schematically shown embodiment, the binding relationship between the edge box and the camera can be automatically initialized and configured in the central server, and different numbers of cameras can be configured according to the computing power of the edge box and the total number of video channels that can be supported; at the same time, if the number of configured cameras exceeds the number of channels supported by the edge box, an alarm prompt is given; the binding relationship between the edge box and the camera can be specifically referred to Figure 7 It should be noted that, in order to ensure the uniqueness of the camera address, the camera address of the camera can be calculated according to the IP address and port address of the camera, thereby avoiding the problem of being unable to process the video stream due to an address error.

[0112] The following, combined Figure 3-Figure 6 ,right Figure 2 The steps involved in the edge box optimization method shown in are explained and illustrated in detail.

[0113] In step S210, current load data reported by the current edge box is received; wherein the current load data includes the number of video paths currently running in the current edge box and the CPU occupancy rate.

[0114] Specifically, when the central server completes the establishment of the binding relationship, it sends the binding relationship to all edge boxes. After the edge box receives the binding relationship, it performs stream decoding according to the stream address of the camera. For example, when someone enters camera 1, edge box 1 starts 1-channel video processing and reports the load data to the central server; the central server receives the load data reported by the current edge box, which may include the number of currently running video channels, CPU (Central Processing Unit) occupancy rate, and of course, the MAC address of the current edge box and box name and other information; it should be supplemented here that the above-mentioned number of currently running video channels can be defined as the number of currently running video channels, and one video channel processes the video stream generated by one camera, that is, the number of video streams processed in the current edge box is the same as the number of currently running video channels.

[0115] In step S220, the current load rate of the current edge box is calculated according to the number of currently running video channels and the CPU occupancy rate, and it is determined whether the current load rate is greater than other load rates of other edge boxes corresponding to the current edge box.

[0116] In this example embodiment, first, the current load rate of the current edge box is calculated according to the number of video channels currently running and the CPU occupancy rate. Specifically, it may include: first, obtaining the total number of video channels that the current edge box can support, and calculating the channel ratio of the currently running video channels in the total number of video channels; secondly, calculating the current load rate of the current edge box according to the channel ratio and the first weight value of the channel ratio, the CPU occupancy rate and the second weight value of the CPU occupancy rate. Specifically, assuming that the first weight value is 80%, the second weight value is 20%, the total number of video channels that the current edge box can support is N, the number of video channels currently running is M, and the current edge box CPU occupancy is K, then the current load rate L1 of the current edge box is:

[0117] L1 = (1 - M / N) * 80% + K * 20%.

[0118] Secondly, after obtaining the current load rate, it can be determined whether the current load rate is greater than other load rates; wherein, the calculation method of other load rates is the same as the calculation method of the current load rate, which will not be repeated here.

[0119] In step S230, when it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box, a new binding relationship is allocated to the camera that generates the new video stream to be processed.

[0120] Specifically, assuming that the current load rate L1 of the current edge box calculated by the central server is higher than the other load rates L2 of other edge boxes 2 and the other load rates L3 of other edge boxes 3, when a new video stream to be processed appears in the current edge box, it can be based on Figure 2 In the binding relationship, when someone enters the screen of camera 2, the central server automatically binds camera 2 to other edge boxes 2 according to the load status of all edge boxes; similarly, when someone enters the screen of camera 3, the central server automatically binds camera 3 to other edge boxes 3 according to the load data of the current edge box; the reallocated binding relationship can be specifically referred to Figure 8 shown.

[0121] In step S240, the camera generating the new video stream to be processed is bound to the other edge boxes based on the new binding relationship, so as to optimize the first edge box and the other edge boxes.

[0122] Specifically, camera 2 can be bound to other edge boxes 2 based on the new binding relationship, and the unprocessed video stream produced by camera 2 can be processed on other edge boxes 2, and the load data of other edge boxes 2 can be reported to the central server; similarly, when someone enters the screen of camera 3, camera 3 can be bound to other edge boxes 3 based on the new binding relationship, and the unprocessed video stream produced by camera 3 can be processed on other edge boxes 3, and the load data of other edge boxes 3 can be reported to the central server. Through this method, the central server can automatically and dynamically allocate cameras according to the load rate of all edge boxes, ensure that all edge boxes evenly distribute computing tasks, and improve the utilization rate of edge boxes while reducing the load of edge boxes.

[0123] The exemplary embodiment of the present disclosure also provides another edge box optimization method, which is configured in the edge box. Fig. 9 As shown, the optimization method of the edge box may include:

[0124] Step S910, according to the binding relationship between the current edge box and the camera, determine the camera bound to the current edge box, and detect whether a video frame including a target object appears in the current video stream captured by the camera.

[0125] Specifically, after the current edge box receives the binding relationship, it can determine the camera to which it is bound, and detect whether a video frame including the target object appears in the current video stream shot by the camera, that is, detect whether a person enters the camera screen. The detection of the video frame including the target object can be implemented by a commonly used image detection algorithm, such as R-CNN or Fast R-CNN, etc., and this example does not impose any special restrictions on this.

[0126] Step S920: when it is detected that a video frame including a target object appears in the current video stream, the current video stream is used as a video stream to be processed, and a video path is run to process the video stream to be processed.

[0127] Specifically, when it is detected that someone enters the screen in the current video stream, the current video stream can be used as the video stream to be processed; if it is not detected that someone enters the screen in the current video stream, no processing is required. Further, an unrunning video path can be run to process the video stream to be processed.

[0128] Step S930, calculating the number of currently running video channels in the current edge box, and generating current load data according to the number of currently running video channels and the CPU occupancy rate generated by processing the video stream to be processed.

[0129] Specifically, the number of all video paths currently running on the current edge box may be counted, and then the current load data may be generated according to the number of all video paths currently running and the CPU occupancy rate generated by processing the video stream to be processed.

[0130] Step S940, reporting the current load data to the central server, so that the central server calculates the current load rate of the current edge box according to the current load data, and optimizes the current edge box and other edge boxes corresponding to the current edge box according to the current load rate.

[0131] Fig. 9 In the edge box optimization method shown, since the central server can calculate the current load rate of the current edge box through the current load data automatically reported by the edge box, and then compare the current load rate with other load rates of other edge boxes, the camera can be dynamically adjusted according to the comparison result, thereby solving the problem in the prior art that the camera cannot be automatically reallocated to other edge boxes according to the computing load of the edge box, thereby causing uneven utilization of the edge boxes, reducing the load of the current edge box and improving the utilization of other edge boxes.

[0132] Fig.10 A flowchart of a method for processing a video stream to be processed is schematically shown. Fig.10 As shown, processing the video stream to be processed may include the following steps:

[0133] Step S1010: Pull the video stream to be processed according to the stream address of the camera, and decode the video stream to be processed to obtain multiple frames of image frames to be identified.

[0134] Specifically, first, pull the video stream to be processed according to the stream address of the camera, and secondly, decode the video stream to be processed to obtain multiple frames of image frames to be identified including portraits; wherein, the decoding of the video stream can be based on a commonly used decoder; the obtained image frames to be identified can be images in YUV format or RGB format, and this example does not impose any special restrictions on this.

[0135] Step S1020, according to the algorithm category bound to the camera, call the algorithm model corresponding to the algorithm category in the current edge box, and use the algorithm model to identify the image frame to be identified to obtain the current recognition result; wherein the algorithm model includes a face recognition algorithm, a face gender and age algorithm, and a head detection algorithm, etc.

[0136] In this example embodiment, when the algorithm category bound to the camera is a face recognition algorithm, the face recognition algorithm is used to identify the image frame to be identified to obtain the current recognition result, which may include: first, using a preset face detection and key point positioning tool to detect the face area to be identified of the image frame to be identified; secondly, extracting the face key points to be identified of the image frame to be identified in the face area to be identified, and calculating the face features to be identified based on the face key points to be identified; finally, performing feature comparison on the face features to be identified and the original face features in a preset feature value library to obtain the current recognition result.

[0137] Furthermore, feature comparison is performed on the facial features to be identified and the original facial features in a preset feature value library to obtain the current recognition result, including: calculating the Euclidean distance between the facial features to be identified and the original facial features in the feature value library in the current edge box; and obtaining a similarity comparison result between the facial features to be identified and the original facial features based on the Euclidean distance.

[0138] Specifically, a general face detection and key point location tool trained by machine learning or deep learning models can be used to obtain the facial key points of the user's face image (the face to be fused); wherein the facial key points are ibug-68 standards, and the facial key points include facial contour key points and facial features key points; at the same time, the facial contour key points can be, for example, Fig.11 The numbered parts shown in the figure are marked with 1-17, and the key points of the facial features include eyebrow key points (18-22, and 23-27), nose bridge key points (28-31), nose wing key points (32-36), eye key points (37-42, and 43-48), and lip key points (outer side: 49-60, inner side: 61-68); secondly, after the facial key points are obtained, the facial features to be identified can be calculated based on the facial key points; further, the calculation method of the Euclidean distance can be specifically shown in the following formula (1):

[0139]

[0140] Among them, X indicates the original facial features, Y indicates the facial features to be identified, and n indicates the number of feature points of the original facial features and the facial features to be identified. It should be noted here that compared with other methods of calculating the similarity between the facial features to be identified and the original facial features, the method of calculating the Euclidean distance can reduce the calculation efficiency while ensuring the calculation accuracy, thereby reducing the burden on the system and improving the user experience.

[0141] It needs to be further explained here that the original facial features in the feature value library of each edge box are obtained in the following way: first, a complete facial feature value library including the original facial features needs to be generated on the central server. Taking the bank branch application scenario as an example, this feature value library is generally above 2 million levels; wherein, the original facial features can be obtained by collecting the facial image on the ID card; then, the central server distributes the full feature value library of 2 million to each edge box under the branch, so that each edge box has a feature value library of no less than 20,000 original facial features.

[0142] In another embodiment of this example, if the algorithm category bound to the camera is a face, gender and age algorithm, the specific recognition process can be: calculate the facial attribute features based on the extracted facial features to be recognized, and then input the facial attribute features into the face deformation age algorithm model to obtain the corresponding gender and age; at the same time, if the algorithm category bound to the camera is a head detection algorithm, the image frame to be recognized can be directly input into the head detection algorithm model to obtain the number of people entering the bank in each time period (taking the bank scene as an example, of course it can also be other scenes). At the same time, in order to improve the accuracy of the statistical results of the number of people, it is also necessary to perform deduplication and other operations on the recognized images, which will not be elaborated here.

[0143] Fig.12 Another edge box optimization method according to an exemplary embodiment of the present disclosure is schematically illustrated.

[0144] refer to Fig.12 As shown, the edge box optimization method can also include the following steps:

[0145] Step S1210, determining whether the similarity comparison result is greater than a preset threshold;

[0146] Step S1220: If yes, a successful identification message is generated according to the similarity comparison result, and the successful identification message is reported to the central server;

[0147] Step S1230: If not, broadcast the facial features to be identified to the other edge boxes, and identify the facial features to be identified in the other edge boxes to obtain other identification results.

[0148] Furthermore, if any other recognition result is a successful recognition, the other successful recognition result is reported to the central server; at the same time, the original facial features corresponding to the facial features to be recognized in the feature value library in other edge boxes corresponding to the other successful recognition results are extracted; finally, the feature value library in the current edge box is updated using the original facial features.

[0149] Furthermore, if all other recognition results are recognition failures, the facial features to be recognized are reported to the central server, so that the central server recognizes the facial features to be recognized.

[0150] For details, refer to Fig.13 As shown, when face recognition is performed in edge box 2, if the similarity comparison result is greater than a preset threshold, a recognition success message is generated based on the similarity comparison result, and the comparison success result (recognition success message) is directly reported to the business application module of the central server; if the feature value library of edge box 2 does not contain the face feature value to be recognized (that is, the similarity comparison result is less than the preset threshold), the face recognition comparison fails, and edge box 2 broadcasts the face feature to be recognized to all other edge boxes (such as edge box 1 and edge box 3); and compares the face feature value to be recognized in edge box 1 and edge box 3 at the same time to obtain other recognition results; if in If the comparison is successful in any one of the boxes (that is, any other recognition result is a successful recognition), the other successful recognition result will be directly reported to the central server, and the original facial features corresponding to the facial features to be recognized in the feature value library of other edge boxes corresponding to the other successful recognition results will be extracted; and the feature value library in the current edge box (edge ​​box 2) will be updated using the original facial features; of course, if all comparisons fail, the feature values ​​of the facial features to be recognized will be sent to the central server for comparison; if the central server compares successfully, the original facial features corresponding to the facial features to be recognized can be allocated to all edge boxes; if it fails, the manual service will be notified.

[0151] Fig.12 In the optimization method of the edge box shown, when the face recognition comparison of the current edge box has no result, the face feature value is first broadcast to all other edge boxes, and a comparison is performed simultaneously in the feature value library of other edge boxes. After the comparison, the result is reported to the central server, and at the same time sent to the current edge box to update the feature value library. The comparison speed will be much faster than the comparison speed of the full feature value library of the central server, thereby solving the problem in the prior art that if there is no result in the face recognition comparison in the edge box, the face feature value is directly sent to the full feature value library of the central server for comparison, which makes the delay time of the face recognition comparison longer. It improves the comparison speed of the facial features to be identified, and also reduces the burden on the central server.

[0152] The exemplary embodiment of the present disclosure also provides an optimization device for an edge box, which is configured in a central server. Fig.14As shown, the optimization device of the edge box may include a load data receiving module 1410, a first calculation module 1420, a first binding relationship allocation module 1430, and a first camera binding module 1440. Among them:

[0153] The load data receiving module 1410 may be used to receive current load data reported by the current edge box; wherein the current load data includes the number of video channels currently running in the current edge box and the CPU occupancy rate;

[0154] The first calculation module 1420 may be used to calculate the current load rate of the current edge box according to the number of currently running video channels and the CPU occupancy rate, and determine whether the current load rate is greater than other load rates of other edge boxes corresponding to the current edge box;

[0155] The first binding relationship allocation module 1430 may be configured to allocate a new binding relationship to a camera generating a new video stream to be processed when it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box;

[0156] The first camera binding module 1440 can be used to bind the camera that generates the new video stream to be processed to the other edge boxes based on the new binding relationship, so as to optimize the first edge box and the other edge boxes.

[0157] In an exemplary embodiment of the present disclosure, the current load rate of the current edge box is calculated according to the number of currently running video paths and the CPU occupancy rate, including:

[0158] Obtain the total number of video channels that the current edge box can support, and calculate the ratio of the currently running video channels to the total number of video channels;

[0159] The current load rate of the current edge box is calculated according to the path ratio and the first weight value of the path ratio, the CPU occupancy rate and the second weight value of the CPU occupancy rate.

[0160] In an exemplary embodiment of the present disclosure, the edge box optimization device further includes:

[0161] A first registration request receiving module may be used to receive a first registration request sent by the current edge box and / or the other edge boxes;

[0162] A first registration request parsing module may be used to parse the first registration request to obtain first attribute information of the current edge box and / or other edge boxes; wherein the first attribute information includes one or more of a box name, a MAC address, a computing power, and a total number of video channels that can be supported;

[0163] The first registration module may be configured to register the current edge box and / or the other edge boxes according to the first attribute information.

[0164] In an exemplary embodiment of the present disclosure, the edge box optimization device further includes:

[0165] A second registration request parsing module, which can be used to receive a second registration request sent by a camera, and parse the second registration request to obtain second attribute information of the camera; wherein the second attribute information includes one or more of a camera name, an IP address, a port address, a stream address, and a bound algorithm category;

[0166] The second registration module can be used to register the camera according to the second attribute information.

[0167] In an exemplary embodiment of the present disclosure, the edge box optimization device further includes:

[0168] A first camera number calculation module may be used to calculate the number of first cameras that the current edge box can accommodate according to the computing power of the current edge box and the total number of video channels that can be supported; and / or

[0169] A second camera number calculation module may be used to calculate the number of second cameras that the other edge boxes can accommodate according to the computing power of the other edge boxes and the total number of video channels that can be supported;

[0170] A binding relationship establishing module, which can be used to establish a binding relationship between the camera and the current edge box and / or the other edge boxes according to the number of the first cameras and / or the number of the second cameras, the MAC address, the port address, and the IP address;

[0171] The binding relationship sending module may be used to bind the camera with the current edge box and / or other edge boxes based on the binding relationship, and send the binding relationship to the current edge box and / or other edge boxes.

[0172] The present disclosure also provides another edge box optimization device, which is configured in the edge box. Fig.15As shown, the optimization device of the edge box may include a camera determination module 1510, a first video stream processing module 1520, a load data generation module 1530, and a load data reporting module 1540. Among them:

[0173] The camera determination module 1510 may be used to determine the camera bound to the current edge box according to the binding relationship between the current edge box and the camera, and detect whether a video frame including a target object appears in the current video stream captured by the camera;

[0174] The first video stream processing module 1520 may be configured to, when detecting that a video frame including a target object appears in the current video stream, use the current video stream as a video stream to be processed, and run a video path to process the video stream to be processed;

[0175] The load data generating module 1530 may be used to calculate the number of currently running video paths in the current edge box, and generate current load data according to the number of currently running video paths and the CPU occupancy rate generated by processing the video stream to be processed;

[0176] The load data reporting module 1540 can be used to report the current load data to the central server, so that the central server calculates the current load rate of the current edge box based on the current load data, and optimizes the current edge box and other edge boxes corresponding to the current edge box based on the current load rate.

[0177] In an exemplary embodiment of the present disclosure, processing the video stream to be processed includes:

[0178] Pulling the video stream to be processed according to the stream address of the camera, and decoding the video stream to be processed to obtain multiple frames of image frames to be identified;

[0179] According to the algorithm category bound to the camera, the algorithm model corresponding to the algorithm category in the current edge box is called, and the image frame to be identified is identified using the algorithm model to obtain a current identification result; wherein the algorithm model includes at least one of a face recognition algorithm, a face gender and age algorithm, and a head detection algorithm.

[0180] In an exemplary embodiment of the present disclosure, the face recognition algorithm is used to recognize the image frame to be recognized to obtain a current recognition result, including:

[0181] Using a preset face detection and key point positioning tool, detecting a face region to be identified in the image frame to be identified;

[0182] Extracting key points of the face to be identified in the image frame to be identified in the face area to be identified, and calculating features of the face to be identified based on the key points of the face to be identified;

[0183] A feature comparison is performed on the facial features to be identified and the original facial features in a preset feature value library to obtain the current recognition result.

[0184] In an exemplary embodiment of the present disclosure, feature comparison is performed on the face features to be recognized and the original face features in a preset feature value library to obtain the current recognition result, including:

[0185] Calculating the Euclidean distance between the face feature to be identified and the original face feature in the feature value library in the current edge box;

[0186] According to the Euclidean distance, a similarity comparison result between the facial features to be identified and the original facial features is obtained.

[0187] In an exemplary embodiment of the present disclosure, the edge box optimization device further includes:

[0188] A first judgment module may be used to judge whether the similarity comparison result is greater than a preset threshold;

[0189] A first result reporting module may be configured to generate a successful identification message according to the similarity comparison result, and report the successful identification message to the central server;

[0190] The face feature broadcasting module to be identified can be used to broadcast the face feature to be identified to the other edge boxes if no, and identify the face feature to be identified in the other edge boxes to obtain other identification results.

[0191] In an exemplary embodiment of the present disclosure, the edge box optimization device further includes:

[0192] A second result reporting module may be used to report any other recognition result that is a successful recognition to the central server if the other recognition result is a successful recognition;

[0193] The original face feature extraction module can be used to extract the original face features corresponding to the face features to be identified from the feature value library in other edge boxes corresponding to other recognition results that have been successfully identified;

[0194] The feature value library updating module can be used to update the feature value library in the current edge box using the original face features.

[0195] In an exemplary embodiment of the present disclosure, the edge box optimization device further includes:

[0196] The facial feature reporting module for to-be-recognized can be used to report the facial feature for to-be-recognized to the central server if all other recognition results are recognition failures, so that the central server can recognize the facial feature for to-be-recognized.

[0197] The specific details of each module in the above-mentioned edge box optimization device have been described in detail in the corresponding edge box optimization method, so they will not be repeated here.

[0198] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0199] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0200] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0201] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0202] Refer to the following Fig.16 1600 according to this embodiment of the present disclosure is described. Fig.16 The electronic device 1600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0203] like Fig.16As shown, the electronic device 1600 is in the form of a general computing device. The components of the electronic device 1600 may include, but are not limited to: the at least one processing unit 1610, the at least one storage unit 1620, a bus 1630 connecting different system components (including the storage unit 1620 and the processing unit 1610), and a display unit 1640.

[0204] The storage unit stores program codes, which can be executed by the processing unit 1610, so that the processing unit 1610 performs the steps described in the above “Exemplary Method” section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 1610 can perform the following steps: Figure 2 Step S210 shown in: receiving current load data reported by the current edge box; wherein the current load data includes the number of video paths currently running in the current edge box and the CPU occupancy rate; step S220: calculating the current load rate of the current edge box according to the number of video paths currently running and the CPU occupancy rate, and judging whether the current load rate is greater than other load rates of other edge boxes corresponding to the current edge box; step S230: when it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box, assigning a new binding relationship to the camera that generates the new video stream to be processed; step S240: binding the camera that generates the new video stream to be processed to the other edge boxes based on the new binding relationship, so as to optimize the first edge box and other edge boxes.

[0205] The processing unit 1610 may also perform the following steps: Fig. 9 Step S910 shown in: according to the binding relationship between the current edge box and the camera, determine the camera bound to the current edge box, and detect whether a video frame including a target object appears in the current video stream captured by the camera; Step S920: when it is detected that a video frame including a target object appears in the current video stream, use the current video stream as a video stream to be processed, and run a video channel to process the video stream to be processed; Step S930: calculate the number of video channels currently running in the current edge box, and generate current load data according to the number of video channels currently running and the CPU occupancy rate generated by processing the video stream to be processed; Step S940: report the current load data to the central server, so that the central server calculates the current load rate of the current edge box according to the current load data, and optimizes the current edge box and other edge boxes corresponding to the current edge box according to the current load rate.

[0206] The storage unit 1620 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 16201 and / or a cache storage unit 16202 , and may further include a read-only storage unit (ROM) 16203 .

[0207] The storage unit 1620 may also include a program / utility 16204 having a set (at least one) of program modules 16205, such program modules 16205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0208] Bus 1630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0209] The electronic device 1600 may also communicate with one or more external devices 1700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1600, and / or communicate with any device that enables the electronic device 1600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1650. Furthermore, the electronic device 1600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1660. As shown, the network adapter 1660 communicates with other modules of the electronic device 1600 via a bus 1630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0210] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0211] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above "Exemplary Method" section of the present specification.

[0212] According to the program product for implementing the above method in the embodiment of the present disclosure, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0213] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0214] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0215] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0216] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0217] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0218] Other embodiments of the present disclosure will be readily apparent to those skilled in the art after considering the specification and practicing the inventions invented herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not invented by the present disclosure. The specification and examples are to be considered merely exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A method for optimizing an edge box, characterized in that: Configured on the central server, the optimization method of the edge box includes: Receive current load data reported by the current edge box; wherein the current load data includes the number of video channels currently running in the current edge box and the CPU occupancy rate; Calculate the current load rate of the current edge box according to the number of currently running video channels and the CPU occupancy rate, and determine whether the current load rate is greater than other load rates of other edge boxes corresponding to the current edge box; When it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box, a new binding relationship is assigned to a camera that generates the new video stream to be processed; Binding the camera generating the new video stream to be processed to the other edge boxes based on the new binding relationship, and processing the new video stream to be processed based on the other edge boxes to optimize the current edge box and the other edge boxes; Among them, processing the new video stream to be processed includes: pulling the new video stream to be processed according to the stream address of the camera, and decoding the new video stream to be processed to obtain multiple frames of image frames to be identified; according to the algorithm category bound to the camera, calling the algorithm model corresponding to the algorithm category in the current edge box, and using the algorithm model to identify the image frames to be identified to obtain the current recognition result; wherein the algorithm model includes at least one of a face recognition algorithm, a face gender and age algorithm, and a head detection algorithm.

2. The edge box optimization method according to claim 1, characterized in that: Calculating the current load rate of the current edge box according to the number of currently running video paths and the CPU occupancy rate includes: Obtain the total number of video channels that the current edge box can support, and calculate the ratio of the currently running video channels to the total number of video channels; The current load rate of the current edge box is calculated according to the path ratio and the first weight value of the path ratio, the CPU occupancy rate and the second weight value of the CPU occupancy rate.

3. The edge box optimization method according to claim 1, characterized in that: The edge box optimization method further includes: Receiving a first registration request sent by the current edge box and / or the other edge boxes; Parsing the first registration request to obtain first attribute information of the current edge box and / or other edge boxes; wherein the first attribute information includes one or more of a box name, a MAC address, a computing power, and a total number of video channels that can be supported; The current edge box and / or the other edge boxes are registered according to the first attribute information.

4. The edge box optimization method according to claim 3, characterized in that: The edge box optimization method further includes: Receive a second registration request sent by the camera, and parse the second registration request to obtain second attribute information of the camera; wherein the second attribute information includes one or more of a camera name, an IP address, a port address, a stream address, and a bound algorithm category; The camera is registered according to the second attribute information.

5. The edge box optimization method according to claim 4, characterized in that: The edge box optimization method further includes: Calculate the number of first cameras that the current edge box can accommodate according to the computing power of the current edge box and the total number of video channels that can be supported; and / or Calculate the number of second cameras that can be accommodated by the other edge boxes according to the computing power of the other edge boxes and the total number of video channels that can be supported; Establishing a binding relationship between the camera and the current edge box and / or the other edge boxes according to the number of the first cameras and / or the number of the second cameras, the MAC address, the port address, and the IP address; The camera is bound to the current edge box and / or other edge boxes based on the binding relationship, and the binding relationship is sent to the current edge box and / or other edge boxes.

6. A method for optimizing an edge box, characterized in that: Configured in an edge box, the optimization method of the edge box includes: According to the binding relationship between the current edge box and the camera, determine the camera bound to the current edge box, and detect whether a video frame including the target object appears in the current video stream captured by the camera; When a video frame including a target object is detected in the current video stream, the current video stream is used as a video stream to be processed, and a video path is run to process the video stream to be processed, including: pulling the video stream to be processed according to the stream address of the camera, and decoding the video stream to be processed to obtain multiple frames of image frames to be recognized; according to the algorithm category bound to the camera, calling the algorithm model corresponding to the algorithm category in the current edge box, and using the algorithm model to recognize the image frame to be recognized to obtain the current recognition result; wherein the algorithm model includes at least one of a face recognition algorithm, a face gender and age algorithm, and a head detection algorithm; Calculate the number of currently running video channels in the current edge box, and generate current load data according to the number of currently running video channels and the CPU occupancy rate generated by processing the video stream to be processed; The current load data is reported to a central server so that the central server calculates the current load rate of the current edge box according to the current load data, and optimizes the current edge box and other edge boxes corresponding to the current edge box according to the current load rate, including: when it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box, a new binding relationship is assigned to the camera that generates the new video stream to be processed; based on the new binding relationship, the camera that generates the new video stream to be processed is bound to the other edge boxes, and the new video stream to be processed is processed based on the other edge boxes, so as to optimize the current edge box and other edge boxes.

7. The edge box optimization method according to claim 6, characterized in that: The face recognition algorithm is used to recognize the image frame to be recognized, and a current recognition result is obtained, including: Using a preset face detection and key point positioning tool, detecting a face region to be identified in the image frame to be identified; Extracting key points of the face to be identified in the image frame to be identified in the face area to be identified, and calculating features of the face to be identified based on the key points of the face to be identified; A feature comparison is performed on the facial features to be identified and the original facial features in a preset feature value library to obtain the current recognition result.

8. The edge box optimization method according to claim 7, characterized in that: Performing feature comparison on the face features to be identified and the original face features in the preset feature value library to obtain the current recognition result includes: Calculating the Euclidean distance between the face feature to be identified and the original face feature in the feature value library in the current edge box; According to the Euclidean distance, a similarity comparison result between the facial features to be identified and the original facial features is obtained.

9. The edge box optimization method according to claim 8, characterized in that: The edge box optimization method further includes: Determine whether the similarity comparison result is greater than a preset threshold; If so, generating a successful identification message according to the similarity comparison result, and reporting the successful identification message to the central server; If not, the facial features to be identified are broadcasted to the other edge boxes, and the facial features to be identified are identified in the other edge boxes to obtain other identification results.

10. The edge box optimization method according to claim 9, characterized in that: The edge box optimization method further includes: If any other recognition result is a successful recognition, then the other successful recognition result is reported to the central server; Extracting original facial features corresponding to the facial features to be identified from feature value libraries in other edge boxes corresponding to other identification results that have been successfully identified; The feature value library in the current edge box is updated using the original face features.

11. The edge box optimization method according to claim 9, characterized in that: The edge box optimization method further includes: If all other recognition results are recognition failures, the facial features to be recognized are reported to the central server so that the central server recognizes the facial features to be recognized.

12. An edge box optimization device, characterized in that: Configured on the central server, the optimization device of the edge box includes: A load data receiving module, used to receive current load data reported by the current edge box; wherein the current load data includes the number of video channels currently running in the current edge box and the CPU occupancy rate; A first calculation module, configured to calculate a current load rate of the current edge box according to the number of currently running video channels and the CPU occupancy rate, and determine whether the current load rate is greater than other load rates of other edge boxes corresponding to the current edge box; A first binding relationship allocation module is used to allocate a new binding relationship for a camera that generates a new video stream to be processed when it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box; A first camera binding module is used to bind the camera that generates the new video stream to be processed to the other edge boxes based on the new binding relationship, and process the new video stream to be processed according to the other edge boxes to optimize the current edge box and the other edge boxes; Among them, processing the new video stream to be processed includes: pulling the new video stream to be processed according to the stream address of the camera, and decoding the new video stream to be processed to obtain multiple frames of image frames to be identified; according to the algorithm category bound to the camera, calling the algorithm model corresponding to the algorithm category in the current edge box, and using the algorithm model to identify the image frames to be identified to obtain the current recognition result; wherein the algorithm model includes at least one of a face recognition algorithm, a face gender and age algorithm, and a head detection algorithm.

13. An edge box optimization device, characterized in that: Configured in an edge box, the optimization device of the edge box includes: A camera determination module, used to determine the camera bound to the current edge box according to the binding relationship between the current edge box and the camera, and detect whether a video frame including a target object appears in the current video stream shot by the camera; The first video stream processing module is used to, when a video frame including a target object is detected in the current video stream, use the current video stream as a video stream to be processed, and run a video path to process the video stream to be processed, including: pulling the video stream to be processed according to the stream address of the camera, and decoding the video stream to be processed to obtain multiple frames of image frames to be recognized; according to the algorithm category bound to the camera, calling the algorithm model corresponding to the algorithm category in the current edge box, and using the algorithm model to recognize the image frame to be recognized to obtain a current recognition result; wherein the algorithm model includes at least one of a face recognition algorithm, a face gender and age algorithm, and a head detection algorithm; A load data generating module, used for calculating the number of currently running video channels in the current edge box, and generating current load data according to the number of currently running video channels and the CPU occupancy rate generated by processing the video stream to be processed; A load data reporting module is used to report the current load data to a central server so that the central server calculates the current load rate of the current edge box according to the current load data, and optimizes the current edge box and other edge boxes corresponding to the current edge box according to the current load rate, including: when it is determined that the current load rate is greater than other load rates and a new video stream to be processed appears in the current edge box, a new binding relationship is assigned to the camera that generates the new video stream to be processed; based on the new binding relationship, the camera that generates the new video stream to be processed is bound to the other edge boxes, and the new video stream to be processed is processed based on the other edge boxes, so as to optimize the current edge box and other edge boxes.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the edge box optimization method according to any one of claims 1 to 11 is implemented.

15. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the edge box optimization method according to any one of claims 1 to 11 by executing the executable instructions.

Citation Information

Patent Citations

  • Compute task distributed dispatching device in server cluster

    CN104363300A

  • Intelligent analysis equipment resource adjustment method and device

    CN110944146A