Time synchronization-based inter-device mutual ranging method and device, equipment and medium
By using a time-synchronized inter-device ranging method, the problem of multi-device ranging under base station-free conditions is solved, achieving accurate and flexible inter-device distance calculation, and adapting to device movement and network topology changes.
Patent Information
- Application Number
- CN202310159642.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-16
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2043-02-16
AI Technical Summary
Existing technologies rely on base stations when measuring distances between multiple devices, which leads to complex network deployments and makes it impossible to measure distances when devices move out of the base station's range, making it difficult to achieve accurate and flexible distance measurement between devices.
A time-synchronized inter-device ranging method is adopted. By generating the starting point of the negotiated time slot block, the detection data is sent to obtain the device number, and the device distance is calculated in the ad hoc network. The method determines whether the device numbers overlap or the device is disconnected from the network, thus realizing inter-device ranging under base station-free conditions.
It improves the accuracy and flexibility of distance measurement between multiple devices, avoids base station dependence, adapts to device movement and network topology changes, and enhances the ability of device integration and network decommissioning identification.
Smart Images

Figure CN116170743B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of carrier-free communication, in particular to a mutual ranging method and device between devices based on time synchronization, equipment and medium. BACKGROUND
[0002] In some cases, the distance between multiple targets needs to be strictly controlled, and the distance needs to be found, alarmed and intervened in time. For example, the distance between multiple targets needs to be calculated to maintain a corresponding distance. In another scenario, such as some autonomous driving, robots and AI scenarios, when autonomous obstacle avoidance, intelligent perception and AI scenarios are needed, a set of multiple targets can be arbitrarily ranged.
[0003] The existing method, for example, in a system for precise ranging based on uwb (Ultra Wideband), the communication between multiple tags and base stations needs to set the number of each tag in the base station system in advance. The tags communicate with multiple base stations in a certain preset number order in series to ensure that the communication does not interfere with each other. However, in a general communication positioning model, multiple base stations need to be installed on buildings or facilities (according to positioning needs, one-dimensional, two-dimensional, three-dimensional, different number of base stations are needed), and the distance between the tags can be indirectly calculated through the base stations. This makes it easy to cause the network deployment to be too complex and tedious when multiple target devices range each other, and when the target device moves out of the range of the base station, the ranging between the target devices cannot be realized. There is an urgent need for a mutual ranging method between devices to realize mutual ranging between multiple devices without relying on base stations, and to improve the accuracy and flexibility of mutual ranging between multiple devices. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a mutual ranging method between devices based on time synchronization, device and medium, to realize mutual ranging between multiple devices without relying on base stations, and to improve the accuracy and flexibility of mutual ranging between multiple devices.
[0005] To solve the above technical problems, the embodiments of the present application provide a mutual ranging method between devices based on time synchronization, comprising:
[0006] When a new device accesses the ad hoc network, the starting point of the negotiation time slot block is generated, and the negotiation data corresponding to the new device is sent based on the starting point, wherein the negotiation data includes the negotiation number of the new device.
[0007] When the other devices in the ad hoc network receive the negotiation number, the other device self-device numbers replied by the other devices are received by the new device, and based on the other device self-device numbers, an unused device number is obtained as the device number of the new device;
[0008] In each time slot, the response data sent back by each device in the ad hoc network is obtained by the current device, and the distance between the current device and other devices is calculated according to the ranging parameters in the response data;
[0009] If the current device is in the active sending time slot block, it is judged whether the current device has lost the preset proportion of valid responses for N times in succession, if so, the device number of the current device is reset as a new negotiation number, and the next period of network entry negotiation processing procedure is re-performed, wherein N is a positive integer;
[0010] It is judged whether the current device has lost the specific device response for N times in succession, if so, the device number of the specific device is deleted from the local routing table.
[0011] To solve the above technical problems, an inter-device mutual ranging device based on time synchronization is provided, comprising:
[0012] A negotiation network entry module is configured to generate a starting point of a negotiation time slot block when a new device accesses an ad hoc network, and send the corresponding probe data of the new device based on the starting point, wherein the probe data includes a negotiation number of the new device;
[0013] A new number generation module is configured to receive the other device self-device numbers replied by the other devices through the new device when the other devices in the ad hoc network receive the negotiation number, and obtain an unused device number as the device number of the new device based on the other device self-device numbers;
[0014] A network entry ranging module is configured to obtain the response data sent back by each device in the ad hoc network by the current device in each time slot, and calculate the distance between the current device and other devices according to the ranging parameters in the response data;
[0015] A device fusion generation module is configured to judge whether the current device has lost the preset proportion of valid responses for N times in succession if the current device is in the active sending time slot block, if so, reset the device number of the current device as a new negotiation number, and re-perform the next period of network entry negotiation processing procedure, wherein N is a positive integer;
[0016] A device off-network processing module is configured to determine whether the current device loses a specific device response for consecutive N times, and if so, delete the device number of the specific device from a local routing table.
[0017] To solve the above technical problems, one technical solution of the present application is to provide a terminal device, comprising one or more processors, and a memory configured to store one or more programs, so that the one or more processors implement the time synchronization-based mutual ranging method between devices.
[0018] To solve the above technical problems, one technical solution of the present application is to provide a computer-readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the time synchronization-based mutual ranging method between devices.
[0019] The embodiments of the present application provide a time synchronization-based mutual ranging method between devices, apparatuses, devices and media. The method comprises: when a new device accesses an ad hoc network, generating a starting point of a negotiation time slot block, and based on the starting point, sending detection data corresponding to the new device, wherein the detection data comprises a negotiation number of the new device; when other devices in the ad hoc network receive the negotiation number, receiving, by the new device, device numbers of the other devices returned by the other devices, and based on the device numbers of the other devices, obtaining unused device numbers as device numbers of the new device; in each time slot, obtaining, by a current device, response data returned by each device in the ad hoc network, and calculating distances between the current device and the other devices according to ranging parameters in the response data; if the current device is in an active sending time slot block, determining whether the current device loses valid responses by a preset proportion for consecutive N times, and if so, resetting the device number of the current device to a new negotiation number, and re-performing a network access negotiation processing procedure in a next period, wherein N is a positive integer; determining whether the current device loses specific device responses for consecutive N times, and if so, deleting the device number of the specific device from a local routing table. The embodiments of the present application add a new device to an ad hoc network, and obtain device numbers of the new device, so as to realize mutual ranging between multiple devices without a base station device, and make the mutual ranging between multiple devices not limited by a place, and at the same time, determine whether the device numbers of the devices overlap, so as to realize fusion of the devices, and identify off-network devices in time, delete the device numbers of the off-network devices, and thus improve accuracy and flexibility of the mutual ranging between multiple devices. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the solutions in the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0021] Figure 1 is an implementation flowchart of the method for mutual ranging between devices based on time synchronization provided by the embodiments of the present application;
[0022] Figure 2 is a schematic diagram of a device communication relationship model provided by the embodiments of the present application;
[0023] Figure 3 is another implementation flowchart of a sub-process of the method for mutual ranging between devices based on time synchronization provided by the embodiments of the present application;
[0024] Figure 4 is another implementation flowchart of a sub-process of the method for mutual ranging between devices based on time synchronization provided by the embodiments of the present application;
[0025] Figure 5 is another implementation flowchart of a sub-process of the method for mutual ranging between devices based on time synchronization provided by the embodiments of the present application;
[0026] Figure 6 is a schematic diagram of a bilateral and bidirectional ranging provided by the embodiments of the present application;
[0027] Figure 7 is another implementation flowchart of a sub-process of the method for mutual ranging between devices based on time synchronization provided by the embodiments of the present application;
[0028] Figure 8 is a schematic diagram of a device ranging apparatus based on time synchronization provided by the embodiments of the present application;
[0029] Figure 9 is a schematic diagram of a terminal device provided by the embodiments of the present application. DETAILED DESCRIPTION
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the description and claims of this application as well as the above abstract are intended to cover not only the embodiments described herein but also any alternatives, modifications, equivalents, and substitutes for those embodiments included within the scope of the application. The terms "comprise", "have" and "include" and any variations thereof used in the description and claims of this application are intended to cover not only the case where the stated features are present but also the case where the stated features are not present. The terms "first", "second", and the like used in the description and claims of this application are used for distinguishing between similar objects talking about the embodiments and are not necessarily used to describe a particular sequential order.
[0031] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive of one another. As will be apparent to one of skill in the art, embodiments described herein can be combinable with other embodiments.
[0032] For better understanding of the present application, the technical solutions of the embodiments of the present application will be described clearly and completely in the following with reference to the drawings.
[0033] The present application will be described in detail below with reference to the drawings and embodiments.
[0034] It should be noted that the method for mutual ranging between devices based on time synchronization provided by the embodiments of the present application is generally executed by a terminal device, and accordingly, the device mutual ranging apparatus based on time synchronization is generally configured in the terminal device.
[0035] Please refer to Figure 1 and Figure 2 , Figure 1 a specific implementation of the method for mutual ranging between devices based on time synchronization is shown, Figure 2 is a schematic diagram of a device communication relationship model provided by the embodiments of the present application.
[0036] It should be noted that the method of the present application is not limited to the flow sequence shown, and the method includes the following steps: Figure 1
[0037] S1: When a new device accesses the ad hoc network, a starting point of a negotiation time slot block is generated, and based on the starting point, the probe data corresponding to the new device is sent, wherein the negotiation number of the new device is included in the probe data.
[0038] Specifically, the embodiments of the present application are a ranging method between multiple devices based on UWB technology, wherein UWB (Ultra Wideband) is a kind of carrierless communication technology, which transmits data by using nanosecond to microsecond non-sinusoidal narrow pulse. As shown in Figure 2 , a multi-device ad hoc network is constructed by using UWB technology, and the ad hoc network is a peer-to-peer mesh network; in the ad hoc network, the multiple devices communicate and range with each other, and all configurations of all devices in the same application scenario are equal, such as specifications and other parameters.
[0039] Please refer to Figure 3 , Figure 3 a specific implementation of step S1 is shown, which is described in detail as follows:
[0040] S11: generating a starting point of a negotiation time slot block according to a pre-determined period and an alignment time when the new device accesses the ad hoc network.
[0041] S12: randomly obtaining a random number according to the concurrent access capability, and generating a random channel based on the starting point and the random number.
[0042] S13: sending the detection data corresponding to the new device through the random channel.
[0043] Specifically, when the new device accesses the ad hoc network, the new device needs to be negotiated. The negotiation means that the new device determines to generate its own number which is not used in the ad hoc network. In the embodiment of the present application, the time of all devices in the ad hoc network is synchronized. It is assumed that a period is 10s, which is a pre-set value related to the total amount of device specifications and needs to be greater than the actual time consumed by the total amount of device specifications. For example, it can be agreed that 0:00:00 is the starting point of calculation, and the starting time of each communication, that is, the starting time of the first time slot block (negotiation time slot block) is calculated at an interval of 10s. The entire time axis is advanced according to the whole period. The last remaining time slice in the period is abandoned. For example, 10s is a period, and it is assumed that 9.8s is consumed after all 100 nodes in the system communicate, and the last remaining 0.2s is the abandoned time slice.
[0044] Therefore, according to the pre-determined period and the alignment time, the starting point of the negotiation time slot block is generated in the embodiment of the present application; then a random number R is randomly obtained according to the concurrent access capability (the concurrent access capability and the total amount of device specifications are set by human, and the value of the concurrent access capability is less than the total amount of device specifications), to obtain the starting time of the random channel which can be used by the current device in the negotiation time slot block, and finally the detection data corresponding to the new device is sent through the random channel. The negotiation number of the new device is included in the detection data. In the embodiment of the present application, if the device number is a double-byte type, the negotiation number of the new device can be defined as a specific 0xFFFF. In practice, the device number can be selected according to the actual data type.
[0045] S2: when the negotiation number is received by other devices in the ad hoc network, the device number of the other device itself is received by the new device, and the unused device number is obtained based on the device number of the other device itself, as the device number of the new device.
[0046] Please refer to Figure 4 , Figure 4 A specific implementation of step S2 is shown, which is described in detail as follows:
[0047] S21: When other devices in the ad hoc network receive the negotiation number, the other devices reply their own device numbers to the new device.
[0048] S22: When the new device receives the preset number of other device own device numbers, the preset number of other device own device numbers are processed by set union to obtain a set union result.
[0049] S23: Based on the set union result, an unused random device number is obtained as the device number of the new device.
[0050] Specifically, when each other device in the ad hoc network receives the probe data including the negotiation number sent by the new device, the other device judges that it is the negotiation data of the new device, and then each other device replies its own device number to the new device according to its own position in the negotiation block; after the new device receives the reply of the device in the negotiation time slot block for P times (default 3), the new device performs set union on the P times of results, and then selects an unused number as the device number of the new device according to the set union result and the communication specification, and updates the device number of the new device to the local routing table.
[0051] Further, a specific embodiment is provided after step S2, which is described in detail as follows:
[0052] The device number of the new device and the own device number of the other device are updated to the local routing table.
[0053] Specifically, updating the device number of the new device and the own device number of the other device to the local routing table can delete the off-network device in the subsequent process.
[0054] S3: In each time slot, the response data sent back by each device in the ad hoc network is acquired by the current device, and the distance between the current device and other devices is calculated according to the ranging parameter in the response data.
[0055] Specifically, the embodiment of the present application can use the common double-sided two-way ranging (DS-TWR) mode to range the devices in the ad hoc network.
[0056] Please refer to Figure 5 and Figure 6 , Figure 5 a specific implementation of step S3 is shown, Figure 6 is a schematic diagram of the double-sided two-way ranging provided by the embodiment of the present application. Of course, according to the actual scene, other ranging algorithms can also be used, as long as the content flow of the present application is followed to complete the required two-way communication and obtain the necessary ranging parameters, which are described in detail as follows:
[0057] S31: In each time slot, the current device acquires response data sent back by each device in the ad hoc network according to ranging requirements, wherein the ranging parameters are included in the response data.
[0058] S32: The distance between the current device and the device corresponding to the response data is calculated according to the ranging parameters.
[0059] Specifically, in the k time slot block, k is the number of devices, and DS-TWR is performed in each time slot to complete the DS-TWR ranging by sending->receiving->sending->receiving (sending data->receiving data->sending data->receiving data) with other N-1 devices. The data sent by the source device each time carries the device number of the opposite party (destination device number) and the device number of itself (source device number), so only the device with the same device number and destination device number will respond to the agreed data, thereby avoiding confusion and collision. When the other receiving devices receive the data of the k device, if it is found that the source device number is not the legal device number of the negotiated number, the source device number is recorded in the local routing table.
[0060] S4: If the current device is in the active sending time slot block, it is determined whether there is a continuous N times of missing preset proportion of valid responses, and if so, the device number of the current device is reset to a new negotiated number, and the next period of network entry negotiation process is performed.
[0061] Specifically, because the positions of the devices in the ad hoc network are discrete in the actual scene space, and are limited by the communication distance, the actual topology of the entire ad hoc network may be blocked, and when multiple devices in the existing network block approach, number conflict may occur, and the devices that conflict need to be re-negotiated, that is, the devices that conflict generate a new number and rejoin the ad hoc network. N is a positive integer.
[0062] Further, an embodiment of step S4 is provided, which is described in detail as follows:
[0063] If the current device is in the active sending time slot block, the current device receives valid response information.
[0064] It is determined whether there is a continuous N times of missing preset proportion of valid request responses in the valid response information, and if so, it is determined that the device number of the current device overlaps with that of other devices.
[0065] The device number of the current device is obtained as the overlapping device number, and the overlapping device number is reset to a new negotiated number.
[0066] Based on the new negotiated number, the current device is re-performed in the next period of network entry negotiation process.
[0067] Specifically, if multiple network blocks in the ad hoc network are physically close, signal sensing occurs, which means that a device receives a new device number. If the device numbers do not overlap, the transceiving communication proceeds normally, and the number of the newly added device is directly updated to the local routing table. The number of failed responses in a preset period is obtained, and whether the number of failed responses exceeds a preset threshold is determined to determine whether the device numbers overlap, to obtain a determination result. For example, multiple devices with device numbers send signals in the same time slot, causing actual transmitted data to interfere with each other, and other devices receive and check failed or invalid signals, resulting in no response or a total number of failed responses >= 2 (preset value) in M times (assuming M = 4, 1, 2, 3, and 4) of interaction that should be performed. It is determined that the current process fails. When 3 times of communication processes fail in the latest 5 times (period) (this threshold can be adjusted), the number of failed responses in a preset period is obtained, and whether the number of failed responses exceeds a preset threshold is determined. If the preset threshold is exceeded, it is considered that there is a collision, that is, the device numbers overlap. The preset proportion is set according to the actual situation, which is not limited here. In a specific embodiment, the preset proportion is 85%.
[0068] Specifically, if the determination result is that the device numbers overlap, the device number is marked as a new negotiation number, and the new negotiation number and the device corresponding to the new negotiation number are reprocessed in the next period of network negotiation, that is, the corresponding device is re-added to step S1 to re-generate a new number for the device.
[0069] S5: Determine whether the current device has lost a specific device response for N consecutive times. If so, delete the device number of the specific device from the local routing table.
[0070] Please refer to Figure 7 , Figure 7 An embodiment of step S5 is shown, which is described as follows:
[0071] S51: Obtain the valid response condition received by the current device.
[0072] S52: Determine whether there is a specific device response missing for N consecutive times in the valid response condition. If so, the specific device is considered as a device that is offline.
[0073] S53: Identify the device number of the offline device in the local routing table as a device number to be deleted, and delete the device number to be deleted from the local routing table.
[0074] Specifically, in an actual scene, when the device is far away from the use scene, the device is powered off or the device is offline, the device needs to be removed from the ad hoc network, so that it does not initiate a corresponding ranging request in the corresponding time slot, thereby avoiding wasting power consumption and channel occupation. Therefore, in the ad hoc network, it is judged whether there is a device that does not send corresponding communication in a preset period. If there is a device that does not send corresponding communication in a preset period, the device that does not send corresponding communication is regarded as an offline device. For example, if a device with an existing serial number does not send the first communication in the active sending time slot block in the next 3 periods, it is judged that the opposite device has been offline, and the opposite device number is removed from the local routing table. When the offline device is determined, the device number of the offline device in the local routing table is identified as a to-be-deleted device number, and the to-be-deleted device number is deleted from the local routing table, so as to remove the offline device from the ad hoc network.
[0075] In the embodiment, when the new device accesses the ad hoc network, the starting point of the negotiation time slot block is generated, and the negotiation data corresponding to the new device is sent based on the starting point, wherein the negotiation data includes the negotiation number of the new device; when the other devices in the ad hoc network receive the negotiation number, the device number of the other devices themselves is received by the new device in reply to the other devices, and the unused device number is obtained based on the device number of the other devices themselves, as the device number of the new device; in each time slot, the response data sent back by each device in the ad hoc network is obtained by the current device, and the distance between the current device and the other devices is calculated according to the ranging parameters in the response data; if the current device is in the active sending time slot block, it is judged whether the current device has lost a preset proportion of valid responses for N times in succession, if so, the device number of the current device is reset to a new negotiation number, and the next period of network negotiation processing procedure is re-performed, wherein N is a positive integer; it is judged whether the current device has lost a specific device response for N times in succession, if so, the device number of the specific device is deleted from the local routing table. The embodiment of the application adds the new device to the ad hoc network and obtains the device number of the new device, so as to realize mutual ranging between multiple devices without a base station device, which is not limited by the place, judges whether the device numbers of the devices overlap, realizes fusion of the devices, and can identify the offline device in time and delete the device number of the offline device, thereby improving the accuracy and flexibility of mutual ranging between multiple devices.
[0076] Please refer to Figure 8 , as an implementation of the method shown in Figure 1 , the application provides an embodiment of a device-to-device mutual ranging device based on time synchronization, which corresponds to the method embodiment shown in Figure 1 , and the device can be applied to various electronic devices.
[0077] As Figure 8 shown, the time synchronization based inter-device mutual ranging device of the embodiment includes a network access negotiation module 61, a new number generation module 62, a network access ranging module 63, a device fusion generation module 64, and a device network exit processing module 65, wherein:
[0078] The network access negotiation module 61 is configured to generate a starting point of a negotiation time slot block when a new device accesses the ad hoc network, and send the detection data corresponding to the new device based on the starting point, wherein the detection data includes the negotiation number of the new device.
[0079] The new number generation module 62 is configured to receive the device numbers of other devices returned by other devices through the new device when the other devices in the ad hoc network receive the negotiation number, and obtain the unused device number as the device number of the new device based on the device numbers of the other devices.
[0080] The network access ranging module 63 is configured to obtain the response data returned by each device in the ad hoc network through the current device in each time slot, and calculate the distance between the current device and other devices according to the ranging parameters in the response data.
[0081] The device fusion generation module 64 is configured to determine whether the current device has lost the valid response of a preset proportion for N times in succession if the current device is in the active sending time slot block, and reset the device number of the current device as a new negotiation number and re-perform the network access negotiation process of the next period if the current device has lost the valid response of the preset proportion for N times in succession, wherein N is a positive integer.
[0082] The device network exit processing module 65 is configured to determine whether the current device has lost the response of a specific device for N times in succession, and delete the device number of the specific device from the local routing table if the current device has lost the response of the specific device for N times in succession.
[0083] Further, the device network exit processing module 65 includes:
[0084] A situation acquisition unit is configured to acquire the situation of receiving valid responses by the current device.
[0085] A network exit device determination module is configured to determine whether the specific device is a network exit device if the specific device has lost the response for N times in succession in the valid response situation.
[0086] A device number deletion module is configured to identify the device number of the network exit device in the local routing table as a to-be-deleted device number, and delete the to-be-deleted device number from the local routing table.
[0087] Further, the network access negotiation module 61 includes:
[0088] A starting point generation unit is configured to generate a starting point of a negotiation time slot block according to a predetermined period and an alignment time when a new device accesses the ad hoc network;
[0089] A random channel generation unit is configured to randomly obtain a random number according to the concurrent access capability, and generate a random channel based on the starting point and the random number;
[0090] A probe data sending unit is configured to send probe data corresponding to the new device through the random channel.
[0091] Further, the new number generation module 62 comprises:
[0092] A self device number sending unit is configured to reply to the new device with a self device number of other devices when other devices in the ad hoc network receive the negotiation number;
[0093] A union result generation unit is configured to perform a union set processing on the self device numbers of the preset number of other devices to obtain a union result when the new device receives the self device numbers of the preset number of other devices.
[0094] A new number updating unit is configured to obtain a random device number that is not used as the device number of the new device based on the union result.
[0095] Further, the network entry ranging module 63 comprises:
[0096] A received data generation unit is configured to obtain response data sent back by each device in the ad hoc network according to the ranging requirement of the current device in each time slot, wherein the response data comprises ranging parameters.
[0097] A device ranging unit is configured to calculate the distance between the current device and the device corresponding to the response data according to the ranging parameters.
[0098] Further, the network entry ranging module 63 further comprises:
[0099] A device number updating module is configured to update the device number of the new device and the self device number of other devices into a local routing table.
[0100] Further, the judgment result generation module 64 comprises:
[0101] An effective request condition unit is configured to obtain an effective response condition of the current device if the current device is in the active sending time slot block.
[0102] An overlap judgment unit is configured to judge whether there is a preset proportion of consecutive N times of missing effective request responses in the effective response condition, and if there is, it is determined that the device number of the current device overlaps with that of other devices.
[0103] The device number resetting unit is configured to acquire a device number of the current device as an overlapping device number, and reset the overlapping device number as a new negotiation number.
[0104] The negotiation resetting unit is configured to re-perform, based on the new negotiation number, the next-period network access negotiation process of the current device.
[0105] To solve the above technical problems, the embodiment of the present application further provides a terminal device. For details, please refer to Figure 9 , Figure 9 The basic structure block diagram of the terminal device of the present embodiment is shown in FIG. 7.
[0106] The terminal device 7 includes a memory 71, a processor 72, and a network interface 73 which are connected to each other through a system bus and communicate with each other. It should be noted that only the terminal device 7 with three components, the memory 71, the processor 72, and the network interface 73 is shown in the figure, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be alternatively implemented. Among them, those skilled in the art can understand that the terminal device here is a device capable of automatically performing numerical calculation and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0107] The memory 71 includes at least one type of readable storage medium, including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 71 can be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7. In other embodiments, the memory 71 can also be an external storage device of the terminal device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 7. Of course, the memory 71 can also include both the internal storage unit and the external storage device of the terminal device 7. In the present embodiment, the memory 71 is generally used to store an operating system and various application software installed on the terminal device 7, such as program codes of the time synchronization-based mutual ranging method between devices, etc. In addition, the memory 71 can also be used to temporarily store various data that have been output or will be output.
[0108] The processor 72 can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 72 is generally used to control the overall operation of the terminal device 7. In the present embodiment, the processor 72 is used to run program codes or process data stored in the memory 71, such as running program codes of the time synchronization-based mutual ranging method between devices to implement various embodiments of the time synchronization-based mutual ranging method between devices.
[0109] The network interface 73 can include a wireless network interface or a wired network interface, and the network interface 73 is generally used to establish a communication connection between the terminal device 7 and other electronic devices.
[0110] The present application also provides another implementation, i.e., to provide a computer readable storage medium, which stores a computer program, and the computer program can be executed by at least one processor to make the at least one processor execute the steps of the time synchronization-based mutual ranging method between devices as described above.
[0111] Those skilled in the art can clearly understand the above-mentioned embodiment method can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the method of each embodiment of the present application.
[0112] Obviously, the above-described embodiments are only some of the embodiments of the present application, not all the embodiments, and the drawings show the preferred embodiments of the present application, but do not limit the patent scope of the present application. The present application can be implemented in many different forms, and conversely, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing specific embodiments, or make equivalent replacements to some technical features. Any equivalent structure made by using the content of the specification and drawings, directly or indirectly applied to other related technical fields, is also within the scope of the patent protection of the present application.
Claims
1. A time synchronization based inter-device mutual ranging method, characterized in that, The application comprises the following steps: When a new device accesses the ad hoc network, a starting point of negotiation time slot block is generated, and the starting point is used to send the probe data corresponding to the new device, wherein the negotiation number of the new device is included in the probe data; When other devices in the ad hoc network receive the negotiation number, the device number of the other devices is received by the new device, and a used number set is constructed based on all received device numbers, the used number set is excluded from a predefined device number range, and an unused device number is randomly selected as the device number of the new device; In each time slot, the response data sent by each device in the ad hoc network is acquired by the current device, and the distance between the current device and other devices is calculated according to the ranging parameter in the response data; If the current device is in the active sending time slot block, it is judged whether the current device has lost a preset proportion of valid responses for N times in succession, if yes, the device number of the current device is reset as a new negotiation number, and the next period of network access negotiation process is re-performed, wherein N is a positive integer; It is judged whether the current device has lost the specific device response for N times in succession, if yes, the device number of the specific device is deleted from the local routing table.
2. The time synchronization based inter-device mutual ranging method according to claim 1, wherein, The judgment whether the current device has lost the specific device response for N times in succession, if yes, the device number of the specific device is deleted from the local routing table, comprising: The valid response condition received by the current device is acquired; It is judged whether the specific device response is lost for N times in succession in the valid response condition, if yes, the specific device is regarded as a network withdrawal device; The device number of the network withdrawal device in the local routing table is identified as a to-be-deleted device number, and the to-be-deleted device number is deleted from the local routing table.
3. The time synchronization based inter-device mutual ranging method according to claim 1, wherein, The generation of the starting point of negotiation time slot block when a new device accesses the ad hoc network, and the sending of the probe data corresponding to the new device based on the starting point, wherein the negotiation number of the new device is included in the probe data, comprising: When the new device accesses the ad hoc network, the starting point of the negotiation time slot block is generated according to a predefined period and alignment time; A random number is randomly acquired according to the concurrent access capability, and a random channel is generated based on the starting point and the random number; The probe data corresponding to the new device is sent through the random channel.
4. The time synchronization based inter-device mutual ranging method according to claim 1, wherein, When other devices in the ad hoc network receive the negotiation number, the device number of the other devices is received by the new device, and a used number set is constructed based on all received device numbers, the used number set is excluded from a predefined device number range, and an unused device number is randomly selected as the device number of the new device, comprising: When the other devices in the ad hoc network receive the negotiation number, the device number of the other devices is replied to the new device by the other devices; When the new device receives a preset number of other device self-device numbers, the preset number of other device self-device numbers are processed by set union to obtain the used number set; The used number set is excluded from the predefined global device number range to obtain the unused number set, and a number is randomly selected from the unused number set as the device number of the new device.
5. The time synchronization based inter-device mutual ranging method according to claim 1, wherein, When the other devices in the ad hoc network receive the negotiation number, the other device self-device numbers replied by the other devices are received by the new device, and an unused device number is obtained based on the other device self-device numbers as the device number of the new device, and the method further comprises: The device number of the new device and the other device self-device numbers are updated into the local routing table.
6. The time synchronization based inter-device mutual ranging method according to claim 1, wherein, In each time slot, the response data sent back by each device in the ad hoc network is obtained by the current device, and the distance between the current device and other devices is calculated according to the ranging parameters in the response data, including: In each time slot, the response data sent back by each device in the ad hoc network is obtained by the current device according to the ranging requirement, wherein the response data includes ranging parameters; The distance between the current device and the device corresponding to the response data is calculated according to the ranging parameters.
7. The time synchronization based inter-device mutual ranging method according to any one of claims 1 to 6, characterized in that, If the current device is in the active sending time slot block, it is judged whether the current device has a continuous N times of missing preset proportion of valid responses, if there is, the device number of the current device is reset to a new negotiation number, and the next period of network entry negotiation processing procedure is performed again, including: If the current device is in the active sending time slot block, the valid response condition of the current device is obtained; It is judged whether there is a continuous N times of missing preset proportion of valid request responses in the valid response condition, if there is, it is determined that the device number of the current device overlaps with that of other devices; The device number of the current device is obtained as an overlapping device number, and the overlapping device number is reset to a new negotiation number; Based on the new negotiation number, the current device is re-performed in the next period of network entry negotiation processing procedure.
8. A time synchronization based inter-device mutual ranging apparatus, characterized by, Including: The negotiation module is used for generating the starting point of the negotiation time slot block when the new device accesses the ad hoc network, and sending the detection data corresponding to the new device based on the starting point, wherein the detection data includes the negotiation number of the new device; The new number generation module is used for receiving the other device self-device numbers replied by the other devices through the new device when the other devices in the ad hoc network receive the negotiation number, and constructing a used number set based on all received device numbers, excluding the used number set from the predefined device number range, and randomly selecting an unused device number as the device number of the new device; The network entry ranging module is configured to acquire, in each time slot, response data sent back by each device in the ad hoc network by the current device, and calculate distances between the current device and other devices according to ranging parameters in the response data; The device fusion generation module is configured to, if the current device is in an active sending time slot block, judge whether the current device has lost a preset proportion of valid responses for N times in succession, reset a device number of the current device as a new negotiation number, and re-perform a network entry negotiation processing procedure in a next period, wherein N is a positive integer. The device withdrawal processing module is configured to judge whether the current device has lost specific device responses for N times in succession, and delete a device number of the specific device from a local routing table if the specific device responses are lost for the N times in succession.
9. A terminal device, comprising: The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the time synchronization based mutual ranging method between devices according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the time synchronization based mutual ranging method between devices according to any one of claims 1 to 7.
Citation Information
Patent Citations
Registration method for dynamic networking equipment
CN105635321A
Time synchronization method and system of ad hoc network communication system and readable storage medium
CN109699071A