Disclosure of Invention
The invention aims to provide an indoor positioning method and system based on UWB (ultra wide band), which solve the problems of complex base station arrangement, high construction difficulty, insufficient positioning precision and mutual conflict between UWB signals.
In order to achieve the purpose, the invention adopts the following technical scheme:
an indoor UWB-based positioning method, comprising:
arranging a plurality of base stations according to the positioning requirement;
broadcasting a message to the base station by the label;
when the base station receives the message, judging whether the base station sets a white list for the label;
if the base station does not set a white list for the label, further judging whether the state of the label is positioned; if the state of the label is not positioned, the base station uploads the message to a positioning server; after receiving the message, the positioning server randomly selects at least three base stations to set a white list for the label, wherein the at least three base stations are base stations with the white lists;
if the base station sets a white list for the label, the base station sends a return command to the label, calculates the distance between the base station and the label and uploads the distance to a positioning server;
and the positioning server calculates the position of the label according to the distance between the base station with the white list and the label, so as to realize the positioning of the label.
Further, the positioning server calculates the position of the tag according to the distance between the base station and the tag, and after the positioning of the tag is achieved, the method further includes:
the positioning server determines whether the base station with the white list is the base station closest to the label according to the calculated position of the label;
if the base station with the white list is not the base station closest to the label, the positioning server reselects at least three base stations which are positioned near the label and can perform positioning as the base stations with a new white list;
and the positioning server recalculates the position of the label according to the distance between the base station with the new white list and the label, so as to realize the optimization of the label positioning.
Further, the recalculating, by the location server, the location of the tag according to the distance between the base station on which the new white list is set and the tag includes:
if the recalculation of the position of the label fails, the positioning server selects at most three base stations different from the base station with the new white list, replaces one of the base stations with the new white list in sequence, and if the positioning is successful, optimizes the positioning of the label and stops the replacement.
Further, the sequentially replacing one of the base stations setting the new white list further includes:
if the positioning still fails after the three base stations are replaced in sequence, the optimization fails, the positioning server selects the base station with the white list for calculation, and the position of the label is calculated according to the distance between the base station with the white list and the label, so that the positioning of the label is realized.
Further, the determining whether the state of the tag is located includes:
the label judges according to the number of received commands sent by the base station, and if the number of the received commands is not less than three, the label is set to be positioned;
if the number of received replies is less than three, the state of the tag is set to be not positioned.
Further, the determining whether the state of the tag is located further includes:
and if the state of the label is positioned, the base station discards the message, does not upload the message to the positioning server, and simultaneously does not send a command back to the label.
In order to achieve the above object, the present invention further provides an indoor positioning system based on UWB, comprising:
a plurality of base stations, one or more tags, at least one location server; the base station is communicated with the tag through a UWB radio frequency signal, and the base station is connected with the positioning server through a wireless or wired network; wherein the content of the first and second substances,
the tag is configured to broadcast a message to the base station;
the base station is configured to receive the message broadcasted by the label and judge whether the base station sets a white list for the label;
if the base station does not set a white list for the tag, the base station is further configured to determine whether the state of the tag is located; if the state of the label is not positioned, the base station uploads the message to a positioning server;
the positioning server is configured to receive the message uploaded by the base station, and randomly select at least three base stations to set a white list for the label, wherein the at least three base stations are base stations with the white list;
if the base station sets a white list for the label, the base station is further configured to send a reply to the label, calculate the distance between the base station and the label, and upload the distance to a positioning server;
and the positioning server is further configured to calculate the position of the label according to the distance between the base station with the white list and the label, so as to realize the positioning of the label.
Further, the positioning server is configured to determine whether the base station setting the white list is a base station closest to the tag according to the calculated position of the tag;
if the base station with the white list is not the base station closest to the label, the positioning server reselects at least three base stations which are positioned near the label and can perform positioning as the base stations with a new white list;
and the positioning server recalculates the position of the label according to the distance between the base station with the new white list and the label, so as to realize the optimization of the label positioning.
Further, the positioning server is configured to recalculate the position of the tag according to the distance between the base station setting the new white list and the tag, including:
if the recalculation of the position of the label fails, the positioning server selects at most three base stations different from the base station with the new white list, replaces one of the base stations with the new white list in sequence, and if the positioning is successful, optimizes the positioning of the label and stops the replacement;
if the positioning still fails after the three base stations are replaced in sequence, the optimization fails, the positioning server selects the base station with the white list for calculation, and the position of the label is calculated according to the distance between the base station with the white list and the label, so that the positioning of the label is realized.
Further, the tag is configured to perform judgment according to the number of received replies sent by the base station, and if the number of the received replies is not less than three, the tag is set to be in a located state;
if the number of received replies is less than three, setting the state of the tag as not-positioned;
the base station is further configured to discard the message and not upload the message to the positioning server if the state of the tag is determined to be positioned, and the base station does not send a command back to the tag.
The invention has the following beneficial effects:
the invention provides an indoor positioning method and system based on UWB technology, which adopts a TWR (Two-Way Ranging) Ranging method, and a positioning server calculates the position of a label according to the distance between one or more base stations and the label to realize the positioning of the label. The technical scheme of the invention has no complex requirements on the arrangement of the base stations, has low construction difficulty, can finish the positioning of the label in the shortest time by setting the white list base station for the label, and simultaneously effectively avoids the mutual conflict between UWB signals. In addition, the technical scheme of the invention can adjust the white list base station according to the distance between the base station with the white list and the label, optimize the positioning network and ensure the positioning precision.
Detailed Description
Various aspects and features of the present application are described herein with reference to the drawings.
It will be understood that various modifications may be made to the embodiments of the present application. Accordingly, the foregoing description should not be construed as limiting, but merely as exemplifications of embodiments. Those skilled in the art will envision other modifications within the scope and spirit of the application.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and, together with a general description of the application given above and the detailed description of the embodiments given below, serve to explain the principles of the application.
These and other characteristics of the present application will become apparent from the following description of preferred forms of embodiment, given as non-limiting examples, with reference to the attached drawings.
It should also be understood that, although the present application has been described with reference to some specific examples, a person of skill in the art shall certainly be able to achieve many other equivalent forms of application, having the characteristics as set forth in the claims and hence all coming within the field of protection defined thereby.
The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely exemplary of the application, which can be embodied in various forms. Well-known and/or repeated functions and constructions are not described in detail to avoid obscuring the application of unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present application in virtually any appropriately detailed structure.
The existing indoor positioning technology based on UWB generally has the problems of complex base station arrangement, high construction difficulty, insufficient positioning precision and mutual conflict between UWB signals.
In view of this, the embodiments of the present invention provide an indoor positioning method based on UWB, which can complete positioning of tags in the shortest time, and effectively avoid mutual collision between UWB signals. Fig. 1 is a schematic flow chart of an indoor UWB-based positioning method disclosed in the present invention, and as shown in fig. 1, the present invention provides an indoor UWB-based positioning method, including:
arranging a plurality of base stations according to the positioning requirement;
broadcasting a message to the base station by the label;
when the base station receives the message, judging whether the base station sets a white list for the label;
if the base station does not set a white list for the label, further judging whether the state of the label is positioned; if the state of the label is not positioned, the base station uploads the message to a positioning server; after receiving the message, the positioning server randomly selects at least three base stations to set a white list for the label, wherein the at least three base stations are base stations with the white lists;
if the base station sets a white list for the label, the base station sends a return command to the label, calculates the distance between the base station and the label and uploads the distance to a positioning server;
and the positioning server calculates the position of the label according to the distance between the base station with the white list and the label, so as to realize the positioning of the label.
Fig. 3 is a schematic diagram of a positioning network before network optimization of the indoor UWB-based positioning method disclosed by the present invention, and the positioning method of the present invention is described in detail below with reference to fig. 1 and 3. Taking fig. 3 as an example, the positioning network of fig. 3 is configured with 16 base stations according to the positioning requirement;
when the label enters a coverage area of a base station for the first time, the label sleeps for a period, and broadcasts a first frame message to the base station after awakening, and all base stations 1-16 can receive the message;
when the base stations 1 to 16 receive the message, it is determined whether a white list is set for the tag, and since the tag in this embodiment enters the area for the first time, no base station sets a white list for the tag;
therefore, all base stations 1 to 16 further determine the positioning state of the tag, and if the positioning state in the tag uplink message is not positioned, all base stations 1 to 16 upload the message to the positioning server; after receiving the first frame message of the tag, the positioning server randomly selects at least three base stations to set a white list for the tag, in this embodiment, four base stations are selected, as shown in fig. 3, the white list is set for the tag at four base stations, namely, base station 3, base station 4, base station 7, and base station 8, and is set in the base station parameters, and the four base stations are used as base stations for setting the white list;
then, after the label is awakened next time, broadcasting a second frame message to all base stations, wherein all the base stations 1-16 can receive the message; when the base station 1-16 receives the message, judging whether a white list is set for the label or not; the method comprises the steps that a first frame message sent by a label enables a positioning server to randomly select four base stations and set a white list for the label;
therefore, the base stations 3, 4, 7 and 8 have set white lists and can participate in the positioning process, and the four base stations with the white lists send the return command to the tag, calculate the distance between the base stations and the tag and upload the distance to the positioning server;
and the positioning server calculates the position of the label according to the distance between the base station with the white list and the label, so that the label is positioned in the shortest time.
Because the white list is randomly set, accurate positioning cannot be achieved at one time in some cases, in order to improve the positioning accuracy, the present invention further provides an optimization method of a positioning network, fig. 2 is a schematic diagram of a network optimization flow of the indoor positioning method based on UWB disclosed by the present invention, as shown in fig. 2, after the positioning of the tag is achieved, the positioning method of the present invention further includes:
the positioning server determines whether the base station with the white list is the base station closest to the label according to the calculated position of the label; if the base station for setting the white list is far away and is not the optimal base station which can participate in the label positioning, entering an optimization process; if the base station with the white list is the base station closest to the label, optimization is not carried out;
continuing to take fig. 3 as an example, since the base station 3, the base station 4, the base station 7, and the base station 8 are base stations participating in positioning and setting a white list, the communication distance between the base stations and the tag is relatively long, and there may be problems of poor accuracy and instability in positioning, the positioning server therefore reselects at least three base stations which are located near the tag and can perform positioning as base stations setting a new white list, fig. 4 is a schematic diagram of a positioning network after network optimization of the UWB-based indoor positioning method disclosed in the present invention, as shown in fig. 4, in this embodiment, the positioning server selects the base station 6, the base station 7, the base station 10, and the base station 11 as base stations setting a new white list;
and the positioning server recalculates the position of the label according to the distance between the base station with the new white list and the label, so as to realize the optimization of label positioning.
In general, the optimization of the positioning of the tag is successful, but in some special cases, because the communication is bidirectional, the tag sends data to the base station, and the data can be received by the base station, but the data tag sent by the base station cannot be received, which may cause the failure of the positioning optimization. Further, the recalculating, by the location server, the location of the tag according to the distance between the base station on which the new white list is set and the tag includes:
if the recalculation of the position of the label fails, the positioning server selects at most three base stations different from the base station with the new white list, replaces one of the base stations with the new white list in sequence, and if the positioning is successful, optimizes the positioning of the label and stops the replacement.
Further, the sequentially replacing one of the base stations setting the new white list further includes:
if the positioning still fails after the three base stations are replaced in sequence, the optimization fails, the positioning server selects the base station with the white list for calculation, and the position of the label is calculated according to the distance between the base station with the white list and the label, so that the positioning of the label is realized.
In the positioning process of the embodiment of the invention, whether the state of the label is positioned is judged according to the number of the received commands sent by the base station, and if the number of the received commands is not less than three, the state of the label is positioned; if the number of received replies is less than three, the tagged state is not located.
The number of whitelists and callbacks is set to be not less than three here, which is determined by trilateration algorithms that are not within the teachings of the present invention. In the embodiment of the invention, the number of the white lists and the number of the callback are set to be 4, so that one callback does not exist, and the positioning can be accurately carried out. However, the number of the white list and the number of the round orders are not too large, and are set to be 4, only the round orders of 4 base stations need to be waited, and the round orders of 5 base stations need to be waited if the number of the round orders is 5. The time for realizing one-time positioning of the label is prolonged, and the more white lists are set, the larger the power consumption is.
Further, the determining whether the state of the tag is located further includes:
if the state of the label is positioned, the base station discards the message, does not upload the message to the positioning server, and simultaneously does not send a command back to the label, so that the network data flow can be effectively reduced.
In order to achieve the above object, the present invention further provides an indoor positioning system based on UWB, comprising:
a plurality of base stations, one or more tags, at least one location server; the base station is communicated with the tag through a UWB radio frequency signal, and the base station is connected with the positioning server through a wireless or wired network; wherein the content of the first and second substances,
the tag is configured to broadcast a message to the base station;
the base station is configured to receive the message broadcasted by the label and judge whether the base station sets a white list for the label;
if the base station does not set a white list for the tag, the base station is further configured to determine whether the state of the tag is located; if the state of the label is not positioned, the base station uploads the message to a positioning server;
the positioning server is configured to receive the message uploaded by the base station, and randomly select at least three base stations to set a white list for the label, wherein the at least three base stations are base stations with the white list;
if the base station sets a white list for the label, the base station is further configured to send a reply to the label, calculate the distance between the base station and the label, and upload the distance to a positioning server;
and the positioning server is further configured to calculate the position of the label according to the distance between the base station with the white list and the label, so as to realize the positioning of the label.
Further, the positioning server is configured to determine whether the base station setting the white list is a base station closest to the tag according to the calculated position of the tag;
if the base station with the white list is not the base station closest to the label, the positioning server reselects at least three base stations which are positioned near the label and can perform positioning as the base stations with a new white list;
and the positioning server recalculates the position of the label according to the distance between the base station with the new white list and the label, so as to realize the optimization of the label positioning.
Further, the positioning server is configured to recalculate the position of the tag according to the distance between the base station setting the new white list and the tag, including:
if the recalculation of the position of the label fails, the positioning server selects at most three base stations different from the base station with the new white list, replaces one of the base stations with the new white list in sequence, and if the positioning is successful, optimizes the positioning of the label and stops the replacement;
if the positioning still fails after the three base stations are replaced in sequence, the optimization fails, the positioning server selects the base station with the white list for calculation, and the position of the label is calculated according to the distance between the base station with the white list and the label, so that the positioning of the label is realized.
Further, the tag is configured to perform judgment according to the number of received replies sent by the base station, and if the number of the received replies is not less than three, the tag is set to be in a located state;
if the number of received replies is less than three, setting the state of the tag as not-positioned;
the base station is further configured to discard the message and not upload the message to the positioning server if the state of the tag is determined to be positioned, and the base station does not send a command back to the tag.
The above embodiments are only exemplary embodiments of the present invention, and are not intended to limit the present invention, and the scope of the present invention is defined by the claims. Various modifications and equivalents may be made by those skilled in the art within the spirit and scope of the present invention, and such modifications and equivalents should also be considered as falling within the scope of the present invention.