Pseudo real-time asynchronous polling calling camera monitoring method and related device
By adopting pseudo -real -time asynchronous rotation camera monitoring methods in financial enterprises and other places, using the main process and the collaborative work of the process to solve the problem of high computing power demand under multi -camera real -time monitoring, realize the efficient utilization of resources and the efficient utilization of resources and the use of resources and the efficient utilization of resources and the use of resources and the efficient utilization of resources and the use of resources and the efficient utilization of resources and the use The accuracy of monitoring.
Patent Information
- Application Number
- CN202411536729.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-01-28
AI Technical Summary
In places such as financial enterprises, images collected by multiple cameras need to be monitored in real time to determine whether the number of staff meets the requirements, resulting in a high demand for computing power.
The camera monitoring method adjusted by pseudo -innocent asynchronous inquiries is adopted to reduce the needs of computing power through the main process and the collaborative work of the process. The main process is responsible for the real -time video image collection and processing of the main camera. It is responsible for the collection and processing of video images from the camera from the process. It only carrises inquiries when necessary to reduce unnecessary data processing.
Effectively reduce the requirements for computing power and data processing, save bandwidth resources, and avoid illegal warning errors caused by monitoring dead ends.
Smart Images

Figure CN119383462A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a pseudo-real-time asynchronous polling camera monitoring method and related devices. Background Art
[0002] Financial enterprises, such as banks, need to install cameras in some places to detect whether the number of staff entering the place meets the requirements through the video captured by the cameras. For example, the number of staff entering the bank's clearing room cannot be less than 2. If the number of staff entering the bank's clearing room is less than 2, a violation warning will be issued.
[0003] If the area of the venue is large, multiple cameras need to be deployed to monitor the entire venue. Multiple cameras can capture images of all areas of the venue. In the related art, it is necessary to determine the number of staff members from the images captured by multiple cameras in real time to determine whether the number of staff members entering the venue meets the requirements.
[0004] The related technology requires real-time processing of images collected by multiple cameras, which requires high computing power. Summary of the invention
[0005] In view of the above problems, the present application provides a pseudo real-time asynchronous polling camera monitoring method and related devices to achieve the purpose of reducing computing power requirements. The specific scheme is as follows:
[0006] In a first aspect, the present application provides a camera monitoring method activated by pseudo real-time asynchronous polling, wherein one or more master cameras and one or more slave cameras are deployed at a site to be monitored; the camera monitoring method activated by pseudo real-time asynchronous polling comprises:
[0007] For each of the main cameras, determining the first number of staff members located in a collection area of the main camera based on the video image collected in real time by the main camera through a first process, so as to obtain the first number corresponding to the main camera; storing the first number in a shared memory; different main cameras correspond to different first processes;
[0008] Control the second process to obtain a first value through the shared memory, where the first value is the sum of the first numbers corresponding to all the main cameras, and if the first value is greater than or equal to a preset compliance number, it is determined that the specification is met;
[0009] If the first value is less than the preset compliance number, a slave camera is determined from the slave cameras that have not been polled, and an i-th value of a staff member located in a collection area of the slave camera is determined based on a video image collected in real time by the slave camera through the second process, where an initial value of i is 2 and i is a positive integer;
[0010] Obtaining the sum of the first value to the i-th value through the second process; if the sum of the first value to the i-th value is greater than or equal to the preset compliance number, determining that the specification is met;
[0011] If the sum of the first value to the i-th value is less than the preset compliance number, set i=i+1, return to the step of determining a slave camera from the slave cameras that have not been polled, and determine the i-th value of the staff member located in the collection area of the slave camera based on the video image collected in real time by the slave camera through the second process;
[0012] If all the slave cameras are polled, and the sum of the first value to the i-th value is less than the preset compliance number, it is determined through the second process that the specification is not met.
[0013] In a possible implementation, the method for determining the main camera includes:
[0014] Obtaining collection areas corresponding to a plurality of cameras deployed at the location to be monitored;
[0015] If the ratio of the first area to the area of the place to be monitored is greater than or equal to a preset space threshold, the candidate camera among the multiple cameras is determined to be the main camera; the first area is less than or equal to the area of the place to be monitored occupied by the collection areas corresponding to the second number of the candidate cameras; the ratio of the second number to the total number of the multiple cameras is less than or equal to a preset value;
[0016] The camera corresponding to the acquisition area with the highest corresponding probability is determined to be the main camera, and the probability of the camera refers to the probability that the staff member is located in the acquisition area of the camera.
[0017] In a possible implementation, determining a slave camera from the slave cameras that have not been polled includes:
[0018] Get the priority levels of all the slave cameras;
[0019] A slave camera with the highest priority is determined from the slave cameras that have not been polled.
[0020] In a possible implementation, the method for determining the priority levels of all the slave cameras includes:
[0021] Inputting the historical activity information of the staff in the collection areas respectively corresponding to all the slave cameras into the pre-built probability prediction model, and obtaining the probabilities respectively corresponding to all the slave cameras through the probability prediction model, wherein the probability of the slave camera refers to the probability that the staff is located in the collection area of the slave camera;
[0022] The priority levels respectively corresponding to all the slave cameras are set according to the probabilities respectively corresponding to all the slave cameras, and the probabilities of the slave cameras are positively correlated with the priority levels of the slave cameras.
[0023] In a possible implementation, the method for determining the priority levels of all the slave cameras includes:
[0024] The priority level of the slave camera is determined according to the distance between the acquisition area of the slave camera and the acquisition area of the main camera; wherein, the closer the distance between the acquisition area of the slave camera and the acquisition area of the main camera is, the higher the priority level of the slave camera is.
[0025] In a possible implementation, the step of determining the first number of workers located in the acquisition area of the main camera based on the video image acquired in real time by the main camera through the first process includes:
[0026] The video image captured in real time by the main camera is input into a pre-built staff type differentiation model through the first process, and the first number of staff members corresponding to the target staff type in the capture area of the main camera is obtained through the staff type differentiation model.
[0027] In a possible implementation, the step of determining, through the second process, the i-th numerical value of the staff member located in the acquisition area of the slave camera based on the video image acquired in real time by the slave camera includes:
[0028] The video image collected in real time from the camera is input into a pre-built staff type differentiation model through the second process, and the i-th value of the staff member corresponding to the target staff type located in the collection area of the slave camera is obtained through the staff type differentiation model.
[0029] The second aspect of the present application provides a pseudo real-time asynchronous polling-activated camera monitoring device, wherein one or more master cameras and one or more slave cameras are deployed at a site to be monitored; the pseudo real-time asynchronous polling-activated camera monitoring device comprises:
[0030] A first determination module is used to determine, for each of the main cameras, a first number of staff members located in a collection area of the main camera based on a video image collected in real time by the main camera through a first process, so as to obtain the first number corresponding to the main camera; and store the first number in a shared memory; different main cameras correspond to different first processes;
[0031] A first acquisition module, used for controlling the second process to acquire a first value through the shared memory, where the first value is the sum of the first numbers corresponding to all the main cameras, and if the first value is greater than or equal to a preset compliance number, it is determined to be in compliance with the specification;
[0032] A second determination module is configured to determine, if the first value is less than the preset compliance number, a slave camera from the slave cameras that have not been polled, and determine, through the second process, an i-th value of a staff member located in a collection area of the slave camera based on a video image collected in real time by the slave camera, where an initial value of i is 2 and i is a positive integer;
[0033] A third determination module, configured to obtain the sum of the first value to the i-th value through the second process; if the sum of the first value to the i-th value is greater than or equal to the preset compliance number, determine that the specification is met;
[0034] a triggering module, configured to set i=i+1 if the sum of the first value to the i-th value is less than the preset compliance number, and trigger the second determining module;
[0035] The fourth determination module is used to determine non-compliance with the specification through the second process if all the slave cameras are polled and the sum of the first value to the i-th value is less than the preset compliance number.
[0036] The third aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an edge computing box, the edge computing box implements the camera monitoring method activated by pseudo-real-time asynchronous polling according to the first aspect or any implementation method of the first aspect.
[0037] A fourth aspect of the present application provides an edge computing box, comprising at least one processor and a memory connected to the processor, wherein:
[0038] The memory is used to store computer programs;
[0039] The processor is used to execute the computer program so that the edge computing box can implement the camera monitoring method of pseudo real-time asynchronous polling in the above-mentioned first aspect or any implementation method of the first aspect.
[0040] In a fifth aspect, the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an edge computing box, the edge computing box can implement the camera monitoring method activated by pseudo real-time asynchronous polling according to the above-mentioned first aspect or any implementation method of the first aspect.
[0041] By means of the above technical solution, the present application provides a camera monitoring method activated by pseudo-real-time asynchronous polling, wherein a first process is started for each main camera; a second process is started for all slave cameras; the first process determines the first number of staff members located in the acquisition area of the main camera based on the video image captured in real time by the main camera; the second process obtains the sum of the first numbers corresponding to all main cameras, i.e., the first value; if the first value is greater than or equal to the preset compliance number, it means that the number of staff members located in the acquisition area of all main cameras has reached the specification requirements, so there is no need to monitor the number of staff members in the acquisition area of the slave cameras, and at this time, the second process does not need to pull video images from the slave cameras. If the first value is less than the preset compliance number, it means that the number of staff members located in the acquisition area of all main cameras has not reached the specification requirements, and it is necessary to further check the number of staff members located in the acquisition area of the slave cameras. At this time, the second process determines a slave camera from the slave cameras that have not been polled, and determines the i-th value of the staff members located in the acquisition area of the slave camera based on the video image captured in real time by the slave camera. The sum of the first value to the i-th value is obtained through the second process; if the sum of the first value to the i-th value is greater than or equal to the preset compliance number, it is determined to be in compliance with the specification; if the sum of the first value to the i-th value is less than the preset compliance number, the second process continues to poll the cameras that have not been polled until all the slave cameras are polled, or the sum of the first value to the i-th value is greater than or equal to the preset compliance number. If all the slave cameras are polled and the sum of the first value to the i-th value is less than the preset compliance number, it is determined not to be in compliance with the specification. In the embodiment of the present application, the number of processes started simultaneously is less than the number of processes started in the related art; in the present application, when the number of staff members located in the collection area of the main camera is greater than or equal to the preset compliance number, only the first process needs to pull the video image collected by the main camera, and there is no need for the second process to pull the video image collected by the slave camera. Compared with the related art that requires pulling the video images collected by all cameras, the amount of data to be processed is greatly reduced, the computing power requirement is reduced, and bandwidth resources are saved; in the case where the number of staff members located in the collection area of the main camera and part of the slave cameras is greater than or equal to the preset compliance number, the first process pulls the video image collected by the main camera, and the second process pulls the video image collected by part of the slave cameras, and there is no need to pull all the video images collected by the slave cameras. Compared with the related art that requires pulling the video images collected by all cameras, the amount of data to be processed is greatly reduced, the computing power requirement is reduced, and bandwidth resources are saved; even if the present application pulls the video image collected by the main camera and all the video images pulled from the slave cameras, the process of pulling the video images from the slave cameras is asynchronous, not simultaneous, so compared with the related art, the amount of data to be processed is greatly reduced, and the computing power requirement is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0043] Figure 1 A schematic diagram of a system architecture provided for this application;
[0044] Figure 2 A schematic diagram of the structure of a server 200 provided in this application;
[0045] Figure 3 A schematic diagram of a process of a pseudo real-time asynchronous polling camera monitoring method provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of the structure of a camera monitoring device activated by pseudo real-time asynchronous polling provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0048] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0049] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0050] It should be noted that the information of the staff involved in this application (including but not limited to user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the staff or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0051] See also Figure 1 , Figure 1 A schematic diagram of a system architecture is shown. The system may include an edge computing box 100, a server 200, and multiple cameras 300.
[0052] The server 200 may include one or more servers ( Figure 1 A server is included as an example for explanation).
[0053] The camera 300 is used to capture still images or videos. The subject (object or organism) generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to the ISP for conversion into a digital image signal.
[0054] Exemplarily, a plurality of cameras 300 are deployed at a location to be monitored. Exemplarily, the location to be monitored may be a bank sorting room, a bank vault, or a bank loading area.
[0055] Exemplarily, the camera 300 may be connected to an NVR (Network Video Recorder), which receives, stores and manages the video images captured by the camera.
[0056] For example, the edge computing box 100 can obtain corresponding real-time video images from the video streams transmitted to the NVR by multiple cameras 300. Thus, the camera monitoring method of pseudo-real-time asynchronous polling provided in the embodiment of the present application can be executed to obtain whether the number of staff entering the monitored place is compliant.
[0057] Exemplarily, the edge computing box 100 may include a storage unit, a power distribution unit, a computing unit, and the like.
[0058] Exemplarily, the edge computing box 100 sends the result of whether the number of staff entering the monitored place is compliant to the server 200. If the number of staff entering the monitored place is not compliant, the edge computing box 100 will issue a violation alarm and simultaneously push the real-time monitoring screen at the time of violation to the server 200.
[0059] Next describe Figure 1 The product form of the server 200;
[0060] Figure 2 A structural diagram of a server 200 is provided, such as Figure 2 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.
[0061] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 2 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0062] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0063] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0064] It should be understood that the above-mentioned edge computing box 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned edge computing box 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with the function of executing instructions, such as CPU, DSP, etc., or a hardware system without the function of executing instructions, such as ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without the function of executing instructions and hardware systems with the function of executing instructions.
[0065] It is understandable that the space of the monitored place is large. If a small number of cameras are set up, there may be blind spots in the monitoring. If the staff is located in the blind spots, the number of staff who actually enter the monitored place may be greater than or equal to the preset compliance number, but because some staff are located in the blind spots, the number of staff in the video image collected by the camera is less than the preset compliance number, resulting in a violation alarm error. Based on this, it is necessary to deploy more cameras in the monitoring place to avoid blind spots in the monitoring.
[0066] It is understandable that, for the financial industry, especially banks, once the cameras in the places to be monitored are deployed, it is very difficult to subsequently change the location of the cameras considering security and compliance process issues. The embodiment of the present application is for a scenario in which multiple cameras are deployed in the place to be monitored, and the collection area of a small number of cameras (for example, accounting for 30% of the number of all cameras deployed in the place to be monitored) is a majority of the area of the place to be monitored (for example, accounting for 80% to 90% of the place to be monitored). For example, 8 cameras are deployed in the place to be monitored, of which 3 cameras (i.e., the main cameras mentioned in the embodiment of the present application) have a collection area of 90% of the place to be monitored, and the other 5 cameras (i.e., the slave cameras provided in the embodiment of the present application) are used to collect video images of monitoring blind spots that the 3 cameras failed to collect.
[0067] It is understandable that since the main camera can collect video images of most areas of the monitored place or the main working area of the staff, the staff are most likely located in the collection area of the main camera; if the number of staff in the video image collected by the main camera is greater than or equal to the preset compliance number, there is no need to check the number of staff in the video image collected by the slave camera; if the number of staff in the video image collected by the main camera is less than the preset compliance number, in order to avoid erroneous violation warnings, it is necessary to check the area that the main camera cannot collect, that is, the monitoring blind spot. At this time, it is necessary to obtain the number of staff in the video image collected by the slave camera, but there is no need to obtain all the video images collected by the slave cameras at the same time. Only the number of staff in the video image collected by one slave camera is obtained each time; if the sum of the number of staff in the video image collected by the slave camera and the number of staff in the video image collected by the main camera is greater than or equal to the preset compliance number, it means compliance; there is no need to poll other slave cameras, otherwise it is necessary to continue polling other slave cameras.
[0068] Each camera corresponds to a process. In the related technology, the number of cameras deployed in the monitored place is the number of processes; multiple processes are started at the same time, so as to determine the number of staff members from the video images collected by multiple cameras in real time. This application can start the number of master processes and 1 slave process for the main camera, that is, each main camera corresponds to a master process, and a slave process polls and processes all the video images collected by the slave cameras, which greatly reduces the number of processes started, thereby reducing the computing power requirements.
[0069] In order to solve the problem of high computing power required in the related art, the embodiment of the present application provides a pseudo real-time asynchronous polling camera monitoring method. The pseudo real-time asynchronous polling camera monitoring method of the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0070] Reference Figure 3 , Figure 3 A flowchart of a pseudo real-time asynchronous polling camera monitoring method provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, a pseudo real-time asynchronous polling camera monitoring method provided in an embodiment of the present application can be applied to an edge computing box. The method can include steps S301 to S306, and these steps are described in detail below.
[0071] One or more master cameras and one or more slave cameras are deployed in the place to be monitored.
[0072] Step S301: For each of the main cameras, determine the first number of staff members located in the collection area of the main camera based on the video image collected in real time by the main camera through a first process to obtain the first number corresponding to the main camera; and store the first number in the shared memory.
[0073] Different main cameras correspond to different first processes.
[0074] Shared memory is the channel for the first process and the second process to communicate.
[0075] The number of master cameras and slave cameras is explained below. Assuming that there are 10 cameras deployed in the monitored location, including 2 master cameras and 8 slave cameras, 2 master processes (ie, the first process) and 1 slave process (ie, the second process) can be created.
[0076] It can be understood that a process may include multiple threads. For example, the first process includes three threads, namely the first thread, the second thread and the third thread. The first thread is used to pull the video image from the main camera, parse it, and store the parsed video image in the first queue; the second thread is used to obtain the parsed video image from the first queue, and analyze the first number of staff members in the video image; the third thread is used to store at least the first number in the shared memory. For example, the serial number of the video image and the corresponding storage value of the first number can also be stored in the shared memory.
[0077] Exemplarily, if there are multiple main cameras, multiple first processes can be started simultaneously.
[0078] Step S302: Control the second process to obtain a first value through the shared memory, where the first value is the sum of the first numbers corresponding to all the main cameras. If the first value is greater than or equal to a preset compliance number, it is determined to be in compliance with the specification.
[0079] Exemplarily, the preset compliance number may be determined based on actual conditions; the preset compliance numbers corresponding to different places to be monitored may be the same or different.
[0080] It is understandable that the first process and the second process can be started at the same time, but when the first process pulls the video image from the main camera, the second process has not yet pulled the video image from the slave camera.
[0081] Step S303: If the first value is less than the preset compliance number, a slave camera is determined from the slave cameras that have not been polled, and the i-th value of the staff member located in the collection area of the slave camera is determined through the second process based on the video image collected in real time by the slave camera.
[0082] The initial value of i is 2 and i is a positive integer.
[0083] It can be understood that a process may include multiple threads. For example, the second process includes three threads, namely the third thread, the fourth thread and the fifth thread. The third thread is used to pull the video image from the camera, parse it, and store the parsed video image in the second queue; the fourth thread is used to obtain the parsed video image from the second queue, and analyze the i-th value of the staff member in the video image; the fifth thread is used to store the i-th value in the shared memory.
[0084] Exemplarily, the acquisition areas of different slave cameras have no intersection.
[0085] It can be understood that initially, all slave cameras have not been polled. In the embodiment of the present application, "the second process determines the i-th value of the staff member located in the collection area of the slave camera based on the video image collected in real time by the slave camera" is referred to as the process of polling the camera.
[0086] Exemplarily, “determining a slave camera from the slave cameras that have never been polled” may be randomly selecting a slave camera from the slave cameras that have never been polled.
[0087] Exemplarily, “determining a slave camera from the slave cameras that have not been polled” may be selecting a slave camera with the highest priority from the slave cameras that have not been polled.
[0088] Step S304: Obtain the sum of the first value to the i-th value through the second process; if the sum of the first value to the i-th value is greater than or equal to the preset compliance number, it is determined to be in compliance with the specification.
[0089] The sum of the first value to the i-th value refers to the sum of the first value, the second value, ..., the i-th value.
[0090] Step S305: If the sum of the first value to the i-th value is less than the preset compliance number, set i=i+1 and return to step S303.
[0091] Step S306: If all the slave cameras are polled, and the sum of the first value to the i-th value is less than the preset compliance number, the second process determines that it does not meet the specification.
[0092] In the embodiment of the present application, steps S302 to S306 are all executed by the second process.
[0093] In an optional implementation, the first process first processes the video image captured by the main camera, and the second process then processes the video image captured by the slave camera, so the video image processed by the first process and the video image processed by the second process are captured at different times.
[0094] For example, the video image collected by the main camera processed by the first process was collected by the main camera at 14:10:11 on October 25, 2024, and 10 milliseconds; the video image collected by the slave camera processed by the second process was collected at 14:10:11 on October 25, 2024, and 60 milliseconds, so there is a deviation in the collection time between the video images processed by the first process and the second process. However, since the processing speed of the first process and the second process is very fast, the collection time difference of the video images processed by the first process and the second process is very small, for example, an interval of 50 milliseconds, so the staff cannot teleport from the collection area of the main camera to the collection area of the slave camera within this collection time difference. When the second process polls the slave cameras, since it polls the slave cameras in sequence, the acquisition time of the video images processed by different slave cameras is different. However, since the speed of polling multiple slave cameras is very fast, for example, all slave cameras can be polled within tens of milliseconds, the staff cannot teleport from the acquisition area of one slave camera to the acquisition area of another slave camera within tens of milliseconds. Therefore, even if the acquisition time of the video images processed by the first process and the second process is different, it can be considered that the sum of the first number to the i-th number is the total number of staff in the monitored place, and the same staff member will not be recorded twice.
[0095] In an optional implementation, the first process has been processing the video image acquired by the main camera in real time to obtain the number of staff members in the video image. As time passes, for the same first process, although the first process processes the video image acquired by the same main camera, the number of frames of the processed video image is different. Assuming that the current time is 14:10:11:10 on October 25, 2024, the first process processes the 5th frame of the video acquired by the main camera. Assuming that 100 frames of video images can be acquired per second, as time passes, the current time is 14:10:11:20 on October 25, 2024, and the first process processes the 6th frame of the video acquired by the main camera. Since the main camera acquires video images in real time, the first value stored in the shared memory at different times should be the latest value at the current time. When the second process polls the slave cameras, since it polls the slave cameras in sequence, the acquisition time of the video images processed by different slave cameras is different. However, since the speed of polling multiple slave cameras is very fast, for example, all slave cameras can be polled within tens or hundreds of milliseconds, the staff cannot teleport from the acquisition area of one slave camera to the acquisition area of another slave camera within tens or hundreds of milliseconds. Therefore, even if the acquisition time of the video images processed by the first process and the second process is different, it can be considered that the sum of the first number to the i-th number is the total number of staff in the monitored place, and the same staff member will not be recorded twice.
[0096] The embodiment of the present application provides a camera monitoring method activated by pseudo-real-time asynchronous polling, wherein a first process is started for each main camera; a second process is started for all slave cameras; the first process determines the first number of staff members located in the acquisition area of the main camera based on the video image captured in real time by the main camera; the second process obtains the sum of the first numbers corresponding to all main cameras, i.e., the first value; if the first value is greater than or equal to the preset compliance number, it means that the number of staff members located in the acquisition area of all main cameras has reached the specification requirements, so there is no need to monitor the number of staff members in the acquisition area of the slave cameras, and at this time, the second process does not need to pull video images from the slave cameras. If the first value is less than the preset compliance number, it means that the number of staff members located in the acquisition area of all main cameras has not reached the specification requirements, and it is necessary to further check the number of staff members located in the acquisition area of the slave cameras. At this time, the second process determines a slave camera from the slave cameras that have not been polled, and determines the i-th value of the staff members located in the acquisition area of the slave camera based on the video image captured in real time by the slave camera. The sum of the first value to the i-th value is obtained through the second process; if the sum of the first value to the i-th value is greater than or equal to the preset compliance number, it is determined to be in compliance with the specification; if the sum of the first value to the i-th value is less than the preset compliance number, the second process continues to poll the cameras that have not been polled until all the slave cameras are polled, or the sum of the first value to the i-th value is greater than or equal to the preset compliance number. If all the slave cameras are polled and the sum of the first value to the i-th value is less than the preset compliance number, it is determined not to be in compliance with the specification. In the embodiment of the present application, the number of processes started simultaneously is less than the number of processes started in the related art; in the present application, when the number of staff members located in the collection area of the main camera is greater than or equal to the preset compliance number, only the first process needs to pull the video image collected by the main camera, and there is no need for the second process to pull the video image collected by the slave camera. Compared with the related art that requires pulling the video images collected by all cameras, the amount of data to be processed is greatly reduced, the computing power requirement is reduced, and bandwidth resources are saved; in the case where the number of staff members located in the collection area of the main camera and part of the slave cameras is greater than or equal to the preset compliance number, the first process pulls the video image collected by the main camera, and the second process pulls the video image collected by part of the slave cameras, and there is no need to pull all the video images collected by the slave cameras. Compared with the related art that requires pulling the video images collected by all cameras, the amount of data to be processed is greatly reduced, the computing power requirement is reduced, and bandwidth resources are saved; even if the present application pulls the video image collected by the main camera and all the video images pulled from the slave cameras, the process of pulling the video images from the slave cameras is asynchronous, not simultaneous, so compared with the related art, the amount of data to be processed is greatly reduced, and the computing power requirement is reduced.
[0097] The following is an explanation of the method for determining the main camera. The process includes the following steps A1 to A3.
[0098] Step A1: Acquire the collection areas corresponding to the multiple cameras deployed at the place to be monitored.
[0099] Exemplarily, the acquisition area of a camera is determined by the field of view of the camera.
[0100] Step A2: If the ratio of the first area to the area of the place to be monitored is greater than or equal to a preset space threshold, determine that the candidate camera among the multiple cameras is the main camera; the first area is less than or equal to the area of the place to be monitored occupied by the collection areas corresponding to the second number of the candidate cameras; the ratio of the second number to the total number of the multiple cameras is less than or equal to a preset value.
[0101] Step A3: Determine that the camera corresponding to the acquisition area with the highest probability is the main camera, and the probability of the camera refers to the probability that the staff member is located in the acquisition area of the camera.
[0102] Exemplarily, the preset space threshold may be determined based on actual conditions, such as 90%.
[0103] Exemplarily, the preset value may be 0.3 or 0.2.
[0104] Exemplarily, the second number may be determined based on actual conditions, for example, 3.
[0105] For example, eight cameras are deployed at the place to be monitored, of which two cameras (i.e., the main cameras mentioned in the embodiment of the present application) have collection areas accounting for 80% of the place to be monitored, and the probability that the staff is located in the collection area of a certain camera is the highest; if "two cameras" does not include "the camera corresponding to the collection area with the highest probability", then three cameras are the main cameras (otherwise, two cameras are the main cameras), and the other five cameras (i.e., the slave cameras provided in the embodiment of the present application) are used to collect video images of blind spots in monitoring that the three cameras failed to collect.
[0106] Exemplarily, one or more main cameras may be randomly determined from a plurality of cameras.
[0107] It can be understood that "determining a slave camera from the slave cameras that have never been polled" can be selecting the slave camera with the highest priority from the slave cameras that have never been polled. At this time, the method of "determining a slave camera from the slave cameras that have never been polled" includes the following steps B1 to B2.
[0108] Step B1: Obtain the priority levels of all the slave cameras.
[0109] Step B2: Determine a slave camera with the highest priority from the slave cameras that have not been polled.
[0110] Exemplarily, there are multiple methods for implementing step B1, and the embodiments of the present application provide but are not limited to the following two.
[0111] The first method for implementing step B1 includes the following steps C11 to C12.
[0112] Step C11: Input the historical activity information of the staff in the collection areas corresponding to all the slave cameras into a pre-built probability prediction model, and obtain the probabilities corresponding to all the slave cameras through the probability prediction model. The probability of the slave camera refers to the probability that the staff is located in the collection area of the slave camera.
[0113] It is understandable that if the current time is October 25, 2024, then staff have entered the monitored place before October 25, 2024. The historical activity information of the preset time period closest to the current time can be input into the pre-built probability prediction model, and the probabilities corresponding to all the cameras can be obtained through the probability prediction model.
[0114] Assuming that the preset time period is 25 days, the preset time period is between October 1, 2024 and October 25, 2024.
[0115] Exemplarily, the historical activity information includes, but is not limited to: the length of time the staff stays in the collection area, the number of times the staff enters and exits the collection area. When a staff leaves a collection area and then enters the collection area again, it is considered to be one entry and exit of the collection area.
[0116] Exemplarily, the probability prediction model is obtained by training by using the historical activity information of the sample staff as the input of the probability prediction model and using the probability of the sample staff being located in each collection area as the training target.
[0117] Step C12: setting the priority levels corresponding to all the slave cameras according to the probabilities corresponding to all the slave cameras, wherein the probabilities of the slave cameras are positively correlated with the priority levels of the slave cameras.
[0118] It can be understood that the higher the probability that the staff is in a certain collection area, the higher the priority of the second process in polling the video images collected from the camera corresponding to the collection area. This can reduce the number of times the camera is polled, further reduce computing power requirements and save bandwidth resources.
[0119] The second method for implementing step B1 includes the following steps C21.
[0120] Step C21: Determine the priority level of the slave camera according to the distance between the acquisition area of the slave camera and the acquisition area of the main camera; wherein, the closer the distance between the acquisition area of the slave camera and the acquisition area of the main camera is, the higher the priority level of the slave camera is.
[0121] It can be understood that the closer the distance between the collection area of the slave camera and the collection area of the main camera, the greater the probability that the staff will move from the collection area of the main camera to the collection area of the slave camera. In order to avoid the above situation, the priority level of the slave camera can be set through step C21.
[0122] It is understandable that there are many types of staff entering the place to be monitored, and the number of staff of the same type needs to be greater than or equal to the preset compliance number. Assuming that it is necessary to monitor whether the number of staff belonging to the target staff type is compliant, step S301 includes the following steps: inputting the video image captured by the main camera in real time into a pre-built staff type distinction model through the first process, and obtaining the first number of staff corresponding to the target staff type in the collection area of the main camera through the staff type distinction model.
[0123] For example, different types of workers have different work clothes, so the type of worker can be determined based on the worker's attire.
[0124] Exemplarily, the training process of the staff type distinction model includes: taking the sample video image as the input of the staff type distinction model, taking the number of people corresponding to various staff types in the sample video image as the training target, and training the staff type distinction model.
[0125] Exemplarily, step S303 includes: inputting the video image collected in real time from the camera into a pre-built staff type differentiation model through the second process, and obtaining the i-th numerical value of the staff member corresponding to the target staff type located in the collection area of the slave camera through the staff type differentiation model.
[0126] A pseudo real-time asynchronous polling-triggered camera monitoring method provided in an embodiment of the present application is introduced above. A device for executing the pseudo real-time asynchronous polling-triggered camera monitoring method will be introduced below.
[0127] See also Figure 4 , Figure 4 A schematic diagram of the structure of a pseudo real-time asynchronous polling camera monitoring device provided in an embodiment of the present application. One or more master cameras and one or more slave cameras are deployed in the monitored area. Figure 4As shown, the pseudo real-time asynchronous polling camera monitoring device includes:
[0128] A first determination module 401 is used for determining, for each of the main cameras, a first number of staff members located in a collection area of the main camera based on a video image collected in real time by the main camera through a first process, so as to obtain the first number corresponding to the main camera; and storing the first number in a shared memory; different main cameras correspond to different first processes;
[0129] A first acquisition module 402 is used to control the second process to obtain a first value through the shared memory, where the first value is the sum of the first numbers corresponding to all the main cameras, and if the first value is greater than or equal to a preset compliance number, it is determined to be in compliance with the specification;
[0130] A second determination module 403 is configured to determine, if the first value is less than the preset compliance number, a slave camera from the slave cameras that have not been polled, and determine, through the second process, an i-th value of a staff member located in a collection area of the slave camera based on a video image collected in real time by the slave camera, where an initial value of i is 2 and i is a positive integer;
[0131] A third determination module 404 is used to obtain the sum of the first value to the i-th value through the second process; if the sum of the first value to the i-th value is greater than or equal to the preset compliance number, determine that the specification is met;
[0132] A trigger module 405 is configured to set i=i+1 if the sum of the first value to the i-th value is less than the preset compliance number, thereby triggering the second determination module;
[0133] The fourth determination module 406 is used to determine non-compliance with the specification through the second process if all the slave cameras are polled and the sum of the first value to the i-th value is less than the preset compliance number.
[0134] In a possible implementation, the method further includes:
[0135] A second acquisition module is used to acquire the collection areas corresponding to the multiple cameras deployed at the place to be monitored;
[0136] A fifth determination module is used to determine that a candidate camera among the multiple cameras is the main camera if the ratio of the first area to the area of the place to be monitored is greater than or equal to a preset space threshold; the first area is less than or equal to the area of the place to be monitored occupied by the collection areas corresponding to the second number of the candidate cameras respectively; the ratio of the second number to the total number of the multiple cameras is less than or equal to a preset value;
[0137] Determine the main camera module, which is used to determine that the camera corresponding to the acquisition area with the highest probability is the main camera, and the probability of the camera refers to the probability that the staff member is located in the acquisition area of the camera
[0138] In a possible implementation, the second determining module includes:
[0139] A first acquisition unit, used for acquiring the priority levels of all the slave cameras;
[0140] The first determining unit is used to determine a slave camera with the highest priority from the slave cameras that have not been polled.
[0141] In a possible implementation, the method further includes:
[0142] A third acquisition module is used to input the historical activity information of the staff in the collection areas corresponding to all the slave cameras into a pre-built probability prediction model, and obtain the probabilities corresponding to all the slave cameras through the probability prediction model, wherein the probability of the slave camera refers to the probability that the staff is located in the collection area of the slave camera;
[0143] The setting module is used to set the priority levels corresponding to all the slave cameras according to the probabilities corresponding to all the slave cameras, and the probabilities of the slave cameras are positively correlated with the priority levels of the slave cameras.
[0144] In a possible implementation, the method further includes:
[0145] The sixth determination module is used to determine the priority level of the slave camera according to the distance between the acquisition area of the slave camera and the acquisition area of the main camera; wherein, the closer the distance between the acquisition area of the slave camera and the acquisition area of the main camera, the higher the priority level of the slave camera.
[0146] In a possible implementation, the first determining module includes:
[0147] A second acquisition unit is used to input the video image captured in real time by the main camera into a pre-built staff type differentiation model through the first process, and obtain the first number of staff members corresponding to the target staff type in the acquisition area of the main camera through the staff type differentiation model.
[0148] In a possible implementation, the second determining module includes:
[0149] The third acquisition unit is used to input the video image collected in real time from the camera into a pre-built staff type differentiation model through the second process, and obtain the i-th numerical value of the staff member corresponding to the target staff type and located in the collection area of the slave camera through the staff type differentiation model.
[0150] Also provided in an embodiment of the present application is a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an edge computing box, the electronic device implements any one of the pseudo-real-time asynchronous polling-triggered camera monitoring methods provided in the embodiments of the present application.
[0151] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When one or more computer programs are executed by an edge computing box, the edge computing box can implement any pseudo-real-time asynchronous polling-triggered camera monitoring method provided in an embodiment of the present application.
[0152] It should be noted that the camera monitoring method and related devices provided by the present invention can be used in the field of artificial intelligence or finance. The above is only an example and does not limit the application field of the camera monitoring method and related devices provided by the present invention.
[0153] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0154] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including application-specific integrated circuits, special CPUs, GPUs, TPUs, special memories, special components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for this application, software program implementation is a better implementation method in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0155] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0156] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A pseudo real-time asynchronous polling camera monitoring method, characterized in that: One or more master cameras and one or more slave cameras are deployed in the place to be monitored; The camera monitoring method activated by pseudo real-time asynchronous polling includes: For each of the main cameras, determining the first number of staff members located in a collection area of the main camera based on the video image collected in real time by the main camera through a first process, so as to obtain the first number corresponding to the main camera; storing the first number in a shared memory; different main cameras correspond to different first processes; Control the second process to obtain a first value through the shared memory, where the first value is the sum of the first numbers corresponding to all the main cameras, and if the first value is greater than or equal to a preset compliance number, it is determined that the specification is met; If the first value is less than the preset compliance number, a slave camera is determined from the slave cameras that have not been polled, and an i-th value of a staff member located in a collection area of the slave camera is determined based on a video image collected in real time by the slave camera through the second process, where an initial value of i is 2 and i is a positive integer; Obtaining the sum of the first value to the i-th value through the second process; if the sum of the first value to the i-th value is greater than or equal to the preset compliance number, determining that the specification is met; If the sum of the first value to the i-th value is less than the preset compliance number, set i=i+1, return to the step of determining a slave camera from the slave cameras that have not been polled, and determine the i-th value of the staff member located in the collection area of the slave camera based on the video image collected in real time by the slave camera through the second process; If all the slave cameras are polled, and the sum of the first value to the i-th value is less than the preset compliance number, it is determined through the second process that the specification is not met.
2. The camera monitoring method based on pseudo real-time asynchronous polling according to claim 1, characterized in that: The method for determining the main camera includes: Obtaining collection areas corresponding to a plurality of cameras deployed at the location to be monitored; If the ratio of the first area to the area of the place to be monitored is greater than or equal to a preset space threshold, the candidate camera among the multiple cameras is determined to be the main camera; the first area is less than or equal to the area of the place to be monitored occupied by the collection areas corresponding to the second number of the candidate cameras; the ratio of the second number to the total number of the multiple cameras is less than or equal to a preset value; The camera corresponding to the acquisition area with the highest corresponding probability is determined to be the main camera, and the probability of the camera refers to the probability that the staff member is located in the acquisition area of the camera.
3. The camera monitoring method based on pseudo real-time asynchronous polling according to claim 2 is characterized in that: The determining a slave camera from the slave cameras that have not been polled comprises: Get the priority levels of all the slave cameras; A slave camera with the highest priority is determined from the slave cameras that have not been polled.
4. The camera monitoring method based on pseudo real-time asynchronous polling according to claim 3 is characterized in that: The method for determining the priority level of all the slave cameras includes: Inputting the historical activity information of the staff in the collection areas respectively corresponding to all the slave cameras into the pre-built probability prediction model, and obtaining the probabilities respectively corresponding to all the slave cameras through the probability prediction model, wherein the probability of the slave camera refers to the probability that the staff is located in the collection area of the slave camera; The priority levels respectively corresponding to all the slave cameras are set according to the probabilities respectively corresponding to all the slave cameras, and the probabilities of the slave cameras are positively correlated with the priority levels of the slave cameras.
5. The camera monitoring method based on pseudo real-time asynchronous polling according to claim 3 is characterized in that: The method for determining the priority level of all the slave cameras includes: The priority level of the slave camera is determined according to the distance between the acquisition area of the slave camera and the acquisition area of the main camera; wherein, the closer the distance between the acquisition area of the slave camera and the acquisition area of the main camera is, the higher the priority level of the slave camera is.
6. The camera monitoring method using pseudo real-time asynchronous polling according to any one of claims 1 to 5, characterized in that: The step of determining the first number of workers located in the acquisition area of the main camera based on the video image acquired in real time by the main camera through the first process includes: The video image captured in real time by the main camera is input into a pre-built staff type differentiation model through the first process, and the first number of staff members corresponding to the target staff type in the capture area of the main camera is obtained through the staff type differentiation model.
7. The camera monitoring method using pseudo real-time asynchronous polling according to any one of claims 1 to 5, characterized in that: The step of determining the i-th numerical value of the staff member located in the acquisition area of the slave camera based on the video image acquired in real time by the slave camera through the second process comprises: The video image collected in real time from the camera is input into a pre-built staff type differentiation model through the second process, and the i-th value of the staff member corresponding to the target staff type in the collection area of the slave camera is obtained through the staff type differentiation model.
8. A pseudo real-time asynchronous polling camera monitoring device, characterized in that: One or more master cameras and one or more slave cameras are deployed in the place to be monitored; The camera monitoring device activated by pseudo real-time asynchronous polling includes: A first determination module is used to determine, for each of the main cameras, a first number of staff members located in a collection area of the main camera based on a video image collected in real time by the main camera through a first process, so as to obtain the first number corresponding to the main camera; and store the first number in a shared memory; different main cameras correspond to different first processes; A first acquisition module, used for controlling the second process to acquire a first value through the shared memory, where the first value is the sum of the first numbers corresponding to all the main cameras, and if the first value is greater than or equal to a preset compliance number, it is determined to be in compliance with the specification; A second determination module is configured to determine, if the first value is less than the preset compliance number, a slave camera from the slave cameras that have not been polled, and determine, through the second process, an i-th value of a staff member located in a collection area of the slave camera based on a video image collected in real time by the slave camera, where an initial value of i is 2 and i is a positive integer; A third determination module, configured to obtain the sum of the first value to the i-th value through the second process; if the sum of the first value to the i-th value is greater than or equal to the preset compliance number, determine that the specification is met; a triggering module, configured to set i=i+1 if the sum of the first value to the i-th value is less than the preset compliance number, and trigger the second determining module; The fourth determination module is used to determine non-compliance with the specification through the second process if all the slave cameras are polled and the sum of the first value to the i-th value is less than the preset compliance number.
9. A computer program product, characterized in that It includes computer-readable instructions, which, when executed on an edge computing box, enable the electronic device to implement the camera monitoring method initiated by pseudo-real-time asynchronous polling as described in any one of claims 1 to 7.
10. An edge computing box, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the edge computing box can implement the camera monitoring method activated by pseudo real-time asynchronous polling as described in any one of claims 1 to 7.