[0025] In order to make the objectives, technical solutions, and advantages of the present invention clearer, the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0026] Combine figure 1 with figure 2 As shown, a Bluetooth positioning method based on indoor map information includes the following steps:
[0027] S1. Import the flat map of the indoor area into the Bluetooth location server, mark out the room wall and door information in the page through the page, submit the marked information to the background database, and store it in different sub-areas in the form of a vertex array. Among them, a, b, c, d, e, f, and g are the sub-regions, the walls surrounding each sub-region are walls, and the “line segment” set on the “wall” is the “door”.
[0028] Specifically, the information of the wall of the room in the area is described in the form of polygonal vertices. For the convenience of subsequent calculations, the wall containing the curved surface is not described directly, and the polygonal approximation is adopted. The different sub-areas in a large area are stored in the form of an array. For each sub-area, the description of the wall is as follows:
[0029] (P 1 ,P 2 ,...,P n ),
[0030] Each of them (P x ,P x+1 ) Represents a wall. The door of each sub-area is described in the form of a line segment. Since each sub-area contains multiple doors, the storage structure is also an array, which is specifically described as:
[0031] [(P 1 ,P 2 ),(P 1 ,P 2 ),...,(P 1 ,P 2 )],
[0032] For each (P 1 ,P 2 ) Has the following constraints, it should be defined by (P x ,P x+1 ) Indicates that the door is opened on the corresponding wall.
[0033] S2, the Bluetooth positioning base station receives the Bluetooth tag data and sends it to the Bluetooth location server, and the Bluetooth location server calculates the spatial position coordinates of each tag through the RSSI positioning principle. Calculate the spatial position information of each tag based on the RSSI positioning principle, and can set 2D or 3D mode. If there is a single base station in the area, the X, Y two-dimensional coordinate information will be returned; if there are multiple Bluetooth positioning base stations in the area, the X, Y, Z three-dimensional coordinate information of the Bluetooth tag will be returned.
[0034] S3. The Bluetooth location server judges whether the Bluetooth tag passes through the sub-area according to the spatial location coordinates of the Bluetooth tag and the stored indoor map information, and whether it moves normally through the door when passing through the sub-area, and if it passes through the sub-area but does not move through the door normally , Then correct the coordinates of the Bluetooth tag.
[0035] Specifically, record the coordinates P of the previous frame of the Bluetooth positioning tag and the sub-area S to which it belongs, obtain the coordinates P'of the Bluetooth tag of the current frame and the sub-area S'to which it belongs, and determine whether S and S'are the same. If they are the same, no correction is made. If they are different, judge whether the change from S to S'passes through the door. The specific logic is as follows. Line segments and sub-regions composed of coordinates P and coordinates P’ form a line selection [(P 1 ,P 2 ),(P 1 ,P 2 ),...,(P 1 ,P 2 )] Whether there is an intersection, if so, it is switched to other sub-areas through the door, indicating normal passage; otherwise, it is considered to be "through the wall" caused by the positioning error of the Bluetooth tag, and it needs to be corrected accordingly. One frame of data replaces this frame of data.
[0036] Specifically, the Bluetooth coordinate point P is used to determine which sub-area it belongs to. The specific logic is as follows. For each sub-area wall (P 1 ,P 2 ,...,P n ), through the traversal method, judge whether the coordinate point is in the polygon that it encloses, if it is, it means that P belongs to this sub-region.
[0037] S4: The indoor positioning application layer server requests the Bluetooth location server for the spatial location coordinates of the Bluetooth tag and the location information of the sub-area where the Bluetooth tag is located, for application layer services.
[0038] Specifically, the application layer server obtains the Bluetooth tag data of the location service. The Bluetooth tag data also includes its coordinate position in the area, and also includes its specific information in a certain sub-area in the map. The sub-area information is usually associated with each in the application layer. Room information. If the Bluetooth tag is bound to a specific person or thing, it can realize the corresponding business logic, such as electronic fence, cross-border alarm, location monitoring, and personnel search.
[0039] Such as image 3 As shown, a Bluetooth positioning system based on indoor map information includes a Bluetooth tag 10, a Bluetooth positioning base station 11, a Bluetooth location server 21, and an indoor positioning application layer server 22. The Bluetooth tag 10 and the Bluetooth positioning base station 11 are connected through Bluetooth signals. The positioning base station 11 and the Bluetooth position server 21 are connected through a wired network and communicate with the TCP/IP protocol; the Bluetooth position server 21 is networked with the indoor positioning application layer server 22 and communicates with the Http protocol; the Bluetooth position server 21 is configured with marked room walls and doors The indoor area plan map of the information detects the spatial position coordinates of the Bluetooth tag 10. When the sub-area of the Bluetooth tag 10 changes from the previous frame, and the sub-area is passed through the wall, the previous frame of data is used Replace this frame of data.
[0040] Such as Figure 4 As shown, the algorithm flow of the Bluetooth positioning system of the present invention based on the indoor map to correct Bluetooth tag data includes the following steps:
[0041] S31, the Bluetooth location server loads the indoor map annotation information, and then enters step S32;
[0042] S32, the Bluetooth location server obtains a frame of Bluetooth tag positioning data from the Bluetooth positioning base station, and then enters step S33;
[0043] S33, the Bluetooth location server calculates the sub-area where the Bluetooth tag data is located, and then proceeds to step S34;
[0044] S34: The Bluetooth location server judges whether the acquired frame of Bluetooth tag positioning data is the first frame of data, if yes, go to step S38, if not, go to step S35;
[0045] S35, comparing the positioning data of the current frame with the positioning data of the previous frame, whether to switch sub-regions, if yes, go to step S36, if not, go to step S38;
[0046] S36, whether the door passes through the sub-area, if yes, go to step S37, if not, go to step S38;
[0047] S37: Correct the positioning data of the Bluetooth tag, replace the data of the previous frame with the data of the previous frame, and then proceed to step S38;
[0048] S38, Bluetooth tag location data storage.
[0049] The above are only preferred specific embodiments of the present invention, but the protection scope of the present invention is not limited to this. Any person skilled in the art can easily think of changes or changes within the technical scope disclosed by the present invention. All replacements shall be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.