Positioning scanning method and device
By collecting and filtering various types of wireless data packets in the terminal device, parsing the frame fields and combining them with CRC checksums, the MAC address and RSSI of the access device are determined, which solves the problem of low scanning success rate caused by wireless data packet collisions and improves the success rate and accuracy of positioning scanning.
Patent Information
- Application Number
- CN202310815206.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2025-01-07
AI Technical Summary
In environments with many connected devices, wireless data packet conflicts can prevent terminal devices from effectively receiving wireless data packets, resulting in a low scanning success rate and affecting the accuracy of positioning and geofencing calculations.
The terminal device collects all wireless data packets in the environment, filters out target data packets for access devices by parsing frame fields, including management frames, control frames, and data frames, improves the reliability of data packets by combining CRC check, and determines MAC address and RSSI for location calculation.
It improves the success rate and accuracy of positioning scanning, alleviates the problem of insufficient scanning caused by wireless data packet collisions, and enhances the accuracy of positioning calculation.
Smart Images

Figure CN119277509A_ABST
Abstract
Description
[Technical field]
[0001] The present application relates to the field of terminal equipment, and in particular to a positioning scanning method and device. [Background technology]
[0002] When terminal devices perform technologies such as indoor positioning and geo-fencing, they need to rely on scanning access devices. When terminal devices scan access devices, they need to receive wireless data packets sent by access devices, namely beacon packets or probe response packets. However, in an environment with many access devices, since wireless data packets sent by different access devices will conflict during the propagation process, the terminal device cannot receive the complete wireless data packet, resulting in a low scanning success rate for the terminal device, which in turn affects other subsequent calculations and processing. [Summary of the invention]
[0003] In view of the problem in the prior art that wireless data packets may collide during transmission, resulting in the terminal device being unable to effectively receive the wireless data packets and a low scanning success rate, the present application provides a positioning scanning method and device. The present application also provides a computer-readable storage medium.
[0004] In a first aspect, the present application provides a positioning scanning method, the method comprising:
[0005] Collect wireless data packets that can be received in the environment where the terminal device is located;
[0006] Filtering target data packets from access devices from collected wireless data packets;
[0007] Determine the MAC address and received signal strength RSSI of each access device according to the target data packet;
[0008] Among them, the MAC address and RSSI of each access device are used for positioning calculation of the terminal device.
[0009] According to the positioning scanning method provided by the present application, when the terminal device collects all wireless data packets in the environment to perform positioning scanning, it is no longer limited to scanning the beacon packets and probe response packets of the access device, thereby improving the success rate of positioning scanning and improving the problem of insufficient positioning scanning success rate caused by the inability to receive wireless data packets due to wireless data packet conflicts.
[0010] Furthermore, in order to improve the accuracy of the positioning scan, the target data packets from the access device are screened from the collected wireless data packets, including:
[0011] Parsing each frame field of the collected wireless data packets, each frame field including: a field for indicating a data sender;
[0012] According to the field used to indicate the data sender, the target data packet from the access device is filtered from the collected wireless data packets.
[0013] Further, in order to determine that the sending end is an access device, according to the field used to indicate the data sender, the target data packet from the access device is filtered from the collected wireless data packets, including:
[0014] The fields used to indicate the sender of data include: a frame type field;
[0015] Filter the wireless data packets whose frame types are specified from the collected wireless data packets.
[0016] Further, in order to determine that the transmitting end is an access device, the frame type is a specified type, including: the frame type is a management frame type, a control frame type, or a data frame type.
[0017] Further, in order to determine that the sending end is an access device, according to the field used to indicate the data sender, the target data packet from the access device is filtered from the collected wireless data packets, including:
[0018] The fields used to indicate the sender of data include: a frame subtype field;
[0019] Filtering wireless data packets whose frame subtypes are preset subtypes from the collected wireless data packets;
[0020] Among them, the preset subtypes include: a beacon frame type, an association response frame type, an authentication response frame type or a detection response frame type.
[0021] Further, in order to determine that the sending end is an access device, according to the field used to indicate the data sender, the target data packet from the access device is filtered from the collected wireless data packets, including:
[0022] The field used to indicate the data sender includes: a control bit field used to indicate whether the wireless data packet comes from the access device;
[0023] The wireless data packets whose control bit field has a first value are filtered out from the collected wireless data packets, where the first value indicates that the wireless data packet comes from an access device.
[0024] Further, in order to determine that the sending end is an access device, according to the field used to indicate the data sender, the target data packet from the access device is filtered from the collected wireless data packets, including:
[0025] The fields used to indicate the data sender include: a data source address TA field and a basic service set identifier SSID field;
[0026] Filter the wireless data packets whose TA fields and SSID fields are consistent from the collected wireless data packets.
[0027] Further, in order to determine that the sending end is an access device, according to the field used to indicate the data sender, the target data packet from the access device is filtered from the collected wireless data packets, including:
[0028] The fields used to indicate the data sender include: a data source address TA field;
[0029] Filter the wireless data packets whose TA fields are consistent with the addresses in the address fingerprint library from the collected wireless data packets.
[0030] Furthermore, in order to improve the accuracy of the positioning calculation, after collecting the wireless data packets that can be received in the environment where the terminal device is located, the method also includes:
[0031] Performing cyclic redundancy check (CRC) on the collected wireless data packets;
[0032] If the CRC check fails, determine whether the TA field of the wireless data packet is valid;
[0033] If the TA field of the wireless data packet is valid, it is further determined whether the wireless data packet comes from the access device.
[0034] In a second aspect, the present application provides a positioning scanning chip, the chip comprising:
[0035] A receiving module collects wireless data packets that can be received in the environment where the terminal device is located;
[0036] A screening module, screening target data packets from access devices from the collected wireless data packets;
[0037] A determination module determines the MAC address and received signal strength RSSI of each access device according to the target data packet;
[0038] Positioning module: The MAC address and RSSI of each access device are used for positioning calculation of the terminal device.
[0039] In a third aspect, the present application provides an electronic device, comprising a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute any method step as in the first aspect.
[0040] In a fourth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer-readable storage medium is run on a computer, the computer executes any method in the first aspect.
Brief Description of the Drawings
[0041] Figure 1 Shown is a schematic diagram of an access device scanning method in the related art;
[0042] Figure 2 Shown is a schematic diagram of another access device scanning method in the related art;
[0043] Figure 3 Shown is a schematic diagram of another access device scanning method in the related art;
[0044] Figure 4 The figure is a schematic diagram of the structure of a terminal device positioning and scanning system provided according to an embodiment of the present application;
[0045] Figure 5 Shown is a flow chart of a positioning scanning method provided according to an embodiment of the present application;
[0046] Figure 6 FIG. 1 is a schematic diagram of a positioning scanning method provided according to an embodiment of the present application;
[0047] Figure 7 The figure is a schematic diagram of the structure of a wireless data packet provided according to an embodiment of the present application;
[0048] Figure 8 The figure is a simplified structural diagram of a positioning scanning chip provided according to an embodiment of the present application;
[0049] Fig. 9 Shown is a schematic diagram of the hardware structure of an electronic device provided according to an embodiment of the present application. [Specific implementation method]
[0050] Before describing the embodiments of the present application, the related technologies and technical problems are first described.
[0051] In related technologies, the scanning success rate of a terminal device when scanning an access device is very important. The terminal device can perform positioning, geo-fencing or other technologies through the scanned access device. Taking Wi-Fi positioning technology as an example, the terminal device scans the existing wireless network and then combines the corresponding positioning algorithm to determine the specific location of the terminal device.
[0052] When executing Wi-Fi positioning technology, it depends on the terminal device to scan the access device. The terminal device needs to sense the existence of the access device by scanning the access device, and then perform positioning based on the basic information of the access device. Therefore, the scanning success rate of the terminal device, that is, whether the access device can be scanned, is very important.
[0053] Specifically, the terminal device senses the presence of the access device, receives the wireless data packet sent by the access device, and obtains the basic information of the access device, including parsing the MAC address of the access device and calculating the received signal strength (RSSI) to scan the access device. Furthermore, when performing other related operations through the scanned access device, such as performing positioning calculations, the terminal device determines the location information of the access device through the MAC address of the access device and the pre-configured fingerprint library. The terminal device calculates the distance to the access device through RSSI, thereby combining the location information of the access device and the distance to the access device to determine the location information of the terminal device.
[0054] Generally, a terminal device scans an access device through a wireless data packet carrying a beacon frame, ie, a beacon frame, or a wireless data packet carrying a response frame, ie, a probe response frame, sent by the access device.
[0055] Specifically, the access device will periodically broadcast beacon packets carrying beacon frames. The terminal device can listen to the beacon packets actively transmitted by the access device within the communication range to obtain the basic information of the access device and scan it. Optionally, the terminal device can also actively detect in the environment in which it is located, by sending a probe request packet carrying a request frame and receiving a probe response packet carrying a response frame returned by the access device, to obtain the basic information of the access device and scan it.
[0056] However, in some complex environments, such as shopping malls, due to the large number of access devices deployed, the time points of wireless data packets sent by different access devices may be relatively concentrated, and most of the access devices are hidden nodes and cannot sense the existence of other access devices, so the sent wireless data packets cannot be sent in sequence. When different access devices transmit wireless data packets at the same time, the waveforms of different wireless data packets will conflict during the propagation process, resulting in abnormal reception of wireless data packets by the terminal device, that is, the terminal device fails to scan the access device.
[0057] When two wireless data packets collide, both wireless data packets will be damaged at the same time, and the terminal device cannot receive any of them. When the terminal device cannot receive the wireless data packet sent by the access device, it naturally cannot scan the access device and cannot perform subsequent operations such as positioning based on the MAC address and RSSI of the access device.
[0058] In a specific embodiment, Figure 1 The figure shows a schematic diagram of a method for scanning access devices. Figure 1 , there are two access devices AP1 and AP2 within the communication range of the terminal device. The terminal device broadcasts a wireless data packet carrying a probe request frame within the communication range. Both AP1 and AP2 receive the wireless data packet carrying the probe request frame sent by the terminal device, and return a wireless data packet carrying a probe response frame to the terminal device. When the terminal device receives the response frame wireless data packets returned by AP1 and AP2, since AP1 and AP2 send the response frame wireless data packets at the same time, the two response frame wireless data packets collide during the transmission process. The terminal device cannot receive any wireless data packet, which causes the terminal device to fail to scan the access devices Ap1 and AP2.
[0059] In another specific embodiment, Figure 2 The figure shows another schematic diagram of an access device scanning method. The terminal device sends a probe request wireless data packet to AP2 in a unicast manner. After receiving the request frame wireless data packet from the terminal device, AP2 returns a probe response wireless data packet. AP1 broadcasts a beacon frame wireless data packet. When the terminal device receives the response frame wireless data packet returned by AP2, it also receives the beacon frame wireless data packet broadcast by AP1, causing the response frame wireless data packet sent by AP2 to collide with the beacon frame wireless data packet broadcast by AP1, resulting in the terminal device being unable to receive any of the two wireless data packets, which in turn causes the terminal device to fail to scan access devices AP1 and AP2.
[0060] When the terminal device scans the access device, the scanning repetition rate is used to characterize the scanning success rate of the terminal device for several access devices. For example, when scanning the access device and querying the location information of the corresponding scanned access device in the fingerprint library, the more access devices the terminal device misses to scan, the lower the scanning repetition rate is, and the lower the accuracy of its positioning calculation is; and the more access devices the terminal device scans, the higher the scanning repetition rate is, and the higher the accuracy of its positioning and fence calculation is.
[0061] Among them, when calculating the scanning repetition rate, it is necessary to determine it according to the proportion of the scanned access devices in the access devices pre-entered in the fingerprint library. The more accesses scanned into the fingerprint library, the higher the scanning repetition rate. Therefore, in order to improve the positioning accuracy, the scanning repetition rate of the terminal device scanning the access device should be improved.
[0062] like Figure 3 As shown, it is a schematic diagram of an access device scanning method. In a specific embodiment, 12 access devices are pre-configured in the fingerprint library. The terminal device scans the access device E in the fingerprint library at position 1; and the terminal device scans the access devices A, E, and I in the fingerprint library at position 2. The scanning repetition rate of the terminal device at position 2 is higher than that at position 1, so the scanning success rate of the terminal device at position 2 is higher, and the accuracy of the positioning performed is higher.
[0063] like Figure 4 FIG. 1 is a schematic diagram of a terminal device positioning and scanning system according to an embodiment of the present application. Figure 4 The terminal device positioning scanning system includes a terminal device and several access devices, wherein the access device is generally a router, and the number of the access devices is two or more.
[0064] When a terminal device scans an access device by receiving wireless data packets in a terminal device positioning and scanning system, it is necessary to collect all receivable wireless data packets in the environment. Access devices can be scanned not only by receiving beacon packets and probe response packets sent by access devices, but also by collecting other frame types of wireless data packets in the terminal device positioning system, such as management frame wireless data packets, data frame wireless data packets, control frame wireless data packets, etc. Among them, beacon packets and probe response packets are both management frame wireless data packets. In addition to beacon packets and probe response packets, management frame wireless data packets also include other types of wireless data packets.
[0065] At the same time, the receiving end of the wireless data packet is not limited to being used to execute positioning terminal devices. Wireless data packets sent by access devices to other terminal devices, as well as wireless data packets sent between access devices, can also be obtained and used to sense access devices, as well as extract information such as MAC addresses and RSSI for related processing to improve the scanning repetition rate of scanning access devices.
[0066] like Figure 5 FIG. 1 is a flowchart of a positioning scanning method provided according to an embodiment of the present application. The method is applied to a terminal device, see Figure 5 The specific steps of the method include:
[0067] S501, collecting wireless data packets that can be received in the environment where the terminal device is located.
[0068] Specifically, the terminal device collects all wireless data packets that can be collected within the communication range. The recipient of the wireless data packet is not limited to the terminal device itself, that is, the terminal device needs to collect wireless data packets that are not sent to the terminal device itself, such as wireless data packets sent from the access device to other terminal devices, or wireless data packets sent between access devices.
[0069] S502: Filter target data packets from access devices from the collected wireless data packets.
[0070] Specifically, each frame field in the collected wireless data packets is parsed to filter out target data packets that meet the receiving requirements from all received wireless data packets.
[0071] The frame field includes a field for indicating a data sender. The target data packet that meets the receiving requirements is a data packet sent by a direct access device.
[0072] S503: Determine the MAC address and received signal strength RSSI of each access device according to the target data packet.
[0073] Specifically, the terminal device determines the MAC address of the access device by parsing the TA in the wireless data packet. The terminal device determines the RSSI of the access device by calculating the received wireless data packet.
[0074] When the wireless data packet is a data frame wireless data packet, the RSSI calculated by the terminal device also needs to take into account the influence of the data transmission rate.
[0075] Specifically, when the terminal device calculates the RSSI of the wireless data packet of the data frame, it also needs to determine the data transmission rate based on the wireless data packet. Since the data transmission rate will affect the RSSI, after calculating the specific value of the RSSI based on the wireless data packet, it is also necessary to query the RSSI mapping table according to the data transmission rate to determine the corresponding RSSI coefficient. After multiplying the calculated RSSI with the determined RSSI coefficient, the target RSSI value used to perform the positioning calculation can be obtained.
[0076] In a specific embodiment, the data transmission rate is determined to be 1 Mbps according to the wireless data packet, and the corresponding RSSI coefficient is determined to be 1.5 by querying the RSSI mapping table, so the target RSSI' used for positioning is finally 1.5*RSSI, where RSSI is the RSSI initially calculated according to the wireless data packet.
[0077] The terminal device can perform operations such as positioning calculation based on the MAC address and RSSI of each access device obtained by scanning the access devices.
[0078] Specifically, the terminal device determines the corresponding access device in the fingerprint database through the determined MAC address, and determines the location information of the access device. The terminal device calculates the Euclidean distance between the terminal device and the router through the calculated RSSI, thereby completing the positioning.
[0079] Figure 6 FIG. 1 is a schematic diagram of a positioning scanning method provided according to an embodiment of the present application. In a specific embodiment, the terminal device is located at point Y, and the terminal device scans the surrounding access devices to perform positioning. During the first scan, the terminal device scans router 1, router 2, and router 3, and calculates the received signal strength RSSI1, RSSI2, and RSSI3 from each router to the terminal device, and determines the vector
[0080] During the second scan, the terminal device scans router 1, router 2, and router 3, and calculates the received signal strength RSSI1', RSSI2', and RSSI3' from each router to the terminal device, and determines the vector
[0081] The formula for the Euclidean distance D between the terminal device and the router is:
[0082] where a i 、b i Represents vectors and The i-th item in .
[0083] Among them, the positioning accuracy can be characterized by calculating the similarity.
[0084] Specifically, sim(A,B) is a vector With vector The higher the similarity of the two vectors, the higher the positioning accuracy. The value of sim(A,B) is determined by D(A,B).
[0085] In addition to receiving beacon packets and probe response packets to perform scans on access devices, the embodiments of the present invention can also perform scans on access devices by collecting other wireless data packets, such as other types of management frame wireless data packets, data frame wireless data packets, control frame wireless data packets, etc., to obtain the MAC address and signal strength of the router, thereby realizing positioning calculation, improving the success rate of positioning scanning, and improving the problem of insufficient success rate of positioning scanning caused by the failure to scan beacon packets and probe response packets.
[0086] When executing S502 to filter the target data packets from the access device from the collected wireless data packets, it is necessary to parse each frame field in the wireless data packet, determine the field used to indicate the data sender, and filter out the target data packets from the access device in combination with different filtering methods.
[0087] like Figure 7 FIG. 1 is a schematic diagram of a wireless data packet structure provided by an embodiment of the present invention. Figure 7 A wireless data packet contains three parts: a frame header, a data part (Frame Body) and a frame tail (FCS). The frame header of a wireless data packet is used to carry the information of the wireless data packet. The frame header of a wireless data packet specifically includes a frame control field (frame control), an address field (address1, address2), etc. By parsing the field used to indicate the data sender in the frame header of the wireless data packet, the target data packet can be filtered out. Among them, the field used to indicate the data sender is different according to different filtering methods.
[0088] In some embodiments, the field used to indicate the data sender includes: a frame type field.
[0089] For details, see Figure 7 In the frame control field of the wireless data packet, there is a frame type field (type field) that identifies different functional frame types. The terminal device parses the frame type field of the wireless data packet to determine the functional frame type carried by the wireless data packet, thereby determining the type of the wireless data packet. The type of the wireless data packet determines whether the wireless data packet can be used as a target data packet.
[0090] In the related art, only when the frame type is determined to be a management frame type by parsing the frame type field, and the wireless data packet is determined to be a beacon packet or a probe response packet under the management frame type through subsequent steps, the wireless data packet will be used to perform positioning scanning, while other types of wireless data packets will be used to perform corresponding functions and will not be determined as target data packets to perform positioning scanning.
[0091] In the embodiment of the present invention, by parsing the field indicating the data sender, that is, parsing the frame type field, when it is determined that the frame type is a preset designated type, the wireless data packet is determined as the target data packet.
[0092] The specified types include management frame types (mgmt frame), control frame types (control frame) and data frame types (data frame).
[0093] In a specific embodiment, when the corresponding frame type field value is parsed to be 00, it is determined that the functional frame type carried by the wireless data packet is a management frame, and the wireless data packet is a management frame wireless data packet, which can be used as a target data packet; when the corresponding frame type field value is parsed to be 01, it is determined that the functional frame type carried by the wireless data packet is a control frame, and the wireless data packet is a control frame wireless data packet, which can be used as a target data packet; when the corresponding frame type field value is parsed to be 10, it is determined that the functional frame type carried by the wireless data packet is a data frame, and the wireless data packet is a data frame wireless data packet, which can be used as a target data packet.
[0094] In some embodiments, in order to improve the accuracy of positioning scanning, the terminal device can also parse other frame fields in the wireless data packet to determine that the sender of the wireless data packet is an access device rather than another terminal device.
[0095] Taking the access device as a router as an example, since the location information of the router has been pre-entered in the fingerprint database, and the location of the router is relatively fixed and generally will not change easily, the terminal device performs positioning calculations through wireless data packets sent by the router with higher accuracy. If the wireless data packet is sent by an access device other than a router, such as a terminal device equipped with a hotspot function, the terminal device may not be able to perform positioning through its location because it is not entered into the fingerprint database, or the terminal device may move, resulting in poor positioning accuracy based on the wireless data packet sent by the terminal device.
[0096] Therefore, when the terminal device filters the target data packets from the access device from the collected wireless data packets, it is also necessary to parse the field used to indicate the data sender to ensure that the collected target data packets are sent by access devices such as routers, rather than other terminal devices.
[0097] In some embodiments, the field used to indicate the data sender includes: a frame subtype field.
[0098] See also Figure 7 In the frame control field of the wireless data packet, there is also a frame subtype field (Subtype type field) that identifies the specific subtype.
[0099] When the frame type is determined to be a management frame type by parsing the frame type field of the wireless data packet, it is necessary to further determine the subtype of the management frame according to the frame subtype field, and determine the sending source of the wireless data packet according to the subtype of the management frame.
[0100] Specifically, the subtypes of management frames include: beacon frame, association request frame, association response frame, disassociation frame, authentication request frame, authentication response frame, deauthentication frame, probe request frame, probe response frame, etc.
[0101] Among them, beacon frames, association response frames, authentication response frames and detection response frames are only sent by access devices. When the terminal device parses the wireless data packet and finds that the management frame of the above subtypes is contained in the wireless data packet, the wireless data packet is determined as the target data packet from the access device.
[0102] When the terminal device determines that the wireless data packet contains management frames of subtypes such as association request frame, disassociation frame, authentication request frame, de-authentication frame, and detection request frame, it is determined that the wireless data packet is not sent by the access device but is sent by other terminal devices within the communication range of the terminal device and cannot be used to perform positioning scanning, so the wireless data packet is discarded.
[0103] In a specific embodiment, when the terminal device parses the frame type field of the wireless data packet and determines that the wireless data packet is a management frame data packet, and further determines that the subtype of the management frame is an authentication response frame by parsing the frame subtype field, it can be determined that the wireless data packet comes from a wireless device and can be determined as a target data packet.
[0104] In some embodiments, the field for indicating the data sender includes: a control bit field for indicating whether the wireless data packet comes from an access device.
[0105] Specifically, wireless data packets whose control bit fields have a first value are filtered out from the collected wireless data packets as target data packets, and the first value is used to indicate that the wireless data packet comes from an access device.
[0106] Among them, the control bit field is generally the FromDs field in the frame control field, and the first value of the control bit field is generally 1.
[0107] See also Figure 7The frame control field also includes a ToDs field and a FromDs field. The ToDs field and the FromDs subfield are used to characterize the type of the source address and the destination address of the wireless data packet.
[0108] When the wireless data packet is determined to be a data frame wireless data packet by parsing the frame field type, it is necessary to determine whether the data frame wireless data packet is transmitted by the access device by parsing the ToDs field and FromsDs field in the frame control field.
[0109] Specifically, the ToDs field and the FromDs field are parsed respectively to obtain the field information therein. When the ToDs field is 0 and the FromDs field is 1, it is determined that the wireless data packet is sent by the access device to the terminal device or other terminal devices; when the ToDs field is 1 and the From field is 1, it is determined that the wireless data packet is sent by any access device to other access devices, that is, data transmission between two bridged access devices or two access devices in a mesh network. When the FromDs field is 0, it can be determined that the wireless data packet is not sent by the access device and is discarded.
[0110] Therefore, when the FromDs subfield in the received wireless data packet is 1, that is, when the control bit field is the first value, no matter what the value of the ToDs field is, the wireless data packet is determined as a target data packet from the access device.
[0111] When the FromDs field in the received wireless data packet is 0, it is determined that the wireless data packet is not sent by the access device, but is sent by other terminal devices within the communication range of the terminal device. It cannot be used to perform positioning, and the wireless data packet is discarded.
[0112] In some embodiments, the field used to indicate the data sender includes: a data source address TA field and a basic service set identifier SSID field.
[0113] Specifically, from the collected wireless data packets, wireless data packets with consistent TA fields and SSID fields are selected as target data packets.
[0114] See also Figure 7 ,The frame header of the wireless data packet also includes address fields address1, address2, address3, and address4.
[0115] Among them, address2 is the TA field. By parsing the adress2 field, the TA of the wireless data packet can be obtained. The SSID field of the wireless data packet is not fixed and needs to be determined in combination with the ToDs field and FromDs field in the frame control field.
[0116] In some embodiments, the field used to indicate the data sender includes: a data source address TA field.
[0117] Specifically, when the SSID field is not parsed in the wireless data packet, the TA field is parsed from the wireless data packet, and the parsed TA field is searched and matched in the preset fingerprint library. When the TA field and the fingerprint are the same in any pre-stored router address, the wireless data packet is determined to be the target data packet, otherwise the wireless data packet is discarded.
[0118] In some embodiments, at S501, after collecting wireless data packets that can be received in the environment where the terminal device is located, a cyclic redundancy check (CRC) needs to be performed to determine the integrity of the wireless data packets. When the terminal device determines through the CRC that there is an error or incompleteness in the wireless data packet, the wireless data packet will be discarded because the wireless data packet cannot perform normal functions.
[0119] In the embodiment of the present invention, after receiving the wireless data packet, a CRC check is performed on the wireless data packet. If the CRC check succeeds, it is determined that the wireless data packet is normal and can be used to perform positioning calculations and its normal functions. If the CRC check fails, it is determined whether the TA field in the wireless data packet is valid. If valid, it can also be used to perform positioning, and further confirm whether the wireless data packet is a target data packet from the access device.
[0120] Among them, since the corresponding function is not to be executed through the wireless data packet, but positioning is required through the wireless data packet, even if the wireless data packet does not pass the CRC check, that is, there is a problem in the wireless data packet, as long as the relevant information of the MAC address still exists in the wireless data packet, the wireless data packet can be used to perform positioning.
[0121] Figure 8 FIG. 1 is a simplified structural diagram of a positioning chip provided according to an embodiment of the present application, and the chip is deployed on a terminal device that performs a positioning scanning method. Figure 8 As shown, the chip includes:
[0122] The receiving module 801 collects wireless data packets that can be received in the environment where the terminal device is located;
[0123] A screening module 802 is configured to screen target data packets from access devices from the collected wireless data packets;
[0124] A determination module 803 determines a MAC address and a received signal strength RSSI of each access device according to the target data packet;
[0125] Positioning module 804, the MAC address and RSSI of each access device are used for positioning calculation of the terminal device.
[0126] In the description of the embodiments of the present application, for the convenience of description, the device is described by dividing it into various modules according to its functions. The division of each module is merely a division of logical functions. When implementing the embodiments of the present application, the functions of each module can be implemented in the same or one or more software and / or hardware.
[0127] Specifically, the device proposed in the embodiment of the present application can be fully or partially integrated into a physical entity during actual implementation, or it can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the detection module can be a separately established processing element, or it can be integrated in a chip of an electronic device. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. In the implementation process, each step of the above method or each of the above modules can be completed by an integrated logic circuit of hardware in a processor element or instructions in the form of software.
[0128] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0129] In actual application scenarios, the method flow of the embodiments shown in this specification can be implemented by an electronic chip installed on an electronic device. Therefore, an embodiment of the present application proposes an electronic chip. For example, the electronic chip is installed on an electronic device, and the electronic chip includes:
[0130] A processor is used to execute computer program instructions stored in a memory, wherein when the computer program instructions are executed by the processor, the electronic chip is triggered to execute the method steps described in the embodiments of the present application.
[0131] An embodiment of the present application further proposes an electronic device, which can be implemented as an Internet access device. The Internet access device includes a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, the server device is triggered to execute the method steps described in the embodiment of the present application.
[0132] Specifically, in one embodiment of the present application, the above-mentioned one or more computer programs are stored in the above-mentioned memory, and the above-mentioned one or more computer programs include instructions. When the above-mentioned instructions are executed by the above-mentioned device, the above-mentioned device executes the method steps described in the embodiment of the present application.
[0133] An embodiment of the present application further proposes an electronic device, which can be implemented as a terminal device. The terminal device includes a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, the terminal device is triggered to execute the method steps described in the embodiment of the present application.
[0134] Specifically, in one embodiment of the present application, the above-mentioned one or more computer programs are stored in the above-mentioned memory, and the above-mentioned one or more computer programs include instructions. When the above-mentioned instructions are executed by the above-mentioned device, the above-mentioned device executes the method steps described in the embodiment of the present application.
[0135] For example, Fig. 9 FIG. 1 shows a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. Fig. 9 As shown, the electronic device 900 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0136] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 900. In other embodiments of the present application, the electronic device 900 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0137] The processor 110 of the electronic device 900 may be a device on a chip (SOC), which may include a central processing unit (CPU), and may further include other types of processors. For example, the processor 110 may be a PWM control chip.
[0138] The processor involved in the processor 110 may include, for example, a CPU, a DSP, a microcontroller or a digital signal processor, and may also include a GPU, an embedded neural network processor (Neural-network Process Units, NPU) and an image signal processor (Image Signal Processing, ISP). The processor 110 may also include necessary hardware accelerators or logic processing hardware circuits, such as ASICs, or one or more integrated circuits for controlling the execution of the program of the technical solution of the present application. In addition, the processor 110 may have the function of operating one or more software programs, and the software programs may be stored in a storage medium.
[0139] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent components or integrated into one or more processors. In some embodiments, the electronic device 900 may also include one or more processors 110. The controller may generate an operation control signal based on the instruction opcode and the timing signal to complete the control of fetching and executing instructions.
[0140] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc. Among them, the USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 900, and can also be used to transmit data between the electronic device 900 and peripheral devices.
[0141] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 900. In other embodiments of the present application, the electronic device 900 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0142] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 900. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0143] The internal memory 121 of the electronic device 900 can be used to store one or more computer programs, which include instructions. The processor 110 can run the above instructions stored in the internal memory 121, so that the electronic device 900 performs the methods provided in some embodiments of the present application, as well as various applications and data processing. The internal memory 121 may include a code storage area and a data storage area. Among them, the code storage area can store an operating system. The data storage area can store data created during the use of the electronic device 900, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), etc.
[0144] The internal memory 121 can be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or it can also be any computer-readable medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer.
[0145] The processor 110 and the internal memory 121 can be combined into a processing device, or more commonly, they are independent components. The processor 110 is used to execute the program code stored in the internal memory 121 to implement the method described in the embodiment of the present application. In specific implementation, the internal memory 121 can also be integrated into the processor, or independent of the processor.
[0146] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 900. While the charging management module 140 is charging the battery 142, it may also power the electronic device 900 through the power management module 141.
[0147] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory interface 120, the mobile communication module 150 and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0148] The wireless communication function of the electronic device 900 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0149] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 900 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0150] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 900. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the processor 110.
[0151] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0152] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 900. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0153] In some embodiments, the antenna 1 of the electronic device 900 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 900 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0154] The electronic device 900 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0155] The electronic device 900 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0156] The electronic device 900 can implement touch input through the display screen 194, the touch sensor 180K, and the processor 110. For example, the touch sensor 180K and the display screen 194 are integrated into a touch screen, and the user's click operation on the touch screen is collected by the touch sensor 180K as a touch signal, and the touch signal is collected and converted by the sensor module 180 and transmitted to the processor 110. The processor 110 recognizes the touch signal and analyzes it into the user's touch operation behavior.
[0157] Furthermore, the devices, apparatuses, and modules described in the embodiments of the present application may be implemented by computer chips or entities, or by products having certain functions.
[0158] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0159] In the several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0160] Specifically, in one embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored. When the computer program is run on a computer, the computer executes the method provided in the embodiment of the present application.
[0161] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is run on a computer, the computer executes the method provided by the embodiment of the present application.
[0162] The embodiments described in this application are described with reference to the flowcharts and / or block diagrams of the methods, devices (apparatus), and computer program products according to the embodiments of the application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0163] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0165] It should also be noted that in the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0166] In the embodiments of the present application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, commodity or device including the element.
[0167] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0168] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0169] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments of the present application can be implemented by a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0170] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, apparatuses and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0171] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A positioning scanning method, characterized in that: The method comprises: Collect wireless data packets that can be received in the environment where the terminal device is located; Filtering target data packets from access devices from collected wireless data packets; Determine the MAC address and received signal strength RSSI of each access device according to the target data packet; Among them, the MAC address and RSSI of each access device are used for positioning calculation of the terminal device.
2. The method according to claim 1, characterized in that The step of screening the target data packet from the access device from the collected wireless data packets includes: Parsing each frame field of the collected wireless data packet, wherein each frame field includes: a field for indicating a data sender; According to the field used to indicate the data sender, the target data packet from the access device is filtered from the collected wireless data packets.
3. The method according to claim 2, characterized in that The step of filtering the target data packet from the access device from the collected wireless data packets according to the field indicating the data sender includes: The field used to indicate the data sender includes: a frame type field; Filter the wireless data packets whose frame types are specified from the collected wireless data packets.
4. The method according to claim 3, characterized in that The frame type is a specified type, including: the frame type is a management frame type, a control frame type or a data frame type.
5. The method according to claim 2, characterized in that: The step of filtering the target data packet from the access device from the collected wireless data packets according to the field indicating the data sender includes: The field used to indicate the data sender includes: a frame subtype field; Filtering wireless data packets whose frame subtypes are preset subtypes from the collected wireless data packets; The preset subtype includes: a beacon frame type, an association response frame type, an authentication response frame type or a detection response frame type.
6. The method according to claim 2, characterized in that The step of filtering the target data packet from the access device from the collected wireless data packets according to the field indicating the data sender includes: The field used to indicate the data sender includes: a control bit field used to indicate whether the wireless data packet comes from an access device; The wireless data packets whose control bit field has a first value are filtered out from the collected wireless data packets, where the first value indicates that the wireless data packet comes from an access device.
7. The method according to any one of claims 2 to 6, characterized in that: The step of filtering the target data packet from the access device from the collected wireless data packets according to the field indicating the data sender includes: The fields used to indicate the data sender include: a data source address TA field and a basic service set identifier SSID field; Filter the wireless data packets whose TA fields and SSID fields are consistent from the collected wireless data packets.
8. The method according to any one of claims 2 to 6, characterized in that: The step of filtering the target data packet from the access device from the collected wireless data packets according to the field indicating the data sender includes: The field used to indicate the data sender includes: a data source address TA field; Filter the wireless data packets whose TA fields are consistent with the addresses in the address fingerprint library from the collected wireless data packets.
9. The method according to claim 1, characterized in that: After collecting wireless data packets that can be received in the environment where the terminal device is located, the method further includes: Performing cyclic redundancy check (CRC) on the collected wireless data packets; If the CRC check fails, determining whether the TA field of the wireless data packet is valid; If the TA field of the wireless data packet is valid, it is further determined whether the wireless data packet comes from an access device.
10. A positioning scanning chip, the chip comprising: A receiving module collects wireless data packets that can be received in the environment where the terminal device is located; A screening module, screening target data packets from access devices from the collected wireless data packets; A determination module determines the MAC address and received signal strength RSSI of each access device according to the target data packet; Positioning module, the MAC address and RSSI of each access device are used for positioning calculation of the terminal device.
11. An electronic device, characterized in that: The electronic device comprises a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method steps as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 9.