Mobile device indoor positioning method and system using optical synchronization ultrasonic one-way ranging
By employing the optical-synchronous ultrasonic one-way ranging method, and utilizing permission judgment, time slice numbering, and polling queue control, combined with infrared light and ultrasonic beam angle constraints, the problem of multi-device concurrent positioning in a centerless and GNSS-free environment was solved, achieving high-precision, low-latency indoor positioning and improving the system's scalability and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU ETESN INFORMATION TECH CO LTD
- Filing Date
- 2025-11-17
- Publication Date
- 2026-07-21
AI Technical Summary
In complex indoor environments without a central location or GNSS, existing ultrasonic/optical cooperative positioning solutions struggle to simultaneously achieve high-quality single-trip ranging, low latency, and scalable absolute coordinate output. In particular, they are unable to meet the requirements of high accuracy, low latency, stable refresh, and scalability under conditions of reflection obstruction and multiple concurrent devices.
Three optically synchronized ultrasonic one-way ranging methods are adopted. By performing permission judgment, time slice numbering and polling queue control on the mobile device, combined with the beam angle constraint of infrared light and ultrasonic waves, orderly access of devices and signal synchronization are achieved. The one-way flight time is obtained by using the local timing technology of the positioning base station, a two-dimensional plane distance set is established, and the base station coordinates that meet the conditions are selected as the positioning result.
It significantly improves the system's scalability and positioning stability, reduces positioning latency, and achieves high-precision, low-latency indoor positioning, meeting the positioning needs of mobile devices in industrial scenarios.
Smart Images

Figure CN121454537B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of indoor positioning technology, and specifically relates to an indoor positioning method and system for mobile devices using optically synchronized ultrasonic one-way ranging. Background Technology
[0002] Indoor Positioning System (IPS) refers to a technological system that, in indoor environments (such as factory workshops, warehouses, underground parking garages, and office buildings) with no GNSS (such as GPS and BeiDou) signal coverage or severely attenuated signals, uses various sensors, wireless communication technologies, or signal propagation characteristics to obtain the absolute coordinates or relative position of mobile devices (such as AGVs, drones, and handheld terminals) to achieve positioning, tracking, and navigation. Its core requirement is to balance positioning accuracy, real-time performance (refresh rate), stability, and scalability in complex indoor scenarios to meet the refined operational needs of industrial production, logistics warehousing, and public services (such as precise AGV docking, drone inspection path planning, and personnel and material tracking).
[0003] Common indoor positioning solutions include UWB, RF+ultrasonic TDoA, and pure vision / SLAM. Traditional ultrasonic echo ranging relies on target reflection, which is susceptible to material properties and multipath effects, and suffers from significant round-trip attenuation. Systems using centralized time slots / polling experience increased latency and limited throughput in scenarios with multiple devices and base stations. Furthermore, complex indoor environments present obstructions and reflections, making it difficult to distinguish direct waves. Existing systems often mitigate these issues with time-domain thresholds or centralized scheduling, but in field conditions without central control / global clocks and where devices can join or leave at any time, it remains difficult to simultaneously achieve high accuracy, low latency, stable refresh rates, and scalability. Summary of the Invention
[0004] The technical problem to be solved by this invention is that in complex indoor environments without a center or GNSS, existing ultrasonic / optical cooperative positioning schemes are difficult to simultaneously obtain high-quality one-way ranging and output stable, low-latency, and scalable absolute coordinates under conditions of reflection obstruction and multiple concurrent devices.
[0005] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: Firstly, three indoor positioning methods for mobile devices using optically synchronized ultrasonic one-way ranging are proposed: The first method for indoor positioning of mobile devices using optically synchronized ultrasonic one-way ranging is as follows: On each mobile device, the following steps are performed: S1: Determine if the mobile device has obtained positioning permission; S2: If positioning permission has been obtained, execute the positioning task, simultaneously executing task A during the positioning task execution; At the end of the positioning task, execute tasks B and C sequentially, then return to S1; Task A includes: establishing an application list and writing the application list into the permission allocation response; Task B includes: broadcasting the permission allocation response, clearing the permission status, and outputting positioning coordinates; Task C includes: broadcasting a positioning permission application; If positioning permission has not been obtained, broadcast a positioning permission application and return to S1; Executing the positioning task includes the following steps: transmitting infrared light and ultrasonic waves to the positioning base station; The infrared light contains the device number of the mobile device, and the infrared beam angle is ≤ the ultrasonic beam angle; The positioning base station is used to detect when the infrared light arrives... The timing begins at the moment the ultrasonic wave arrives and ends at the moment it arrives, and feedback information is sent to each mobile device within the wireless signal coverage area. The feedback information includes: the one-way flight time of the ultrasonic wave, base station coordinates, and device ID; the one-way flight time of the ultrasonic wave = timing end time - timing start time. It checks if the device ID in each feedback message matches the device ID of the mobile device; if they do not match, the feedback message is discarded; if they match, the feedback message is retained. It obtains the two-dimensional planar distance between the mobile device and the positioning base station corresponding to each feedback message, and establishes a set of planar distances. It determines whether a two-dimensional planar distance ≤ a first threshold can be selected from the set of planar distances; if so, the base station coordinates of the positioning base station corresponding to the minimum value among the selected two-dimensional planar distances are used as the positioning coordinates of the mobile device; if not, the positioning coordinates of the mobile device are obtained through trilateration.
[0006] The second method for indoor positioning of mobile devices using optically synchronized ultrasonic one-way ranging is as follows: S1: Number each mobile device according to the order in which they are started; S2: Divide the duration of one second on the time axis into multiple consecutive time slices of equal length, and number the time slices cyclically according to the number of mobile devices; S3: Send a control signal and the current time slice number to each mobile device; the control signal is used to control the mobile device to determine whether its number matches the current time slice number. If they match, broadcast a feedback signal and execute the positioning task. At the end of the positioning task, broadcast a task end signal. If they do not match, enter a waiting state; S4: When a task end signal is received or no feedback signal is received, jump to the next time slice and return to S3; when a mobile device is added or removed indoors, return to S1; Executing the positioning task includes the following steps: transmitting infrared light and ultrasonic waves to the positioning base station; the infrared light contains the device number of the mobile device, and the infrared... The beam angle is less than or equal to the ultrasonic beam angle. The positioning base station is used to start timing when the infrared light arrives and end timing when the ultrasonic wave arrives, and to send feedback information to each mobile device within the wireless signal coverage area. The feedback information includes: the one-way flight time of the ultrasonic wave, the base station coordinates, and the device number. The one-way flight time of the ultrasonic wave = the end time of timing - the start time of timing. It is determined whether the device number in each feedback information is consistent with the device number of this mobile device. If they are inconsistent, the feedback information is discarded. If they are consistent, the feedback information is retained. The two-dimensional plane distance between this mobile device and the positioning base station corresponding to each feedback information is obtained, and a set of plane distances is established. It is determined whether a two-dimensional plane distance ≤ a first threshold can be selected from the set of plane distances. If so, the base station coordinates of the positioning base station corresponding to the minimum value of the selected two-dimensional plane distances are used as the positioning coordinates of this mobile device. If not, the positioning coordinates of this mobile device are obtained through trilateration.
[0007] The third method for indoor positioning of mobile devices using optically synchronized ultrasonic one-way ranging is as follows: Each mobile device performs the following steps: S1: Broadcasts a channel occupancy request; the channel occupancy request includes the device number of the mobile device; S2: Establishes a polling queue based on the priority of the positioning task and / or the time sequence of the channel occupancy requests; S3: Obtains the waiting time based on the channel duration and the position of the mobile device's channel number in the polling queue; S4: After the waiting time expires, executes the positioning task and broadcasts the positioning task start time. After the positioning task is completed, the device number of the mobile device is moved to the end of the polling queue, and the process returns to S1. Executing the positioning task includes the following steps: transmitting infrared light and ultrasonic waves to the positioning base station; the infrared light contains the device number of the mobile device, and the infrared beam angle is ≤ the ultrasonic beam angle; the positioning base station is used to detect the arrival time of the infrared light. The timing process begins and ends at the arrival time of the ultrasonic wave, and feedback information is sent to each mobile device within the wireless signal coverage area. The feedback information includes: the one-way flight time of the ultrasonic wave, base station coordinates, and device ID; the one-way flight time of the ultrasonic wave = timing end time - timing start time. The system checks if the device ID in each feedback message matches the device ID of the mobile device. If they do not match, the feedback message is discarded; if they match, it is retained. The system obtains the two-dimensional planar distance between the mobile device and the positioning base station corresponding to each feedback message, and establishes a set of planar distances. It then determines whether a two-dimensional planar distance ≤ a first threshold can be selected from the set. If so, the base station coordinates of the positioning base station corresponding to the minimum selected two-dimensional planar distance are used as the positioning coordinates of the mobile device; otherwise, the positioning coordinates of the mobile device are obtained through trilateration.
[0008] Secondly, it provides three types of indoor positioning systems for mobile devices using optically synchronized ultrasonic one-way ranging: The first type of indoor positioning system for mobile devices using optically synchronized ultrasonic one-way ranging includes: a positioning device installed on each mobile device and multiple fixed positioning base stations; the positioning device includes: an analysis module for determining whether the mobile device has obtained positioning permission; a first task execution module for executing a positioning task when the mobile device has obtained positioning permission; a second task execution module for synchronously executing task A during the execution of the positioning task; task A includes: establishing an application list and writing the application list into a permission allocation response; a third task execution module for sequentially executing tasks B and C when the positioning task ends; task B includes: broadcasting a permission allocation response, clearing the permission status, and outputting positioning coordinates; task C includes: broadcasting a positioning permission application; if positioning permission is not obtained, broadcasting a positioning permission application; the task execution module is used to broadcast a positioning permission application when the mobile device has not obtained positioning permission; the operation control module is used to control the analysis module to work after executing tasks B and C or after broadcasting a positioning permission application when the mobile device has not obtained positioning permission; the first task execution module includes: an infrared light transmitter for transmitting infrared light to the positioning base stations; the infrared light contains the device number of the mobile device; and an ultrasonic transmitter for transmitting... Ultrasonic wave; infrared beam angle ≤ ultrasonic beam angle; information processing unit, used to determine whether the device number in each feedback message is consistent with the device number of this mobile device; if inconsistent, discard the feedback message; if consistent, retain the feedback message; numerical calculation unit, used to obtain the two-dimensional planar distance between this mobile device and the positioning base station corresponding to each feedback message, and establish a planar distance set; analysis unit, used to determine whether two-dimensional planar distances ≤ a first threshold can be filtered from the planar distance set; first coordinate acquisition unit, used to, under the condition that two-dimensional planar distances ≤ a first threshold can be filtered from the planar distance set, calculate the selected two-dimensional planar distances... The minimum value of the location base station corresponding to the location base station is used as the location coordinate of this mobile device; the second coordinate acquisition unit is used to obtain the location coordinate of this mobile device by trilateration when a two-dimensional plane distance ≤ the first threshold cannot be selected from the plane distance set; the location base station includes: a timer, used to start timing when the infrared light arrives and end timing when the ultrasonic wave arrives; an information transmission module, used to send feedback information to each mobile device within the wireless signal coverage area; the feedback information includes: the one-way flight time of the ultrasonic wave, the base station coordinates and the device number; the one-way flight time of the ultrasonic wave = the timer end time - the timer start time.
[0009] The second type of indoor positioning system for mobile devices using optically synchronized ultrasonic one-way ranging includes: a controller, a positioning device installed on each mobile device, and multiple fixed positioning base stations. The controller includes: a first numbering module for numbering each mobile device according to the order in which they are started; a second numbering module for dividing each second into multiple equal-length continuous time slices on a time axis and cyclically numbering the time slices according to the number of mobile devices; a signal transmitting module for sending a control signal and the current time slice number to each mobile device; the control signal controls the mobile device to determine whether its number matches the current time slice number; if they match, it broadcasts a feedback signal and executes a positioning task, broadcasting a task completion signal at the end of the positioning task; if they do not match, it enters a waiting state; a running control module is used to jump to the next time slice when a task completion signal is received or no feedback signal is received, and to control the signal transmitting module to work; when a mobile device is added or removed indoors, it controls the first numbering module to work. The positioning device includes: an infrared light transmitter for emitting infrared light to the positioning base stations; the infrared light contains the device number of the mobile device; and an ultrasonic transmitter for emitting ultrasonic waves to the positioning base stations; the infrared beam angle is ≤ the ultrasonic wave angle. The system includes: a bend angle; an information processing unit for determining whether the device number in each feedback message matches the device number of the mobile device; if they do not match, the feedback message is discarded; if they match, the feedback message is retained; a numerical calculation unit for obtaining the two-dimensional planar distance between the mobile device and the positioning base station corresponding to each feedback message, and establishing a set of planar distances; an analysis unit for determining whether a two-dimensional planar distance ≤ a first threshold can be selected from the set of planar distances; a first coordinate acquisition unit for using the base station coordinates of the positioning base station corresponding to the minimum value of the selected two-dimensional planar distance as the positioning coordinates of the mobile device, provided that a two-dimensional planar distance ≤ a first threshold can be selected from the set of planar distances; and a second coordinate acquisition unit for obtaining the positioning coordinates of the mobile device through trilateration, provided that a two-dimensional planar distance ≤ a first threshold cannot be selected from the set of planar distances; and a positioning base station including: a timer for starting timing when infrared light arrives and ending timing when ultrasonic waves arrive; and an information transmission module for sending feedback information to each mobile device within the wireless signal coverage area; the feedback information includes: the one-way flight time of the ultrasonic wave, the base station coordinates, and the device number; the one-way flight time of the ultrasonic wave = the end time of timing - the start time of timing.
[0010] The third type of indoor positioning system for mobile devices using optically synchronized ultrasonic one-way ranging includes: a positioning device installed on each mobile device and multiple fixed positioning base stations; the positioning device includes: a channel occupancy request module for broadcasting a channel occupancy request from the mobile device; the channel occupancy request contains the device number of the mobile device; a polling queue establishment module for establishing a polling queue according to the priority of the positioning task and / or the time sequence of the channel occupancy request; a waiting time acquisition module for acquiring the waiting time according to the channel duration and the position of the mobile device's channel number in the polling queue; a positioning task execution module for executing the positioning task after the waiting time expires and broadcasting the positioning task start time; and a operation control module for adjusting the device number of the mobile device to the end of the polling queue after the positioning task is completed and controlling the operation of the channel occupancy request module; the positioning task execution module includes: an infrared light transmitter for emitting infrared light to the positioning base stations; the infrared light contains the device number of the mobile device; an ultrasonic transmitter for emitting ultrasonic waves to the positioning base stations; the infrared beam angle is ≤ the ultrasonic beam angle; and an information processing unit for judging the device number in each feedback message and... The device IDs of the mobile devices are checked against each other. If they are inconsistent, the feedback information is discarded; if they are consistent, the feedback information is retained. A numerical calculation unit is used to obtain the two-dimensional planar distance between the mobile device and the positioning base station corresponding to each feedback information, and to establish a set of planar distances. An analysis unit is used to determine whether a two-dimensional planar distance ≤ a first threshold can be selected from the set of planar distances. A first coordinate acquisition unit is used to take the base station coordinates of the positioning base station corresponding to the minimum value of the selected two-dimensional planar distance as the positioning coordinates of the mobile device if a two-dimensional planar distance ≤ a first threshold can be selected from the set of planar distances. A second coordinate acquisition unit is used to obtain the positioning coordinates of the mobile device through trilateration if a two-dimensional planar distance ≤ a first threshold cannot be selected from the set of planar distances. The positioning base station includes: a timer, used to start timing when the infrared light arrives and end timing when the ultrasonic wave arrives; and an information transmission module, used to send feedback information to each mobile device within the wireless signal coverage area. The feedback information includes: the one-way flight time of the ultrasonic wave, the base station coordinates, and the device ID. The one-way flight time of the ultrasonic wave = the end time of timing - the start time of timing.
[0011] Compared with the prior art, the present invention has the following advantages and beneficial effects: 1. Three methods are employed to achieve orderly access for multiple devices: Method 1 uses a closed-loop scheduling logic of "location permission judgment, location permission request, and location permission allocation" (steps S1 and tasks A, B, and C). Mobile devices establish an application list, broadcast permission allocation responses, and request location permissions. Method 2 divides unit time into equal time slices and assigns time slice numbers. The order in which mobile devices execute location tasks is controlled by matching the time slice numbers with the mobile device numbers. Method 3 establishes a polling queue. The waiting time is determined based on the position of the mobile device in the polling queue, and location tasks are executed sequentially, thereby avoiding signal overlap and mutual interference between multiple devices. All three protection methods effectively avoid air interface collisions caused by multiple devices simultaneously emitting infrared / ultrasonic signals, significantly improving system scalability and supporting concurrent location of multiple mobile devices without affecting location stability.
[0012] 2. The positioning task utilizes infrared beam angle and ultrasonic beam angle constraints to prioritize the capture of direct waves and suppress multipath interference and false triggering caused by wall reflections at the physical level, significantly improving the effectiveness and reliability of feedback information. Relying on the local timing method of the positioning base station ("infrared light timing start point, ultrasonic timing end point"), and the ability for the mobile device to simultaneously receive feedback information from multiple base stations with a single transmission, the redundant overhead of centralized polling is avoided, significantly reducing positioning latency. By establishing a set of two-dimensional plane distances, it prioritizes filtering qualified two-dimensional plane distances and directly uses the corresponding base station coordinates as the positioning result, balancing the speed and stability of near-field positioning. When no distance is selected, coordinates are obtained through trilateration to ensure far-field positioning accuracy. Combined with the accurate input of feedback information such as base station number, timing duration, and base station coordinates, it ultimately achieves high precision, low latency, and high reliability for indoor positioning of mobile devices in GNSS-free environments, fully meeting the positioning needs of mobile robots, AGVs, and other equipment in industrial scenarios. Attached Figure Description
[0013] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating an indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging, as provided in Embodiment 1 of the present invention. Figure 2 This is a schematic diagram of the specific execution flow of the positioning task provided in Embodiment 1 of the present invention; Figure 3 Provided for Embodiment 1 of the present invention; Figure 4 This is a flowchart illustrating an indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging, as provided in Embodiment 2 of the present invention. Figure 5This is a flowchart illustrating an indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging, as provided in Embodiment 3 of the present invention.
[0014] The attached diagram shows the markings and corresponding component names: 1-Location base station; 2-Location device. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. The illustrative embodiments and descriptions of this invention are for illustrative purposes only and are not intended to limit the invention. The embodiments described below are some, but not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0016] In the following description, numerous specific details are set forth to provide a thorough understanding of the invention. However, it will be apparent to those skilled in the art that these specific details are not necessary to practice the invention. In other embodiments, well-known structures, materials, or methods are not specifically described to avoid obscuring the invention. Unless otherwise specified, the materials, instruments, and reagents used in the following embodiments are commercially available. Unless otherwise specified, the techniques used in the embodiments are conventional methods well known to those skilled in the art.
[0017] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0018] Example 1: A method for indoor positioning of mobile devices using optically synchronized ultrasonic one-way ranging is provided. This method is applicable to mobile device clusters consisting of multiple mobile devices and relies on positioning devices installed on the mobile devices and multiple positioning base stations fixedly installed on the indoor ceiling. The overall technical route is as follows: the positioning device emits infrared light and ultrasonic waves sequentially in each positioning cycle; the positioning base station calculates the one-way flight time of the positioning cycle locally, with the moment of receiving infrared light as the starting point and the moment of receiving ultrasonic waves as the ending point, and sends back the observation frame containing the base station number and the three-dimensional coordinates of the base station to the positioning device; the positioning device, based on environmental parameters such as temperature and humidity, eliminates the influence of the height difference between the base station and the device on the one-way flight time, and prioritizes "near base station direct acquisition" (when the device is located near the base station) or triangular positioning with the largest non-collinear area selection in the plane, and outputs absolute coordinates; wherein, the emission direction and beam angle of the synchronous light are in the same direction as the emission direction and beam angle of the ultrasonic waves, and the infrared beam angle is ≤ the ultrasonic beam angle, to ensure priority capture of direct waves and suppression of reflection and false triggering.
[0019] This method is executed on each mobile device. Figure 1 The following steps are shown: Step 1: Determine whether this mobile device has obtained location permission.
[0020] This method addresses indoor positioning scenarios without a central controller and involving multiple concurrent mobile devices. To ensure the orderliness, real-time performance, and reliability of positioning, a "unique authorization credential" mechanism is used to resolve resource contention issues related to the shared air interface. Specifically, positioning tasks require the positioning device to emit infrared and ultrasonic signals, and the positioning base station needs to transmit its one-way flight time via a wireless link. These signals rely on a shared air interface for transmission. Without authorization constraints, multiple mobile devices may emit signals simultaneously, leading to interference from superimposed infrared and ultrasonic signals, false triggering of the base station, or wireless packet conflicts, directly compromising the accuracy of ranging and the continuity of positioning. Positioning authorization, acting as an "air interface usage right authorization credential," only allows mobile devices with authorized positioning rights to perform positioning within their designated positioning period. Mobile devices without authorization are not allowed to perform positioning and remain in a waiting state to acquire authorization, thus preventing signal collisions at the source and improving channel utilization and positioning stability.
[0021] Therefore, each mobile device that wants to perform a location task needs to determine whether it has obtained location permission. The determination method is as follows: Step 1.1: Continuously scan other mobile devices for location permission requests or permission assignment responses broadcast at a fixed frequency.
[0022] Step 1.2: Scan Result Analysis. If no location permission requests or permission allocation responses are detected consecutively, set the permission status of this mobile device to "Location Permission Granted". If a permission allocation response is detected, read the request list in the permission allocation response; determine if the location permission request of this mobile device is at the top of the request list; if yes, set the permission status of this mobile device to "Location Permission Granted"; otherwise, set the permission status of this mobile device to "Location Permission Deferred".
[0023] It should be noted in advance that: 1. This method applies to the current location period. The method described in this embodiment was also executed in the previous location period. 2. Location permission must be obtained by the mobile device by initiating a location permission request. After completing the current location task, the mobile device that has obtained location permission must release the location permission and assign the location permission to the user (mobile device) in the next location period through a permission allocation response. Based on this explanation, the time corresponding to the location permission request in step 1.1 is the current location period, and the permission allocation response comes from the previous location period.
[0024] During the current positioning cycle, each mobile device scans the room at a fixed frequency (e.g., 10ms / time) via its 2.4G wireless module to see if any other devices have broadcast positioning permission requests or permission allocation responses. The purpose of broadcasting a positioning permission request is to declare its positioning needs to other devices in the room, while broadcasting a permission allocation response is to ensure that multiple devices perform positioning in an orderly manner, avoiding signal collisions. If no positioning permission request is detected consecutively (e.g., 3 times) (other mobile devices have not broadcast positioning permission requests), it means that only this mobile device currently has a positioning need, and in this case, this mobile device naturally obtains positioning permission. If no permission allocation response is detected consecutively (e.g., 3 times), it means that only one mobile device (i.e., this mobile device) is currently in the room. This is because the scheduling of positioning permissions relies on a closed loop of "request-allocation." As long as there are two or more mobile devices in the room, any mobile device that broadcasts a positioning permission request will inevitably be received by other mobile devices, and there will be no completely silent state; in this case, this mobile device will also naturally obtain positioning permission.
[0025] Furthermore, if a permission allocation response is detected, it indicates that a mobile device completed its location task in the previous location cycle, released location permissions, and assigned a user to the location permission via a broadcast allocation response. Therefore, it is necessary to read the request list from the permission allocation response (the request list is an "order table" for multiple mobile devices to perform location tasks; the method for creating the request list will be explained later). After reading the request list, it is necessary to determine whether the location permission request of this mobile device is at the head of the request list. If the location permission request of this mobile device is at the head of the request list, it means that this mobile device submitted the location permission request earliest and has the highest usage weight; in this case, the permission status of this mobile device can be set to "location permission granted." Conversely, if the location permission request of this mobile device is not at the head of the request list, it needs to wait in the queue; in this case, the permission status of this mobile device needs to be set to "location permission denied."
[0026] Step 2: If location permissions have been obtained, execute the location task, simultaneously executing task A during the location task execution; upon completion of the location task, execute tasks B and C sequentially, then return to Step 1. If location permissions have not been obtained, broadcast a location permission request, then return to Step 1.
[0027] Task A involves creating an application list and writing it into the permission allocation response; Task B involves broadcasting the permission allocation response, clearing the permission status, and outputting the location coordinates; and Task C involves broadcasting a location permission application.
[0028] For mobile devices that have already obtained location permissions, in addition to performing the location task, preparations must be made to maintain the task execution order for the next location cycle. This involves creating a request list and writing the request list into the permission allocation response. After completing the location task, the request list, along with the permission allocation response, needs to be broadcast to other mobile devices. Since location permissions are released after the location task is completed, the location permission status needs to be cleared, and the location coordinates need to be output as the task execution result. Furthermore, the mobile device also needs to broadcast a location permission request in order to obtain permission to perform the next round of location tasks.
[0029] Next, the positioning task described in step 2 will be explained in detail. Based on the above explanation of the overall technical route of this method, the overall process of the positioning task is as follows: the positioning device emits infrared synchronization light → the positioning device waits for a fixed microsecond delay → the positioning device emits ultrasonic waves → the positioning base station obtains the one-way flight time of the ultrasonic waves → the positioning base station transmits the one-way flight time and its own coordinates back to the positioning device via a wireless link → the positioning device gathers the data from the positioning base station and subtracts the inherent delay → the positioning device calculates the speed of sound and converts it into spatial distance based on temperature and humidity → the positioning device eliminates the altitude difference to obtain the planar distance → the positioning device obtains the positioning coordinates based on the planar distance. Specifically, the positioning task includes... Figure 2 The following steps are shown: Step 2.1: Transmit infrared light and ultrasonic waves to the positioning base station.
[0030] Infrared propagation speed is close to the speed of light (3×10⁻⁶). 8 Indoors, the propagation time of ultrasonic waves is negligible (less than 1 ns), making it suitable as a "global synchronization starting point." Ultrasonic waves, with a slower propagation speed (330-360 m / s), have a flight time proportional to distance, making them suitable for ranging. However, ultrasonic waves are susceptible to multipath reflection (false signals from walls / objects), propagation attenuation (high round-trip loss), and false triggering (non-target signals triggering the positioning base station) when propagating indoors. Therefore, infrared light is used to provide a synchronization timing reference, perform spatial gate filtering, and trigger the positioning base station response. This ensures accurate measurement of the ultrasonic wave's one-way flight time by having all base stations use the moment they receive infrared light as the starting point for timing. Furthermore, the narrow beam angle of the infrared beam only wakes up base stations in the effective area directly below them, filtering out false triggering caused by reflected ultrasound and distant interference signals. Finally, infrared light informs the positioning base station of the source and timing of subsequent ultrasonic signals, preventing the base station from failing to recognize effective signals due to propagation attenuation and superposition, thus ensuring the reliability of the ranging link.
[0031] Infrared light and ultrasonic waves are emitted by a positioning device installed on the mobile device. The infrared light and ultrasonic waves are emitted in a specific order: First, the infrared emitter in the positioning device (e.g., a 940nm infrared LED, model R333-A) emits 38kHz, 940nm infrared light (lasting 10-20μs) to each positioning base station within the infrared coverage area as a synchronization reference and spatial gating. Then, the positioning device waits for a fixed microsecond delay (e.g., 50-100μs, the fixed microsecond delay needs to be calibrated according to the device's hardware response speed) to avoid superposition of the infrared and ultrasonic signals. Next, the ultrasonic emitter in the positioning device (e.g., a 40kHz ultrasonic transmitter, model T40-16) emits a 40kHz ultrasonic pulse (lasting 50-100μs) to each positioning base station within the ultrasonic coverage area. Finally, the positioning device opens a 20-50ms feedback waiting window to prepare to receive feedback information from each positioning base station.
[0032] It should be further explained that the infrared transmitter and the ultrasonic transmitter must be installed in the same direction, and the infrared beam angle must be less than or equal to the ultrasonic beam angle (preferably 30°-45° for the infrared beam angle and 60°-90° for the ultrasonic beam angle). The smaller infrared beam angle allows for precise targeting of the positioning base station within the infrared light coverage area, while the slightly larger ultrasonic beam angle covers the range targeted by the infrared light. The combination of the two forms a "spatial filter," ensuring that only positioning base stations located within a certain range directly above the positioning device correctly receive the signal. Through physical layer constraints, it is ensured that the "optical gating cone" falls completely within the "ultrasonic main lobe," preferentially capturing direct waves from the source and suppressing false triggering caused by light / sound signals reflected from walls and equipment (to be explained in detail later).
[0033] The positioning base station is used to start timing when the infrared light arrives and end timing when the ultrasonic wave arrives, as well as to send feedback information to each mobile device within a defined range for location tracking. The base station is fixedly installed on the indoor ceiling (e.g., 7 positioning base stations are evenly distributed on the ceiling of a 100㎡ factory workshop). After installation, a laser rangefinder is used to measure and record the three-dimensional coordinates (x, y, z) of each base station. The base station is connected to the host computer via a serial port, and AT commands are used to write the "base station number (e.g., 01-10), three-dimensional coordinates (e.g., base station 01: x=2.0m, y=3.0m, z=3.5m), and correction parameters for one-way flight time" into the base station's EEPROM (a storage module that does not lose data when power is off) to align timing discrepancies between different base stations. Additionally, the field order of the feedback information returned by the positioning base station must be agreed upon as follows: "Identifier header (e.g., 0xAA), base station number, timing duration (i.e., one-way flight time, in μs), x-coordinate, y-coordinate, z-coordinate, and device number of the mobile device carried in the infrared light."
[0034] It should be further explained that the above-mentioned correction parameters for one-way flight time are obtained by measuring the difference between the measured one-way flight time and the theoretical one-way flight time for each positioning base station under standard environmental conditions (such as temperature 25℃, humidity 50%, and no obstruction). This difference is then used as the correction parameter for one-way flight time and fixed to the positioning base station. In addition, each positioning base station has a unique and independent correction parameter, which is an inherent characteristic determined by the hardware attributes of the positioning base station itself (such as individual differences in components). It needs to be calibrated and fixed separately and cannot be used universally.
[0035] When the positioning base station captures infrared light through an infrared light receiving module (such as TSOP1838), it immediately starts a local timer. When the ultrasonic receiving module (such as RCWL-1640 / 9620) captures ultrasonic waves, it stops the timer and obtains the one-way flight time of the ultrasonic waves. Subsequently, the positioning base station transmits the observation frame containing the "identifier header, base station number, one-way flight time, base station coordinates, and device number" as feedback information back to the positioning device through the ESP-Now wireless link (low latency, high robustness). The antenna (downward-radiating ceramic antenna) of the positioning base station needs to be optimized to downward radiation (gain ≥ 5dBi) to improve the success rate of wireless backhaul. For example, after a positioning base station receives infrared light, it starts a timer. After 125μs, it receives ultrasonic waves, and the timer stops (one-way flight time = 125μs). Then, the positioning base station transmits the feedback information "0xAA|03|125|2500|3200|3500|02" (x=2500mm, y=3200mm, z=3500mm) back to the positioning device.
[0036] It should be further explained that: 1. Each positioning base station must complete the timing independently to avoid signal transmission delays caused by centralized timing, while ensuring the integrity of the returned data. 2. The feedback information returned by the positioning base station is only received by mobile devices with the same device number located within the wireless signal coverage area. The reason is: like Figure 3 As shown, positioning base station 1 is mounted on the ceiling, and positioning device 2 is installed on the mobile device on the ground; the two are in a "vertically opposite" relationship. The infrared beam angle and ultrasonic beam angle can be understood as the "conical range of signal propagation." The smaller the beam angle, the narrower the cone, and the more concentrated the signal coverage area; the larger the beam angle, the wider the cone, and the broader the coverage area. The combination of the infrared beam angle and the ultrasonic beam angle forms "spatial filtering," activating only positioning base station 1 within the infrared light coverage area. The activated positioning base station 1 receives the ultrasonic waves, processes the information, and then transmits the feedback information back to the positioning device wirelessly. This includes the following two steps: (1) Infrared beam angle wakes up positioning base station 1 - The infrared beam angle is small (e.g., 30°), forming a "narrow cone" propagation range. Because positioning base station 2 is installed on the ceiling, the infrared light will only cover positioning base station 1 vertically upward within this "narrow cone" range (e.g., diameter 1-2 meters, the specific size is determined by the beam angle and installation height). For example, when the indoor space height is 3 meters, the coverage diameter of the 30° infrared beam angle is ≈3×tan(15°)×2≈1.6 meters. Only when positioning base station 1 is exactly within this infrared light circular area can the infrared light emitted by positioning device 2 be received by positioning base station 1. This can be figuratively understood as positioning base station 1 passing the "location authentication" of positioning device 2, positioning base station 1 being successfully "wake up", and preparing to receive subsequent ultrasonic waves. If positioning base station 1 is not within the infrared light circular area (e.g., 2 meters to the side of the base station), the infrared light will either be filtered by the field of view of the infrared light receiver or the intensity will be attenuated to the point that it cannot trigger positioning base station 1. This is equivalent to positioning base station 1 failing the "location authentication" of positioning device 2, and positioning base station 1 not being successfully "wake up".
[0037] (2) Ultrasonic Beam Angle Matching Position Authentication—After emitting infrared light, the positioning device 2 will immediately emit ultrasonic waves with a large ultrasonic beam angle (e.g., 60°), forming a "wide cone" propagation range. Since the infrared beam angle is less than or equal to the ultrasonic beam angle, this "wide cone" propagation range can completely encompass the aforementioned "narrow cone" propagation range (e.g., when the indoor space height is 3 meters, the coverage diameter of a 60° beam angle is approximately 3 × tan(30°) × 2 ≈ 3.46 meters). In other words, as long as the positioning base station 1 is within the aforementioned "narrow cone" propagation range, the ultrasonic waves emitted by the positioning device 2 will definitely be received by the positioning base station 1. The core function of this step is to ensure that the ultrasonic waves received by the positioning base station 1 are emitted by the positioning device 2 that just "woke up" it, and not emitted by other positioning devices 1, nor are they reflected waves (e.g., ultrasonic waves reflected by walls). If the positioning base station 1 is not within the aforementioned "narrow cone" propagation range, even if the ultrasonic waves emitted by the positioning device 2 can propagate to the positioning base station 1, since the positioning base station 1 was not woken up by infrared light, it will also identify the ultrasonic waves as "interference signals" and will not process them.
[0038] Corresponding to Figure 3In the diagram, the receiving surfaces of the infrared and ultrasonic sensors of positioning base station 1 face downwards; the transmitting surfaces of the transmitting probes (infrared and ultrasonic transmitters) of positioning device 2 face upwards. Only positioning base stations 1 within the infrared light coverage area (Figures ③ / ④ / ⑤) are activated and begin timing, ending when an ultrasonic wave is received. Positioning base stations 1 outside the infrared light coverage area (Figures ① / ② / ⑥ / ⑦) remain inactive and silent. Both infrared and ultrasonic waves propagate in straight lines, with the shortest propagation time. The infrared beam angle is smaller than the ultrasonic beam angle, ensuring that as long as the infrared sensor is not affected by reflected light, the influence of ultrasonic wave reflection is naturally filtered out. For positioning base stations 1 located near walls, a light-shielding plate can be added to the wall side to block reflected light, increasing reliability. Furthermore, any positioning base station 1 that receives an infrared signal will also receive an ultrasonic signal.
[0039] Step 2.2: Determine whether the device number in each feedback message matches the device number of this mobile device; if they do not match, discard the feedback message; if they match, retain the feedback message.
[0040] Since the positioning devices of all mobile devices within the range of the wireless signal emitted by the positioning base station can receive the feedback information, and the feedback information carries the device number of the mobile device that previously emitted infrared light, each mobile device within the signal coverage area can accurately know whether the current feedback information is what it needs by comparing the consistency of the device number.
[0041] Step 2.3: Obtain the two-dimensional planar distance between this mobile device and the positioning base station corresponding to each received feedback information, and establish a set of planar distances.
[0042] The purpose of obtaining two-dimensional planar distance is: 1. Indoor positioning often requires planar coordinates (such as AGV navigation and personnel tracking, which only focus on the XY axes), and the height information contained in three-dimensional distance is not a core requirement; 2. Eliminate height difference interference and avoid calculation errors caused by differences in the installation height of base stations and equipment; 3. Simplify the calculation complexity. Two-dimensional calculation (such as trilateration) does not require handling the complex matrix operations of three-dimensional coordinates, adapts to the computing power of embedded devices, and improves the real-time performance of positioning.
[0043] Furthermore, obtaining the two-dimensional planar distance includes the following steps: Step 2.3.1: Subtract the inherent delay of the infrared transmitter, the inherent delay of the ultrasonic transmitter, the response time of the infrared receiver module, and the response time of the ultrasonic receiver module from the timing duration to obtain the corrected timing duration.
[0044] The aim is to eliminate the impact of hardware latency on ranging and ensure accurate spatial distance calculation.
[0045] Step 2.3.2: Correct the speed of the ultrasound using Cramer's empirical formula to obtain the actual speed of the ultrasound.
[0046] The aim is to eliminate the influence of environmental factors on distance measurement and further ensure the accuracy of spatial distance calculation. Cramer's empirical formula, proposed by Owen Cramer in 1993 in J. Acoust. Soc. Am., is an approximation of the speed of sound in a "real gas." It treats air as a "humid, CO2-containing real gas" and directly calculates the speed of sound in air using four common meteorological quantities: temperature, relative humidity, atmospheric pressure, and CO2 mole fraction. Under normal temperature and pressure, the uncertainty is approximately 0.1 m / s⁻¹. The formula for calculating the speed of sound in an indoor environment using Cramer's empirical formula is: c = 331.502 + 0.60355T + 0.0124e − 0.00026P, where c is the corrected actual speed of sound (m / s⁻¹), T is the indoor air temperature (°C), e is the indoor water vapor partial pressure (hPa), and P is the total atmospheric pressure (hPa).
[0047] For example, if the current indoor temperature is 28℃ and the humidity is 60%, the ultrasonic speed is calculated as c = 331.502 + 0.60355 × 28 + 0.0124 × 2.34 − 0.00026 × 1013.25 = 331.502 + 16.8994 + 0.0290 - 0.2634 ≈ 348.4.14. The timing duration calculated by the negative positioning base station is 125μs. After deducting the inherent delay of 20μs (including the inherent delay of the infrared transmitter and the ultrasonic transmitter), the response time of the positioning base station of 15μs (including the response time of the infrared receiving module and the response time of the ultrasonic receiving module), and the correction parameter of 2μs for the one-way flight time, the one-way flight time of the ultrasonic wave is obtained as 88μs.
[0048] Step 2.3.3: Calculate the three-dimensional spatial distance between the mobile device and the positioning base station using the corrected timing duration and the actual speed of the ultrasonic wave.
[0049] Three-dimensional spatial distance = actual speed of ultrasound × corrected one-way flight time of ultrasound.
[0050] For example, the three-dimensional spatial distance d = 349.11 m / s × 88 × 10⁻ 6 s≈0.0307m=30.7cm.
[0051] Step 2.3.4: Obtain the height difference between the positioning base station and the mobile device.
[0052] The aim is to simplify the positioning calculation dimensions (indoor scenes often require XY plane coordinates) and eliminate the interference of height differences on planar positioning. Specifically, the installation height of the positioning device is measured in advance (e.g., the installation height of equipment on an AGV is 0.5m), and the net height difference Δz between each positioning base station and the positioning device is calculated as: "Z-coordinate of the positioning base station - installation height of the positioning device".
[0053] Step 2.3.5: Convert the three-dimensional spatial distance into a two-dimensional planar distance based on the elevation difference and the Pythagorean theorem.
[0054] According to the Pythagorean theorem, the three-dimensional spatial distance d can be converted to a two-dimensional distance d_xy in the XY plane using the formula " (If d < Δz, the data is considered invalid and the location base station is removed.)
[0055] For example, if the z-coordinate of a positioning base station is 3.5m and the installation height of the positioning device is 0.5m, then the net height difference Δz = 3.0m; the three-dimensional spatial distance d = 30.7cm (0.307m). Since d < Δz, the positioning base station data is deemed invalid and discarded. If the calculated three-dimensional spatial distance d = 2.5m, then the planar two-dimensional distance... (No real solution, discarded); If the calculated three-dimensional spatial distance d = 3.2m, then the two-dimensional planar distance... (Valid solution).
[0056] The final result is a set of planar distances containing "base station number - two-dimensional planar distance".
[0057] Step 2.4: Determine whether two-dimensional planar distances ≤ the first threshold can be filtered from the planar distance set; if yes, proceed to step 2.5; if no, proceed to step 2.6.
[0058] Step 2.5: Use the base station coordinates of the location base station corresponding to the minimum value among the selected two-dimensional plane distances as the location coordinates of this mobile device.
[0059] When a mobile device is directly below a positioning base station, the deviation between the two-dimensional coordinates (x, y) of the positioning base station and the actual coordinates of the mobile device is extremely small (e.g., ≤2cm). Therefore, the two-dimensional coordinates (x, y) of the positioning base station can be directly used as the positioning result of the mobile device. The purpose of this step is to improve the refresh rate of near-field positioning (avoiding complex calculations) and eliminate coordinate jumps that are prone to occur in trilateration calculations in the near-field region.
[0060] The specific implementation method is as follows: traverse the set of planar distances. If the planar two-dimensional distance d_xy of any base station is less than or equal to the first threshold (the first threshold can be 50-100cm, adjusted according to the base station density), determine that the device is located in the "near field area directly below" the positioning base station. Directly take the two-dimensional coordinates (x,y) of the positioning base station as the positioning coordinates of the mobile device and skip the subsequent trilateration. If there are multiple near-field positioning base stations, take the two-dimensional coordinates (x,y) of the positioning base station with the smallest planar two-dimensional distance d_xy as the positioning coordinates of the mobile device.
[0061] The determination that a mobile device is located in the "near field region directly below" the positioning base station is based on the principle that a two-dimensional planar distance d_xy ≤ a first threshold. (1) Definition and characteristics of the near-field region: In electromagnetic wave propagation, the near-field region refers to the region close to the radiation source, usually within one wavelength of the radiation source. In this region, the electric field and magnetic field are independent, and their intensity changes more complexly with distance, and the attenuation rate is faster than that of the far field. When the two-dimensional planar distance d_xy between the mobile device and the positioning base station is less than or equal to a certain threshold, the device may be located in the near-field region of the base station from the perspective of distance.
[0062] (2) Relationship between signal propagation characteristics and distance: In the near field region, the signal strength and propagation characteristics are significantly different from those in the far field. Generally speaking, the signal strength is relatively strong in the near field region, and due to the closer distance, the signal is less affected by environmental factors. When the two-dimensional planar distance d_xy ≤ a certain threshold, the signal strength, phase, and other characteristics of the positioning base station signal received by the mobile device may conform to the signal propagation characteristics of the near field region, thus it can be determined that the mobile device is located in the near field region of the positioning base station.
[0063] (3) Geometric Model and Error Range of the Positioning System: In indoor positioning systems, a corresponding geometric model is usually established to determine the location of the mobile device. Based on information such as the location of the positioning base station, the direction of signal propagation, and time, the distance between the mobile device and the positioning base station can be calculated. Due to measurement errors and the influence of various environmental factors, a reasonable threshold needs to be set to determine whether the device is located in the near-field region directly below the base station. When the calculated two-dimensional planar distance d_xy is within this threshold range, the device can be considered to be in the near-field region directly below the base station.
[0064] Step 2.6: Obtain the positioning coordinates of this mobile device through trilateration.
[0065] Trilateration is a mathematical process that uses the distances from three (or more) known points to an unknown point to calculate the coordinates of the unknown point.
[0066] The specific steps for obtaining the positioning coordinates of this mobile device through trilateration are as follows: Step 2.6.1: Enumerate all combinations of positioning base stations that meet the preset conditions.
[0067] The preset condition is that the area of the triangle formed by the three positioning base stations is greater than or equal to the third threshold (for example, the third threshold is 1m). 2 ).
[0068] The purpose of this step is to enumerate all combinations of "3 non-collinear base stations". If the area of the triangle formed by the three points is ≤1m², then... 2 Then they are determined to be collinear.
[0069] Step 2.6.2: Calculate the area of the triangle formed by each combination of positioning base stations, and select the combination of positioning base stations with the largest triangle area as the optimal combination.
[0070] The core idea of selecting the combination of three non-collinear base stations with the largest area as the "optimal solution" is to improve positioning accuracy by utilizing the geometric distribution characteristics and avoid the risk of geometric degradation. The reasons are: (1) The larger the area, the more dispersed the distribution of the three base stations, the narrower the range measurement intersection area, the lower the positioning ambiguity, and the smaller the coordinate calculation error; (2) The large area combination can effectively reduce the geometric accuracy attenuation factor (GDOP) and reduce the impact of individual base station errors and environmental interference on the positioning results; (3) It can avoid the solution failure caused by the collinear or concentrated distribution of the three base stations, avoid the jump in positioning error, and ensure the stability of the results.
[0071] Step 2.6.3: Use the base station coordinates of the three positioning base stations with the optimal combination to perform trilateration calculation and obtain the positioning coordinates of the mobile device.
[0072] Let the two-dimensional plane coordinates of positioning base station A be (x1, y1), positioning base station B be (x2, y2), positioning base station C be (x3, y3), and mobile device P be (x, y). According to the formula "(x-x1)²+(y-y1)²=d",... A _xy²", "(x-x2)²+(y-y2)²=d B _xy²", "(x-x3)²+(y-y3)²=d C Solve the system of equations _xy² to obtain the (x, y) coordinates of the device. Where d A _xy represents the horizontal distance between the mobile device and the positioning base station A in a two-dimensional plane (the positioning plane, such as the ground XY plane). This means that the difference in installation height between the mobile device and the positioning base station A is ignored; only the straight-line distance between their projection points on the same horizontal plane is calculated. B _xy represents the horizontal distance between the mobile device and the positioning base station B in the two-dimensional positioning plane, and its calculation logic is related to d. AThe xy coordinates are consistent, and the straight-line distance is calculated only between the planar projection point of the positioning base station B and the projection point of the mobile device; d C _xy represents the horizontal distance between the mobile device and the positioning base station C in the two-dimensional positioning plane, following the same planar projection distance calculation rules, corresponding to the horizontal position association between the positioning base station C and the mobile device.
[0073] Furthermore, in Task A, the method for creating the application list is as follows: Step A1: Continuously collect location permission requests broadcast by other mobile devices.
[0074] Location permission requests include: the identity information of the mobile device.
[0075] Step A2: Sort all the location permission requests collected in chronological order and create a request list.
[0076] In summary, the indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging provided in this embodiment is an indoor absolute coordinate positioning system with "optical synchronization triggering - ultrasonic one-way ranging - wireless backhaul" as the main link. It suppresses multipath interference at the source through "cross-media beam angle constraint (infrared beam angle ≤ ultrasonic beam angle, and in the same direction)," simplifies the link organization through "receiver local start and end timing," ensures positioning accuracy through "robust geometric solution pipeline," and achieves concurrent scheduling through "distributed tokens + bootstrapping backoff." This method can solve the problem that existing ultrasonic / optical cooperative positioning schemes cannot simultaneously obtain high-quality one-way ranging and output stable, low-latency, and scalable absolute coordinates in complex indoor environments without a center or GNSS, even under conditions of reflection obstruction and multiple concurrent devices.
[0077] Example 2: Another indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging is provided. This method is also applicable to mobile device clusters consisting of multiple mobile devices, relying on a controller, a positioning device installed on the mobile devices, and multiple positioning base stations fixedly installed on the indoor ceiling. The overall technical approach is as follows: the controller divides a unit of time into multiple consecutive time slices of equal length on the time axis, cyclically numbers the time slices according to the number of mobile devices, and controls the mobile devices to sequentially execute positioning tasks by matching the time slice numbers with the mobile device numbers, thereby avoiding mutual interference between multiple devices.
[0078] The method described in this embodiment includes Figure 4 The following steps are shown: Step 1: Number each mobile device according to the order in which they are started.
[0079] It should be noted that this step relies on the premise that each mobile device broadcasts its current status signal upon entering the startup state. The controller collects the current status signal of each mobile device in the room in real time and assigns a number to each mobile device according to the order of signal collection time, ensuring that the mobile device that starts up first has priority in performing the positioning task. This is also the basis for the controller to maintain task order among multiple mobile devices.
[0080] Step 2: Divide the duration of one second on the timeline into multiple consecutive time slices of equal length, and number the time slices cyclically according to the number of mobile devices.
[0081] The core logic of this step is to first determine the minimum time required for a single positioning task (determined by the indoor floor height), and then determine the "time cycle period t" based on the refresh rate. cycle Finally, the number of devices is matched, and a time slice is allocated to each mobile device to perform the positioning task, ensuring that multiple devices can run concurrently without conflict and meet real-time requirements.
[0082] Based on the core logic of this step, it can be seen that: (1) The indoor floor height determines the minimum time consumption of a single positioning task. That is, the higher the floor height, the longer the one-way flight time of the ultrasonic wave, and the greater the minimum time consumption of a single positioning task; (2) The number of mobile devices determines the lower limit of the number of time slices. That is, at least the number of time slices must be equal to the total number of mobile devices to ensure that each mobile device can be allocated an independent time slice to perform the positioning task and avoid signal collision. This is the core of time division multiplexing; (3) The positioning refresh rate is "the number of positioning operations that each mobile device needs to complete in a unit of time (in this embodiment, the unit of time is set to 1 second)". It needs to be achieved through "time slice loop". The loop period must be less than or equal to 1 / positioning refresh rate to meet the real-time requirements. The higher the positioning refresh rate, the longer the time slice loop period t. cycle The shorter.
[0083] The method for dividing one second into multiple consecutive time slices of equal length on the time axis is as follows: Step 2.1: Obtain the one-way flight time of the ultrasound waves based on the indoor floor height.
[0084] The speed of ultrasonic waves in indoor air is c≈340m / s (which can be corrected using the Cramer formula described in Example 1). The indoor floor height H is the vertical distance from the floor to the ceiling. Therefore, the one-way flight time t of the ultrasonic waves is... sound =H / c. For example, when the indoor floor height H = 3m, t sound =3 / 340≈0.0088s=8.8ms; When the indoor floor height H=5m, t sound =5 / 340≈0.0147s=14.7ms.
[0085] Step 2.2: Obtain the sum of the one-way flight time, ultrasonic transmission delay, base station timing duration, base station data processing duration, base station information feedback duration, and positioning coordinate acquisition duration to get the total positioning task time.
[0086] In addition to the ultrasonic flight time, the minimum time for a single positioning task also includes the ultrasonic wave transmission delay, the base station's timing time, the base station's data processing time, the base station's information feedback time, and the time for acquiring positioning coordinates. Therefore, the total time t for the positioning task is... task = One-way flight time + ultrasonic transmission delay + base station timing time + base station data processing time + base station information feedback time + positioning coordinate acquisition time. For example, when the indoor floor height H = 3m, the ultrasonic transmission delay is 50μs (0.2ms), the base station timing and data processing time totals 5ms, the base station information feedback time is 3ms, and the positioning coordinate acquisition time (local calculation time of the positioning device) is 3ms, the total time t for a single positioning task is... task =8.8ms+0.2ms+5ms+3ms+3ms=20ms.
[0087] Step 2.3: Calculate the number of time slices based on the total time taken for the positioning task and the desired positioning refresh rate.
[0088] The location refresh rate f (unit: Hz, i.e., the number of times per second) represents the time required for each mobile device to complete one location task. Therefore, the time slice cycle period (the total time for all mobile devices to poll once) must be less than or equal to 1 / f; otherwise, real-time performance cannot be met. If the location refresh rate is preset to f = 10Hz (each device performs 10 locations per second), then t cycle =1 / 10=0.1s=100ms.
[0089] In addition, the number of time slices N must simultaneously satisfy condition 1: N≥M (total number of mobile devices) and condition 2: N×t task ≤t cycle Condition 1 ensures that each device is allocated at least one independent time slice to avoid conflicts; Condition 2 ensures that the total time for all time slices to poll once is less than or equal to the time slice cycle period to meet the refresh frequency requirement.
[0090] Combining conditions 1 and 2, the number of time slices is And N≥M, Indicates t cycle With t task Round the quotient up to the nearest whole number.
[0091] Step 2.4: If the number of time slices is less than the number of mobile devices, reduce the positioning refresh rate and return to step 2.3. If the number of time slices is greater than or equal to the number of mobile devices, proceed to step 2.5.
[0092] If the calculated N < M (i.e., the number of mobile devices exceeds the carrying capacity of the current time slice cycle), the time slice cycle needs to be increased by reducing the positioning refresh rate to accommodate more time slices. Return to step 2.3 to recalculate the number of time slices, and iterate in this way until the number of time slices satisfies conditions 1 and 2 above.
[0093] For example: (1) When the indoor floor height H=3m, the total number of mobile devices M=5, and the positioning refresh frequency f=10Hz, first calculate the total positioning task time t. task =20ms; then calculate the time slice cycle period t. cycle =100ms, next calculate the current number of time slices. And N=5≥M=5, satisfying conditions 1 and 2; finally, calculate the number of time slices per unit time (1s) = 1000ns / 100ms×5 = 50, that is, each mobile device occupies 1 time slice, looping 10 times per second (satisfying 10Hz refresh), with no signal conflict.
[0094] (2) When the indoor floor height H=5m, the total number of mobile devices M=5, and the positioning refresh frequency f=10Hz, first calculate the total positioning task time t. task =30ms; then calculate the time slice cycle period t. cycle =100ms, next calculate the current number of time slices. Furthermore, N=4 < M=5, which does not satisfy condition 1. The positioning refresh rate needs to be adjusted. For example, if the positioning refresh rate is reduced to f=7Hz, the time slice cycle period t needs to be recalculated. cycle =140ms, N=5≥M=5, satisfying conditions 1 and 2; finally, calculate the number of time slices per unit time (1s) =1000ns / 140ms×5≈36, that is, each mobile device occupies 1 time slice, looping 7 times per second (satisfying 10Hz refresh), with no signal conflict.
[0095] Step 2.5: Divide the unit time into equal time intervals according to the number of time slices to obtain multiple consecutive time slices of equal length.
[0096] Step 3: Send a control signal and the current time slice number to each mobile device.
[0097] The control signal is used to control the mobile device to determine whether the number of the mobile device matches the number of the current time slice. If they match, a feedback signal is broadcast and the positioning task is executed. When the positioning task ends, a task end signal is broadcast. If they do not match, the device enters a waiting state.
[0098] The feedback signal indicates that the mobile device has received the control signal and the current time slice number sent by the controller. It is used to remind the controller that the control signal and the current time slice number were sent successfully, and the corresponding mobile device can successfully perform the positioning task. If the controller does not receive the feedback signal, it means that the mobile device may not be able to perform the positioning task at present (such as not starting or device failure). In this case, the current time slice is skipped and a time slice is reallocated to other mobile devices.
[0099] Step 4: When a task completion signal is received or no feedback signal is received, jump to the next time slice and return to Step 3; when a mobile device is added or removed indoors, return to Step 1.
[0100] Steps 1 to 4 above enable multi-device collaborative positioning based on central control, avoiding signal conflicts. The steps for each mobile device to perform the positioning task are the same as those described in Example 1, and will not be repeated here.
[0101] Example 3: Another indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging is provided. This method is also applicable to mobile device clusters consisting of multiple mobile devices, relying on positioning devices installed on the mobile devices and multiple positioning base stations fixedly installed on the indoor ceiling. The overall technical approach is as follows: Each mobile device establishes a polling queue based on channel occupancy requests broadcast by other mobile devices, using a time-first or priority-first approach. The waiting time is determined according to the mobile device's position in the polling queue, and positioning tasks are performed sequentially, thereby avoiding signal overlap and mutual interference among multiple devices.
[0102] The method described in this embodiment includes: Figure 5 The following steps are shown: Step 1: Broadcast the channel occupancy request of this mobile device.
[0103] The channel occupancy request includes the device ID of the mobile device, which is pre-defined. Each mobile device queues to use its corresponding communication channel and completes the positioning task within the channel occupancy time; the order of communication channel usage is determined by establishing a polling queue. Each mobile device broadcasts its channel occupancy request to other mobile devices, which forms the basis for the subsequent establishment of the polling queue.
[0104] Step 2: Establish a polling queue based on the priority of the positioning task and / or the order of channel occupancy requests.
[0105] Each mobile device establishes a polling queue considering two priorities: the priority for executing the location task and the priority for requesting channel occupancy. The priority for executing the location task is pre-set based on the actual project's demand for mobile device location services. For example, if a project requires real-time location services for mobile device A, while mobile device B only needs location services at a fixed frequency, then mobile device A is given the first priority, and mobile device B is given the second priority. If multiple mobile devices have the same priority, the order of requests for channel occupancy by each mobile device is further determined based on the order in which they request the channel occupancy.
[0106] Based on the above principles, a polling queue is established, which contains sequentially arranged device numbers and the channel occupancy time corresponding to each device.
[0107] Step 3: Obtain the waiting time based on the channel duration and the position of the mobile device's channel number in the polling queue.
[0108] It should be noted that this embodiment uses the time-slice division method described in Embodiment 2 to pre-determine the channel occupancy time for each mobile device. The waiting time for the mobile device is... T represents the waiting time, and k is the total number of mobile devices preceding this mobile device in the current position. ai ti represents the position of the i-th mobile device, and ti represents the channel occupancy time of the i-th mobile device.
[0109] Step 4: Adjust the waiting time of this mobile device according to the location task start time broadcast by other mobile devices.
[0110] In decentralized control scenarios, each mobile device relies on its own local clock (such as an MCU crystal oscillator) for timing. However, hardware differences (crystal oscillator accuracy, power supply fluctuations) can cause "clock drift." For example, mobile device A's local clock might be too fast (preset for a 20ms channel duration, but only 19.5ms is actually elapsed before it's considered finished), while mobile device B's clock might be too slow (preset for a 20ms channel duration, but only 20.3ms is actually elapsed before it's finished). Without time correction, after multiple loops, mobile device A's "estimated start time for positioning" will be earlier, and mobile device B's estimated start time for positioning will be later, ultimately causing the time channels of the two mobile devices to overlap and signals to collide (simultaneously emitting infrared light and ultrasonic waves).
[0111] Therefore, mobile devices within the waiting time need to adjust their waiting time in real time based on the location task start time broadcast by mobile devices already occupying the current communication channel. The specific steps are as follows: Step 4.1: Continuously collect the location task start time broadcast by other mobile devices.
[0112] Step 4.2: Obtain the time deviation between the start time and waiting time of the location task.
[0113] Step 4.3: Adjust the remaining waiting time based on the time deviation.
[0114] For example: If there are 5 mobile devices indoors (numbered 1-5 in sequence) using time-division coding for positioning, a total of 5 communication channels are configured, the duration of a single communication channel is 20ms, and the cycle period is 100ms; mobile device 3 has communication channel 3, and according to the preset rules, positioning should start at 40ms, and it is currently in the waiting timer stage.
[0115] When the local timer of mobile device 3 shows 32ms, it receives a channel occupancy request broadcast by mobile device 2. This signal clearly indicates "communication channel 2, actual start time 20ms, channel duration 20ms". After parsing the signal, mobile device 3 calculates that communication channel 2 of mobile device 2 has been occupied since 20ms, and has been running for 10ms by the time the channel occupancy request is received. The current actual time should be 30ms. Comparing this to its own local time of 32ms, mobile device 3 determines that its own time is 2ms ahead. Based on this discrepancy, device 3 corrects its original remaining waiting time to 12ms, and continues to wait according to the corrected time. Finally, it accurately starts positioning at the preset time of 40ms, ensuring that there is no overlap with the time channels of other devices and guaranteeing orderly concurrency of multiple devices.
[0116] Step 5: After the waiting period ends, execute the location task and broadcast the location task start time. After the location task is completed, move the device number of this mobile device to the end of the polling queue and return to Step 1.
[0117] The above steps 1 to 5 can also achieve multi-device collaborative positioning based on central control, avoiding signal conflicts. The steps for each mobile device to perform the positioning task are the same as those described in Example 1, and will not be repeated in this embodiment.
[0118] Example 4: Corresponding to Example 1, this example provides an indoor positioning system for mobile devices using optically synchronized ultrasonic one-way ranging, including: a positioning device installed on each mobile device and multiple fixed positioning base stations; The positioning device includes: The analysis module is used to determine whether the mobile device has obtained location permissions; The first task execution module is used to perform location tasks provided that the mobile device has obtained location permissions. The second task execution module is used to execute task A synchronously during the location task execution; task A includes: establishing an application list and writing the application list into the permission allocation response; The third task execution module is used to execute task B and task C sequentially when the positioning task ends. Task B includes: broadcasting permission allocation response, clearing permission status and outputting positioning coordinates. Task C includes: broadcasting positioning permission request; if positioning permission is not obtained, broadcasting positioning permission request. The fourth task execution module is used to broadcast a location permission request when the mobile device has not obtained location permission. The operation control module is used to control the analysis module to work after completing tasks B and C or after broadcasting a location permission request when the mobile device has not obtained location permission. The first task execution module includes: An infrared light emitter is used to transmit infrared light to each positioning base station; An ultrasonic transmitter is used to send ultrasonic waves to each positioning base station; The numerical calculation unit is used to obtain the two-dimensional planar distance between the mobile device and the positioning base station corresponding to each received feedback information, and to establish a set of planar distances; The analysis unit is used to determine whether two-dimensional planar distances greater than or equal to a first threshold can be selected from the set of planar distances. The first coordinate acquisition unit is used to take the base station coordinates of the positioning base station corresponding to any selected two-dimensional plane distance as the positioning coordinates of the mobile device, provided that a two-dimensional plane distance greater than or equal to a first threshold can be selected from the set of plane distances. The second coordinate acquisition unit is used to obtain the positioning coordinates of the mobile device by trilateration when a two-dimensional plane distance greater than or equal to the first threshold cannot be filtered out from the plane distance set. Positioning base stations include: A timer, used to start timing when infrared light arrives and stop timing when ultrasonic waves arrive; The information sending module is used to send feedback information to each mobile device located within a defined range; the defined range refers to the area below the positioning base station defined by the infrared beam angle; the infrared beam angle is ≤ the ultrasonic beam angle; the feedback information includes: base station number, timing duration, and base station coordinates.
[0119] Furthermore, the analysis module includes: The signal scanning unit is used to continuously scan for location permission requests or permission allocation responses broadcast by other mobile devices at a fixed frequency. The first permission setting unit is used to set the permission status of this mobile device to "location permission has been obtained" if no location permission request or permission allocation response is detected multiple times in a row. The list reading unit is used to read the list of requests in the permission allocation response when the permission allocation response is scanned; The analysis and control unit is used to determine whether the location permission request of this mobile device is at the top of the request list, and controls the second permission setting unit to work. If not, it controls the third permission setting unit to work. The second permission setting unit is used to set the permission status of this mobile device to "location permission has been obtained"; The third permission setting unit is used to set the permission status of this mobile device to "location permission not granted".
[0120] Furthermore, Task A also includes: calculating the packet return rate of this mobile device; Packet return rate = number of times feedback information was successfully received ÷ total number of times infrared light and ultrasonic waves were emitted; Task D also includes: broadcasting the packet return rate.
[0121] Furthermore, the second task execution module includes: The signal acquisition unit is used to continuously acquire location permission requests broadcast by other mobile devices; the location permission requests include: the mobile device's identity information, expected location period, and return packet rate; The list creation unit is used to sort all collected location permission requests in chronological order and create a request list. The data reading unit is used to sequentially read each location permission request in the request list; The data processing unit is used to mark location permission requests with a response rate less than the second threshold. The data update unit is used to compress the expected location period in the marked location permission requests proportionally and update the request list; the compression ratio = return rate.
[0122] Furthermore, the positioning device also includes a delay control module, which controls the ultrasonic transmitter to wait for a preset fixed time after the infrared light transmitter emits infrared light to the positioning base station, and controls the ultrasonic transmitter to emit ultrasonic waves to each positioning base station after the wait is terminated.
[0123] Furthermore, the numerical computation unit includes: The time correction subunit is used to subtract the inherent delay of the infrared transmitter, the inherent delay of the ultrasonic transmitter, the reaction time of the infrared receiver module, and the reaction time of the ultrasonic receiver module from the timing duration to obtain the corrected timing duration; The velocity correction subunit is used to correct the velocity of the ultrasonic wave using Cramer's empirical formula to obtain the actual velocity of the ultrasonic wave. The spatial distance calculation subunit is used to calculate the three-dimensional spatial distance between the mobile device and the positioning base station using the corrected timing duration and the actual speed of the ultrasonic wave; The elevation difference acquisition subunit is used to acquire the elevation difference between the positioning base station and the mobile device; The planar distance calculation subunit is used to convert three-dimensional spatial distances into two-dimensional planar distances based on elevation differences and the Pythagorean theorem.
[0124] Furthermore, the second coordinate acquisition unit includes: The base station combination generation sub-unit is used to enumerate all positioning base station combinations that meet the preset conditions; the preset conditions are: the area of the triangle formed by the three positioning base stations is greater than or equal to the third threshold. The optimal combination screening subunit is used to calculate the area of the triangle formed by each combination of positioning base stations, and select the positioning base station combination with the largest triangle area as the optimal combination. The trilateration interpretation subunit is used to perform trilateration calculations using the base station coordinates of the three optimally combined positioning base stations to obtain the positioning coordinates of the mobile device.
[0125] The functions and working principles of the above-mentioned devices, equipment, modules and units can be referred to the corresponding explanations in Embodiment 1, and will not be repeated in this embodiment.
[0126] Example 5: Corresponding to Example 2, this example provides another indoor positioning system for mobile devices using optically synchronized ultrasonic one-way ranging, including: a controller, a positioning device installed on each mobile device, and multiple fixed positioning base stations; The controller includes: The first numbering module is used to number each mobile device according to the order in which the devices are started. The second numbering module is used to divide the duration of one second into multiple consecutive time slices of equal length on the time axis, and to cyclically number the time slices according to the number of mobile devices. The signal transmission module is used to send control signals and the current time slice number to each mobile device. The control signal is used to control the mobile device to determine whether the number of the mobile device matches the number of the current time slice. If they match, the device broadcasts a feedback signal and executes the positioning task. When the positioning task ends, the device broadcasts a task end signal. If they do not match, the device enters a waiting state. The operation control module is used to jump to the next time slice when a task end signal is received or no feedback signal is received, and to control the signal sending module to work. When new or fewer mobile devices are added indoors, the module controls the first number setting module to work. The positioning device includes: The analysis module is used to determine whether the mobile device has obtained location permissions; The first task execution module is used to perform location tasks provided that the mobile device has obtained location permissions. The second task execution module is used to execute task A synchronously during the location task execution; task A includes: establishing an application list and writing the application list into the permission allocation response; The third task execution module is used to execute task B and task C sequentially when the positioning task ends. Task B includes: broadcasting permission allocation response, clearing permission status and outputting positioning coordinates. Task C includes: broadcasting positioning permission request; if positioning permission is not obtained, broadcasting positioning permission request. The fourth task execution module is used to broadcast a location permission request when the mobile device has not obtained location permission. The operation control module is used to control the analysis module to work after completing tasks B and C or after broadcasting a location permission request when the mobile device has not obtained location permission. The first task execution module includes: An infrared light emitter is used to transmit infrared light to each positioning base station; An ultrasonic transmitter is used to send ultrasonic waves to each positioning base station; The numerical calculation unit is used to obtain the two-dimensional planar distance between the mobile device and the positioning base station corresponding to each received feedback information, and to establish a set of planar distances; The analysis unit is used to determine whether two-dimensional planar distances greater than or equal to a first threshold can be selected from the set of planar distances. The first coordinate acquisition unit is used to take the base station coordinates of the positioning base station corresponding to any selected two-dimensional plane distance as the positioning coordinates of the mobile device, provided that a two-dimensional plane distance greater than or equal to a first threshold can be selected from the set of plane distances. The second coordinate acquisition unit is used to obtain the positioning coordinates of the mobile device by trilateration when a two-dimensional plane distance greater than or equal to the first threshold cannot be filtered out from the plane distance set. Positioning base stations include: A timer, used to start timing when infrared light arrives and stop timing when ultrasonic waves arrive; The information sending module is used to send feedback information to each mobile device located within a defined range; the defined range refers to the area below the positioning base station defined by the infrared beam angle; the infrared beam angle is ≤ the ultrasonic beam angle; the feedback information includes: base station number, timing duration, and base station coordinates.
[0127] The functions and working principles of the above-mentioned devices, equipment, modules and units can be referred to the corresponding explanations in Embodiment 2, and will not be repeated in this embodiment.
[0128] Example 6: Corresponding to Example 3, this example provides another indoor positioning system for mobile devices using optically synchronized ultrasonic one-way ranging, including: a positioning device installed on each mobile device and multiple fixed positioning base stations; The positioning device includes: The channel occupancy request module is used to broadcast a channel occupancy request for this mobile device; the channel occupancy request includes the device number of this mobile device; The polling queue establishment module is used to establish polling queues according to the priority of positioning tasks and / or the order of channel occupancy requests. The waiting time acquisition module is used to acquire the waiting time based on the channel duration and the position of the channel number of this mobile device in the polling queue; The location task execution module is used to execute the location task after the waiting period has ended and broadcast the location task start time. The operation control module is used to adjust the device number of this mobile device to the end of the polling queue after the positioning task is completed, and to control the channel occupancy application module to work. The location task execution module includes: An infrared light emitter is used to transmit infrared light to each positioning base station; An ultrasonic transmitter is used to send ultrasonic waves to each positioning base station; The numerical calculation unit is used to obtain the two-dimensional planar distance between the mobile device and the positioning base station corresponding to each received feedback information, and to establish a set of planar distances; The analysis unit is used to determine whether two-dimensional planar distances greater than or equal to a first threshold can be selected from the set of planar distances. The first coordinate acquisition unit is used to take the base station coordinates of the positioning base station corresponding to any selected two-dimensional plane distance as the positioning coordinates of the mobile device, provided that a two-dimensional plane distance greater than or equal to a first threshold can be selected from the set of plane distances. The second coordinate acquisition unit is used to obtain the positioning coordinates of the mobile device by trilateration when a two-dimensional plane distance greater than or equal to the first threshold cannot be filtered out from the plane distance set. Positioning base stations include: A timer, used to start timing when infrared light arrives and stop timing when ultrasonic waves arrive; The information sending module is used to send feedback information to each mobile device located within a defined range; the defined range refers to the area below the positioning base station defined by the infrared beam angle; the infrared beam angle is ≤ the ultrasonic beam angle; the feedback information includes: base station number, timing duration, and base station coordinates.
[0129] The functions and working principles of the above-mentioned devices, equipment, modules and units can be referred to the corresponding explanations in Embodiment 3, and will not be repeated in this embodiment.
[0130] It should be understood that the terms "system," "device," "unit," and / or "module" as used in this specification are a method of distinguishing different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.
[0131] As indicated in this specification and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of expressly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
[0132] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0133] It should be noted that the structures, proportions, sizes, etc., illustrated in the accompanying drawings are merely for illustrative purposes to aid those skilled in the art and are not intended to limit the scope of the invention. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in proportions, or adjustments to size, without affecting the effectiveness and purpose of the invention, should still fall within the scope of the disclosed technical content. Furthermore, terms such as "upper," "lower," "left," "right," and "middle" used in this specification are merely for clarity and not intended to limit the scope of the invention. Changes or adjustments to their relative relationships, without substantially altering the technical content, should also be considered within the scope of the invention.
Claims
1. An indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging, characterized in that, Execute S1 and S2 on each mobile device: S1: Determine whether this mobile device has obtained location permissions; S2: If location permissions have been obtained, execute the location task, and execute task A synchronously during the location task execution; When the location task is completed, execute tasks B and C in sequence, and return to S1; Task A includes: creating an application list and writing the application list into the permission allocation response; Task B includes: broadcasting the permission allocation response, clearing the permission status, and outputting the location coordinates; Task C includes: broadcasting a location permission request; if location permission is not obtained, broadcast a location permission request and return to S1; Performing a location task includes the following steps: The device transmits infrared light and ultrasonic waves to the positioning base station. The infrared light contains the device number of the mobile device, and the infrared beam angle is less than or equal to the ultrasonic beam angle. The positioning base station is used to start timing when the infrared light arrives and end timing when the ultrasonic waves arrive, as well as to send feedback information to each mobile device within the wireless signal coverage area. The feedback information includes: the one-way flight time of the ultrasonic waves, the base station coordinates, and the device number. The one-way flight time of the ultrasonic waves = the timer end time - the timer start time. Determine if the device ID in each feedback message matches the device ID of this mobile device; if they do not match, discard the feedback message; if they match, retain the feedback message. Obtain the two-dimensional planar distance between this mobile device and the positioning base station corresponding to each feedback information, and establish a set of planar distances; Determine whether a two-dimensional planar distance ≤ a first threshold can be selected from the set of planar distances; if so, use the base station coordinates of the positioning base station corresponding to the minimum value among the selected two-dimensional planar distances as the positioning coordinates of this mobile device; if not, obtain the positioning coordinates of this mobile device through trilateration. Obtaining a two-dimensional plane distance includes the following steps: The corrected timing duration is obtained by subtracting the inherent delay of the infrared transmitter, the inherent delay of the ultrasonic transmitter, the reaction time of the infrared receiver module, the reaction time of the ultrasonic receiver module, and the correction parameters of the one-way flight time from the timing duration. The actual speed of the ultrasound is obtained by correcting the speed of the ultrasound using Cramer's empirical formula. The three-dimensional spatial distance between the mobile device and the positioning base station is calculated using the corrected timing duration and the actual speed of the ultrasonic wave; Obtain the elevation difference between the positioning base station and the mobile device; Based on the elevation difference and the Pythagorean theorem, the three-dimensional spatial distance is converted into a two-dimensional planar distance.
2. The indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging according to claim 1, characterized in that, S1 includes: Continuously scan other mobile devices for location permission requests or permission allocation responses broadcast at a fixed frequency; If no location permission request or permission allocation response is detected after multiple consecutive scans, the permission status of this mobile device will be set to "location permission granted". If a permission allocation response is detected, read the request list in the permission allocation response; determine whether the location permission request of this mobile device is at the head of the request list; if yes, set the permission status of this mobile device to "location permission granted"; otherwise, set the permission status of this mobile device to "location permission denied".
3. The indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging according to claim 1, characterized in that, In Task A, creating the application list includes: Continuously collect location permission requests broadcast by other mobile devices; Sort all location permission requests collected in chronological order and create a request list.
4. An indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging, characterized in that, Includes the following steps: S1: Number each mobile device according to the order in which they are started; S2: Divide the duration of one second on the timeline into multiple consecutive time slices of equal length, and number the time slices cyclically according to the number of mobile devices; S3: Send a control signal and the current time slice number to each mobile device; the control signal is used to control the mobile device to determine whether the number of the mobile device matches the number of the current time slice. If they match, broadcast a feedback signal and execute the positioning task. When the positioning task ends, broadcast a task end signal. If they do not match, enter a waiting state. S4: When a task completion signal is received or no feedback signal is received, jump to the next time slice and return to S3; when a mobile device is added or removed indoors, return to S1. Performing a location task includes the following steps: The device transmits infrared light and ultrasonic waves to the positioning base station. The infrared light contains the device number of the mobile device, and the infrared beam angle is less than or equal to the ultrasonic beam angle. The positioning base station is used to start timing when the infrared light arrives and end timing when the ultrasonic waves arrive, as well as to send feedback information to each mobile device within the wireless signal coverage area. The feedback information includes: the one-way flight time of the ultrasonic waves, the base station coordinates, and the device number. The one-way flight time of the ultrasonic waves = the timer end time - the timer start time. Determine if the device ID in each feedback message matches the device ID of this mobile device; if they do not match, discard the feedback message; if they match, retain the feedback message. Obtain the two-dimensional planar distance between this mobile device and the positioning base station corresponding to each feedback information, and establish a set of planar distances; Determine whether a two-dimensional planar distance ≤ a first threshold can be selected from the set of planar distances; if so, use the base station coordinates of the positioning base station corresponding to the minimum value among the selected two-dimensional planar distances as the positioning coordinates of this mobile device; if not, obtain the positioning coordinates of this mobile device through trilateration. Obtaining a two-dimensional plane distance includes the following steps: The corrected timing duration is obtained by subtracting the inherent delay of the infrared transmitter, the inherent delay of the ultrasonic transmitter, the reaction time of the infrared receiver module, the reaction time of the ultrasonic receiver module, and the correction parameters of the one-way flight time from the timing duration. The actual speed of the ultrasound is obtained by correcting the speed of the ultrasound using Cramer's empirical formula. The three-dimensional spatial distance between the mobile device and the positioning base station is calculated using the corrected timing duration and the actual speed of the ultrasonic wave; Obtain the elevation difference between the positioning base station and the mobile device; Based on the elevation difference and the Pythagorean theorem, the three-dimensional spatial distance is converted into a two-dimensional planar distance.
5. The indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging according to claim 4, characterized in that, Dividing each second into multiple consecutive time slices of equal length includes the following steps: S2.1: Obtain the one-way flight time of the ultrasonic wave based on the indoor floor height; S2.2: Obtain the sum of the one-way flight time, ultrasonic transmission delay, base station timing duration, base station data processing duration, base station information feedback duration, and positioning coordinate acquisition duration to obtain the total positioning task time; S2.3: Calculate the number of time slices based on the total time consumed by the positioning task and the expected positioning refresh rate; S2.4: If the number of time slices is less than the number of mobile devices, reduce the positioning refresh rate and return to S2.3; if the number of time slices is greater than or equal to the number of mobile devices, execute S2.
5. S2.5: Divide the unit time into equal time intervals according to the number of time slices to obtain multiple continuous time slices of equal length.
6. An indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging, characterized in that, Perform the following steps on each mobile device: S1: Broadcasts a channel occupancy request for this mobile device; the channel occupancy request includes the device number of this mobile device; S2: Establish a polling queue based on the priority of the positioning task and / or the order of channel occupancy requests; S3: Obtain the waiting time based on the channel duration and the position of the mobile device's channel number in the polling queue; S4: After the waiting period ends, execute the location task and broadcast the location task start time. After the location task is completed, move the device number of this mobile device to the end of the polling queue and return to S1. Performing a location task includes the following steps: The device transmits infrared light and ultrasonic waves to the positioning base station. The infrared light contains the device number of the mobile device, and the infrared beam angle is less than or equal to the ultrasonic beam angle. The positioning base station is used to start timing when the infrared light arrives and end timing when the ultrasonic waves arrive, as well as to send feedback information to each mobile device within the wireless signal coverage area. The feedback information includes: the one-way flight time of the ultrasonic waves, the base station coordinates, and the device number. The one-way flight time of the ultrasonic waves = the timer end time - the timer start time. Determine if the device ID in each feedback message matches the device ID of this mobile device; if they do not match, discard the feedback message; if they match, retain the feedback message. Obtain the two-dimensional planar distance between this mobile device and the positioning base station corresponding to each feedback information, and establish a set of planar distances; Determine whether a two-dimensional planar distance ≤ a first threshold can be selected from the set of planar distances; if so, use the base station coordinates of the positioning base station corresponding to the minimum value among the selected two-dimensional planar distances as the positioning coordinates of this mobile device; if not, obtain the positioning coordinates of this mobile device through trilateration. Obtaining a two-dimensional plane distance includes the following steps: The corrected timing duration is obtained by subtracting the inherent delay of the infrared transmitter, the inherent delay of the ultrasonic transmitter, the reaction time of the infrared receiver module, the reaction time of the ultrasonic receiver module, and the correction parameters of the one-way flight time from the timing duration. The actual speed of the ultrasound is obtained by correcting the speed of the ultrasound using Cramer's empirical formula. The three-dimensional spatial distance between the mobile device and the positioning base station is calculated using the corrected timing duration and the actual speed of the ultrasonic wave; Obtain the elevation difference between the positioning base station and the mobile device; Based on the elevation difference and the Pythagorean theorem, the three-dimensional spatial distance is converted into a two-dimensional planar distance.
7. The indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging according to claim 6, characterized in that, S4 and earlier included: Continuously collect the location task start time broadcast by other mobile devices; Obtain the time deviation between the start time and waiting time of the location task; The remaining waiting time is adjusted based on the time deviation.
8. The indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging according to any one of claims 1-7, characterized in that, Transmitting infrared light and ultrasonic waves to each positioning base station includes the following steps: Transmit infrared light to each positioning base station; After waiting for a preset fixed time, it transmits ultrasonic waves to each positioning base station.
9. The indoor positioning method for mobile devices using optically synchronized ultrasonic one-way ranging according to any one of claims 1-7, characterized in that, The positioning coordinates are obtained through trilateration, including the following steps: Enumerate all combinations of positioning base stations that meet the preset conditions; the preset conditions are: the area of the triangle formed by the three positioning base stations is greater than or equal to the third threshold. Calculate the area of the triangle formed by each combination of positioning base stations, and select the combination of positioning base stations with the largest triangle area as the optimal combination; The location coordinates of the mobile device are obtained by performing trilateration calculation using the base station coordinates of the three optimally combined positioning base stations.
10. An indoor positioning system for mobile devices using optically synchronized ultrasonic one-way ranging, characterized in that, include: Positioning devices installed on each mobile device and multiple fixed positioning base stations; The positioning device includes: The analysis module is used to determine whether the mobile device has obtained location permissions; The first task execution module is used to perform location tasks provided that the mobile device has obtained location permissions. The second task execution module is used to execute task A synchronously during the location task execution; task A includes: establishing an application list and writing the application list into the permission allocation response; The third task execution module is used to execute task B and task C sequentially when the positioning task ends. Task B includes: broadcasting permission allocation response, clearing permission status and outputting positioning coordinates. Task C includes: broadcasting positioning permission request; if positioning permission is not obtained, broadcasting positioning permission request. The fourth task execution module is used to broadcast a location permission request when the mobile device has not obtained location permission. The operation control module is used to control the analysis module to work after completing tasks B and C or after broadcasting a location permission request when the mobile device has not obtained location permission. The first task execution module includes: An infrared light emitter is used to transmit infrared light to a positioning base station; the infrared light contains the device number of this mobile device. An ultrasonic transmitter is used to transmit ultrasonic waves to a positioning base station; the infrared beam angle is ≤ the ultrasonic beam angle. The information processing unit is used to determine whether the device number in each feedback message matches the device number of the mobile device; if they do not match, the feedback message is discarded; if they match, the feedback message is retained. The numerical calculation unit is used to obtain the two-dimensional planar distance between this mobile device and the positioning base station corresponding to each feedback information, and to establish a set of planar distances; The analysis unit is used to determine whether two-dimensional planar distances ≤ a first threshold can be selected from the set of planar distances. The first coordinate acquisition unit is used to take the base station coordinates of the positioning base station corresponding to the minimum value of the selected two-dimensional plane distances as the positioning coordinates of the mobile device, under the condition that it is possible to filter out two-dimensional plane distances ≤ a first threshold from the set of plane distances. The second coordinate acquisition unit is used to obtain the positioning coordinates of the mobile device by trilateration when a two-dimensional plane distance ≤ the first threshold cannot be selected from the plane distance set. Positioning base stations include: A timer, used to start timing when infrared light arrives and stop timing when ultrasonic waves arrive; The information transmission module is used to send feedback information to each mobile device within the wireless signal coverage area; the feedback information includes: the one-way flight time of the ultrasonic wave, the base station coordinates, and the device number; the one-way flight time of the ultrasonic wave = the end time of timing - the start time of timing; The specific steps for obtaining the two-dimensional planar distance are as follows: Subtract the inherent delay of the infrared transmitter, the inherent delay of the ultrasonic transmitter, the response time of the infrared receiver module, the response time of the ultrasonic receiver module, and correction parameters for the one-way flight time from the timing duration to obtain the corrected timing duration; correct the ultrasonic velocity using Cramer's empirical formula to obtain the actual ultrasonic velocity; calculate the three-dimensional spatial distance between the mobile device and the positioning base station using the corrected timing duration and the actual ultrasonic velocity; obtain the elevation difference between the positioning base station and the mobile device; and convert the three-dimensional spatial distance into a two-dimensional planar distance based on the elevation difference and the Pythagorean theorem.
11. An indoor positioning system for mobile devices using optically synchronized ultrasonic one-way ranging, characterized in that, include: The controller, the positioning device installed on each mobile device, and multiple fixed positioning base stations; The controller includes: The first numbering module is used to number each mobile device according to the order in which the devices are started. The second numbering module is used to divide the duration of one second into multiple consecutive time slices of equal length on the time axis, and to cyclically number the time slices according to the number of mobile devices. The signal transmission module is used to send control signals and the current time slice number to each mobile device. The control signal is used to control the mobile device to determine whether the number of the mobile device matches the number of the current time slice. If they match, the device broadcasts a feedback signal and executes the positioning task. When the positioning task ends, the device broadcasts a task end signal. If they do not match, the device enters a waiting state. The operation control module is used to jump to the next time slice when a task end signal is received or no feedback signal is received, and to control the signal sending module to work. When new or fewer mobile devices are added indoors, the module controls the first number setting module to work. The positioning device includes: An infrared light emitter is used to transmit infrared light to a positioning base station; the infrared light contains the device number of this mobile device. An ultrasonic transmitter is used to transmit ultrasonic waves to a positioning base station; the infrared beam angle is ≤ the ultrasonic beam angle. The information processing unit is used to determine whether the device number in each feedback message matches the device number of the mobile device; if they do not match, the feedback message is discarded; if they match, the feedback message is retained. The numerical calculation unit is used to obtain the two-dimensional planar distance between this mobile device and the positioning base station corresponding to each feedback information, and to establish a set of planar distances; The analysis unit is used to determine whether two-dimensional planar distances ≤ a first threshold can be selected from the set of planar distances. The first coordinate acquisition unit is used to take the base station coordinates of the positioning base station corresponding to the minimum value of the selected two-dimensional plane distances as the positioning coordinates of the mobile device, under the condition that it is possible to filter out two-dimensional plane distances ≤ a first threshold from the set of plane distances. The second coordinate acquisition unit is used to obtain the positioning coordinates of the mobile device by trilateration when a two-dimensional plane distance ≤ the first threshold cannot be selected from the plane distance set. Positioning base stations include: A timer, used to start timing when infrared light arrives and stop timing when ultrasonic waves arrive; The information transmission module is used to send feedback information to each mobile device within the wireless signal coverage area; the feedback information includes: the one-way flight time of the ultrasonic wave, the base station coordinates, and the device number; the one-way flight time of the ultrasonic wave = the end time of timing - the start time of timing; The specific steps for obtaining the two-dimensional planar distance are as follows: Subtract the inherent delay of the infrared transmitter, the inherent delay of the ultrasonic transmitter, the response time of the infrared receiver module, the response time of the ultrasonic receiver module, and correction parameters for the one-way flight time from the timing duration to obtain the corrected timing duration; correct the ultrasonic velocity using Cramer's empirical formula to obtain the actual ultrasonic velocity; calculate the three-dimensional spatial distance between the mobile device and the positioning base station using the corrected timing duration and the actual ultrasonic velocity; obtain the elevation difference between the positioning base station and the mobile device; and convert the three-dimensional spatial distance into a two-dimensional planar distance based on the elevation difference and the Pythagorean theorem.
12. An indoor positioning system for mobile devices using optically synchronized ultrasonic one-way ranging, characterized in that, include: Positioning devices installed on each mobile device and multiple fixed positioning base stations; The positioning device includes: The channel occupancy request module is used to broadcast a channel occupancy request for this mobile device; the channel occupancy request includes the device number of this mobile device; The polling queue establishment module is used to establish polling queues according to the priority of positioning tasks and / or the order of channel occupancy requests. The waiting time acquisition module is used to acquire the waiting time based on the channel duration and the position of the channel number of this mobile device in the polling queue; The location task execution module is used to execute the location task after the waiting period has ended and broadcast the location task start time. The operation control module is used to adjust the device number of this mobile device to the end of the polling queue after the positioning task is completed, and to control the channel occupancy application module to work. The location task execution module includes: An infrared light emitter is used to transmit infrared light to a positioning base station; the infrared light contains the device number of this mobile device. An ultrasonic transmitter is used to transmit ultrasonic waves to a positioning base station; the infrared beam angle is ≤ the ultrasonic beam angle. The information processing unit is used to determine whether the device number in each feedback message matches the device number of the mobile device; if they do not match, the feedback message is discarded; if they match, the feedback message is retained. The numerical calculation unit is used to obtain the two-dimensional planar distance between this mobile device and the positioning base station corresponding to each feedback information, and to establish a set of planar distances; The analysis unit is used to determine whether two-dimensional planar distances ≤ a first threshold can be selected from the set of planar distances. The first coordinate acquisition unit is used to take the base station coordinates of the positioning base station corresponding to the minimum value of the selected two-dimensional plane distances as the positioning coordinates of the mobile device, under the condition that it is possible to filter out two-dimensional plane distances ≤ a first threshold from the set of plane distances. The second coordinate acquisition unit is used to obtain the positioning coordinates of the mobile device by trilateration when a two-dimensional plane distance ≤ the first threshold cannot be selected from the plane distance set. Positioning base stations include: A timer, used to start timing when infrared light arrives and stop timing when ultrasonic waves arrive; The information transmission module is used to send feedback information to each mobile device within the wireless signal coverage area; the feedback information includes: the one-way flight time of the ultrasonic wave, the base station coordinates, and the device number; the one-way flight time of the ultrasonic wave = the end time of timing - the start time of timing; The specific steps for obtaining the two-dimensional planar distance are as follows: Subtract the inherent delay of the infrared transmitter, the inherent delay of the ultrasonic transmitter, the response time of the infrared receiver module, the response time of the ultrasonic receiver module, and correction parameters for the one-way flight time from the timing duration to obtain the corrected timing duration; correct the ultrasonic velocity using Cramer's empirical formula to obtain the actual ultrasonic velocity; calculate the three-dimensional spatial distance between the mobile device and the positioning base station using the corrected timing duration and the actual ultrasonic velocity; obtain the elevation difference between the positioning base station and the mobile device; and convert the three-dimensional spatial distance into a two-dimensional planar distance based on the elevation difference and the Pythagorean theorem.