Crowd counting method, device and equipment and readable storage medium
By building a MAC address database and using mapping factors, the problem of low WiFi signal population counting accuracy is solved, and accurate population counting is achieved based on wireless communication equipment, reducing hardware requirements and costs.
Patent Information
- Application Number
- CN202311759424.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2025-07-22
AI Technical Summary
In the prior art, when counting people based on WiFi signals, there is a problem of low counting accuracy, which is mainly due to the randomization of MAC address and the reception of the same mobile device signal by multiple AP devices.
By constructing a MAC address database, the number of MAC addresses in the preset area and the target area is obtained, and the mapping factor is used to reflect the relationship between the number of MAC addresses and the number of people, and the number of people in the target area is determined.
Based on the existing wireless communication equipment, the number of people in the target area is accurately obtained, the hardware demand and statistical cost are reduced, and the accuracy of crowd counting is improved.
Smart Images

Figure CN120358533A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of data processing, and particularly relates to a method, device, equipment and readable storage medium for crowd counting. Background Art
[0002] In response to the demand for the distribution of people in physical space during the process of urbanization construction, regional crowd counting technology has emerged and is widely applied to fields such as security monitoring and traffic management. In the prior art, crowd counting is achieved by adopting a method of obtaining the number of people in a region based on wireless signals, mainly by counting the Wireless Fidelity (WiFi) signals in the region to estimate the number of people in the region. The method of using WiFi signals for crowd counting counts the crowd by counting the number of Media Access Control (Mac) addresses received in the region. However, due to the influence of MAC randomization, the received MAC addresses and users do not have a one-to-one correspondence. At the same time, multiple Wireless Access Point (AP) devices in the region may receive signals sent by the same mobile device, resulting in the problem of duplicate counting.
[0003] It can be seen that the method of realizing crowd technology based on WiFi signals in the prior art has the problem of low counting accuracy. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide a method, device, equipment and readable storage medium for crowd counting, which can solve the problem of low counting accuracy in the method of realizing crowd technology based on WiFi signals in the prior art.
[0005] In a first aspect, the embodiments of this application provide a method for crowd counting, and the method includes:
[0006] Based on the Media Access Control (MAC) addresses corresponding to each terminal device received by N wireless access point (AP) devices, a MAC address database is constructed, where the N AP devices are set in a preset region, and N is an integer greater than 1;
[0007] Obtain the first address quantity of the first MAC address in the MAC address database, and the second address quantity of the second MAC address in the MAC address database, where the first MAC address is the MAC address received by the AP device in the preset region, the second MAC address is the MAC address received by the AP device in the target region, and the preset region includes the target region;
[0008] Determine a mapping factor based on the pre-acquired first number of people and the first number of addresses within the preset area, where the mapping factor is used to reflect the mapping relationship between the number of MAC addresses and the number of people within the preset area;
[0009] Based on the mapping factor and the second number of addresses, determine the second number of people within the target area.
[0010] Optionally, constructing a MAC address database based on the MAC addresses corresponding to each terminal device received by N AP devices includes:
[0011] Collect M frame data sent by the N AP devices, where the frame data includes the MAC address corresponding to the terminal device, where M is an integer greater than 1, and N is less than M;
[0012] Preprocess the M frame data to obtain target data corresponding to the target device, where the target device is a terminal device that sends a probe frame to at least one target AP device, the target AP device is set within the preset area, and the target data includes the MAC address corresponding to the target device and the received signal strength indication RSSI corresponding to the target device relative to multiple AP devices respectively, and M is an integer greater than 1;
[0013] Based on the RSSI corresponding to the target device relative to multiple AP devices respectively, determine the target floor where the target device is located within the preset area, where the target floor is any one of K floors, the K floors are set within the preset area, and K is an integer greater than or equal to 1;
[0014] Determine whether the target device is located within the preset range corresponding to the target floor;
[0015] When the target device is located within the preset range, construct the MAC address database based on the target data corresponding to the target device.
[0016] Optionally, the frame data is carried in the probe frames collected by the N AP devices, and the probe frames are sent by each terminal device to the AP device.
[0017] Optionally, before preprocessing the M frame data, it further includes:
[0018] Eliminate the frame data with RSSI lower than the preset value in the M frame data, where each frame data carries the RSSI.
[0019] Optionally, preprocessing the M frame data to obtain target data corresponding to the target device includes:
[0020] Decode the M frame data to obtain M first data, where the first data includes the MAC address corresponding to the terminal device;
[0021] Eliminate the first data carrying a fixed MAC address from the M first data to obtain L pieces of the target data, where L is an integer greater than 1 and L is less than or equal to M.
[0022] Optionally, the target data includes the location information of the target AP device that receives the MAC address sent by the target device. The determining of the target floor where the target device is located in the preset area based on the RSSI corresponding to the target device relative to multiple AP devices respectively includes:
[0023] Determine the floors corresponding to the multiple AP devices corresponding to the target device in the preset area based on the location information, where the multiple AP devices corresponding to the target device are distributed on P floors, and P is less than or equal to K;
[0024] Determine the first RSSI of the target device on each floor, and determine the second RSSI based on the first RSSI corresponding to the P floors respectively, where the first RSSI is the maximum RSSI among the target RSSIs corresponding to all the target AP devices on the same floor, and the second RSSI is the maximum RSSI among the first RSSIs corresponding to the P floors;
[0025] Determine the target floor where the target device is located based on the first RSSI and the second RSSI.
[0026] Optionally, the determining of the target floor where the target device is located based on the first RSSI and the second RSSI includes:
[0027] In the case where the difference between the first RSSI and the second RSSI is greater than a preset value, determine that the target floor where the target device is located is the same as the floor corresponding to the second RSSI;
[0028] In the case where there is no first RSSI greater than the second RSSI, determine that the target floor where the target device is located is the floor corresponding to the current first RSSI.
[0029] Optionally, the target data corresponding to the target device includes the location information and the RSSI of all the AP devices corresponding to the terminal device on the same floor. The determining of whether the target device is located within the preset range corresponding to the target floor includes:
[0030] When the target floor where the target device is located is determined, based on the location information of all AP devices corresponding to the target device on the same floor and the RSSI, determine the location coordinates of the target device on the target floor;
[0031] Based on the location coordinates, determine whether the target device is located within the preset range.
[0032] Optionally, the first number of people is obtained based on the following method:
[0033] Receive the first number of people reported by a base station set in the preset area, where the first number of people is determined by the base station based on the number of mobile terminals belonging to the preset area.
[0034] In a second aspect, an embodiment of the present application provides a crowd counting device, including:
[0035] A database construction module, configured to construct a MAC address database based on the media access control MAC addresses corresponding to each terminal device received by N wireless access point AP devices, where the N AP devices are set in a preset area, and N is an integer greater than 1;
[0036] A quantity acquisition module, configured to acquire a first address quantity of a first MAC address in the MAC address database, and a second address quantity of a second MAC address in the MAC address database, where the first MAC address is the MAC address received by the AP device in the preset area, the second MAC address is the MAC address received by the AP device in the target area, and the preset area includes the target area;
[0037] A first determination module, configured to determine a mapping factor based on the first number of people in the preset area and the first address quantity obtained in advance, where the mapping factor is used to reflect the mapping relationship between the MAC address quantity and the number of people in the preset area;
[0038] A second determination module, configured to determine the second number of people in the target area based on the mapping factor and the second address quantity.
[0039] In a third aspect, an embodiment of the present application provides a crowd counting device, which includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the crowd counting method described in the first aspect are implemented.
[0040] Fourthly, an embodiment of the present application provides a readable storage medium, on which a program or instructions are stored, and when the program or instructions are executed by a processor, the steps of the population counting method described in the first aspect are implemented.
[0041] In the embodiment of the present application, by collecting the MAC addresses corresponding to each terminal device received by N AP devices in a preset area, a MAC address database is constructed, so that the first address quantity of the MAC addresses in the preset area and the second address quantity of the MAC addresses in the target area can be determined from the address database. Then, a mapping factor is obtained through the first address quantity and the previously obtained first number of people in the preset area, and the mapping factor can reflect the mapping relationship between the quantity of MAC addresses and the quantity of people in the preset area. In this way, based on the known second address quantity, the second number of people in the target area can be obtained through the mapping factor. It can be seen that the embodiment of the present application can utilize the existing AP devices in the preset area to obtain the quantity of MAC addresses, without relying on visual perception of the quantity of people, reducing the application cost. At the same time, it can accurately obtain the number of people in the target area and achieve the purpose of regional population counting. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments of the present application. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0043] Figure 1 is a flowchart of a population counting method provided by an embodiment of the present application;
[0044] Figure 2 is Figure 1 a flowchart of constructing a MAC address database in
[0045] Figure 3 is a flowchart of determining the target floor where the target device is located in the preset area in an embodiment of the present application;
[0046] Figure 4 is a structural schematic diagram of a population counting device provided by an embodiment of the present application;
[0047] Figure 5 is a structural schematic diagram of a population counting device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0048] The technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application belong to the scope of protection of the present application.
[0049] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally indicates an "or" relationship between the associated objects before and after.
[0050] To make the embodiments of the present application clearer, the following is an introduction to the relevant technical knowledge involved in the embodiments of the present application:
[0051] Regarding the problem of counting the number of people or users in a region, wireless communication network operators can count the number of people or users in their affiliated regions through 5G base stations. However, since the area counted by the base station does not match the actual required physical area, and the area counted by the base station is usually relatively large, it is difficult to achieve the counting of the number of people or users in a smaller area. Therefore, in the prior art, WiFi signals are used to count the number of mobile devices. It mainly uses the probe (Probe Request) frame signals sent by mobile devices, and estimates the number of people or users in the statistical area by counting the number of media access control (MAC) addresses received by the access point (AP) wireless access point device.
[0052] In addition, for the protection of the privacy of mobile devices, the MAC address of a mobile device is randomly changed when it sends a probe frame currently (i.e., MAC randomization). That is, multiple MAC addresses received by an AP device may come from the same mobile device, resulting in a large error in counting the number of people based on the number of MAC addresses of mobile devices received by the AP. Therefore, a method that can map the number of MAC addresses to the number of people is needed, which can more accurately reflect the relationship between the number of MAC addresses and the number of people in a region. In addition to the MAC randomization problem, for counting the number of people in a region, since AP devices in different regions can receive signals sent by the same mobile device, the existing method cannot accurately count the mobile device into the correct region, resulting in mis-statistics, and further affecting the accuracy of counting the number of people.
[0053] The following will combine the accompanying drawings and, through specific embodiments and their application scenarios, elaborate in detail on the crowd counting method, device, and related equipment provided by the embodiments of the present application.
[0054] Please refer to Figure 1 , Figure 1 which is a flowchart of a crowd counting method provided by an embodiment of the present application. As Figure 1 shown, the crowd counting method includes the following steps:
[0055] Step 101: Based on the media access control (MAC) addresses of each terminal device received by N wireless access point (AP) devices, construct a MAC address database, where the N AP devices are set in a preset area, and N is an integer greater than 1.
[0056] In an embodiment of the present application, constructing a MAC address database requires storing data information corresponding to terminal devices, including the MAC address of the terminal device, the RSSI sent by the terminal device to the AP device, the location information of each AP device, the MAC address, etc. Among them, the information related to the terminal device stored in the MAC address database requires that the terminal device is within the preset range, and terminal devices outside the preset range need to be excluded to avoid interfering with the counting of MAC addresses within the preset range and reducing the impact on the accuracy of crowd counting. Specifically, the MAC address database can be constructed by collecting the media access control MAC addresses and their related data of each terminal device in the preset area. Specifically, the MAC addresses and their related data corresponding to each terminal device can be received by N AP devices and reported by the AP devices. In this way, by applying existing wireless communication devices, the counting of the number of people in a region can be realized at a low cost.
[0057] It should be noted that the data stored in the MAC address database can be stored according to the data corresponding to different terminal devices. For example, it includes the RSSI of multiple AP devices corresponding to one terminal device, the location information of each AP device, and multiple MAC addresses sent to multiple AP devices. It can also be stored according to the AP devices set in different regions. For example, it includes multiple MAC addresses, RSSI sent by multiple terminal devices corresponding to one AP device, and the location information of the AP device itself.
[0058] Step 102: Obtain the first address quantity of the first MAC address in the MAC address database and the second address quantity of the second MAC address in the MAC address database, where the first MAC address is the MAC address received by the AP device in the preset area, the second MAC address is the MAC address received by the AP device in the target area, and the preset area includes the target area.
[0059] It can be understood that since the MAC address database pre-stores the MAC addresses corresponding to all terminal devices at a certain set time and within a set range (such as in the preset area), the first address quantity in the preset area can be directly obtained from the MAC address database, and the second address quantity in the target area can also be obtained.
[0060] Step 103: Determine a mapping factor based on the previously obtained first number of people in the preset area and the first address quantity. The mapping factor is used to reflect the mapping relationship between the MAC address quantity and the number of people in the preset area.
[0061] In a specific embodiment of the present application, the mapping factor can be determined by the first number of people and the first address quantity in the preset area, and can be determined by the following formula:
[0062]
[0063] Among them, factor represents the mapping factor, a represents the first number of people in the preset area, and b represents the first address quantity;
[0064] The mapping factor determined above can more accurately reflect the mapping relationship between the MAC address quantity and the number of people in the preset area. When only the MAC address quantity of a certain area is available, the number of people in the area can be obtained by combining the mapping factor. In addition, the above first number of people can be the first number of people in the preset area within a set time, and the first address quantity can also be the quantity corresponding to the MAC addresses in the preset area within the same set time as the first number of people, so that the mapping factor can more accurately reflect the mapping relationship between the number of people and the MAC addresses in any target area in the preset area, and realize the function of accurately counting the number of people in the area.
[0065] Step 104: Determine the second number of people in the target area based on the mapping factor and the second number of addresses.
[0066] In a specific embodiment of the present application, by combining the mapping factor with the second number of addresses corresponding to the target area obtained from the MAC address database, the number of people in the target area, that is, the second number of people, can be accurately obtained. The above process only uses existing wireless communication devices without visual recognition, greatly reducing the demand for hardware devices, reducing the crowd statistics cost, and at the same time being able to accurately obtain the number of people in the target area, with a wide coverage range, covering any target area within the preset area, and being able to accurately count the number of people in a small area according to the crowd statistics requirements.
[0067] Please refer to Figure 2 , Figure 2 Yes Figure 1 is the schematic flowchart of building the MAC address database in
[0068] Step 201: Collect M frame data sent by the N AP devices, where the frame data includes the MAC address corresponding to the terminal device, M is an integer greater than 1, and N is less than M;
[0069] Step 202: Preprocess the M frame data to obtain target data corresponding to the target device, where the target device is a terminal device that sends a probe frame to at least one target AP device, the target AP device is set in the preset area, and the target data includes the MAC address corresponding to the target device and the received signal strength indication (RSSI) corresponding to the target device relative to multiple AP devices respectively, and M is an integer greater than 1;
[0070] Step 203: Determine the target floor where the target device is located in the preset area based on the RSSI corresponding to the target device relative to multiple AP devices respectively, where the target floor is any one of the K floors, and the K floors are set in the preset area, and K is an integer greater than or equal to 1;
[0071] Step 204: Determine whether the target device is located within the preset range corresponding to the target floor;
[0072] Step 205: When the target device is located within the preset range, build the MAC address database based on the target data corresponding to the target device.
[0073] In a specific embodiment of the present application, constructing a MAC address database may involve steps such as data collection, data preprocessing, floor positioning, and location determination. Finally, the MAC addresses of terminal devices within a preset area and their related data are stored in the MAC address database to complete the construction.
[0074] Among them, data collection can correspond to step 201 above, and the frame data sent by the terminal device is reported through the AP device. Data preprocessing can be the preprocessing of the collected frame data (corresponding to step 202), which can specifically include data decoding, data filtering, data verification, etc. Decode the frame data to obtain the MAC address corresponding to the terminal device, as well as the RSSI of the terminal device to the AP device, etc. Data filtering can be to filter out frame data including fixed MAC addresses to avoid interference from fixed devices within the preset area. Data verification is to verify whether the data is sent by the terminal device. If there are other interfering devices, they can be excluded through this step to reduce interfering data.
[0075] Furthermore, floor positioning needs to determine the floor where the terminal device is located within the preset area, and judge the target floor where the terminal device is located in the physical space, so as to avoid being interfered by the B floor when counting the number of people in the target area on the A floor of the same floor. Distinguish the target floor corresponding to the target device, reduce interference from terminal devices on other floors, and improve the accuracy of population counting.
[0076] In addition, after determining the target floor, it is also possible to determine whether the target device is within the preset range of the target floor (i.e., the target area corresponding to the target floor), and count the population data of a certain floor located in the target area to achieve accurate counting of a small area.
[0077] Optionally, the frame data is carried in the probe frames collected by the N AP devices, and the probe frames are sent by each of the terminal devices to the AP devices.
[0078] It should be noted that after the mobile device turns on the WiFi switch, it will periodically send probe frames to the AP devices that are close enough to receive the WiFi signal. After receiving the WiFi signal, the AP device will collect the probe frames according to the pre-configured Arescout interface and report them to the server for processing.
[0079] Optionally, before preprocessing the M frame data, it further includes:
[0080] Eliminate the frame data in the M frame data that contains an RSSI lower than a preset value, where each frame data carries the RSSI.
[0081] In a specific embodiment of the present application, before preprocessing the M frame data, frame data with RSSI lower than a preset value in the M frame data can be excluded. Specifically, an RSSI lower than a certain threshold can be set as an outlier. For example, an RSSI lower than -100 dBm is set as an outlier. An RSSI less than the threshold indicates that the terminal device corresponding to the RSSI is not within the preset range, and the data needs to be excluded to prevent interference with the statistics of the MAC address quantity, reduce data with large errors, and reduce the error impact.
[0082] Optionally, preprocessing the M frame data to obtain target data corresponding to the target device includes:
[0083] Decoding the M frame data to obtain M first data, where the first data includes the MAC address corresponding to the terminal device;
[0084] Excluding the first data carrying a fixed MAC address in the M first data to obtain L pieces of the target data, where L is an integer greater than 1 and less than or equal to M.
[0085] In another embodiment of the present application, when preprocessing the M frame data, data carrying a fixed MAC address in the M frame data can be excluded. Since the MAC address corresponding to a fixed terminal is usually a fixed address, and the second digit is usually one of 2, 6, a, e, and the MAC address corresponding to a mobile terminal is usually a non-fixed address, the MAC address whose second digit does not carry the aforementioned numbers and its corresponding frame data can be directly excluded to complete the preprocessing process of the M frame data and exclude the interference of fixed terminals in the MAC address data.
[0086] Optionally, the target data includes the location information of the target AP device that receives the MAC address sent by the target device. Determining the target floor where the target device is located in the preset area based on the RSSI corresponding to the target device relative to multiple AP devices respectively includes:
[0087] Determining the floors corresponding to the multiple AP devices corresponding to the target device in the preset area, where the multiple AP devices corresponding to the target device are distributed on P floors, and P is less than or equal to K;
[0088] Determining the first RSSI of the target device on each floor, and determining the second RSSI based on the first RSSI corresponding to the P floors respectively, where the first RSSI is the maximum RSSI among the target RSSIs corresponding to all the target AP devices on the same floor, and the second RSSI is the maximum RSSI among the first RSSIs corresponding to the P floors;
[0089] Based on the first RSSI and the second RSSI, determine the target floor where the target device is located.
[0090] In another embodiment of the present application, since a terminal device sends probe frames to multiple AP devices, multiple AP devices can receive the RSSIs of the same terminal device corresponding to different AP devices respectively. Determine the RSSIs of the same terminal device corresponding to multiple AP devices. The signal strengths of a terminal device for different AP devices can reflect the signal strengths of the terminal device for AP devices in different floors, thereby determining the floor where the terminal device is located.
[0091] It can be understood that first, it is necessary to classify the multiple AP devices corresponding to a terminal device (which can be the target device). Classify them according to the floors where the AP devices are located respectively. Classify the AP devices on the same floor into one category. Thus, it can be determined that the multiple AP devices corresponding to the target device are distributed on P floors and are divided into P categories. Subsequently, determine the maximum RSSI (i.e., the first RSSI) received by the AP devices on each of the P floors. Thus, each floor has a first RSSI, and there are P first RSSIs for P floors. Among the first RSSIs of each determined floor, compare all the first RSSIs to determine the maximum RSSI among all the first RSSIs as the second RSSI. The above determination of the target floor where the target device is located based on the first RSSI and the second RSSI can be achieved by comparing the second RSSI with the first RSSI of each floor.
[0092] Specifically, since the second RSSI is the maximum RSSI, the target device is more likely to be on the floor corresponding to the second RSSI. When there is no small difference between other first RSSIs and the second RSSI, it indicates that the target device is located on the floor corresponding to the second RSSI. And when there is a small difference between other first RSSIs and the second RSSI, it is difficult to determine the floor where the target device is located. The target device can be regarded as being located on the floor corresponding to the first RSSI with a small difference from the second RSSI. In this way, the floor where the target device is located can be determined more accurately, preventing the influence of terminal devices distributed on multiple floors on the number statistics in the target area on a certain floor.
[0093] Optionally, the determining the target floor where the target device is located based on the first RSSI and the second RSSI includes:
[0094] In the case where the difference between the first RSSI and the second RSSI is greater than a preset value, determine that the target floor where the target device is located is the same as the floor corresponding to the second RSSI;
[0095] When there is at least one difference between the first RSSI and the second RSSI that is less than or equal to the preset value, determine that the target floor where the target device is located is the floor corresponding to the current first RSSI.
[0096] Please refer specifically to Figure 3 , Figure 3 is a schematic flowchart of the process for determining the target floor where the target device is located within the preset area in an embodiment of the present application, specifically including the following steps:
[0097] Step 301: Based on the location information, determine the floors corresponding to the respective multiple AP devices corresponding to the target device within the preset area;
[0098] Step 302: Determine the first RSSI of the target device on each floor, and determine the second RSSI based on the first RSSI corresponding to each of the P floors;
[0099] Step 303: Whether there is a difference between one first RSSI and the second RSSI that is greater than the preset value;
[0100] Step 304: When there is a difference between one first RSSI and the second RSSI that is greater than the preset value, determine that the target floor where the target device is located is the same as the floor corresponding to the second RSSI;
[0101] Step 305: When there is no difference between one first RSSI and the second RSSI that is greater than the preset value, determine that the target floor where the target device is located is the floor corresponding to the current first RSSI.
[0102] It can be understood that determining the specific floor where the target device is located can be achieved by comparing the first RSSI and the second RSSI. Specifically, a threshold (for example, -10 dBM) can be set. When the difference between the first RSSI and the second RSSI is greater than the threshold, it indicates that the signal of the target device on the floor corresponding to the second RSSI is the best and the possibility of being on the floor corresponding to the second RSSI is the greatest, and it can be determined that the target device is located on the floor corresponding to the second RSSI. When there is no difference between one first RSSI and the second RSSI that is greater than the threshold, it means that it is difficult to determine the floor where the target device is located. It may be that the target device is set on the floor corresponding to the maximum first RSSI other than the second RSSI. Since it is close to the floor corresponding to the second RSSI, the target device has a relatively large RSSI for the floor corresponding to the second RSSI. At this time, it can be considered that the target device is on the floor corresponding to the maximum first RSSI other than the second RSSI, or the data corresponding to this target device may not be used and it may not be included in the MAC address database to reduce errors.
[0103] Optionally, the target data corresponding to the target device includes the location information and RSSI of each AP device corresponding to the terminal device on the same floor. Determining whether the target device is located within the preset range corresponding to the target floor includes:
[0104] When determining the target floor where the target device is located, based on the location information and RSSI of all AP devices corresponding to the target device on the same floor, determine the location coordinates of the target device on the target floor;
[0105] Based on the location coordinates, determine whether the target device is located within the preset range.
[0106] It can be understood that during the use of a mobile device, since the location of the mobile device is usually not perceivable, and a mobile device located outside the target area can also send a probe frame to an AP device set within the target area, resulting in the AP device within the target area receiving a probe frame sent by a mobile terminal outside the target area, increasing the number of MAC addresses received by the AP device within the target area. This easily causes an error in determining the number of MAC addresses corresponding to the terminal devices within the target area, affecting the accuracy of the population count. Therefore, it is necessary to distinguish the location of the mobile terminal to prevent including mobile terminals outside the target area in the statistics.
[0107] In an embodiment of the present application, a mobile device for which the target floor has been determined can be located to determine whether its location coordinates, etc. are within the preset range corresponding to the target floor. If it is within the preset range, it indicates that the mobile terminal is set within the target area. If it is outside the preset range, it indicates that the mobile device is set outside the target area, and this mobile device needs to be excluded to prevent this mobile device and its related MAC addresses from being included in the MAC address database, reducing the error in determining the number of MAC addresses within the target area subsequently, so as to improve the accuracy of the population count.
[0108] It should be noted that the above preset range can correspond to a preset area or a target area. Obtaining the population count in the preset area or target area can be obtaining the population count within the plane range of the preset area or target area on the target floor, or the population count within the same plane range corresponding to multiple target floors. The present application does not limit this here.
[0109] Specifically, the location coordinates of the terminal device on the target floor can be calculated through the following formula:
[0110]
[0111]
[0112]
[0113] Among them, K represents the total number of AP devices that can receive probe frames sent by the same terminal device (since the terminal device can send probe frames to multiple AP devices, resulting in a relatively large number of AP devices, K AP devices with the strongest RSSI among multiple AP devices can be selected, and K can be set to be less than or equal to 4).
[0114] w i represents the weight of the i-th AP device among the K AP devices;
[0115] RSSI i represents the signal strength received by the i-th AP device;
[0116] x i and y i respectively represent the abscissa and ordinate of the i-th AP device (the coordinates corresponding to each AP device can be measured in advance).
[0117] In this way, after obtaining the position coordinates of a terminal device through the above formula, it can be determined whether the position coordinates are within a preset range, and the MAC addresses corresponding to the terminal devices whose position coordinates are included within the preset range are stored in the MAC address database, facilitating obtaining the number of MAC addresses received by AP devices within a preset area or a target area through the MAC address database, and improving the accuracy of crowd number statistics.
[0118] It is also worth mentioning that in this application, when determining the position coordinates of a terminal device, it can only be determined that there is one terminal device within the preset range or not within the preset range, and it cannot correspond to a specific terminal device, let alone a specific terminal device user. Therefore, there is no problem of infringing on the privacy of the terminal device.
[0119] Optionally, the first number of people is obtained based on the following method:
[0120] Receiving the first number of people reported by a base station set in the preset area, where the first number of people is determined by the base station based on the number of mobile terminals belonging to the preset area.
[0121] It can be understood that the above first number of people can be obtained by reporting from a base station set in a preset area. Among them, the range of the preset area can be the same as the range under the jurisdiction of the base station. By collecting the number of mobile terminals in the preset area through the base station, the number of people or the number of users in the preset area can be reflected by the number of mobile terminals, so as to determine the mapping factor and reflect the relationship between the number of people in the area and the number of MAC addresses.
[0122] Please refer to Figure 4 , Figure 4 FIG. is a schematic structural diagram of a population counting device provided by an embodiment of the present application. The population counting device 400 specifically includes:
[0123] A database construction module 401, configured to construct a MAC address database based on the media access control MAC addresses corresponding to each terminal device received by N wireless access point AP devices, where the N AP devices are set in a preset area, and N is an integer greater than 1;
[0124] A quantity acquisition module 402, configured to acquire a first address quantity of a first MAC address in the MAC address database, and a second address quantity of a second MAC address in the MAC address database, where the first MAC address is the MAC address received by the AP device in the preset area, the second MAC address is the MAC address received by the AP device in the target area, and the preset area includes the target area;
[0125] A first determination module 403, configured to determine a mapping factor based on the first number of people in the preset area and the first address quantity obtained in advance, where the mapping factor is used to reflect the mapping relationship between the number of MAC addresses and the number of people in the preset area;
[0126] A second determination module 404, configured to determine a second number of people in the target area based on the mapping factor and the second address quantity.
[0127] Optionally, the database construction module 401 includes:
[0128] A first collection sub-module, configured to collect M frame data sent by the N AP devices, where the frame data includes the MAC address corresponding to the terminal device, where M is an integer greater than 1, and N is less than M;
[0129] A first acquisition sub-module, configured to preprocess the M frame data to obtain target data corresponding to a target device, where the target device is a terminal device that sends probe frames to at least one target AP device, the target AP devices are arranged in the preset area, and the target data includes the MAC address corresponding to the target device and the received signal strength indication (RSSI) corresponding to the target device relative to multiple AP devices respectively, and M is an integer greater than 1;
[0130] A first determination sub-module, configured to determine, based on the RSSI corresponding to the target device relative to multiple AP devices respectively, the target floor where the target device is located in the preset area, where the target floor is any one of K floors, the K floors are arranged in the preset area, and K is an integer greater than or equal to 1;
[0131] A second determination sub-module, configured to determine whether the target device is located within a preset range corresponding to the target floor;
[0132] A construction sub-module, configured to, when the target device is located within the preset range, construct the MAC address database based on the target data corresponding to the target device.
[0133] Optionally, the frame data is carried in the probe frames collected by the N AP devices, and the probe frames are sent by each of the terminal devices to the AP devices.
[0134] Optionally, the first acquisition sub-module further includes:
[0135] A first rejection unit, configured to reject the frame data with an RSSI lower than a preset value in the M frame data, where each frame data carries the RSSI.
[0136] Optionally, the first acquisition sub-module includes:
[0137] A decoding unit, configured to decode the M frame data to obtain M first data, and the first data includes the MAC address corresponding to the terminal device;
[0138] A second rejection unit, configured to reject the first data with a fixed MAC address in the M first data to obtain L pieces of the target data, where L is an integer greater than 1 and less than or equal to M.
[0139] Optionally, the target data includes the location information of the target AP device that receives the MAC address sent by the target device, and the first determination sub-module includes:
[0140] A first determination unit, configured to determine the floors corresponding to multiple AP devices corresponding to the target device within the preset area based on the location information, where the multiple AP devices corresponding to the target device are distributed on P floors, and P is less than or equal to K;
[0141] A second determination unit, configured to determine the first RSSI of the target device on each floor, and determine a second RSSI based on the first RSSIs corresponding to the P floors, where the first RSSI is the maximum RSSI among the target RSSIs corresponding to all the target AP devices on the same floor, and the second RSSI is the maximum RSSI among the first RSSIs corresponding to the P floors;
[0142] A third determination unit, configured to determine the target floor where the target device is located based on the first RSSI and the second RSSI.
[0143] Optionally, the third determination unit is configured to:
[0144] In the case that the difference between the first RSSI and the second RSSI is greater than a preset value, determine that the target floor where the target device is located is the same as the floor corresponding to the second RSSI;
[0145] In the case that there is no first RSSI greater than the second RSSI, determine that the target floor where the target device is located is the floor corresponding to the current first RSSI.
[0146] Optionally, the target data corresponding to the target device includes the location information and the RSSI of all AP devices corresponding to the terminal device on the same floor, and the second determination sub-module includes:
[0147] A fourth determination unit, configured to, when determining the target floor where the target device is located, determine the location coordinates of the target device on the target floor based on the location information and the RSSI of all AP devices corresponding to the target device on the same floor;
[0148] A fifth determination unit, configured to determine whether the target device is located within the preset range based on the location coordinates.
[0149] Optionally, the first number of people is obtained in the following manner:
[0150] Receive the first number of people reported by a base station disposed within the preset area, where the first number of people is determined by the base station based on the number of mobile terminals belonging to the preset area.
[0151] The crowd counting device 400 provided by the embodiments of the present application can implement Figure 1 and Figure 2 each process implemented by the method embodiments described therein. To avoid repetition, it will not be elaborated here.
[0152] As Figure 5 shown, the embodiments of the present application further provide a crowd counting device 500, including a processor 501, a memory 502, a program or instruction stored on the memory 502 and executable on the processor 501. When the program or instruction is executed by the processor 501, it implements each process of the method embodiments shown in Figure 1 and Figure 2 and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0153] The embodiments of the present application further provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above-mentioned Figure 1 crowd counting method embodiments and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0154] Wherein, the processor is the processor in the crowd counting device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk or optical disc, etc.
[0155] It should be noted that in this article, the terms "including", "comprising" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without more limitations, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including that element. In addition, it should be pointed out that the methods and devices in the embodiments of the present application are not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0156] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal (which can be a mobile phone, computer, computing power network, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0157] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
Claims
1. A method for crowd counting, characterized in that, Including: Based on the media access control (MAC) addresses corresponding to each terminal device received by N wireless access point (AP) devices, a MAC address database is constructed, where the N AP devices are set in a preset area, and N is an integer greater than 1; Obtain the first address quantity of the first MAC address in the MAC address database and the second address quantity of the second MAC address in the MAC address database, where the first MAC address is the MAC address received by the AP devices in the preset area, the second MAC address is the MAC address received by the AP devices in the target area, and the preset area includes the target area; Based on the first number of people and the first address quantity in the preset area obtained in advance, determine a mapping factor, where the mapping factor is used to reflect the mapping relationship between the number of MAC addresses and the number of people in the preset area; Based on the mapping factor and the second address quantity, determine the second number of people in the target area.
2. The method according to claim 1, characterized in that, The constructing of the MAC address database based on the MAC addresses corresponding to each terminal device received by N AP devices includes: Collect M frame data sent by the N AP devices, where the frame data includes the MAC address corresponding to the terminal device, M is an integer greater than 1, and N is less than M; Preprocess the M frame data to obtain target data corresponding to the target device, where the target device is the terminal device that sends a probe frame to at least one target AP device, the target AP device is set in the preset area, and the target data includes the MAC address corresponding to the target device and the received signal strength indication (RSSI) corresponding to the target device relative to multiple AP devices respectively, and M is an integer greater than 1; Based on the RSSI corresponding to the target device relative to multiple AP devices respectively, determine the target floor where the target device is located in the preset area, where the target floor is any one of K floors, and the K floors are set in the preset area, and K is an integer greater than or equal to 1; Determine whether the target device is located within the preset range corresponding to the target floor; When the target device is located within the preset range, construct the MAC address database based on the target data corresponding to the target device.
3. The method according to claim 2, wherein The probe frames collected by the N AP devices carry the frame data, and the probe frames are sent by each terminal device to the AP devices.
4. The method according to claim 2, wherein Before preprocessing the M frame data, it further includes: Eliminate the frame data with RSSI lower than a preset value in the M frame data, where each frame data carries the RSSI.
5. The method according to claim 2, wherein The preprocessing of the M frame data to obtain the target data corresponding to the target device includes: Decode the M frame data to obtain M first data, where the first data includes the MAC address corresponding to the terminal device; Remove the first data carrying a fixed MAC address from the M first data to obtain L pieces of the target data, where L is an integer greater than 1 and less than or equal to M.
6. The method according to claim 2, characterized in that, The target data includes the location information of the target AP device that receives the MAC address sent by the target device. The determining of the target floor where the target device is located in the preset area based on the RSSI corresponding to the target device relative to multiple AP devices respectively includes: Determine the floors corresponding to the multiple AP devices corresponding to the target device in the preset area based on the location information, where the multiple AP devices corresponding to the target device are distributed on P floors, and P is less than or equal to K; Determine the first RSSI of the target device on each floor, and determine the second RSSI based on the first RSSI corresponding to the P floors respectively, where the first RSSI is the maximum RSSI among the target RSSIs corresponding to all the target AP devices on the same floor, and the second RSSI is the maximum RSSI among the first RSSIs corresponding to the P floors respectively; Determine the target floor where the target device is located based on the first RSSI and the second RSSI.
7. The method according to claim 6, characterized in that The determining of the target floor where the target device is located based on the first RSSI and the second RSSI includes: In the case where the difference between the first RSSI and the second RSSI is greater than a preset value, determine that the target floor where the target device is located is the same as the floor corresponding to the second RSSI; In the case where there is no first RSSI greater than the second RSSI, determine that the target floor where the target device is located is the floor corresponding to the current first RSSI.
8. The method according to claim 2, wherein The target data corresponding to the target device includes the location information and the RSSI of all AP devices corresponding to the terminal device on the same floor. The determining of whether the target device is located within the preset range corresponding to the target floor includes: In the case of determining the target floor where the target device is located, determine the position coordinates of the target device on the target floor based on the location information and the RSSI of all AP devices corresponding to the target device on the same floor; Determine whether the target device is located within the preset range based on the position coordinates.
9. The method according to claim 1, characterized in that The first number of people is obtained based on the following method: Receive the first number of people reported by the base station set in the preset area, where the first number of people is determined by the base station based on the number of mobile terminals belonging to the preset area.
10. A crowd counting device, characterized in that, Include: A database construction module, configured to construct a MAC address database based on the media access control MAC addresses corresponding to each terminal device received by N wireless access point AP devices, where the N AP devices are set in a preset area, and N is an integer greater than 1; A quantity acquisition module, configured to acquire a first address quantity of a first MAC address in the MAC address database and a second address quantity of a second MAC address in the MAC address database, where the first MAC address is a MAC address received by an AP device in the preset area, the second MAC address is a MAC address received by an AP device in the target area, and the preset area includes the target area; A first determination module, configured to determine a mapping factor based on a first number of people in the preset area and the first address quantity acquired in advance, where the mapping factor is used to reflect the mapping relationship between the MAC address quantity and the number of people in the preset area; A second determination module, configured to determine a second number of people in the target area based on the mapping factor and the second address quantity.
11. A crowd counting device, characterized in that, Comprising a processor and a memory, where the memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the crowd counting method according to any one of claims 1-9 are implemented.
12. A computer-readable storage medium, characterized in that, A program or instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the steps of the crowd counting method according to any one of claims 1-9 are implemented.