A security detection method for BLE Beacon indoor positioning system
Through the combination of the Hidden Markov model and the Grubbs test method, multiple safety improvements of the BLE Beacon indoor positioning system are achieved, and abnormal anchor nodes are identified and isolated, which solves the safety challenges of the BLE Beacon indoor positioning system, reducing costs and improving system safety.
Patent Information
- Application Number
- CN202211108159.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-13
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-09-13
AI Technical Summary
BLE Beacon indoor positioning systems face multiple security challenges such as spoofing attacks, beacon hijacking attacks and physical attacks. The existing solutions are costly and cannot solve all problems at the same time.
The hidden Markov model and Grubbs test method are used to work together with the anchor node and the cloud server to detect the exceptions and positioning errors of the beacon packet sequence to identify the attacked anchor nodes.
Without increasing hardware costs, the security of the BLE Beacon indoor positioning system can be improved at the same time, quickly discover and isolate abnormal anchor nodes, and reduce positioning errors.
Smart Images

Figure CN115515137B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of system-on-chip and embedded systems, and low-power Bluetooth communication, relates to BLE Beacon indoor positioning system technology, and particularly relates to a security detection method for a BLE Beacon indoor positioning system. Background Art
[0002] Bluetooth Low Energy (BLE) is a low data transfer rate technology suitable for low-power Internet of Things applications, and BLE Beacon is an Internet of Things technology based on BLE. BLE Beacon broadcasts beacon packets at certain time intervals. It does not need to communicate with devices and does not need to identify how many devices receive the beacon packets it sends. Therefore, BLE Beacon has been widely used in the field of the Internet of Things, such as indoor positioning, museum guidance, intelligent warehouse, smart home control, etc. However, BLE Beacon still faces many challenges in aspects such as protocol compatibility, service life, hardware deployment, distance estimation, server interaction, and security.
[0003] In the application scenario of an indoor positioning system, the BLE Beacon, as an anchor node, continuously broadcasts unencrypted beacon packets and can respond to pairing requests from other devices and modify its own working state. Therefore, the BLE Beacon in the application scenario of an indoor positioning system faces severe security challenges. The security challenges can be divided into the following three types, namely:
[0004] ⑴ Spoofing attack. Since the BLE Beacon anchor node publicly broadcasts its beacon packets, any unauthorized third-party device can easily obtain the beacon packets and obtain important data such as the Media Access Control (MAC) address and Universally Unique Identifier (UUID) in the beacon packets. Then, the third-party device can choose to forward the beacon packets or simulate the BLE Beacon device. The indoor positioning system precisely locates through the UUID of the beacon packets and their Received Signal Strength Indication (usually simply referred to as RSSI). If the system is subjected to a spoofing attack, it will lead to problems such as errors or reduced accuracy in the positioning system.
[0005] ⑵ Beacon hijacking attack. A beacon hijacking attack refers to an unauthorized third-party device establishing a connection with a BLE Beacon and accessing its configuration layer to modify key settings such as its UUID and transmission power, resulting in problems such as the cloud server being unable to correctly identify the anchor node and the positioning system accuracy decreasing.
[0006] ⑶ Physical attack. In the application scenario of indoor positioning, a physical attack usually refers to a third party damaging or moving the anchor node, or the anchor node stopping working for other reasons. These problems will also cause abnormalities in the indoor positioning system and the inability to provide positioning services normally.
[0007] Currently, for the above security challenges, common solutions mainly include ensuring that each BLE Beacon anchor node has a unique and counterfeit-proof identity recognition method to deal with spoofing attacks, such as the unique radio frequency fingerprint of each device and the geographical location verification of the Global Positioning System (GPS); or verifying whether the third-party device paired with the BLE Beacon anchor node is an authorized device to deal with beacon hijacking attacks, such as dynamic tokens, etc.; it is also possible to detect anchor nodes that stop working or have abnormalities as soon as possible through the system to deal with physical attacks, such as the hidden Markov model, etc.
[0008] These existing solutions can usually handle some security challenges existing in BLE Beacons, but most of these solutions are only applicable to specific usage scenarios and cannot be widely used. For example, ① additional hardware facilities are often required, resulting in high costs; ② a large number of BLE Beacon devices are not deployed in the test environment, so the effect may not be good in the application scenario of indoor positioning where a large number of BLE Beacons need to work together; ③ they can only handle a single security challenge and cannot solve all security problems faced by indoor positioning at the same time. Taking the radio frequency fingerprint method as an example, BLE devices need to have powerful computing capabilities to distinguish the subtle differences in BLE signals emitted by different devices, and then they can identify whether the source of the beacon packet is a third-party device to improve its security. This solution will result in a relatively high cost for deploying BLE devices and is not applicable to application scenarios such as indoor positioning systems. Therefore, a security solution with low cost and capable of solving multiple security challenges simultaneously needs to be designed for the application scenario of indoor positioning. Summary of the Invention
[0009] Object of the Invention: In order to overcome the deficiencies existing in the prior art, a security detection method for a BLE Beacon indoor positioning system is provided. The implementation of this method does not require additional hardware, can improve the security of the BLE Beacon indoor positioning system, and has the effects of low cost and being able to solve multiple security challenges simultaneously.
[0010] Technical solution: To achieve the above object, the present invention provides a security detection method for a BLE Beacon indoor positioning system, including the following steps:
[0011] S1: The anchor node enters the scanning state to obtain the beacon packet sequence for modeling and probability calculation;
[0012] S2: Divide the obtained sufficient number of beacon packet sequences into a training set TO and a validation set VO. Use the training set TO to establish a hidden Markov model, and use the validation set VO to calculate the lowest probability of the sequence under the hidden Markov model;
[0013] S3: The anchor node broadcasts beacon packets at a set broadcast time interval, and after reaching the scanning time interval, receives the beacon packets of other anchor nodes and arranges them into a sequence in the order of reception time;
[0014] S4: According to the sequence obtained in step S3, calculate the lowest probability of the sequence under the hidden Markov model. Compare the calculated lowest probability with the lowest probability obtained from the validation set in step S2 to determine whether the scanning is abnormal. If it is abnormal, enter step S5;
[0015] S5: Upload the abnormal beacon packets to the cloud server. When the cloud server receives the abnormal beacon packets or reaches the security detection time interval, perform security detection, and detect the abnormal anchor nodes attacked in the beacon packets through the method of consistency check.
[0016] Further, the hidden Markov model in step S2 is expressed as λ=(A,B,π), and the establishment method is:
[0017] Under the condition of randomly assigning λ=(A,B,π), obtain the probability P t ,o t+1} of the observation sequence TO={o i} being converted from state x j to x t,ij
[0018] P t,ij =π(i)*b i (o t )*a i (j)*b j (o t+1 ) (1)
[0019] Re-estimate the values of A, B, and π, as shown in equations 2, 3, and 4:
[0020]
[0021]
[0022]
[0023] where a i (j) * 、b i (j) * and π(i) * are the values in matrices A, B, and π. Finally, a new parameter λ=(A * , B * , π * ) is obtained. After that, the above steps are repeated until the values of A, B, and π converge, thus completing the establishment of the hidden Markov model. A total of three hidden Markov models are established.
[0024] Furthermore, the calculation method for the lowest probability of the sequence under the hidden Markov model in step S2 is as follows:
[0025] The validation set VO is divided into multiple subsequences of length k, and the lowest probability of each sequence under the three hidden Markov models is calculated. The calculation method is as follows:
[0026] The probabilities of each hidden state at the initial moment are obtained, and the probabilities of the hidden states at time t are obtained by recursion, and then the probability of the observation sequence appearing can be obtained. Its calculation formula is shown in equations 5, 6, and 7:
[0027] P(x i , o1|λ)=π i *b i (o1) (5)
[0028]
[0029]
[0030] According to the calculation results, the lowest probability of each sequence under the three hidden Markov models is obtained.
[0031] Furthermore, the calculation method for the lowest probability of the sequence under the hidden Markov model in step S4 is as follows:
[0032] The scanned beacon packet sequence is divided into multiple subsequences with a step size of k, and the lowest probabilities of these subsequences under the three hidden Markov models are calculated respectively.
[0033] Furthermore, the method for determining whether an abnormality occurs in the scan in step S4 is as follows:
[0034] The calculated minimum probabilities of the subsequences under the three hidden Markov models are compared with the three minimum probabilities obtained from the validation set VO in step S2. If the minimum probability of a subsequence under two or more hidden Markov models is lower than the minimum probability of the validation set VO under the corresponding hidden Markov model, it is considered that the scan has found an abnormality.
[0035] Furthermore, the beacon packet of step S5 includes: the UUID of the anchor node, whether the modeling is completed, whether an abnormality is found, and the UUID and RSSI value of the neighbor anchor node in this scanning phase.
[0036] Furthermore, the method of safety detection in step S5 is:
[0037] The cloud server records the beacon packet sequence uploaded by the anchor node and the corresponding RSSI value, and then regards each anchor node as a node to be located. During security detection, each anchor node is located, and the anchor node with large positioning error is detected by the Grubbs test method and regarded as a suspicious anchor node.
[0038] The RSSI value is the signal strength of a receiving device receiving another device's signal. The distance between the two devices can be calculated based on the signal strength and the wireless signal transmission loss model.
[0039] The Grubbs test method is used to detect anchor nodes with large positioning errors, which is equivalent to a filter. Each node is positioned and the positioning result is compared with the actual deployment position to obtain the difference. Finally, all the calculated differences are tested with the Grubbs test method to detect "differences with large fluctuations".
[0040] The cloud server relocates the anchor nodes while excluding suspicious anchor nodes one by one; if the positioning error of an anchor node is not abnormal after the Grubbs test during the positioning process, then the anchor node is considered to be a normal anchor node, and the excluded anchor nodes are voted, and it is considered that the excluded anchor nodes are likely to be abnormal anchor nodes that have been attacked; after relocating all anchor nodes, according to the voting results, the anchor nodes with a voting result of 0 and determined to be likely to be normal anchor nodes during the positioning process are determined to be normal anchor nodes, and the remaining anchor nodes are all abnormal anchor nodes.
[0041] In the present invention, the anchor node broadcasts beacon packets regularly, and then other anchor nodes receive and detect. The node to be positioned receives the beacon packets and packages multiple beacon packets and uploads them to the cloud server. The cloud server parses the beacon packets to find out whether there are abnormalities and abnormal anchor nodes in the indoor positioning system.
[0042] The present invention provides a design solution for a high-security BLE Beacon indoor positioning system, which is applicable to quickly discovering attacked anchor nodes when the BLE Beacon indoor positioning system is under attacks such as spoofing attacks, beacon hijacking attacks, and physical attacks. This solution requires anchor nodes to detect the received beacon packet sequence through a hidden Markov model to discover whether there are abnormalities in the indoor positioning system. Then, the cloud server detects the abnormal anchor nodes under attack through a consistency check method.
[0043] A security detection method for a BLE Beacon indoor positioning system provided by the present invention can simultaneously address multiple security challenges. The specific principle is as follows:
[0044] Multiple security challenges will cause the UUID sequences received by some anchor nodes in the indoor positioning system to be abnormal, and some anchor nodes will have abnormal positioning during the anchor node positioning process. Whether there are abnormalities can be discovered based on whether the UUID sequence is abnormal; the attacked anchor nodes can be determined by whether the anchor nodes are abnormally positioned.
[0045] The solution of the present invention is divided into two parts: abnormality discovery and abnormal anchor node positioning, which are implemented through an abnormality discovery algorithm based on a hidden Markov model and an abnormal anchor node detection algorithm based on a consistency check, respectively.
[0046] In the abnormality discovery algorithm, each anchor node establishes a UUID sequence based on the received signal, which has a certain regularity under normal circumstances. If there are attacked anchor nodes, it will cause the UUID sequences received by their neighbor nodes to lose their original regularity. Therefore, this regularity can be discovered and detected by establishing a hidden Markov model, and when the UUID sequence is abnormal, it is considered that there are attacked anchor nodes.
[0047] In the abnormal anchor node detection algorithm, each anchor node is regarded as a node to be positioned, and the RSSI values of the beacon packets received by its neighbor anchor nodes are used for positioning. Then, the positioning results of the attacked anchor nodes will inevitably have a large error compared with the known actual coordinates. To distinguish the positioning error caused by an attacked anchor node from the error caused by normal interference, the Grubbs test method can be used to detect the anchor nodes with large positioning errors and regard them as suspicious anchor nodes. Finally, the anchor nodes are re-positioned and tested by excluding the suspicious anchor nodes one by one, so as to detect the abnormal anchor nodes under attack.
[0048] Beneficial effects: Compared with the prior art, on the premise of low cost and with the working environment of the BLE Beacon indoor positioning system as the verification condition, the present invention realizes the function of discovering abnormal anchor nodes in the BLE Beacon indoor positioning system under attack. The whole process neither requires the anchor nodes to add additional hardware modules nor requires additional hardware detection devices, greatly reducing the cost of ensuring the security of the BLE Beacon indoor positioning system and improving the security of the indoor positioning system. Brief Description of the Drawings
[0049] Figure 1 is the flowchart of the operation of the abnormal anchor node discovery algorithm of the present invention.
[0050] Figure 2 is the flowchart of the operation of the security detection algorithm of the cloud server of the present invention. Detailed Embodiments
[0051] The present invention will be further clarified below with reference to the drawings and specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and not to limit the scope of the present invention. After reading the present invention, various equivalent modifications of the present invention by those skilled in the art fall within the scope defined by the appended claims of this application.
[0052] The present invention provides a security detection method for a BLE Beacon indoor positioning system, as Figure 1 shown, including the following steps:
[0053] S1: The anchor node enters the scanning state to obtain the beacon packet sequence for modeling and probability calculation;
[0054] S2: Divide the obtained sufficient number of beacon packet sequences into a training set TO and a validation set VO. Use the training set TO to establish a hidden Markov model, and use the validation set VO to calculate the lowest probability of the sequence under the hidden Markov model;
[0055] The hidden Markov model is represented as λ = (A, B, π), and the establishment method is:
[0056] Under the condition of randomly assigning λ = (A, B, π), obtain the probability P t of the observation sequence TO = {o t+1}, o i} when it is converted from state x j to x t,ij
[0057] P t,ij = π(i) * b i (o t ) * a i (j) * b j (ot+1 ) (1)
[0058] Re - estimate the values of A, B, and π as shown in Equations 2, 3, and 4:
[0059]
[0060]
[0061]
[0062] where a i (j) * , b i (j) * and π(i) * are the values in matrices A, B, and π. Finally, obtain the new parameter λ=(A * , B * , π * ). After that, repeat the above steps until the values of A, B, and π converge, thus completing the establishment of the Hidden Markov Model. A total of three Hidden Markov Models are established.
[0063] The calculation method for the lowest probability of a sequence under the Hidden Markov Model is as follows:
[0064] Divide the validation set VO into multiple subsequences of length k, and calculate the lowest probability of each sequence under the three Hidden Markov Models. The calculation method is as follows:
[0065] Obtain the probabilities of each hidden state at the initial moment, and obtain the probabilities of each hidden state at time t through recursion, then the probability of the observed sequence can be obtained. Its calculation formula is as shown in Equations 5, 6, and 7:
[0066] P(x i , o1|λ)=π i *b i (o1) (5)
[0067]
[0068]
[0069] According to the calculation results, obtain the lowest probability of each sequence under the three Hidden Markov Models.
[0070] S3: The anchor node broadcasts beacon packets at the set broadcast time interval, and after reaching the scan time interval, receives the beacon packets of other anchor nodes and arranges them into an ordered sequence in the order of reception time;
[0071] S4: According to the sequential sequence obtained in step S3, calculate the lowest probability of the sequence under the hidden Markov model, compare the calculated lowest probability with the lowest probability obtained from the validation set in step S2, and determine whether an abnormality occurs in the scan. If an abnormality occurs, proceed to step S5:
[0072] The method for calculating the lowest probability of the sequence under the hidden Markov model is as follows:
[0073] Divide the beacon packet sequence obtained by scanning into multiple subsequences with a step size of k, and calculate the lowest probabilities of these subsequences under three hidden Markov models respectively.
[0074] The method for determining whether an abnormality occurs in the scan is as follows:
[0075] Compare the lowest probabilities of the obtained subsequences under the three hidden Markov models with the three lowest probabilities obtained from the validation set VO in step S2. If the lowest probabilities of two or more subsequences under the hidden Markov models are lower than the lowest probabilities of the validation set VO under the corresponding hidden Markov models, it is considered that an abnormality is detected in the scan.
[0076] After the scan is completed, the anchor node adds the detection result of this time, the received beacon packet, and the RSSI value to its own beacon packet. Therefore, the beacon packet includes: the UUID of the anchor node, whether the modeling is completed, whether an abnormality is found, and the UUID and RSSI value of the neighbor anchor nodes in the current scan stage.
[0077] S5: Upload the beacon packet with an abnormality to the cloud server. When the cloud server receives the abnormal beacon packet or reaches the security detection time interval, perform a security detection, and detect the abnormal anchor node attacked in the beacon packet through a consistency check method:
[0078] In a conventional indoor positioning system, the node to be located only uploads the UUID of the scanned anchor node and the corresponding RSSI value to the cloud server. In the high-security solution proposed by the present invention, the node to be located also needs to be a medium between the anchor node and the cloud server, and is responsible for truthfully forwarding the content in the anchor node beacon packet to the cloud server. Therefore, the data packet of the node to be located needs to contain the following information: the number of the node to be located, the number of received anchor nodes, the valid information of each beacon packet, and the corresponding received signal strength RSSI value.
[0079] As Figure 2 shown, the method for security detection is as follows:
[0080] The cloud server records the beacon packet sequence uploaded by the anchor nodes and the corresponding received signal strength RSSI values, and then treats each anchor node as a node to be located. During security detection, each anchor node is located, and the anchor nodes with large positioning errors are detected through the Grubbs test method and regarded as suspicious anchor nodes;
[0081] The process of locating each anchor node is as follows:
[0082] First, the cloud system adds the information about which beacon packets an anchor node has received and the RSSI values of these beacon packets recorded in the beacon packets to the positioning matrix. Then, using the beacon packet information of a certain anchor node received by other anchor nodes, as well as indoor positioning algorithms such as the least squares algorithm and the centroid of triangle positioning algorithm, this anchor node is located. Record the positioning errors of all anchor nodes, as shown in Equation 8.
[0083]
[0084] Among them, (x i , y i ) is the known coordinate of the anchor node, is the calculated coordinate of the anchor node. Then, the Grubbs test method is used to detect the suspicious outlier with the largest error and determine whether this value is an outlier. Repeat the above steps until no more outliers are detected. Finally, all the anchor nodes corresponding to the outliers are regarded as suspicious anchor nodes.
[0085] After detecting the suspicious anchor nodes, these suspicious anchor nodes need to be excluded one by one, and the cloud server relocates the anchor nodes under the condition of excluding the suspicious anchor nodes one by one; if the positioning error ε i of a certain anchor node is not an outlier after passing the Grubbs test, then it is considered that this anchor node may be a normal anchor node, and a vote is conducted on the excluded anchor nodes, believing that the excluded anchor nodes are very likely to be abnormal anchor nodes under attack; after relocating all the anchor nodes, according to the voting results, the anchor nodes with a voting result of 0 and determined to be possibly normal anchor nodes during the positioning process are determined as normal anchor nodes, and the rest of the anchor nodes are abnormal anchor nodes.
[0086] The above detection process can be summarized as follows: When there is an attacked anchor node or third-party device in the high-security positioning system, the neighbor nodes of this anchor node or third-party device will find that the frequency of receiving the corresponding beacon packet deviates greatly from the normal frequency during the scanning process, resulting in the probability of the observation sequence in this scanning process being lower than the lowest probability of the verification set sequence, thus detecting the anomaly. When the node to be located receives the beacon packet containing the anomaly information from this neighbor anchor node, it adds it to its own data packet and uploads it to the server. After receiving the data packet carrying the anomaly, the cloud server first parses the data packet and locates the node to be located according to the content of the data packet. During the process of parsing the data packet, the information about the detected anomaly uploaded in the beacon packet will be parsed out, and then the security detection will start. First, the Grubbs test is performed on the positioning error of the anchor node to detect the suspicious anchor node, and finally the anomaly anchor node detection algorithm is used to detect the anomaly anchor node.
[0087] In this embodiment, the above detection method is applied as an example, specifically as follows:
[0088] The solution of the present invention is applicable to the collaborative software design of multiple hardware platforms for various BLE chips and high-security solutions under the PC platform, which mainly includes two parts: detecting anomaly anchor nodes and the cloud server detecting suspicious anchor nodes for security, specifically:
[0089] Detecting anomaly anchor nodes:
[0090] After the anchor node is powered on successfully, first set its scanning time interval and scanning time window to 10.24 s, and the broadcast time interval to 150 ms. Then the anchor node enters the hidden Markov model modeling state. In this state, when the broadcast time interval arrives, the anchor node broadcasts its own beacon packet to help the surrounding anchor nodes establish a hidden Markov model. In other time periods, the anchor node arranges the received beacon packets in a sequential sequence. After scanning enough beacon packets (10,000 beacon packets are taken in this embodiment), the first 8,000 sequences of this sequence are used to establish three hidden Markov models through the Baum-Welch algorithm, and then the latter 2,000 sequences are divided into subsequences with a step size of 8, and the probabilities of these subsequences appearing under the three hidden Markov models are calculated through the forward algorithm, and then the lowest probability under the three hidden Markov models is recorded.
[0091] After the anchor node modeling and probability calculation are completed, the anchor node operates normally. First, set the scanning time interval to 10.24 s, the scanning time window to 250 ms, and the broadcast time interval for positioning to 150 ms. When the broadcast time interval arrives, the anchor node regularly broadcasts beacon packets. When the scanning time interval of the anchor node arrives, the anchor node scans for 250 ms according to the set scanning time window and receives multiple beacon packets. After the scanning is completed, the anchor node obtains the sequential sequence of the received data packets in chronological order, and obtains the probabilities of the sequence appearing under three hidden Markov models through the forward algorithm. If the probability of the sequence is less than the lowest probability under two hidden Markov models, then it is considered that the received beacon packet sequence is abnormal, and the anchor node adds the abnormality to its own beacon packet and reports the abnormality.
[0092] The cloud server performs security detection on suspicious anchor nodes:
[0093] The cloud server records the beacon packet sequences uploaded by the anchor nodes and the corresponding received signal strength RSSI values, and then locates each anchor node during security detection. Detect the anchor nodes with large positioning errors through the Grubbs test method and regard them as suspicious anchor nodes;
[0094] After detecting the suspicious anchor nodes, it is necessary to exclude these suspicious anchor nodes one by one. The cloud server re-locates the anchor nodes on the condition of excluding the suspicious anchor nodes one by one; if the positioning error ε of an anchor node during the positioning process i is not abnormal after passing the Grubbs test, then it is considered that the anchor node may be a normal anchor node, and a vote is taken on the excluded anchor nodes, and it is considered that the excluded anchor nodes are very likely to be abnormal anchor nodes under attack; after re-locating all the anchor nodes, according to the voting results, determine that the anchor nodes with a voting result of 0 and judged to be possibly normal anchor nodes during the positioning process are normal anchor nodes, and the rest of the anchor nodes are abnormal anchor nodes.
Claims
1. A security detection method for a BLE Beacon indoor positioning system, characterized in that It includes the following steps: S1: The anchor node enters the scanning state to obtain the beacon packet sequence for modeling and probability calculation; S2: Divide the obtained beacon packet sequence into a training set and a validation set, establish a hidden Markov model using the training set, and calculate the lowest probability of the sequence under the hidden Markov model using the validation set; S3: The anchor node broadcasts beacon packets at a set broadcast time interval, and after reaching the scanning time interval, receives the beacon packets of other anchor nodes and arranges them into a sequence in the order of reception time; S4: According to the sequence obtained in step S3, calculate the lowest probability of the sequence under the hidden Markov model, compare the calculated lowest probability with the lowest probability obtained from the validation set in step S2, and determine whether the scanning is abnormal. If it is abnormal, go to step S5; S5: Upload the abnormal beacon packets to the cloud server. When the cloud server receives the abnormal beacon packets or reaches the security detection time interval, perform security detection, and detect the abnormal anchor nodes attacked in the beacon packets through the consistency check method; In step S2, the hidden Markov model is represented as λ=(A,B,π), and the establishment method is: Under the condition of random assignment λ = (A, B, π), obtain the probability P t that the observation sequence TO = {o t+1 , o i} transitions from state x j to x t,ij P t,ij = π(i) * b i (o t ) * a i (j) * b j (o t+1 ) (1) Re-estimate the values of A, B, and π, as shown in equations 2, 3, and 4: where a i (j) * , b i (j) * and π(i) * are the values in matrices A, B, π, and finally a new parameter λ = (A * , B * , π * ) is obtained. After that, the above steps are repeated until the values of A, B, and π converge, thus completing the establishment of the hidden Markov model. A total of three hidden Markov models are established.
2. The security detection method for a BLE Beacon indoor positioning system according to claim 1, wherein The calculation method of the lowest probability of the sequence under the hidden Markov model in step S2 is: Divide the validation set VO into multiple subsequences with a length of k, and calculate the lowest probability of each sequence under the three hidden Markov models. The calculation method is: Obtain the probabilities of each hidden state at the initial moment, and obtain the probabilities of each hidden state at time t through recursion, then the probability of the observation sequence can be obtained. The calculation formula is as shown in equations 5, 6, and 7: P(x i ,o1|λ) = π i *b i (o1) (5) According to the calculation results, obtain the lowest probability of each sequence under the three hidden Markov models.
3. The security detection method for a BLE Beacon indoor positioning system according to claim 1, characterized in that, The calculation method of the lowest probability of the sequence under the hidden Markov model in step S4 is: Divide the beacon packet sequence obtained by scanning into multiple subsequences with a step size of k, and calculate the lowest probability of these subsequences under the three hidden Markov models respectively.
4. The security detection method for a BLE Beacon indoor positioning system according to claim 3, wherein, The method for determining whether the scanning is abnormal in step S4 is: Compare the lowest probabilities of the calculated subsequences under the three hidden Markov models with the three lowest probabilities obtained from the validation set VO in step S2. If the lowest probabilities of two or more subsequences under the hidden Markov models are lower than the lowest probabilities of the validation set VO under the corresponding hidden Markov models, it is considered that the scanning finds an abnormality.
5. A security detection method for a BLE Beacon indoor positioning system according to claim 1, characterized in that, The beacon packets in step S5 include: the UUID of the anchor node, whether the modeling is completed, whether an abnormality is found, and the UUID and RSSI values of the neighbor anchor nodes in the current scanning stage.
6. The security detection method for a BLE Beacon indoor positioning system according to claim 1, characterized in that The method for security detection in step S5 is: The cloud server records the beacon packet sequence uploaded by the anchor nodes and the corresponding received signal strength indication (RSSI) values, and then treats each anchor node as a node to be located. During security detection, each anchor node is located, and the anchor nodes with large positioning errors are detected through the Grubbs test method and regarded as suspicious anchor nodes; The cloud server relocates the anchor nodes one by one under the condition of excluding the suspicious anchor nodes; If the positioning error of a certain anchor node is not abnormal after passing the Grubbs test during the positioning process, then it is considered that the anchor node may be a normal anchor node, and a vote is conducted on the excluded anchor nodes, believing that the excluded anchor nodes are very likely to be abnormal anchor nodes that have been attacked; after relocating all the anchor nodes, according to the voting results, the anchor nodes with a voting result of 0 and judged to be possibly normal anchor nodes during the positioning process are determined to be normal anchor nodes, and the rest of the anchor nodes are abnormal anchor nodes.