WO2022222006A1 - 测距方法、装置、通信设备及存储介质 - Google Patents

测距方法、装置、通信设备及存储介质 Download PDF

Info

Publication number
WO2022222006A1
WO2022222006A1 PCT/CN2021/088204 CN2021088204W WO2022222006A1 WO 2022222006 A1 WO2022222006 A1 WO 2022222006A1 CN 2021088204 W CN2021088204 W CN 2021088204W WO 2022222006 A1 WO2022222006 A1 WO 2022222006A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
terminal
random number
public key
replayed
Prior art date
Application number
PCT/CN2021/088204
Other languages
English (en)
French (fr)
Inventor
于磊
李小龙
Original Assignee
北京小米移动软件有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京小米移动软件有限公司 filed Critical 北京小米移动软件有限公司
Priority to PCT/CN2021/088204 priority Critical patent/WO2022222006A1/zh
Priority to CN202180001196.4A priority patent/CN115606216A/zh
Publication of WO2022222006A1 publication Critical patent/WO2022222006A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information

Definitions

  • the present disclosure relates to the field of wireless communication technologies, but is not limited to the field of wireless communication technologies, and in particular, relates to a ranging method, apparatus, communication device, and storage medium.
  • the ToF method is a very popular ranging technology.
  • the measuring device sends a measuring signal to the device under test.
  • the device under test returns the measurement signal after receiving the measurement signal, and the measurement device can calculate the distance between the devices according to the flight time of the measurement signal.
  • the embodiments of the present disclosure disclose a ranging method, an apparatus, a communication device, and a storage medium.
  • a ranging method is provided, wherein the method is performed by a first terminal, and the method includes:
  • it also includes:
  • integrity protection is performed on the first message and/or the third message.
  • the method further includes:
  • the determining of the sending operation of the third message according to the determination result of whether the second message is replayed includes:
  • the first message is further used to indicate at least one of the following:
  • the second message is further used to indicate at least one of the following:
  • the application ID encrypted by the first public key is used to trigger the second terminal to send the second message;
  • the second message indicates the first random number encrypted by the first public key; the method further includes:
  • the first message is replayed, and the first random number decrypted by the first private key is a repeated random number.
  • the second message indicates the second random number encrypted by the first public key; the method further includes:
  • the second message indicates the application ID; and the sending to the second terminal a third message encrypted with the second public key includes:
  • the third message determined based on the application ID is sent to the second terminal.
  • the third message is further used to indicate at least one of the following:
  • a ranging method is provided, wherein the method is performed by a second terminal, and the method includes:
  • the method further includes:
  • integrity-protected verification is performed on the first message.
  • the method further includes:
  • the determining of the sending operation of the second message according to the result of the verification of the integrity includes:
  • the method further includes:
  • integrity-protected verification is performed on the third message.
  • the third message is further used to indicate at least one of the following:
  • the third message indicates the third random number encrypted by the second public key; the method further includes:
  • the third message indicates the ID of the first terminal; the method further includes:
  • the determining whether to measure the distance between the first terminal and the second terminal according to the ID of the first terminal includes:
  • the ID of the first terminal is not a predetermined ID; it is determined that the distance between the first terminal and the second terminal is not measured.
  • the method further includes:
  • the distance between the first terminal and the second terminal is determined based on the first time difference and the second time difference, where the second time difference is the time when the first message is received and the time when the second message is sent time difference.
  • the first message is further used to indicate at least one of the following:
  • the second message is further used to indicate at least one of the following:
  • the application ID encrypted by the first key is used to trigger the second terminal to send the second message;
  • a distance measuring device comprising:
  • a sending module configured to broadcast a first message, where the first message is used to indicate the first public key of the device
  • a first receiving module configured to receive a second message sent by a second terminal, where the second message is used to indicate the second public key of the second terminal encrypted by the first public key;
  • a first sending module configured to send a third message encrypted by the second public key to the second terminal, where the third message is used to indicate the sending moment of the first message and the reception of the second message The first time difference in time.
  • a distance measuring device comprising:
  • a receiving module configured to receive a first message sent by a first terminal, where the first message is used to indicate a first public key of the first terminal;
  • a first sending module configured to send a second message to the first terminal, where the second message is used to indicate the second public key of the second terminal encrypted by the first public key;
  • a second receiving module configured to receive a third message encrypted by the second public key sent by the device, where the third message is used to indicate the sending moment of the first message and the receiving moment of the second message
  • the first time difference is used to determine the distance between the first terminal and the device.
  • a communication device comprising:
  • a memory for storing the processor-executable instructions
  • the processor is configured to: when executing the executable instructions, implement the method described in any embodiment of the present disclosure.
  • a computer storage medium stores a computer-executable program, and when the executable program is executed by a processor, implements the method described in any embodiment of the present disclosure.
  • broadcast a first message where the first message is used to indicate the first public key of the first terminal; receive a second message sent by a second terminal, where the second message is used to indicate the first public key of the first terminal A second public key of the second terminal encrypted with a public key; sending a third message encrypted by the second public key to the second terminal, where the third message is used to indicate the sending of the first message
  • the first time difference between the time and the receiving time of the second message when measuring the distance between the first terminal and the second terminal, the first public key is indicated by the first message; the second public key is indicated by the second message and all The second public key is encrypted by the first public key; and the third message is encrypted by the second public key.
  • the technical solution of the present application carries the safety information in the first message and the second message for ranging. While being safe, it can reduce the consumption of signaling resources and save time for ranging.
  • FIG. 1 is a schematic structural diagram of a wireless communication system according to an exemplary embodiment.
  • FIG. 2 is a schematic diagram of a ranging method according to an exemplary embodiment.
  • Fig. 3 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 4 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 5 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 6 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 7 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 8 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 9 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 10 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 11 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 12 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 13 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 14 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 15 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 16 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 17 is a schematic flowchart of a ranging method according to an exemplary embodiment.
  • Fig. 18 is a schematic diagram of a distance measuring apparatus according to an exemplary embodiment.
  • Fig. 19 is a schematic diagram of a distance measuring device according to an exemplary embodiment.
  • FIG. 20 is a schematic structural diagram of a terminal according to an exemplary embodiment.
  • Fig. 21 is a block diagram of a base station according to an exemplary embodiment.
  • first, second, third, etc. may be used in embodiments of the present disclosure to describe various pieces of information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.
  • the word "if” as used herein can be interpreted as "at the time of” or "when” or "in response to determining.”
  • the terms “greater than” or “less than” are used herein when characterizing the relationship of size. However, those skilled in the art can understand that the term “greater than” also covers the meaning of “greater than or equal to”, and “less than” also covers the meaning of "less than or equal to”.
  • FIG. 1 shows a schematic structural diagram of a wireless communication system provided by an embodiment of the present disclosure.
  • the wireless communication system is a communication system based on a mobile communication technology, and the wireless communication system may include: several user equipments 110 and several base stations 120 .
  • the user equipment 110 may be a device that provides voice and/or data connectivity to the user.
  • User equipment 110 may communicate with one or more core networks via a Radio Access Network (RAN), and user equipment 110 may be IoT user equipment such as sensor devices, mobile phones, and computers with IoT user equipment For example, it may be a stationary, portable, pocket-sized, hand-held, computer-built, or vehicle-mounted device.
  • RAN Radio Access Network
  • IoT user equipment such as sensor devices, mobile phones, and computers with IoT user equipment
  • it may be a stationary, portable, pocket-sized, hand-held, computer-built, or vehicle-mounted device.
  • station Ses, STA
  • subscriber unit subscriber unit
  • subscriber station subscriber station
  • mobile station mobile station
  • mobile station mobile station
  • remote station remote station
  • access terminal remote user equipment
  • user terminal user terminal
  • user agent user device
  • user equipment or user equipment.
  • the user equipment 110 may also be a device of an unmanned aerial vehicle.
  • the user equipment 110 may also be an in-vehicle device, for example, a trip computer with a wireless communication function, or a wireless user equipment connected to an external trip computer.
  • the user equipment 110 may also be a roadside device, for example, may be a street light, a signal light, or other roadside devices with a wireless communication function.
  • the base station 120 may be a network-side device in a wireless communication system.
  • the wireless communication system may be a fourth generation mobile communication (the 4th generation mobile communication, 4G) system, also known as a long term evolution (Long Term Evolution, LTE) system; or, the wireless communication system may also be a 5G system, Also known as New Radio System or 5G NR System.
  • the wireless communication system may also be a next-generation system of the 5G system.
  • the access network in the 5G system can be called NG-RAN (New Generation-Radio Access Network, a new generation of radio access network).
  • the base station 120 may be an evolved base station (eNB) used in the 4G system.
  • the base station 120 may also be a base station (gNB) that adopts a centralized distributed architecture in a 5G system.
  • eNB evolved base station
  • gNB base station
  • the base station 120 adopts a centralized distributed architecture it usually includes a centralized unit (central unit, CU) and at least two distributed units (distributed unit, DU).
  • the centralized unit is provided with a protocol stack of a Packet Data Convergence Protocol (PDCP) layer, a Radio Link Control Protocol (Radio Link Control, RLC) layer, and a Media Access Control (Media Access Control, MAC) layer; distribution A physical (Physical, PHY) layer protocol stack is set in the unit, and the specific implementation manner of the base station 120 is not limited in this embodiment of the present disclosure.
  • PDCP Packet Data Convergence Protocol
  • RLC Radio Link Control Protocol
  • MAC Media Access Control
  • distribution A physical (Physical, PHY) layer protocol stack is set in the unit, and the specific implementation manner of the base station 120 is not limited in this embodiment of the present disclosure.
  • a wireless connection can be established between the base station 120 and the user equipment 110 through a wireless air interface.
  • the wireless air interface is a wireless air interface based on the fourth generation mobile communication network technology (4G) standard; or, the wireless air interface is a wireless air interface based on the fifth generation mobile communication network technology (5G) standard, such as
  • the wireless air interface is a new air interface; alternatively, the wireless air interface may also be a wireless air interface based on a 5G next-generation mobile communication network technology standard.
  • an E2E (End to End, end-to-end) connection may also be established between the user equipments 110 .
  • V2V vehicle to vehicle, vehicle-to-vehicle
  • V2I vehicle to Infrastructure, vehicle-to-roadside equipment
  • V2P vehicle to pedestrian, vehicle-to-person communication in vehicle-to-everything (V2X) communication etc. scene.
  • the above-mentioned user equipment may be regarded as the terminal equipment of the following embodiments.
  • the above wireless communication system may further include a network management device 130 .
  • the network management device 130 may be a core network device in a wireless communication system, for example, the network management device 130 may be a mobility management entity (Mobility Management Entity) in an evolved packet core network (Evolved Packet Core, EPC). MME). Alternatively, the network management device may also be other core network devices, such as a serving gateway (Serving GateWay, SGW), a public data network gateway (Public Data Network GateWay, PGW), a policy and charging rules functional unit (Policy and Charging Rules) Function, PCRF) or home subscriber server (Home Subscriber Server, HSS), etc.
  • the implementation form of the network management device 130 is not limited in this embodiment of the present disclosure.
  • the embodiments of the present disclosure enumerate multiple implementation manners to clearly illustrate the technical solutions of the embodiments of the present disclosure.
  • the multiple embodiments provided by the embodiments of the present disclosure may be executed independently, or may be executed together with the methods of other embodiments in the embodiments of the present disclosure, or may be executed alone or in combination and then executed together with some methods in other related technologies; this is not limited by the embodiments of the present disclosure.
  • the ToF ranging method is a two-way ranging technology, which uses the round-trip flight time of the data signal between the transmitter and the receiver to measure the distance between two points.
  • the time interval between the transmitter sending the data signal and receiving the response signal from the receiver is denoted as Tt
  • Tr time interval between the receiver receiving the data signal from the transmitter and sending the response signal.
  • the one-way flight time Tf (Tt-Tr)/2 of the signal between the transmitting end and the receiving end, then the distance between the two points is d
  • d c*Tf, where c represents the electromagnetic wave propagation speed.
  • the first message sent by the discovering device contains positioning requirement information
  • the second message sent by the discovered device provides positioning information.
  • the location information is used for the discovery device to determine the location information between the two devices. Because the discovery process must be in clear text, information transmitted between devices is vulnerable to interception and misuse.
  • the inter-device location measurement process is divided into three steps: device discovery, authentication, authorization, and measurement. This process solves the problem of information security, but in public places that require frequent ranging, it brings a lot of signaling burden and increases delay.
  • this embodiment provides a ranging method, wherein the method is executed by a first terminal, and the method includes:
  • Step 31 Broadcast a first message, where the first message is used to indicate the first public key of the first terminal;
  • Step 32 Receive a second message sent by the second terminal, where the second message is used to indicate the second public key of the second terminal encrypted by the first public key;
  • Step 33 Send a third message encrypted with the second public key to the second terminal, where the third message is used to indicate the first time difference between the time when the first message is sent and the time when the second message is received.
  • the first terminal and the second terminal may be, but not limited to, a mobile phone, a wearable device, a vehicle-mounted terminal, a roadside unit (RSU, Road Side Unit), a smart home terminal, an industrial sensing device and/or a medical device Wait.
  • a mobile phone a wearable device
  • vehicle-mounted terminal a roadside unit (RSU, Road Side Unit)
  • RSU Road Side Unit
  • smart home terminal an industrial sensing device and/or a medical device Wait.
  • the first message may be broadcast periodically.
  • the period for broadcasting the first message may be determined according to the time delay requirement of ranging.
  • the period of broadcasting the first message in response to the ranging delay requirement being greater than the delay threshold, it is determined that the period of broadcasting the first message is greater than the period threshold.
  • the period of broadcasting the first message is less than the period threshold. In this way, the period of broadcasting the first message can be adapted to the delay requirement of ranging.
  • the first terminal may send the first message by broadcasting.
  • the second terminal may receive first messages sent by a plurality of first terminals in a broadcast manner. After receiving the first messages sent by the plurality of first terminals in a broadcast manner, the second terminal may discard some of the received first messages. In one embodiment, when the terminal sending the first message is not a terminal preset by the second terminal, the second terminal will discard the first message sent by the terminal. In another embodiment, when the terminal sending the first message is a terminal preset by the second terminal and is not a terminal that needs to be connected for ranging, the second terminal will discard the first message sent by the terminal.
  • the secret key of the first terminal includes a first public key and a first private key. After receiving the information encrypted by the second terminal using the first public key, the first terminal can decrypt the information using the first private key. encrypted information. After receiving the information encrypted by the first terminal using the first private key, the second terminal can decrypt the encrypted information using the first public key.
  • the first terminal may send the first public key to the second terminal in advance. In this way, the security of information transmission between the first terminal and the second terminal can be ensured.
  • the secret key of the second terminal includes a second public key and a second private key. After receiving the information encrypted by the first terminal using the second public key, the second terminal can decrypt the information using the second private key. encrypted information. After receiving the information encrypted by the second terminal using the second private key, the first terminal can decrypt the encrypted information using the second public key.
  • the second terminal may send the second public key to the first terminal in advance. In this way, the security of information transmission between the first terminal and the second terminal can be ensured.
  • the second terminal sends the second message to the first terminal in response to receiving the first message sent by the first terminal and determining that the first terminal is a preset terminal.
  • the preset terminal may be configured in a terminal set, and the terminal set is provided with an identifier including at least one first terminal used for ranging between the first terminal and the second terminal.
  • the second terminal may determine whether the identifier of the first terminal carried in the first message is in the terminal set. In response to the identification of the first terminal carried in the first message being in the terminal set, the second message is sent to the first terminal.
  • the first terminal when the first terminal broadcasts the first message, it will record the sending time of the first message; when the first terminal receives the second message sent by the second terminal, it will record the receiving time of the second message; A terminal will determine the first time difference between the sending time and the receiving time according to the sending time and the receiving time. and send the information of the first time difference to the second terminal through a third message.
  • the second terminal when the second terminal receives the first message sent by the first terminal, it records the reception time of the first message; when the second terminal sends the second message to the first terminal, it records the sending time of the second message time; the second terminal will determine the second time difference between the sending time and the receiving time according to the receiving time and the sending time. After receiving the first time difference sent by the first terminal, the second terminal determines the difference between the first time difference and the second time difference, and determines the difference between the first terminal and the second terminal based on the difference and the electromagnetic wave propagation speed distance.
  • the second terminal may determine the distance between the first terminal and the second terminal by using an average value of the distances measured within a predetermined period of time. In this way, the measurement accuracy of the distance between the first terminal and the second terminal can be improved.
  • the duration of the predetermined period is determined according to the required measurement accuracy.
  • the predetermined period of time is determined to have a duration greater than the duration threshold in response to a requirement that the measurement accuracy be greater than or equal to the accuracy threshold.
  • the predetermined duration is determined to be less than or equal to the duration threshold in response to the required measurement accuracy being less than the accuracy threshold.
  • using the second public key to encrypt the third message may be using the second public key to encrypt information such as the first time difference and the identity of the first terminal in the third message.
  • the second terminal may discard the third message after receiving the third message in response to receiving the third message and failing to decrypt the third message using the second private key. In this way, the security of data transmission between the first terminal and the second terminal can be ensured.
  • the first terminal sends the third message to the second terminal in response to receiving the second message sent by the second terminal and determining that the first message and/or the second message has not been replayed.
  • the second terminal sends the second message to the first terminal in response to receiving the first message sent by the first terminal and determining that the first message is not replayed.
  • the first message indicating the first public key of the first terminal includes: the first message carries the first public key; or the first message carries indication information indicating the first public key. For example, the indication information "00" indicates the first public key.
  • the first public key is indicated by the first message; the second public key is indicated by the second message, and the second public key is replaced by the first public key. encrypting; and encrypting the third message with the second public key.
  • the technical solution of the present application carries the safety information in the first message and the second message for ranging. While being safe, it can reduce the consumption of signaling resources and save time for ranging.
  • a ranging method is provided in this embodiment, wherein the method is performed by a first terminal, and the method includes:
  • Step 41 Perform integrity protection on the first message and/or the third message based on the first private key of the first terminal.
  • the first terminal uses a predetermined integrity protection algorithm, takes at least one of the key, the message itself, and the length of the message as input parameters, calculates a first verification code containing multiple bits, and uses The first verification code is carried in the information field of the first message and/or the third message.
  • the second terminal calculates the second verification code of the first message and/or the third message with the same calculation method, and compares the first verification code with the second verification code The code determines whether the integrity protection check was successful. If the first verification code is the same as the second verification code, the second terminal determines that the verification of the integrity protection is successful; otherwise, determines that the verification of the integrity protection fails.
  • the second terminal discards the first message after receiving the first message in response to the failure to verify the integrity protection of the first message. In another embodiment, the second terminal discards the third message after receiving the third message in response to the failure to verify the integrity protection of the third message.
  • this embodiment provides a ranging method, wherein the method is performed by a first terminal, and the method includes:
  • Step 51 Determine that the first terminal determines that the first message is replayed; discard the second message;
  • the first terminal determines that the first message is not replayed; it is determined whether to send the third message according to the result of whether the second message is replayed.
  • the replay of the first message may be that the third terminal broadcasts the first message after acquiring the first message. Wherein, the third terminal is different from the first terminal.
  • the first message carries an encrypted first random number, where the first random number is generated by the first terminal. After the second terminal receives the first message carrying the first random number, if the second terminal receives the first message carrying the first random number again, it is determined that the first message is played back. It should be noted that the second terminal may send a message indicating that the first message is played back to the first terminal.
  • the first message carries an encrypted first random number, where the first random number is generated by the first terminal.
  • the second terminal After receiving the first message carrying the first random number, the second terminal sends a second message carrying the first random number to the first terminal, and the first terminal receives the second message carrying the first random number Afterwards, if the second message carrying the first random number is received again, it is determined that the first message is replayed.
  • the second message carries an encrypted second random number, where the second random number is generated by the second terminal. After the first terminal receives the second message carrying the second random number, if it receives the second message carrying the second random number again, it is determined that the second message is replayed.
  • the second message in response to determining that the first message was replayed, the second message is discarded and the first terminal does not send the third message to the second terminal.
  • this embodiment provides a ranging method, wherein the method is performed by a first terminal, and the method includes:
  • Step 61 determine that the second message is replayed; determine not to send the third message;
  • the second message carries an encrypted second random number, where the second random number is generated by the second terminal. After the first terminal receives the second message carrying the second random number, if it receives the second message carrying the second random number again, it is determined that the second message is replayed.
  • the first message is further used to indicate at least one of the following:
  • the first random number generated by the first terminal where the first random number is used to determine whether the first message is played back.
  • the first random number may be encrypted based on the first public key;
  • the second terminal after receiving the first message sent by the first terminal, determines whether the identity identifier carried in the first message is a predetermined identifier; in response to the identity identifier being the predetermined identifier, the second terminal receives the After the first message, a second message is sent to the first terminal. In response to the identity identifier not being the predetermined identifier, the second terminal discards the first message after receiving the first message and does not send the second message to the first terminal.
  • the second terminal sends the second message to the first terminal in response to receiving the first message sent by the first terminal and determining that the first terminal is the predetermined terminal.
  • the predetermined terminal may be configured in a terminal set, and the terminal set is provided with an identity identifier including at least one first terminal used for ranging between the first terminal and the second terminal.
  • the second terminal may determine whether the identity identifier of the first terminal carried in the first message is in the terminal set. In response to the identity of the first terminal carried in the first message being in the terminal set, the second message is sent to the first terminal.
  • the first message carries a first random number encrypted based on the first public key, where the first random number is generated by the first terminal.
  • the second terminal After receiving the first message carrying the first random number, the second terminal sends a second message carrying the first random number to the first terminal, and the first terminal receives the second message carrying the first random number Afterwards, if the second message carrying the first random number is received again, it is determined that the first message is replayed. The second message is discarded upon receipt of the second message in response to the first message being replayed.
  • the command ID of the first message may be used to indicate the number of times the first message was sent. For example, if the first message is broadcast for the first time, the command ID of the first message may indicate "00"; if the first message is broadcast for the second time, the command ID of the first message may indicate "01".
  • the second message is further used to indicate at least one of the following:
  • the application ID encrypted by the first public key, the application ID, is used to trigger the second terminal to send the second message;
  • the first random number generated by the first terminal where the first random number is used to determine whether the first message is played back.
  • the first random number is encrypted based on the first public key;
  • the second random number generated by the second terminal is used to determine whether the second message is played back.
  • the second random number is encrypted based on the first public key
  • different ranging applications may run in the second terminal, wherein application IDs of different ranging applications are different.
  • the different application IDs may instruct the first terminal to send a third message containing different information to the second terminal.
  • the third message of different information may be a third message containing information of different format, quantity and type, and the like.
  • the first message carries an encrypted first random number, where the first random number is generated by the first terminal. After the second terminal receives the first message carrying the first random number, if the second terminal receives the first message carrying the first random number again, it is determined that the first message is played back.
  • the first message carries an encrypted first random number, where the first random number is generated by the first terminal.
  • the second terminal After receiving the first message carrying the first random number, the second terminal sends a second message carrying the first random number to the first terminal, and the first terminal receives the second message carrying the first random number Afterwards, if the second message carrying the first random number is received again, it is determined that the first message is replayed.
  • the second message carries an encrypted second random number, where the second random number is generated by the second terminal. After the first terminal receives the second message carrying the second random number, if it receives the second message carrying the second random number again, it is determined that the second message is replayed.
  • the command ID of the first message may be used to indicate the number of times the first message was sent. For example, if the first message is broadcast for the first time, the command ID of the first message may indicate "00"; if the first message is broadcast for the second time, the command ID of the first message may indicate "01".
  • a ranging method is provided in this embodiment, wherein the method is executed by the first terminal, and the second message indicates the first random number encrypted by the first public key; the method includes:
  • Step 71 Determine that the first message is not replayed, wherein the first random number decrypted by the first private key is not a repeated random number;
  • the first message is replayed, and the first random number decrypted by the first private key is a repeated random number.
  • the first message carries a first random number encrypted with a first public key, where the first random number is generated by the first terminal.
  • the second terminal After receiving the first message carrying the first random number, the second terminal sends a second message carrying the first random number to the first terminal, where the first random number is encrypted with the first private key.
  • the first terminal After the first terminal receives the second message carrying the first random number, if it receives the second message carrying the first random number again, it is determined that the first message is replayed.
  • the first random number may be decrypted using the first private key of the first terminal.
  • the first message carries a first random number encrypted with a first public key, where the first random number is generated by the first terminal.
  • the second terminal After receiving the first message carrying the first random number, the second terminal sends a second message carrying the first random number to the first terminal, where the first random number is encrypted with the first private key.
  • the first terminal After the first terminal receives the second message carrying the first random number, if it does not receive the second message carrying the first random number, it is determined that the first message is not replayed.
  • the first random number may be decrypted using the first private key of the first terminal.
  • this embodiment provides a ranging method, wherein the second message indicates a second random number encrypted by the first public key; the method includes:
  • Step 81 Determine that the second message is not replayed, wherein the second random number decrypted by the first private key is not a repeated random number;
  • the second message carries an encrypted second random number, where the second random number is generated by the second terminal. After the first terminal receives the second message carrying the second random number, if it receives the second message carrying the second random number again, it is determined that the second message is replayed.
  • the second message carries an encrypted second random number, where the second random number is generated by the second terminal. After the first terminal receives the second message carrying the second random number, if the second message carrying the second random number is not received again, it is determined that the second message is not replayed.
  • this embodiment provides a ranging method, wherein the second message indicates the application ID; the method includes:
  • Step 91 Send a third message determined based on the application ID to the second terminal.
  • different ranging applications may run in the second terminal, wherein application IDs of different ranging applications are different.
  • the different application IDs may instruct the first terminal to send a third message containing different information to the second terminal.
  • the third message of different information may be a third message containing information of different format, quantity and type, and the like.
  • a third message determined based on the application ID is sent to the second terminal.
  • the third message is further used to indicate at least one of the following:
  • the third random number generated by the first terminal is used to determine whether the third message is replayed; here, the third random number is encrypted based on the second public key;
  • the second terminal after receiving the first message sent by the first terminal, determines whether the identity identifier carried in the first message is a predetermined identifier; in response to the identity identifier being the predetermined identifier, the second terminal receives the After the first message, a second message is sent to the first terminal. In response to the identity identifier not being the predetermined identifier, the second terminal discards the first message after receiving the first message and does not send the second message to the first terminal.
  • the second terminal sends the second message to the first terminal in response to receiving the first message sent by the first terminal and determining that the first terminal is the predetermined terminal.
  • the predetermined terminal may be configured in a terminal set, and the terminal set is provided with an identity identifier including at least one first terminal used for ranging between the first terminal and the second terminal.
  • the second terminal may determine whether the identity identifier of the first terminal carried in the first message is in the terminal set. In response to the identity of the first terminal carried in the first message being in the terminal set, the second message is sent to the first terminal.
  • the third message carries a third random number encrypted by the second public key, where the third random number is generated by the first terminal. After the second terminal receives the first message carrying the third random number, if it receives the third message carrying the third random number again, it is determined that the third message is replayed.
  • the command ID of the first message may be used to indicate the number of times the first message was sent. For example, if the first message is broadcast for the first time, the command ID of the first message may indicate "00"; if the first message is broadcast for the second time, the command ID of the first message may indicate "01".
  • this embodiment provides a ranging method, wherein the method is performed by a second terminal, and the method includes:
  • Step 101 Receive a first message sent by a first terminal, where the first message is used to indicate a first public key of the first terminal;
  • Step 102 Send a second message to the first terminal, where the second message is used to indicate the second public key of the second terminal encrypted by the first public key;
  • Step 103 Receive a third message encrypted by the second public key sent by the second terminal, where the third message is used to indicate the first time difference between the time of sending the first message and the time of receiving the second message; the first time difference is used to determine The distance between the first terminal and the second terminal.
  • the first terminal and the second terminal may be, but not limited to, a mobile phone, a wearable device, a vehicle-mounted terminal, a roadside unit (RSU, Road Side Unit), a smart home terminal, an industrial sensing device and/or a medical device Wait.
  • a mobile phone a wearable device
  • vehicle-mounted terminal a roadside unit (RSU, Road Side Unit)
  • RSU Road Side Unit
  • smart home terminal an industrial sensing device and/or a medical device Wait.
  • the first message may be broadcast periodically.
  • the period for broadcasting the first message may be determined according to the time delay requirement of ranging.
  • the period of broadcasting the first message in response to the ranging delay requirement being greater than the delay threshold, it is determined that the period of broadcasting the first message is greater than the period threshold.
  • the period of broadcasting the first message is less than the period threshold. In this way, the period of broadcasting the first message can be adapted to the delay requirement of ranging.
  • the first terminal may send the first message by broadcasting.
  • the second terminal may receive first messages sent by a plurality of first terminals in a broadcast manner. After receiving the first messages sent by the plurality of first terminals in a broadcast manner, the second terminal may discard some of the received first messages. In one embodiment, when the terminal sending the first message is not a terminal preset by the second terminal, the second terminal will discard the first message sent by the terminal. In another embodiment, when the terminal sending the first message is a terminal preset by the second terminal and is not a terminal that needs to be connected for ranging, the second terminal will discard the first message sent by the terminal.
  • the secret key of the first terminal includes a first public key and a first private key. After receiving the information encrypted by the second terminal using the first public key, the first terminal can decrypt the information using the first private key. encrypted information. After receiving the information encrypted by the first terminal using the first private key, the second terminal can decrypt the encrypted information using the first public key.
  • the first terminal may send the first public key to the second terminal in advance. In this way, the security of information transmission between the first terminal and the second terminal can be ensured.
  • the secret key of the second terminal includes a second public key and a second private key. After receiving the information encrypted by the first terminal using the second public key, the second terminal can decrypt the information using the second private key. encrypted information. After receiving the information encrypted by the second terminal using the second private key, the first terminal can decrypt the encrypted information using the second public key.
  • the second terminal may send the second public key to the first terminal in advance. In this way, the security of information transmission between the first terminal and the second terminal can be ensured.
  • the second terminal sends the second message to the first terminal in response to receiving the first message sent by the first terminal and determining that the first terminal is a preset terminal.
  • the preset terminal may be configured in a terminal set, and the terminal set is provided with an identifier including at least one first terminal used for ranging between the first terminal and the second terminal.
  • the second terminal may determine whether the identifier of the first terminal carried in the first message is in the terminal set. In response to the identification of the first terminal carried in the first message being in the terminal set, the second message is sent to the first terminal.
  • the first terminal when the first terminal broadcasts the first message, it will record the sending time of the first message; when the first terminal receives the second message sent by the second terminal, it will record the receiving time of the second message; A terminal will determine the first time difference between the sending time and the receiving time according to the sending time and the receiving time. and send the information of the first time difference to the second terminal through a third message.
  • the second terminal when the second terminal receives the first message sent by the first terminal, it records the reception time of the first message; when the second terminal sends the second message to the first terminal, it records the sending time of the second message time; the second terminal will determine the second time difference between the sending time and the receiving time according to the receiving time and the sending time. After receiving the first time difference sent by the first terminal, the second terminal determines the difference between the first time difference and the second time difference, and determines the difference between the first terminal and the second terminal based on the difference and the electromagnetic wave propagation speed distance.
  • the second terminal may determine the distance between the first terminal and the second terminal by using an average value of the distances measured within a predetermined period of time. In this way, the measurement accuracy of the distance between the first terminal and the second terminal can be improved.
  • the duration of the predetermined period is determined according to the required measurement accuracy.
  • the predetermined period of time is determined to have a duration greater than the duration threshold in response to a requirement that the measurement accuracy be greater than or equal to the accuracy threshold. Alternatively, in response to the required measurement accuracy being less than the accuracy threshold, it is determined that the predetermined duration is less than or equal to the duration threshold.
  • using the second public key to encrypt the third message may be using the second public key to encrypt information such as the first time difference and the identity of the first terminal in the third message.
  • the second terminal may discard the third message after receiving the third message in response to receiving the third message and failing to decrypt the third message using the second private key. In this way, the security of data transmission between the first terminal and the second terminal can be ensured.
  • the first terminal sends the third message to the second terminal in response to receiving the second message sent by the second terminal and determining that the first message and/or the second message has not been replayed.
  • the second terminal sends the second message to the first terminal in response to receiving the first message sent by the first terminal and determining that the first message is not replayed.
  • the first message indicating the first public key of the first terminal includes: the first message carries the first public key; or the first message carries indication information indicating the first public key. For example, the indication information "00" indicates the first public key.
  • the first public key is indicated by the first message; the second public key is indicated by the second message, and the second public key is replaced by the first public key. encrypting; and encrypting the third message with the second public key.
  • the technical solution of the present application carries the safety information in the first message and the second message for ranging. While being safe, it can reduce the consumption of signaling resources and save time for ranging.
  • this embodiment provides a ranging method, wherein the method is performed by a second terminal, and the method includes:
  • Step 111 Perform integrity protection verification on the first message based on the first public key of the first terminal.
  • the first terminal uses a predetermined integrity protection algorithm, and uses at least one of the first private key, the message itself, and the length of the message as input parameters to calculate a first verification code that includes multiple bits, The first verification code is carried in the information field of the first message.
  • the second terminal calculates the second verification code of the first message with the same calculation method based on the first public key, and determines the integrity protection code by comparing the first verification code and the second verification code. Check if it is successful. If the first verification code is the same as the second verification code, the second terminal determines that the verification of the integrity protection is successful; otherwise, determines that the verification of the integrity protection fails.
  • the second terminal discards the first message after receiving the first message in response to the failure to verify the integrity protection of the first message.
  • this embodiment provides a ranging method, wherein the method is performed by a second terminal, and the method includes:
  • Step 121 Determine whether to send the second message according to the integrity verification result.
  • the determination result indicates that the verification is successful; it is determined to send the second message.
  • the determination result indicates that the authentication failed; it is determined to discard the first message and not send the second message.
  • the first terminal uses a predetermined integrity protection algorithm, takes at least one of the key, the message itself, and the length of the message as input parameters, calculates a first verification code containing multiple bits, and uses The first verification code is carried in the information field of the first message.
  • the second terminal calculates the second verification code of the first message with the same calculation method, and determines whether the verification of integrity protection is successful by comparing the first verification code and the second verification code. If the first verification code is the same as the second verification code, the second terminal determines that the verification of the integrity protection is successful, that is, the verification result indicates that the verification is successful; otherwise, it is determined that the verification of the integrity protection fails, that is, the verification result indicates that the verification fails.
  • This embodiment provides a ranging method, wherein the method is performed by a second terminal, and the method includes:
  • a ranging method is provided in this embodiment, wherein the method is performed by a second terminal, and the method includes:
  • Step 131 Perform integrity protection verification on the third message based on the first public key of the first terminal.
  • the first terminal uses a predetermined integrity protection algorithm, and uses at least one of the first private key, the message itself, and the length of the message as input parameters, and calculates a first verification code containing multiple bits to carry in the information field of the third message.
  • the second terminal calculates the second verification code of the third message with the same calculation method based on the first public key, and determines the integrity protection code by comparing the first verification code and the second verification code. Check if it is successful. If the first verification code is the same as the second verification code, the second terminal determines that the verification of the integrity protection is successful; otherwise, it determines that the verification of the integrity protection fails.
  • the second terminal discards the third message after receiving the third message in response to the failure to verify the integrity protection of the third message.
  • the third message further indicates one or more of the following information:
  • the third random number generated by the first terminal is used to determine whether the third message is replayed; here, the third random number is encrypted based on the second public key;
  • the second terminal after receiving the first message sent by the first terminal, determines whether the identity identifier carried in the first message is a predetermined identifier; in response to the identity identifier being the predetermined identifier, the second terminal receives the After the first message, a second message is sent to the first terminal. In response to the identity identifier not being the predetermined identifier, the second terminal discards the first message after receiving the first message and does not send the second message to the first terminal.
  • the second terminal sends the second message to the first terminal in response to receiving the first message sent by the first terminal and determining that the first terminal is the predetermined terminal.
  • the predetermined terminal may be configured in a terminal set, and the terminal set is provided with an identity identifier including at least one first terminal used for ranging between the first terminal and the second terminal.
  • the second terminal may determine whether the identity identifier of the first terminal carried in the first message is in the terminal set. In response to the identity of the first terminal carried in the first message being in the terminal set, the second message is sent to the first terminal.
  • the third message carries a third random number encrypted by the second public key, where the third random number is generated by the first terminal. After the second terminal receives the first message carrying the third random number, if the second terminal receives the third message carrying the third random number again, it is determined that the third message is played back.
  • the command ID of the first message may be used to indicate the number of times the first message was sent. For example, if the first message is broadcast for the first time, the command ID of the first message may indicate "00"; if the first message is broadcast for the second time, the command ID of the first message may indicate "01".
  • a ranging method is provided in this embodiment, wherein the method is executed by a second terminal, and a third message indicates a third random number encrypted by the second public key; the method includes:
  • Step 141 determining that the third message is not replayed, wherein the third random number decrypted by the second private key is not a repeated random number;
  • the third message carries an encrypted third random number, where the third random number is generated by the first terminal. After the second terminal receives the third message carrying the third random number, if it receives the third message carrying the third random number again, it is determined that the third message is played back.
  • the third message carries an encrypted third random number, where the third random number is generated by the first terminal. After the second terminal receives the third message carrying the third random number, if the third message carrying the third random number is not received again, it is determined that the third message is not replayed.
  • this embodiment provides a ranging method, wherein the method is performed by a second terminal, and a third message indicates the ID of the first terminal; the method includes:
  • Step 151 Determine that the result of performing integrity protection verification on the third message indicates that the verification is successful and the third message is not replayed; determine whether to measure the distance between the first terminal and the second terminal according to the ID of the first terminal.
  • the ID of the first terminal in response to the ID of the first terminal being the predetermined ID, it is determined to measure the distance between the first terminal and the second terminal.
  • the ID of the first terminal not being the predetermined ID in response to the ID of the first terminal not being the predetermined ID, it is determined not to measure the distance between the first terminal and the second terminal.
  • the predetermined ID may be configured in a terminal set, and the terminal set is provided with a predetermined ID including at least one first terminal used for ranging between the first terminal and the second terminal.
  • the second terminal may determine whether the ID of the first terminal carried in the third message is in the terminal set. In response to the ID of the first terminal carried in the third message being in the terminal set, it is determined to measure the distance between the first terminal and the second terminal.
  • this embodiment provides a ranging method, wherein the method is performed by a second terminal, and the method includes:
  • Step 161 Determine that the ID of the first terminal is a predetermined ID, and determine to measure the distance between the first terminal and the second terminal; or, determine that the ID of the first terminal is not a predetermined ID, and determine not to measure the first terminal and the second terminal the distance between.
  • the predetermined ID may be configured in a terminal set, and the terminal set is provided with a predetermined ID including at least one first terminal used for ranging between the first terminal and the second terminal.
  • the second terminal may determine whether the ID of the first terminal carried in the third message is in the terminal set. In response to the ID of the first terminal carried in the third message being in the terminal set, it is determined to measure the distance between the first terminal and the second terminal. In response to that the ID of the first terminal carried in the third message is not in the terminal set, it is determined that the distance between the first terminal and the second terminal is not to be measured.
  • this embodiment provides a ranging method, wherein the method is performed by a second terminal, and the method includes:
  • Step 171 Determine the distance between the first terminal and the second terminal based on the first time difference and the second time difference, where the second time difference is the time difference between the time when the first message is received and the time when the second message is sent.
  • the second terminal when the second terminal receives the first message sent by the second terminal, it will record the third time information of receiving the first message; when the second terminal sends the second message to the first terminal, it will record the sending time information. Fourth time information of the second message; the second terminal will determine the second time difference between the time of receiving the first message and the time of sending the second message according to the third time information and the fourth time information. After receiving the first time difference sent by the first terminal, the second terminal determines the difference between the first time difference and the second time difference, and determines the difference between the first terminal and the second terminal based on the difference and the electromagnetic wave propagation speed distance.
  • the second terminal may determine the distance between the first terminal and the second terminal by using an average value of the measured distances within a predetermined period of time. In this way, the measurement accuracy of the distance between the first terminal and the second terminal can be improved.
  • the duration of the predetermined period is determined according to the required measurement accuracy.
  • the predetermined period of time is determined to have a duration greater than the duration threshold in response to a requirement that the measurement accuracy be greater than or equal to the accuracy threshold.
  • the predetermined duration is determined to be less than or equal to the duration threshold in response to the required measurement accuracy being less than the accuracy threshold.
  • the first message is further used to indicate at least one of the following:
  • the first random number generated by the first terminal where the first random number is used to determine whether the first message is replayed; the first random number is encrypted based on the first public key;
  • the second terminal after receiving the first message sent by the first terminal, determines whether the identity identifier carried in the first message is a predetermined identifier; in response to the identity identifier being the predetermined identifier, the second terminal receives the After the first message, a second message is sent to the first terminal. In response to the identity identifier not being the predetermined identifier, the second terminal discards the first message after receiving the first message and does not send the second message to the first terminal.
  • the second terminal sends the second message to the first terminal in response to receiving the first message sent by the first terminal and determining that the first terminal is the predetermined terminal.
  • the predetermined terminal may be configured in a terminal set, and the terminal set is provided with an identity identifier including at least one first terminal used for ranging between the first terminal and the second terminal.
  • the second terminal may determine whether the identity identifier of the first terminal carried in the first message is in the terminal set. In response to the identity of the first terminal carried in the first message being in the terminal set, the second message is sent to the first terminal.
  • the first message carries a first random number encrypted based on the first public key, where the first random number is generated by the first terminal.
  • the second terminal After receiving the first message carrying the first random number, the second terminal sends a second message carrying the first random number to the first terminal, and the first terminal receives the second message carrying the first random number Afterwards, if the second message carrying the first random number is received again, it is determined that the first message is replayed. The second message is discarded upon receipt of the second message in response to the first message being replayed.
  • the command ID of the first message may be used to indicate the number of times the first message was sent. For example, if the first message is broadcast for the first time, the command ID of the first message may indicate "00"; if the first message is broadcast for the second time, the command ID of the first message may indicate "01".
  • the second message is further used to indicate at least one of the following:
  • the application ID encrypted by the first key is used to trigger the second terminal to send the second message;
  • the first random number generated by the first terminal where the first random number is used to determine whether the first message is played back.
  • the first random number is encrypted based on the first public key;
  • a second random number generated by the second terminal wherein the second random number is used to determine whether the second message is played back.
  • the second random number is encrypted based on the first public key
  • different ranging applications may run in the second terminal, wherein application IDs of different ranging applications are different.
  • the different application IDs may instruct the first terminal to send a third message containing different information to the second terminal.
  • the third message of different information may be a third message containing information of different format, quantity and type, and the like.
  • the first message carries an encrypted first random number, where the first random number is generated by the first terminal.
  • the second terminal After receiving the first message carrying the first random number, the second terminal determines that the first message is replayed if it receives the first message carrying the first random number again.
  • the first message carries an encrypted first random number, where the first random number is generated by the first terminal.
  • the second terminal After receiving the first message carrying the first random number, the second terminal sends a second message carrying the first random number to the first terminal, and the first terminal receives the second message carrying the first random number Afterwards, if the first message carrying the first random number is received again, it is determined that the first message is replayed.
  • the second message carries an encrypted second random number, where the second random number is generated by the second terminal. After the first terminal receives the second message carrying the second random number, if it receives the second message carrying the second random number again, it is determined that the second message is replayed.
  • the command ID of the first message may be used to indicate the number of times the first message was sent. For example, if the first message is broadcast for the first time, the command ID of the first message may indicate "00"; if the first message is broadcast for the second time, the command ID of the first message may indicate "01".
  • an embodiment of the present disclosure provides a distance measuring device, the device includes
  • a sending module 181, configured to broadcast a first message, where the first message is used to indicate the first public key of the device;
  • a receiving module 182 configured to receive a second message sent by the second terminal, where the second message is used to indicate the second public key of the second terminal encrypted by the first public key;
  • a sending module 181 configured to send a third message encrypted with the second public key to the second terminal, where the third message is used to indicate the sending moment of the first message and the receiving moment of the second message the first time difference.
  • an embodiment of the present disclosure provides a distance measuring device, and the device includes:
  • a receiving module 191 configured to receive a first message sent by a first terminal, where the first message is used to indicate a first public key of the first terminal;
  • a sending module 192 configured to send a second message to the first terminal, where the second message is used to indicate the second public key of the second terminal encrypted by the first public key;
  • a receiving module 191 configured to receive a third message encrypted by the second public key sent by the second terminal, where the third message is used to indicate the sending time of the first message and the reception of the second message The first time difference of the moment; the first time difference is used to determine the distance between the first terminal and the device.
  • Embodiments of the present disclosure provide a communication device, the communication device includes:
  • memory for storing processor-executable instructions
  • the processor is configured to, when executing the executable instructions, implement the method applied to any embodiment of the present disclosure.
  • the processor may include various types of storage media, which are non-transitory computer storage media, and can continue to memorize and store information on the communication device after the power is turned off.
  • the processor can be connected to the memory through a bus or the like, and is used to read the executable program stored on the memory.
  • An embodiment of the present disclosure further provides a computer storage medium, wherein the computer storage medium stores a computer-executable program, and when the executable program is executed by a processor, the method of any embodiment of the present disclosure is implemented.
  • an embodiment of the present disclosure provides a structure of a terminal.
  • this embodiment provides a terminal 800, which may be a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc. .
  • the terminal 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and communication component 816.
  • the processing component 802 generally controls the overall operations of the terminal 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 802 can include one or more processors 820 to execute instructions to perform all or some of the steps of the methods described above.
  • processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components.
  • processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
  • Memory 804 is configured to store various types of data to support operation at device 800 . Examples of such data include instructions for any application or method operating on the terminal 800, contact data, phonebook data, messages, pictures, videos, and the like. Memory 804 may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • Power supply assembly 806 provides power to various components of terminal 800 .
  • Power supply components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to terminal 800 .
  • Multimedia component 808 includes screens that provide an output interface between terminal 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. A touch sensor can sense not only the boundaries of a touch or swipe action, but also the duration and pressure associated with the touch or swipe action.
  • the multimedia component 808 includes a front-facing camera and/or a rear-facing camera. When the device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.
  • Audio component 810 is configured to output and/or input audio signals.
  • the audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when the terminal 800 is in an operating mode, such as a calling mode, a recording mode, and a voice recognition mode.
  • the received audio signal may be further stored in memory 804 or transmitted via communication component 816 .
  • audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
  • Sensor assembly 814 includes one or more sensors for providing various aspects of the status assessment of terminal 800 .
  • the sensor component 814 can detect the open/closed state of the device 800, the relative positioning of components, such as the display and keypad of the terminal 800, the sensor component 814 can also detect the position change of the terminal 800 or a component of the terminal 800, the user The presence or absence of contact with the terminal 800, the orientation or acceleration/deceleration of the terminal 800 and the temperature change of the terminal 800.
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 816 is configured to facilitate wired or wireless communication between terminal 800 and other devices.
  • the terminal 800 can access a wireless network based on a communication standard, such as Wi-Fi, 2G or 3G, or a combination thereof.
  • the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication.
  • NFC near field communication
  • the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • terminal 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation is used to perform the above method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A gate array
  • controller microcontroller, microprocessor or other electronic component implementation is used to perform the above method.
  • non-transitory computer-readable storage medium including instructions, such as a memory 804 including instructions, which are executable by the processor 820 of the terminal 800 to perform the above method.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
  • an embodiment of the present disclosure shows a structure of a base station.
  • the base station 900 may be provided as a network-side device.
  • the base station 900 includes a processing component 922, which further includes one or more processors, and a memory resource, represented by memory 932, for storing instructions executable by the processing component 922, such as application programs.
  • An application program stored in memory 932 may include one or more modules, each corresponding to a set of instructions.
  • the processing component 922 is configured to execute instructions to perform any of the aforementioned methods applied to the base station.
  • the base station 900 may also include a power supply assembly 926 configured to perform power management of the base station 900, a wired or wireless network interface 950 configured to connect the base station 900 to a network, and an input output (I/O) interface 958.
  • Base station 900 may operate based on an operating system stored in memory 932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本公开实施例提供了一种测距方法,其中,该方法由第一终端执行,该方法,包括:广播第一消息,第一消息用于指示第一终端的第一公钥;接收第二终端发送的第二消息,第二消息用于指示第一公钥加密的第二终端的第二公钥;向第二终端发送第二公钥加密的第三消息,第三消息用于指示第一消息的发送时刻和第二消息的接收时刻的第一时间差。

Description

测距方法、装置、通信设备及存储介质 技术领域
本公开涉及无线通信技术领域但不限于无线通信技术领域,尤其涉及一种测距方法、装置、通信设备及存储介质。
背景技术
随着无线通信网络的不断发展,设备与设备之间的测距需求越来越多。以飞行时间测距(ToF,Time of Flight)方法为例,ToF方法是非常流行的测距技术。ToF在使用无线信号进行测距时,测量设备向被测设备发送测量信号。被测设备在接收到测量信号后再返回测量信号,测量设备则可以根据测量信号飞行的时间计算设备间的距离。
相关技术中,在进行设备之间的安全测距时,特别是当存在大量的测距需求时,会消耗大量的时间和信令资源。
发明内容
本公开实施例公开了一种测距方法、装置、通信设备及存储介质。
根据本公开实施例的第一方面,提供一种测距方法,其中,所述方法由第一终端执行,所述方法,包括:
广播第一消息,所述第一消息用于指示第一终端的第一公钥;
接收第二终端发送的第二消息,所述第二消息用于指示所述第一公钥加密的所述第二终端的第二公钥;
向所述第二终端发送所述第二公钥加密的第三消息,所述第三消息用于指示所述第一消息的发送时刻和所述第二消息的接收时刻的第一时间差。
在一个实施例中,还包括:
基于所述第一终端的第一私钥,对所述第一消息和/或所述第三消息进行完整性保护。
在一个实施例中,所述方法,还包括:
确定所述第一消息被重放;丢弃所述第二消息;
或者,
确定所述第一消息未被重放;根据所述第二消息是否被重放的结果确定是否发送所述第三消息。
在一个实施例中,所述根据所述第二消息是否被重放的确定结果确定所述第三消息的发送操作,包括:
确定所述第二消息被重放;确定不发送所述第三消息;
或者,
确定所述第二消息未被重放;确定发送所述第三消息。
在一个实施例中,所述第一消息,还用于指示以下至少一种:
所述第一终端的身份标识ID;
所述第一终端生成的第一随机数,所述第一随机数用于确定所述第一消息是否被重放;
所述第一消息的命令ID。
在一个实施例中,所述第二消息,还用于指示以下至少一种:
所述第一公钥加密的应用ID,所述应用ID,用于触发所述第二终端发送所述第二消息;
所述第一终端生成的第一随机数,所述第一随机数用于确定所述第一消息是否被重放;
所述第二终端生成的第二随机数,所述第二随机数用于确定所述第二消息是否被重放;
所述第一消息的命令ID。
在一个实施例中,所述第二消息指示所述第一公钥加密的所述第一随机数;所述方法,还包括:
确定所述第一消息未被重放,其中,所述第一私钥解密的所述第一随机数不为重复的随机数;
或者,
确定所述第一消息被重放,所述第一私钥解密的所述第一随机数为重复的随机数。
在一个实施例中,所述第二消息指示所述第一公钥加密的所述第二随机数;所述方法,还包括:
确定所述第二消息未被重放,其中,所述第一私钥解密的所述第二随机数不为重复的随机数;
或者,
确定所述第二消息被重放,其中,所述第一私钥解密的所述第二随机数为重复的随机数。
在一个实施例中,所述第二消息指示所述应用ID;所述向所述第二终端发送利用所述第二公钥加密的第三消息,包括:
向所述第二终端发送基于所述应用ID确定的所述第三消息。
在一个实施例中,所述第三消息,还用于指示以下至少一种:
所述第一终端的ID;
所述第一终端生成的第三随机数,所述第三随机数用于确定所述第三消息是否被重放;
所述第一消息的命令ID。
根据本公开实施例的第二方面,提供一种测距方法,其中,所述方法由第二终端执行,所述方法,包括:
接收第一终端发送的第一消息,所述第一消息用于指示所述第一终端的第一公钥;
向所述第一终端发送第二消息,所述第二消息用于指示所述第一公钥加密的第二终端的第二公钥;
接收所述第二终端发送的所述第二公钥加密的第三消息,所述第三消息用于指示所述第一消息的发送时刻和所述第二消息的接收时刻的第一时间差;所述第一时间差,用于确定所述第一终端与所述第二终端之间的距离。
在一个实施例中,所述方法,还包括:
基于所述第一终端的第一公钥,对所述第一消息进行完整性保护的验证。
在一个实施例中,所述方法,还包括:
根据所述完整性的验证的验证结果,确定是否发送所述第二消息。
在一个实施例中,所述根据所述完整性的验证的结果,确定所述第二消息的发送操作,包括:
确定所述结果指示验证成功;确定发送所述第二消息;
或者,
确定所述结果指示验证失败;确定丢弃所述第一消息且不发送所述第二消息。
在一个实施例中,所述方法,还包括:
基于所述第一终端的第一公钥,对所述第三消息进行完整性保护的验证。
在一个实施例中,所述第三消息,还用于指示以下至少之一:
所述第一终端的ID;
所述第一终端生成的第三随机数,所述第三随机数用于确定所述第三消息是否被重放;
所述第一消息的命令ID。
在一个实施例中,所述第三消息指示所述第二公钥加密的所述第三随机数;所述方法,还包括:
确定所述第三消息未被重放,其中,所述第二私钥解密的所述第三随机数不为重复的随机数;
或者,
确定所述第三消息被重放,其中,其中,所述第二私钥解密的所述第三随机数为重复的随机数。
在一个实施例中,所述第三消息指示所述第一终端的ID;所述方法,还包括:
确定对所述第三消息进行完整性保护验证的结果指示验证成功且所述第三消息未被重放;根据所述第一终端的ID确定是否测量所述第一终端与所述第二终端之间的距离。
在一个实施例中,所述根据所述第一终端的ID确定是否测量所述第一终端与所述第二终端之间的距离,包括:
确定所述第一终端的ID为预定ID;确定测量所述第一终端与所述第二终端之间的距离;
或者,
确定所述第一终端的ID不为预定ID;确定不测量所述第一终端与所述第二终端之间的距离。
在一个实施例中,所述方法,还包括:
基于所述第一时间差和第二时间差确定所述第一终端与所述第二终端之间的距离,所述第二时间差,为所述第一消息的接收时刻和所述第二消息的发送时刻的时间差。
在一个实施例中,所述第一消息,还用于指示以下至少之一:
所述第一终端的身份标识ID;
所述第一终端生成的第一随机数,所述第一随机数用于确定所述第一消息是否被重放;
所述第一消息的命令ID。
在一个实施例中,所述第二消息,还用于指示以下至少之一:
所述第一密钥加密的应用ID,所述应用ID,用于触发所述第二终端发送所述第二消息;
所述第一终端生成的第一随机数,所述第一随机数,用于确定所述第一消息是否被重放;
所述第二终端生成的第二随机数,所述第二随机,用于确定所述第二消息是否被重放;
所述第一消息的命令ID。
根据本公开实施例的第三方面,提供一种测距装置,所述装置包括:
发送模块,用于广播第一消息,所述第一消息用于指示所述装置的第一公钥;
第一接收模块,用于接收第二终端发送的第二消息,所述第二消息用于指示所述第一公钥加密的所述第二终端的第二公钥;
第一发送模块,用于向所述第二终端发送所述第二公钥加密的第三消息,所述第三消息用于指示所述第一消息的发送时刻和所述第二消息的接收时刻的第一时间差。
根据本公开实施例的第四方面,提供一种测距装置,所述装置包括:
接收模块,用于接收第一终端发送的第一消息,所述第一消息用于指示所述第一终端的第一公钥;
第一发送模块,用于向所述第一终端发送第二消息,所述第二消息用于指示所述第一公钥加密的所述第二终端的第二公钥;
第二接收模块,用于接收所述装置发送的所述第二公钥加密的第三消息,所述第三消息用于指示所述第一消息的发送时刻和所述第二消息的接收时刻的第一时间差;所述第一时间差,用于确定所述第一终端与所述装置之间的距离。
根据本公开实施例的第五方面,提供一种通信设备,所述通信设备,包括:
处理器;
用于存储所述处理器可执行指令的存储器;
其中,所述处理器被配置为:用于运行所述可执行指令时,实现本公开任意实施例所述的方法。
根据本公开实施例的第六方面,提供一种计算机存储介质,所述计算机存储介质存储有计算机可执行程序,所述可执行程序被处理器执行时实现本公开任意实施例所述的方法。
在本公开实施例中,广播第一消息,所述第一消息用于指示第一终端的第一公钥;接收第二终端发送的第二消息,所述第二消息用于指示所述第一公钥加密的所述第二终端的第二公钥;向所述第二终端发送所述第二公钥加密的第三消息,所述第三消息用于指示所述第一消息的发送时刻和所述第二消息的接收时刻的第一时间差。这里,在测量所述第一终端与所述第二终端之间的距离时,利用所述第一消息指示所述第一公钥;利用所述第二消息指示所述第二公钥且所述第二公钥被所述第一公钥加密;并通过所述第二公钥加密所述第三消息。相较于利用额外的消息携带安全信息以确保测距信息的传输安全的方式,本申请技术方案将安全信息携带在用于测距的第一消息和第二消息中,如此,在确保信息传输安全的同时,能够减少信令资源的消耗且节省测距的时间。
附图说明
图1是根据一示例性实施例示出的一种无线通信系统的结构示意图。
图2是根据一示例性实施例示出的测距方法的示意图。
图3是根据一示例性实施例示出的一种测距方法的流程示意图。
图4是根据一示例性实施例示出的一种测距方法的流程示意图。
图5是根据一示例性实施例示出的一种测距方法的流程示意图。
图6是根据一示例性实施例示出的一种测距方法的流程示意图。
图7是根据一示例性实施例示出的一种测距方法的流程示意图。
图8是根据一示例性实施例示出的一种测距方法的流程示意图。
图9是根据一示例性实施例示出的一种测距方法的流程示意图。
图10是根据一示例性实施例示出的一种测距方法的流程示意图。
图11是根据一示例性实施例示出的一种测距方法的流程示意图。
图12是根据一示例性实施例示出的一种测距方法的流程示意图。
图13是根据一示例性实施例示出的一种测距方法的流程示意图。
图14是根据一示例性实施例示出的一种测距方法的流程示意图。
图15是根据一示例性实施例示出的一种测距方法的流程示意图。
图16是根据一示例性实施例示出的一种测距方法的流程示意图。
图17是根据一示例性实施例示出的一种测距方法的流程示意图。
图18是根据一示例性实施例示出的测距装置的示意图。
图19是根据一示例性实施例示出的测距装置的示意图。
图20是根据一示例性实施例示出的一种终端的结构示意图。
图21是根据一示例性实施例示出的一种基站的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开实施例的一些方面相一致的装置和方法的例子。
在本公开实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开实施例。在本公开实施例和所附权利要求书中所使用的单数形式的“一种”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本公开实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
出于简洁和便于理解的目的,本文在表征大小关系时,所使用的术语为“大于”或“小于”。但对于本领域技术人员来说,可以理解:术语“大于”也涵盖了“大于等于”的含义,“小于”也涵盖了“小于等于”的含义。
请参考图1,其示出了本公开实施例提供的一种无线通信系统的结构示意图。如图1所示,无线通信系统是基于移动通信技术的通信系统,该无线通信系统可以包括:若干个用户设备110以及若干个基站120。
其中,用户设备110可以是指向用户提供语音和/或数据连通性的设备。用户设备110可以经无线接入网(Radio Access Network,RAN)与一个或多个核心网进行通信,用户设备110可以是物联网用户设备,如传感器设备、移动电话和具有物联网用户设备的计算机,例如,可以是固定式、便携式、袖珍式、手持式、计算机内置的或者车载的装置。例如,站(Station,STA)、订户单元(subscriber unit)、订户站(subscriber station),移动站(mobile station)、移动台(mobile)、远程站(remote station)、接入点、远程用户设备(remote terminal)、接入用户设备(access terminal)、用户装置(user terminal)、用户代理(user agent)、用户设备(user device)、或用户设备(user equipment)。或者,用户设备110也可以是无人飞行器的设备。或者,用户设备110也可以是车载设备,比如,可以是具有无线通信功能的行车电脑,或者是外接行车电脑的无线用户设备。或者,用户设备110也可以是路边设备,比如,可以是具有无线通信功能的路灯、信号灯或者其它路边设备等。
基站120可以是无线通信系统中的网络侧设备。其中,该无线通信系统可以是第四代移动通信技术(the 4th generation mobile communication,4G)系统,又称长期演进(Long Term Evolution,LTE)系统;或者,该无线通信系统也可以是5G系统,又称新空口系统或5G NR系统。或者,该无线通信系统也可以是5G系统的再下一代系统。其中,5G系统中的接入网可以称为NG-RAN(New Generation-Radio Access Network,新一代无线接入网)。
其中,基站120可以是4G系统中采用的演进型基站(eNB)。或者,基站120也可以是5G系统中采用集中分布式架构的基站(gNB)。当基站120采用集中分布式架构时,通常包括集中单元(central unit,CU)和至少两个分布单元(distributed unit,DU)。集中单元中设置有分组数据汇聚协议(Packet Data Convergence Protocol,PDCP)层、无线链路层控制协议(Radio Link Control,RLC)层、媒体访问控制(Media Access Control,MAC)层的协议栈;分布单元中设置有物理(Physical,PHY)层协议栈,本公开实施例对基站120的具体实现方式不加以限定。
基站120和用户设备110之间可以通过无线空口建立无线连接。在不同的实施方式中,该无线空口是基于第四代移动通信网络技术(4G)标准的无线空口;或者,该无线空口是基于第五代移动通信网络技术(5G)标准的无线空口,比如该无线空口是新空口;或者,该无线空口也可以是基于5G的更下一代移动通信网络技术标准的无线空口。
在一些实施例中,用户设备110之间还可以建立E2E(End to End,端到端)连接。比如车联网通信(vehicle to everything,V2X)中的V2V(vehicle to vehicle,车对车)通信、V2I(vehicle to Infrastructure,车对路边设备)通信和V2P(vehicle to pedestrian,车对人)通信等场景。
这里,上述用户设备可认为是下面实施例的终端设备。
在一些实施例中,上述无线通信系统还可以包含网络管理设备130。
若干个基站120分别与网络管理设备130相连。其中,网络管理设备130可以是无线通信系统中的核心网设备,比如,该网络管理设备130可以是演进的数据分组核心网(Evolved Packet Core,EPC)中的移动性管理实体(Mobility Management Entity,MME)。或者,该网络管理设备也可以是其它的核心网设备,比如服务网关(Serving GateWay,SGW)、公用数据网网关(Public Data Network GateWay,PGW)、策略与计费规则功能单元(Policy and Charging Rules Function,PCRF)或者归属签约用户服务 器(Home Subscriber Server,HSS)等。对于网络管理设备130的实现形态,本公开实施例不做限定。
为了便于本领域内技术人员理解,本公开实施例列举了多个实施方式以对本公开实施例的技术方案进行清晰地说明。当然,本领域内技术人员可以理解,本公开实施例提供的多个实施例,可以被单独执行,也可以与本公开实施例中其他实施例的方法结合后一起被执行,还可以单独或结合后与其他相关技术中的一些方法一起被执行;本公开实施例并不对此作出限定。
为了更好地理解本公开任一个实施例所描述的技术方案,首先,对相关技术中的测距场景进行说明:
请参见图2,ToF测距方法属于双向测距技术,利用数据信号在发射端和接收端之间往返的飞行时间来测量两点间的距离。将发射端发出数据信号和接收到接收端应答信号的时间间隔记为Tt,接收端收到发射端的数据信号和发出应答信号的时间间隔记为Tr。信号在发射端和接收端之间的单向飞行时间Tf=(Tt-Tr)/2,则两点间的距离为d,且d=c*Tf,其中,c表示电磁波传播速度。
在一个实施例中,在定位设备的发现过程中,发现设备发出的第一消息中包含着定位需求信息,被发现设备发出的第二消息则提供了定位信息。定位信息用于供发现设备确定两个设备之间的位置信息。由于发现过程必须是明文,因此,设备之间传输的信息容易被截取和滥用。
在一个实施例中,为了确保设备信息安全和测量的可靠性,设备间位置测量过程被分为了3个步骤:设备发现、认证及授权和测量。这个过程中解决了信息安全的问题,但是在需要频繁测距的公共场合,带了来大量的信令负担并增大了延迟。
如图3所示,本实施例中提供一种测距方法,其中,该方法由第一终端执行,该方法,包括:
步骤31、广播第一消息,第一消息用于指示第一终端的第一公钥;
步骤32、接收第二终端发送的第二消息,第二消息用于指示第一公钥加密的第二终端的第二公钥;
步骤33、向第二终端发送第二公钥加密的第三消息,第三消息用于指示第一消息的发送时刻和第二消息的接收时刻的第一时间差。
这里,该第一终端和第二终端可以是但不限于是手机、可穿戴设备、车载终端、路侧单元(RSU,Road Side Unit)、智能家居终端、工业用传感设备和/或医疗设备等。
在一个实施例中,可以是周期性地广播第一消息。这里,可以是根据测距的时延要求确定广播第一消息的周期。在一个实施例中,响应于测距的时延要求大于时延阈值,确定广播第一消息的周期大于周期阈值。响应于测距的时延要求小于时延阈值,确定广播第一消息的周期小于周期阈值。如此,广播第一消息的周期可以适应于测距的时延要求。
在一个实施例中,第一终端可以是通过广播方式发送第一消息。在一个实施例中,第二终端可以接收多个第一终端通过广播方式发送的第一消息。第二终端在接收到多个第一终端通过广播方式发送的第一消息后,可以丢弃接收到的部分第一消息。在一个实施例中,当发送第一消息的终端不为第二终端预先设置的终端时,第二终端会丢弃该终端发送的第一消息。在另一个实施例中,当发送第一消息的终端为第二终端预先设置的终端且不为测距需要连接的终端时,第二终端会丢弃该终端发送的第一消息。
在一个实施例中,第一终端的秘钥包括第一公钥和第一私钥,第一终端在接收到第二终端利用第一公钥加密的信息后,可以利用第一私钥解密该加密的信息。第二终端在接收到第一终端利用第一私钥加密的信息后,可以利用第一公钥解密该加密的信息。这里,第二终端在利用第一公钥解密前,第一终端可以是预先将第一公钥发送给第二终端。如此,可以确保第一终端与第二终端之间信息的传输安全。
在一个实施例中,第二终端的秘钥包括第二公钥和第二私钥,第二终端在接收到第一终端利用第二公钥加密的信息后,可以利用第二私钥解密该加密的信息。第一终端在接收到第二终端利用第二私钥加密的信息后,可以利用第二公钥解密该加密的信息。这里,第一终端在利用第二公钥解密前,第二终端可以是预先将第二公钥发送给第一终端。如此,可以确保第一终端与第二终端之间信息的传输安全。
在一个实施例中,第二终端响应于接收到第一终端发送的第一消息且确定第一终端为预先设置的终端,向第一终端发送第二消息。这里,预先设置的终端可以是配置在终端集中,终端集中设置有包括用于第一终端与第二终端之间测距的至少一个第一终端的标识。第二终端在接收到第一终端的第一消息后,可以确定第一消息中携带的第一终端的标识是否在终端集中。响应于第一消息中携带的第一终端的标识在终端集中,向第一终端发送第二消息。
在一个实施例中,第一终端在广播第一消息时,会记录第一消息的发送时刻;第一终端在接收第二终端发送的第二消息时,会记录第二消息的接收时刻;第一终端会根据发送时刻和接收时刻确定发送时刻和接收时刻之间的第一时间差。并将第一时间差的信息通过第三消息发送给第二终端。
在一个实施例中,第二终端在接收第一终端发送的第一消息时,会记录第一消息的接收时刻;第二终端在向第一终端发送第二消息时,会记录第二消息发送时刻;第二终端会根据接收时刻和发送时刻确定发送时刻和接收时刻之间的第二时间差。在接收到第一终端发送的第一时间差后,第二终端确定第一时间差和第二时间差之间的差值,并基于该差值与电磁波传播速度确定第一终端与第二终端之间的距离。
在一个实施例中,第二终端可以通过预定时段内测量到的距离的平均值,确定第一终端与第二终端之间的距离。这样,可以提高第一终端与第二终端之间的距离的测量精度。在一个实施例中,根据要求测量精度确定预定时段的时长。在一个实施例中,响应于要求测量精度大于或者等于精度阈值,确定预定时段的时长大于时长阈值。或者,响应于要求测量精度小于精度阈值,确定预定时长小于或者等于时长阈值。
在一个实施例中,利用第二公钥加密第三消息可以是是利用第二公钥加密第三消息中的第一时间差和第一终端的身份标识等信息。第二终端响应于接收到第三消息且利用第二私钥不能解密第三消息,可以在接收到第三消息后丢弃第三消息。这样,可以确保第一终端与第二终端之间数据传输的安全。
在一个实施例中,第一终端响应于接收到第二终端发送的第二消息且确定第一消息和/或第二消息未被重放,向第二终端发送第三消息。
在一个实施例中,第二终端响应于接收到第一终端发送的第一消息且确定第一消息未被重放,向第一终端发送第二消息。
在一个实施例中,第一消息指示第一终端的第一公钥,包括:第一消息携带第一公钥;或者,第一消息携带指示第一公钥的指示信息。例如,指示信息“00”指示第一公钥。
本公开实施例中,在测量第一终端与第二终端之间的距离时,利用第一消息指示第一公钥;利用第二消息指示第二公钥且第二公钥被第一公钥加密;并通过第二公钥加密第三消息。相较于利用额外的消息携带安全信息以确保测距信息的传输安全的方式,本申请技术方案将安全信息携带在用于测距的第一消息和第二消息中,如此,在确保信息传输安全的同时,能够减少信令资源的消耗且节省测距的时间。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图4所示,本实施例中提供一种测距方法,其中,该方法由第一终端执行,该方法,包括:
步骤41、基于第一终端的第一私钥,对第一消息和/或第三消息进行完整性保护。
在一个实施例中,第一终端使用预定完整性保护算法,以密钥、消息本身以及消息的长度等中的至少一个作为输入参数,计算一个包含多个比特位的第一验证码,并将该第一验证码携带在第一消息和/或第三消息的信息域中。第二终端在接收到第一消息和/或第三消息后,以同样的计算方法计算该第一消息和/或第三消息的第二验证码,并通过比较第一验证码和第二验证码确定完整性保护的校验是否成功。如果第一验证码与第二验证码相同,则第二终端确定完整性保护的校验成功,否则,确定完整性保护的校验失败。
在一个实施例中,第二终端响应于对第一消息的完整性保护的校验失败,在接收到第一消息后会丢弃第一消息。在另一个实施例中,第二终端响应于对第三消息的完整性保护的校验失败,在接收到第三消息后会丢弃第三消息。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图5所示,本实施例中提供一种测距方法,其中,该方法由第一终端执行,该方法,包括:
步骤51、确定第一终端确定第一消息被重放;丢弃第二消息;
或者,
确定第一终端确定第一消息未被重放;根据第二消息是否被重放的结果确定是否发送第三消息。
在一个实施例中,第一消息被重放可以是第三终端在获取第一消息后广播第一消息。其中,第三终端不同于第一终端。
在一个实施例中,第一消息中携带有加密的第一随机数,其中,该第一随机数是第一终端生成的。在第二终端接收到携带该第一随机数的第一消息后,如果第二终端再次接收到携带该第一随机数的第一消息,确定第一消息被重放。需要说明的是,第二终端可以向第一终端发送指示第一消息被重放的消息。
在一个实施例中,第一消息中携带有加密的第一随机数,其中,该第一随机数是第一终端生成的。在第二终端接收到携带该第一随机数的第一消息后,向第一终端发送携带该第一随机数的第二消息,在第一终端接收到携带该第一随机数的第二消息后,如果再次接收到携带该第一随机数的第二消息,确定第一消息被重放。
在一个实施例中,第二消息中携带有加密的第二随机数,其中,该第二随机数是第二终端生成的。 在第一终端接收到携带该第二随机数的第二消息后,如果再次接收到携带该第二随机数的第二消息,确定第二消息被重放。
在一个实施例中,响应于第二消息被重放,确定不发送第三消息。或者,响应于第二消息未被重放,确定发送第三消息。
在一个实施例中,响应于确定第一消息被重放,丢弃第二消息且第一终端不向第二终端发送第三消息。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图6所示,本实施例中提供一种测距方法,其中,该方法由第一终端执行,该方法,包括:
步骤61、确定第二消息被重放;确定不发送第三消息;
或者,
确定第二消息未被重放;确定发送第三消息。
在一个实施例中,第二消息中携带有加密的第二随机数,其中,该第二随机数是第二终端生成的。在第一终端接收到携带该第二随机数的第二消息后,如果再次接收到携带该第二随机数的第二消息,确定第二消息被重放。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
在一个实施例中,第一消息,还用于指示以下至少一种:
第一终端的身份标识ID;
第一终端生成的第一随机数,第一随机数用于确定第一消息是否被重放。这里,可以基于第一公钥加密第一随机数;
第一消息的命令ID。
在一个实施例中,在第二终端接收到第一终端发送的第一消息后,确定第一消息中携带的身份标识是否为预定标识;响应于身份标识为预定标识,第二终端在接收到第一消息后向第一终端发送第二消息。响应于身份标识不为预定标识,第二终端在接收到第一消息后丢弃该第一消息并不会向第一终端发送第二消息。
在一个实施例中,第二终端响应于接收到第一终端发送的第一消息且确定第一终端为预定终端,向第一终端发送第二消息。这里,预定终端可以是配置在终端集中,终端集中设置有包括用于第一终端与第二终端之间测距的至少一个第一终端的身份标识。第二终端在接收到第一终端的第一消息后,可以确定第一消息中携带的第一终端的身份标识是否在终端集中。响应于第一消息中携带的第一终端的身份标识在终端集中,向第一终端发送第二消息。
在一个实施例中,第一消息中携带有基于第一公钥加密的第一随机数,其中,该第一随机数是第一终端生成的。在第二终端接收到携带该第一随机数的第一消息后,向第一终端发送携带该第一随机数的 第二消息,在第一终端接收到携带该第一随机数的第二消息后,如果再次接收到携带该第一随机数的第二消息,确定第一消息被重放。响应于第一消息被重放,在接收到第二消息后丢弃第二消息。
在一个实施例中,第一消息的命令ID可以是用于指示该第一消息被发送的次数。例如,第一消息被第一次广播,则第一消息的命令ID可以指示“00”;第一消息被第二次广播,则第一消息的命令ID可以指示“01”。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
在一个实施例中,第二消息,还用于指示以下至少一种:
第一公钥加密的应用ID,应用ID,用于触发第二终端发送第二消息;
第一终端生成的第一随机数,第一随机数用于确定第一消息是否被重放。这里,基于第一公钥加密第一随机数;
第二终端生成的第二随机数,第二随机数用于确定第二消息是否被重放。这里,基于第一公钥加密第二随机数;
第一消息的命令ID。
在一个实施例中,第二终端中可以运行有不同的测距应用,其中,不同的测距应用的应用ID不同。不同的应用ID可以指示第一终端向第二终端发送包含不同信息的第三消息。这里,不同信息的第三消息可以是包含不同格式、数量和类型等的信息的第三消息。
在一个实施例中,第一消息中携带有加密的第一随机数,其中,该第一随机数是第一终端生成的。在第二终端接收到携带该第一随机数的第一消息后,如果第二终端再次接收到携带该第一随机数的第一消息,确定第一消息被重放。
在一个实施例中,第一消息中携带有加密的第一随机数,其中,该第一随机数是第一终端生成的。在第二终端接收到携带该第一随机数的第一消息后,向第一终端发送携带该第一随机数的第二消息,在第一终端接收到携带该第一随机数的第二消息后,如果再次接收到携带该第一随机数的第二消息,确定第一消息被重放。
在一个实施例中,第二消息中携带有加密的第二随机数,其中,该第二随机数是第二终端生成的。在第一终端接收到携带该第二随机数的第二消息后,如果再次接收到携带该第二随机数的第二消息,确定第二消息被重放。
在一个实施例中,第一消息的命令ID可以是用于指示该第一消息被发送的次数。例如,第一消息被第一次广播,则第一消息的命令ID可以指示“00”;第一消息被第二次广播,则第一消息的命令ID可以指示“01”。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图7所示,本实施例中提供一种测距方法,其中,该方法由第一终端执行,第二消息指示第一公 钥加密的第一随机数;该方法,包括:
步骤71、确定第一消息未被重放,其中,所述第一私钥解密的所述第一随机数不为重复的随机数;
或者,
确定第一消息被重放,所述第一私钥解密的所述第一随机数为重复的随机数。
在一个实施例中,第一消息中携带有利用第一公钥加密的第一随机数,其中,该第一随机数是第一终端生成的。在第二终端接收到携带该第一随机数的第一消息后,向第一终端发送携带该第一随机数的第二消息,其中,该第一随机数利用第一私钥加密。在第一终端接收到携带该第一随机数的第二消息后,如果再次接收到携带该第一随机数的第二消息,确定第一消息被重放。这里,第一随机数可以是利用第一终端的第一私钥解密。
在一个实施例中,第一消息中携带有利用第一公钥加密的第一随机数,其中,该第一随机数是第一终端生成的。在第二终端接收到携带该第一随机数的第一消息后,向第一终端发送携带该第一随机数的第二消息,其中,该第一随机数利用第一私钥加密。在第一终端接收到携带该第一随机数的第二消息后,如果未接收到携带该第一随机数的第二消息,确定第一消息未被重放。这里,第一随机数可以是利用第一终端的第一私钥解密。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图8所示,本实施例中提供一种测距方法,其中,第二消息指示第一公钥加密的第二随机数;该方法,包括:
步骤81、确定第二消息未被重放,其中,所述第一私钥解密的所述第二随机数不为重复的随机数;
或者,
确定第二消息被重放,其中,所述第一私钥解密的所述第二随机数为重复的随机数。
在一个实施例中,第二消息中携带有加密的第二随机数,其中,该第二随机数是第二终端生成的。在第一终端接收到携带该第二随机数的第二消息后,如果再次接收到携带该第二随机数的第二消息,确定第二消息被重放。
在一个实施例中,第二消息中携带有加密的第二随机数,其中,该第二随机数是第二终端生成的。在第一终端接收到携带该第二随机数的第二消息后,如果未再次接收到携带该第二随机数的第二消息,确定第二消息未被重放。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图9所示,本实施例中提供一种测距方法,其中,第二消息指示所述应用ID;该方法,包括:
步骤91、向第二终端发送基于应用ID确定的第三消息。
在一个实施例中,第二终端中可以运行有不同的测距应用,其中,不同的测距应用的应用ID不同。不同的应用ID可以指示第一终端向第二终端发送包含不同信息的第三消息。这里,不同信息的第三消 息可以是包含不同格式、数量和类型等的信息的第三消息。
在一个实施例中,响应于接收到第二终端发送的第二消息,向第二终端发送基于应用ID确定的第三消息。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
在一个实施例中,第三消息,还用于指示以下至少一种:
第一终端的ID;
第一终端生成的第三随机数,第三随机数用于确定第三消息是否被重放;这里,基于第二公钥加密第三随机数;
第一消息的命令ID。
在一个实施例中,在第二终端接收到第一终端发送的第一消息后,确定第一消息中携带的身份标识是否为预定标识;响应于身份标识为预定标识,第二终端在接收到第一消息后向第一终端发送第二消息。响应于身份标识不为预定标识,第二终端在接收到第一消息后丢弃该第一消息并不会向第一终端发送第二消息。
在一个实施例中,第二终端响应于接收到第一终端发送的第一消息且确定第一终端为预定终端,向第一终端发送第二消息。这里,预定终端可以是配置在终端集中,终端集中设置有包括用于第一终端与第二终端之间测距的至少一个第一终端的身份标识。第二终端在接收到第一终端的第一消息后,可以确定第一消息中携带的第一终端的身份标识是否在终端集中。响应于第一消息中携带的第一终端的身份标识在终端集中,向第一终端发送第二消息。
在一个实施例中,第三消息中携带有第二公钥加密的第三随机数,其中,该第三随机数是第一终端生成的。在第二终端接收到携带该第三随机数的第一消息后,如果再次接收到携带该第三随机数的第三消息,确定第三消息被重放。
在一个实施例中,第一消息的命令ID可以是用于指示该第一消息被发送的次数。例如,第一消息被第一次广播,则第一消息的命令ID可以指示“00”;第一消息被第二次广播,则第一消息的命令ID可以指示“01”。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图10所示,本实施例中提供一种测距方法,其中,该方法由第二终端执行,该方法,包括:
步骤101、接收第一终端发送的第一消息,第一消息用于指示第一终端的第一公钥;
步骤102、向第一终端发送第二消息,第二消息用于指示第一公钥加密的第二终端的第二公钥;
步骤103、接收第二终端发送的第二公钥加密的第三消息,第三消息用于指示第一消息的发送时刻和第二消息的接收时刻的第一时间差;第一时间差,用于确定第一终端与第二终端之间的距离。
这里,该第一终端和第二终端可以是但不限于是手机、可穿戴设备、车载终端、路侧单元(RSU, Road Side Unit)、智能家居终端、工业用传感设备和/或医疗设备等。
在一个实施例中,可以是周期性地广播第一消息。这里,可以是根据测距的时延要求确定广播第一消息的周期。在一个实施例中,响应于测距的时延要求大于时延阈值,确定广播第一消息的周期大于周期阈值。响应于测距的时延要求小于时延阈值,确定广播第一消息的周期小于周期阈值。如此,广播第一消息的周期可以适应于测距的时延要求。
在一个实施例中,第一终端可以是通过广播方式发送第一消息。在一个实施例中,第二终端可以接收多个第一终端通过广播方式发送的第一消息。第二终端在接收到多个第一终端通过广播方式发送的第一消息后,可以丢弃接收到的部分第一消息。在一个实施例中,当发送第一消息的终端不为第二终端预先设置的终端时,第二终端会丢弃该终端发送的第一消息。在另一个实施例中,当发送第一消息的终端为第二终端预先设置的终端且不为测距需要连接的终端时,第二终端会丢弃该终端发送的第一消息。
在一个实施例中,第一终端的秘钥包括第一公钥和第一私钥,第一终端在接收到第二终端利用第一公钥加密的信息后,可以利用第一私钥解密该加密的信息。第二终端在接收到第一终端利用第一私钥加密的信息后,可以利用第一公钥解密该加密的信息。这里,第二终端在利用第一公钥解密前,第一终端可以是预先将第一公钥发送给第二终端。如此,可以确保第一终端与第二终端之间信息的传输安全。
在一个实施例中,第二终端的秘钥包括第二公钥和第二私钥,第二终端在接收到第一终端利用第二公钥加密的信息后,可以利用第二私钥解密该加密的信息。第一终端在接收到第二终端利用第二私钥加密的信息后,可以利用第二公钥解密该加密的信息。这里,第一终端在利用第二公钥解密前,第二终端可以是预先将第二公钥发送给第一终端。如此,可以确保第一终端与第二终端之间信息的传输安全。
在一个实施例中,第二终端响应于接收到第一终端发送的第一消息且确定第一终端为预先设置的终端,向第一终端发送第二消息。这里,预先设置的终端可以是配置在终端集中,终端集中设置有包括用于第一终端与第二终端之间测距的至少一个第一终端的标识。第二终端在接收到第一终端的第一消息后,可以确定第一消息中携带的第一终端的标识是否在终端集中。响应于第一消息中携带的第一终端的标识在终端集中,向第一终端发送第二消息。
在一个实施例中,第一终端在广播第一消息时,会记录第一消息的发送时刻;第一终端在接收第二终端发送的第二消息时,会记录第二消息的接收时刻;第一终端会根据发送时刻和接收时刻确定发送时刻和接收时刻之间的第一时间差。并将第一时间差的信息通过第三消息发送给第二终端。
在一个实施例中,第二终端在接收第一终端发送的第一消息时,会记录第一消息的接收时刻;第二终端在向第一终端发送第二消息时,会记录第二消息发送时刻;第二终端会根据接收时刻和发送时刻确定发送时刻和接收时刻之间的第二时间差。在接收到第一终端发送的第一时间差后,第二终端确定第一时间差和第二时间差之间的差值,并基于该差值与电磁波传播速度确定第一终端与第二终端之间的距离。
在一个实施例中,第二终端可以通过预定时段内测量到的距离的平均值,确定第一终端与第二终端之间的距离。这样,可以提高第一终端与第二终端之间的距离的测量精度。在一个实施例中,根据要求测量精度确定预定时段的时长。在一个实施例中,响应于要求测量精度大于或者等于精度阈值,确定预定时段的时长大于时长阈值。或者,响应于要求测量精度小于精度阈值,确定预定时长小于或者等于时 长阈值。
在一个实施例中,利用第二公钥加密第三消息可以是是利用第二公钥加密第三消息中的第一时间差和第一终端的身份标识等信息。第二终端响应于接收到第三消息且利用第二私钥不能解密第三消息,可以在接收到第三消息后丢弃第三消息。这样,可以确保第一终端与第二终端之间数据传输的安全。
在一个实施例中,第一终端响应于接收到第二终端发送的第二消息且确定第一消息和/或第二消息未被重放,向第二终端发送第三消息。
在一个实施例中,第二终端响应于接收到第一终端发送的第一消息且确定第一消息未被重放,向第一终端发送第二消息。
在一个实施例中,第一消息指示第一终端的第一公钥,包括:第一消息携带第一公钥;或者,第一消息携带指示第一公钥的指示信息。例如,指示信息“00”指示第一公钥。
本公开实施例中,在测量第一终端与第二终端之间的距离时,利用第一消息指示第一公钥;利用第二消息指示第二公钥且第二公钥被第一公钥加密;并通过第二公钥加密第三消息。相较于利用额外的消息携带安全信息以确保测距信息的传输安全的方式,本申请技术方案将安全信息携带在用于测距的第一消息和第二消息中,如此,在确保信息传输安全的同时,能够减少信令资源的消耗且节省测距的时间。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图11所示,本实施例中提供一种测距方法,其中,该方法由第二终端执行,该方法,包括:
步骤111、基于第一终端的第一公钥,对第一消息进行完整性保护的验证。
在一个实施例中,第一终端使用预定完整性保护算法,以第一私钥、消息本身以及消息的长度等中的至少一个作为输入参数,计算一个包含多个比特位的第一验证码,并将该第一验证码携带在第一消息的信息域中。第二终端在接收到第一消息后,基于第一公钥,以同样的计算方法计算该第一消息的第二验证码,并通过比较第一验证码和第二验证码确定完整性保护的校验是否成功。如果第一验证码与第二验证码相同,则第二终端确定完整性保护的校验成功,否则,确定完整性保护的校验失败。
在一个实施例中,第二终端响应于对第一消息的完整性保护的校验失败,在接收到第一消息后会丢弃第一消息。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图12所示,本实施例中提供一种测距方法,其中,该方法由第二终端执行,该方法,包括:
步骤121、根据完整性的验证的结果,确定是否发送第二消息。
在一个实施例中,确定结果指示验证成功;确定发送第二消息。
在一个实施例中,确定结果指示验证失败;确定丢弃第一消息且不发送第二消息。
在一个实施例中,第一终端使用预定完整性保护算法,以密钥、消息本身以及消息的长度等中的至少一个作为输入参数,计算一个包含多个比特位的第一验证码,并将该第一验证码携带在第一消息的信 息域中。第二终端在接收到第一消息后,以同样的计算方法计算该第一消息的第二验证码,并通过比较第一验证码和第二验证码确定完整性保护的校验是否成功。如果第一验证码与第二验证码相同,则第二终端确定完整性保护的校验成功,即验证结果指示验证成功;否则,确定完整性保护的校验失败,即验证结果指示验证失败。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
本实施例中提供一种测距方法,其中,该方法由第二终端执行,该方法,包括:
确定结果指示验证成功;确定发送第二消息;
或者,
确定结果指示验证失败;确定丢弃第一消息且不发送第二消息。
如图13所示,本实施例中提供一种测距方法,其中,该方法由第二终端执行,该方法,包括:
步骤131、基于第一终端的第一公钥,对第三消息进行完整性保护的验证。
在一个实施例中,第一终端使用预定完整性保护算法,以第一私钥、消息本身以及消息的长度等中的至少一个作为输入参数,计算一个包含多个比特位的第一验证码携带在第三消息的信息域中。第二终端在接收到第三消息后,基于第一公钥,以同样的计算方法计算该第三消息的第二验证码,并通过比较第一验证码和第二验证码确定完整性保护的校验是否成功。如果第一验证码与第二验证码相同,则第二终端确定完整性保护的校验成功,否则确定完整性保护的校验失败。
在一个实施例中,第二终端响应于对第三消息的完整性保护的校验失败,在接收到第三消息后会丢弃第三消息。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
在一个实施例中,第三消息,还指示以下信息中的一种或多种:
第一终端的ID;
第一终端生成的第三随机数,第三随机数用于确定第三消息是否被重放;这里,基于第二公钥加密第三随机数;
第一消息的命令ID。
在一个实施例中,在第二终端接收到第一终端发送的第一消息后,确定第一消息中携带的身份标识是否为预定标识;响应于身份标识为预定标识,第二终端在接收到第一消息后向第一终端发送第二消息。响应于身份标识不为预定标识,第二终端在接收到第一消息后丢弃该第一消息并不会向第一终端发送第二消息。
在一个实施例中,第二终端响应于接收到第一终端发送的第一消息且确定第一终端为预定终端,向第一终端发送第二消息。这里,预定终端可以是配置在终端集中,终端集中设置有包括用于第一终端与 第二终端之间测距的至少一个第一终端的身份标识。第二终端在接收到第一终端的第一消息后,可以确定第一消息中携带的第一终端的身份标识是否在终端集中。响应于第一消息中携带的第一终端的身份标识在终端集中,向第一终端发送第二消息。
在一个实施例中,第三消息中携带有第二公钥加密的第三随机数,其中,该第三随机数是第一终端生成的。在第二终端接收到携带该第三随机数的第一消息后,如果第二终端再次接收到携带该第三随机数的第三消息,确定第三消息被重放。
在一个实施例中,第一消息的命令ID可以是用于指示该第一消息被发送的次数。例如,第一消息被第一次广播,则第一消息的命令ID可以指示“00”;第一消息被第二次广播,则第一消息的命令ID可以指示“01”。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图14所示,本实施例中提供一种测距方法,其中,该方法由第二终端执行,第三消息指示第二公钥加密的第三随机数;该方法,包括:
步骤141、确定第三消息未被重放,其中,所述第二私钥解密的所述第三随机数不为重复的随机数;
或者,
确定第三消息被重放,其中,所述第二私钥解密的所述第三随机数为重复的随机数。
在一个实施例中,第三消息中携带有加密的第三随机数,其中,该第三随机数是第一终端生成的。在第二终端接收到携带该第三随机数的第三消息后,如果再次接收到携带该第三随机数的第三消息,确定第三消息被重放。
在一个实施例中,第三消息中携带有加密的第三随机数,其中,该第三随机数是第一终端生成的。在第二终端接收到携带该第三随机数的第三消息后,如果未再次接收到携带该第三随机数的第三消息,确定第三消息未被重放。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图15所示,本实施例中提供一种测距方法,其中,该方法由第二终端执行,第三消息指示第一终端的ID;该方法,包括:
步骤151、确定对第三消息进行完整性保护验证的结果指示验证成功且第三消息未被重放;根据第一终端的ID确定是否测量第一终端与第二终端之间的距离。
在一个实施例中,响应于第一终端的ID为预定ID,确定测量第一终端与第二终端之间的距离。或者,响应于第一终端的ID不为预定ID,确定不测量第一终端与第二终端之间的距离。
在一个实施例中,预定ID可以是配置在终端集中,终端集中设置有包括用于第一终端与第二终端之间测距的至少一个第一终端的预定ID。第二终端在接收到第一终端的第三消息后,可以确定第三消息中携带的第一终端的ID是否在终端集中。响应于第三消息中携带的第一终端的ID在终端集中,确 定测量第一终端与第二终端之间的距离。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图16所示,本实施例中提供一种测距方法,其中,该方法由第二终端执行,该方法,包括:
步骤161、确定第一终端的ID为预定ID,确定测量第一终端与第二终端之间的距离;或者,确定第一终端的ID不为预定ID,确定不测量第一终端与第二终端之间的距离。
在一个实施例中,预定ID可以是配置在终端集中,终端集中设置有包括用于第一终端与第二终端之间测距的至少一个第一终端的预定ID。第二终端在接收到第一终端的第三消息后,可以确定第三消息中携带的第一终端的ID是否在终端集中。响应于第三消息中携带的第一终端的ID在终端集中,确定测量第一终端与第二终端之间的距离。响应于第三消息中携带的第一终端的ID不在终端集中,确定不测量第一终端与第二终端之间的距离。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图17所示,本实施例中提供一种测距方法,其中,该方法由第二终端执行,该方法,包括:
步骤171、基于第一时间差和第二时间差确定第一终端与第二终端之间的距离,第二时间差,为第一消息的接收时刻和第二消息的发送时刻的时间差。
在一个实施例中,第二终端在接收第二终端发送的第一消息时,会记录接收第一消息的第三时刻信息;第二终端在向第一终端发送第二消息时,会记录发送第二消息的第四时刻信息;第二终端会根据第三时刻信息和第四时刻信息确定接收第一消息的时刻和发送第二消息的时刻之间的第二时间差。在接收到第一终端发送的第一时间差后,第二终端确定第一时间差和第二时间差之间的差值,并基于该差值与电磁波传播速度确定第一终端与第二终端之间的距离。
在一个实施例中,第二终端可以通过预定时段内的测量到的距离的平均值,确定第一终端与第二终端之间的距离。这样,可以提高第一终端与第二终端之间的距离的测量精度。在一个实施例中,根据要求测量精度确定预定时段的时长。在一个实施例中,响应于要求测量精度大于或者等于精度阈值,确定预定时段的时长大于时长阈值。或者,响应于要求测量精度小于精度阈值,确定预定时长小于或者等于时长阈值。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
在一个实施例中,第一消息,还用于指示以下至少一种:
第一终端的身份标识ID;
第一终端生成的第一随机数,第一随机数用于确定第一消息是否被重放;基于第一公钥加密第一随机数;
第一消息的命令ID。
在一个实施例中,在第二终端接收到第一终端发送的第一消息后,确定第一消息中携带的身份标识是否为预定标识;响应于身份标识为预定标识,第二终端在接收到第一消息后向第一终端发送第二消息。响应于身份标识不为预定标识,第二终端在接收到第一消息后丢弃该第一消息并不会向第一终端发送第二消息。
在一个实施例中,第二终端响应于接收到第一终端发送的第一消息且确定第一终端为预定终端,向第一终端发送第二消息。这里,预定终端可以是配置在终端集中,终端集中设置有包括用于第一终端与第二终端之间测距的至少一个第一终端的身份标识。第二终端在接收到第一终端的第一消息后,可以确定第一消息中携带的第一终端的身份标识是否在终端集中。响应于第一消息中携带的第一终端的身份标识在终端集中,向第一终端发送第二消息。
在一个实施例中,第一消息中携带有基于第一公钥加密的第一随机数,其中,该第一随机数是第一终端生成的。在第二终端接收到携带该第一随机数的第一消息后,向第一终端发送携带该第一随机数的第二消息,在第一终端接收到携带该第一随机数的第二消息后,如果再次接收到携带该第一随机数的第二消息,确定第一消息被重放。响应于第一消息被重放,在接收到第二消息后丢弃第二消息。
在一个实施例中,第一消息的命令ID可以是用于指示该第一消息被发送的次数。例如,第一消息被第一次广播,则第一消息的命令ID可以指示“00”;第一消息被第二次广播,则第一消息的命令ID可以指示“01”。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
在一个实施例中,第二消息,还用于指示以下至少之一:
第一密钥加密的应用ID,应用ID,用于触发第二终端发送第二消息;
第一终端生成的第一随机数,第一随机数用于确定第一消息是否被重放。这里,基于第一公钥加密第一随机数;
第二终端生成的第二随机数,其中,第二随机数用于确定第二消息是否被重放。这里,基于第一公钥加密第二随机数;
第一消息的命令ID。
在一个实施例中,第二终端中可以运行有不同的测距应用,其中,不同的测距应用的应用ID不同。不同的应用ID可以指示第一终端向第二终端发送包含不同信息的第三消息。这里,不同信息的第三消息可以是包含不同格式、数量和类型等的信息的第三消息。
在一个实施例中,第一消息中携带有加密的第一随机数,其中,该第一随机数是第一终端生成的。在第二终端接收到携带该第一随机数的第一消息后,如果再次接收到携带该第一随机数的第一消息,确定第一消息被重放。
在一个实施例中,第一消息中携带有加密的第一随机数,其中,该第一随机数是第一终端生成的。在第二终端接收到携带该第一随机数的第一消息后,向第一终端发送携带该第一随机数的第二消息,在 第一终端接收到携带该第一随机数的第二消息后,如果再次接收到携带该第一随机数的第一消息,确定第一消息被重放。
在一个实施例中,第二消息中携带有加密的第二随机数,其中,该第二随机数是第二终端生成的。在第一终端接收到携带该第二随机数的第二消息后,如果再次接收到携带该第二随机数的第二消息,确定第二消息被重放。
在一个实施例中,第一消息的命令ID可以是用于指示该第一消息被发送的次数。例如,第一消息被第一次广播,则第一消息的命令ID可以指示“00”;第一消息被第二次广播,则第一消息的命令ID可以指示“01”。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图18所示,本公开实施例中提供一种测距装置,该装置包括
发送模块181,用于广播第一消息,所述第一消息用于指示所述装置的第一公钥;
接收模块182,用于接收第二终端发送的第二消息,所述第二消息用于指示所述第一公钥加密的所述第二终端的第二公钥;
发送模块181,用于向所述第二终端发送所述第二公钥加密的第三消息,所述第三消息用于指示所述第一消息的发送时刻和所述第二消息的接收时刻的第一时间差。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
如图19所示,本公开实施例中提供一种测距装置,该装置包括:
接收模块191,用于接收第一终端发送的第一消息,所述第一消息用于指示所述第一终端的第一公钥;
发送模块192,用于向所述第一终端发送第二消息,所述第二消息用于指示所述第一公钥加密的所述第二终端的第二公钥;
接收模块191,用于接收所述第二终端发送的所述第二公钥加密的第三消息,所述第三消息用于指示所述第一消息的发送时刻和所述第二消息的接收时刻的第一时间差;所述第一时间差,用于确定所述第一终端与所述装置之间的距离。
需要说明的是,本领域内技术人员可以理解,本公开实施例提供的方法,可以被单独执行,也可以与本公开实施例中一些方法或相关技术中的一些方法一起被执行。
本公开实施例提供一种通信设备,通信设备,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,处理器被配置为:用于运行可执行指令时,实现应用于本公开任意实施例的方法。
其中,处理器可包括各种类型的存储介质,该存储介质为非临时性计算机存储介质,在通信设备掉电之后能够继续记忆存储其上的信息。
处理器可以通过总线等与存储器连接,用于读取存储器上存储的可执行程序。
本公开实施例还提供一种计算机存储介质,其中,计算机存储介质存储有计算机可执行程序,可执行程序被处理器执行时实现本公开任意实施例的方法。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
如图20所示,本公开一个实施例提供一种终端的结构。
参照图20所示终端800本实施例提供一种终端800,该终端具体可是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。
参照图20,终端800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。
处理组件802通常控制终端800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。
存储器804被配置为存储各种类型的数据以支持在设备800的操作。这些数据的示例包括用于在终端800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件806为终端800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为终端800生成、管理和分配电力相关联的组件。
多媒体组件808包括在终端800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当终端800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组 件810还包括一个扬声器,用于输出音频信号。
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件814包括一个或多个传感器,用于为终端800提供各个方面的状态评估。例如,传感器组件814可以检测到设备800的打开/关闭状态,组件的相对定位,例如组件为终端800的显示器和小键盘,传感器组件814还可以检测终端800或终端800一个组件的位置改变,用户与终端800接触的存在或不存在,终端800方位或加速/减速和终端800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件816被配置为便于终端800和其他设备之间有线或无线方式的通信。终端800可以接入基于通信标准的无线网络,如Wi-Fi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,终端800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器804,上述指令可由终端800的处理器820执行以完成上述方法。例如,非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
如图21所示,本公开一实施例示出一种基站的结构。例如,基站900可以被提供为一网络侧设备。参照图21,基站900包括处理组件922,其进一步包括一个或多个处理器,以及由存储器932所代表的存储器资源,用于存储可由处理组件922的执行的指令,例如应用程序。存储器932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件922被配置为执行指令,以执行上述方法前述应用在所述基站的任意方法。
基站900还可以包括一个电源组件926被配置为执行基站900的电源管理,一个有线或无线网络接口950被配置为将基站900连接到网络,和一个输入输出(I/O)接口958。基站900可以操作基于存储在存储器932的操作系统,例如Windows Server TM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本发明的其它实施方案。本公开旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由下面的权利要求指出。
应当理解的是,本发明并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本发明的范围仅由所附的权利要求来限制。

Claims (26)

  1. 一种测距方法,其中,所述方法由第一终端执行,所述方法,包括:
    广播第一消息,所述第一消息用于指示第一终端的第一公钥;
    接收第二终端发送的第二消息,所述第二消息用于指示所述第一公钥加密的所述第二终端的第二公钥;
    向所述第二终端发送所述第二公钥加密的第三消息,所述第三消息用于指示所述第一消息的发送时刻和所述第二消息的接收时刻的第一时间差。
  2. 根据权利要求1所述的方法,其中,所述方法,还包括:
    基于所述第一终端的第一私钥,对所述第一消息和/或所述第三消息进行完整性保护。
  3. 根据权利要求1所述的方法,其中,所述方法,还包括:
    确定所述第一消息被重放;丢弃所述第二消息;
    或者,
    确定所述第一消息未被重放;根据所述第二消息是否被重放的结果确定是否发送所述第三消息。
  4. 根据权利要求3所述的方法,其中,所述根据所述第二消息是否被重放的结果确定是否发送所述第三消息,包括:
    确定所述第二消息被重放;确定不发送所述第三消息;
    或者,
    确定所述第二消息未被重放;确定发送所述第三消息。
  5. 根据权利要求4所述的方法,其中,所述第一消息,还用于指示以下至少一种:
    所述第一终端的身份标识ID;
    所述第一终端生成的第一随机数,所述第一随机数用于确定所述第一消息是否被重放;
    所述第一消息的命令ID。
  6. 根据权利要求4所述的方法,其中,所述第二消息,还用于指示以下至少一种:
    所述第一公钥加密的应用ID,所述应用ID,用于触发所述第二终端发送所述第二消息;
    所述第一终端生成的第一随机数,所述第一随机数用于确定所述第一消息是否被重放;
    所述第二终端生成的第二随机数,所述第二随机数用于确定所述第二消息是否被重放;
    所述第一消息的命令ID。
  7. 根据权利要求6所述的方法,其中,所述第二消息指示所述第一公钥加密的所述第一随机数;所述方法,还包括:
    确定所述第一消息未被重放,其中,所述第一私钥解密的所述第一随机数不为重复的随机数;
    或者,
    确定所述第一消息被重放,所述第一私钥解密的所述第一随机数为重复的随机数。
  8. 根据权利要求6所述的方法,其中,所述第二消息指示所述第一公钥加密的所述第二随机数;所述方法,还包括:
    确定所述第二消息未被重放,其中,所述第一私钥解密的所述第二随机数不为重复的随机数;
    或者,
    确定所述第二消息被重放,其中,所述第一私钥解密的所述第二随机数为重复的随机数。
  9. 根据权利要求6所述的方法,其中,所述第二消息指示所述应用ID;所述向所述第二终端发送利用所述第二公钥加密的第三消息,包括:
    向所述第二终端发送基于所述应用ID确定的所述第三消息。
  10. 根据权利要求4所述的方法,其中,所述第三消息,还用于指示以下至少一种:
    所述第一终端的ID;
    所述第一终端生成的第三随机数,所述第三随机数用于确定所述第三消息是否被重放;
    所述第一消息的命令ID。
  11. 一种测距方法,其中,所述方法由第二终端执行,所述方法,包括:
    接收第一终端发送的第一消息,所述第一消息用于指示所述第一终端的第一公钥;
    向所述第一终端发送第二消息,所述第二消息用于指示所述第一公钥加密的第二终端的第二公钥;
    接收所述第二终端发送的所述第二公钥加密的第三消息,所述第三消息用于指示所述第一消息的发送时刻和所述第二消息的接收时刻的第一时间差;所述第一时间差,用于确定所述第一终端与所述第二终端之间的距离。
  12. 根据权利要求11所述的方法,其中,所述方法,还包括:
    基于所述第一终端的第一公钥,对所述第一消息进行完整性保护的验证。
  13. 根据权利要求12所述的方法,其中,所述方法,还包括:
    根据所述完整性的验证的结果,确定是否发送所述第二消息。
  14. 根据权利要求13所述的方法,其中,所述根据所述完整性的验证的结果,确定是否发送所述第二消息,包括:
    确定所述结果指示验证成功;确定发送所述第二消息;
    或者,
    确定所述结果指示验证失败;确定丢弃所述第一消息且不发送所述第二消息。
  15. 根据权利要求11所述的方法,其中,所述方法,还包括:
    基于所述第一终端的第一公钥,对所述第三消息进行完整性保护的验证。
  16. 根据权利要求11所述的方法,其中,所述第三消息,还用于指示以下至少之一:
    所述第一终端的ID;
    所述第一终端生成的第三随机数,所述第三随机数用于确定所述第三消息是否被重放;
    所述第一消息的命令ID。
  17. 根据权利要求16所述的方法,其中,所述第三消息指示所述第二公钥加密的所述第三随机数;所述方法,还包括:
    确定所述第三消息未被重放,其中,所述第二私钥解密的所述第三随机数不为重复的随机数;
    或者,
    确定所述第三消息被重放,其中,所述第二私钥解密的所述第三随机数为重复的随机数。
  18. 根据权利要求11所述的方法,其中,所述第三消息指示所述第一终端的ID;所述方法,还包括:
    确定对所述第三消息进行完整性保护验证的结果指示验证成功且所述第三消息未被重放;
    根据所述第一终端的ID确定是否测量所述第一终端与所述第二终端之间的距离。
  19. 根据权利要求18所述的方法,其中,所述根据所述第一终端的ID确定是否测量所述第一终端与所述第二终端之间的距离,包括:
    确定所述第一终端的ID为预定ID;确定测量所述第一终端与所述第二终端之间的距离;
    或者,
    确定所述第一终端的ID不为预定ID;确定不测量所述第一终端与所述第二终端之间的距离。
  20. 根据权利要求19所述的方法,其中,所述方法,还包括:
    基于所述第一时间差和第二时间差确定所述第一终端与所述第二终端之间的距离,所述第二时间差,为所述第一消息的接收时刻和所述第二消息的发送时刻的时间差。
  21. 根据权利要求11所述的方法,其中,所述第一消息,还用于指示以下至少一种:
    所述第一终端的身份标识ID;
    所述第一终端生成的第一随机数,所述第一随机数用于确定所述第一消息是否被重放;
    所述第一消息的命令ID。
  22. 根据权利要求11所述的方法,其中,所述第二消息,还用于指示以下至少之一:
    所述第一密钥加密的应用ID,所述应用ID,用于触发所述第二终端发送所述第二消息;
    所述第一终端生成的第一随机数,所述第一随机数用于确定所述第一消息是否被重放;
    所述第二终端生成的第二随机数,所述第二随机数用于确定所述第二消息是否被重放;
    所述第一消息的命令ID。
  23. 一种测距装置,所述装置包括:
    发送模块,用于广播第一消息,所述第一消息用于指示所述装置的第一公钥;
    接收模块,用于接收第二终端发送的第二消息,所述第二消息用于指示所述第一公钥加密的所述第二终端的第二公钥;
    所述发送模块,还用于向所述第二终端发送所述第二公钥加密的第三消息,所述第三消息用于指示所述第一消息的发送时刻和所述第二消息的接收时刻的第一时间差。
  24. 一种测距装置,所述装置包括:
    接收模块,用于接收第一终端发送的第一消息,所述第一消息用于指示所述第一终端的第一公钥;
    发送模块,用于向所述第一终端发送第二消息,所述第二消息用于指示所述第一公钥加密的所述第二终端的第二公钥;
    接收模块,还用于接收所述第二终端发送的所述第二公钥加密的第三消息,所述第三消息用于指示所述第一消息的发送时刻和所述第二消息的接收时刻的第一时间差;所述第一时间差,用于确定所述第一终端与所述装置之间的距离。
  25. 一种通信设备,其中,包括:
    存储器;
    处理器,分别与所述天线及存储器连接,被配置为通过执行存储在所述存储器上的计算机可执行指令,控制所述天线的收发,并能够实现权利要求1至10、或11至22任一项所述的方法。
  26. 一种计算机存储介质,所述计算机存储介质存储有计算机可执行指令,所述计算机可执行指令被处理器执行后能够实现权利要求1至10、或11至22任一项所述的方法。
PCT/CN2021/088204 2021-04-19 2021-04-19 测距方法、装置、通信设备及存储介质 WO2022222006A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2021/088204 WO2022222006A1 (zh) 2021-04-19 2021-04-19 测距方法、装置、通信设备及存储介质
CN202180001196.4A CN115606216A (zh) 2021-04-19 2021-04-19 测距方法、装置、通信设备及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/088204 WO2022222006A1 (zh) 2021-04-19 2021-04-19 测距方法、装置、通信设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022222006A1 true WO2022222006A1 (zh) 2022-10-27

Family

ID=83723666

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/088204 WO2022222006A1 (zh) 2021-04-19 2021-04-19 测距方法、装置、通信设备及存储介质

Country Status (2)

Country Link
CN (1) CN115606216A (zh)
WO (1) WO2022222006A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106043232A (zh) * 2015-04-02 2016-10-26 大众汽车有限公司 用于交通运输工具用无线电钥匙的距离确定和认证
CN107251621A (zh) * 2015-02-13 2017-10-13 高通股份有限公司 高效测距
CN107438230A (zh) * 2016-05-27 2017-12-05 苹果公司 安全无线测距
CN108291960A (zh) * 2015-11-23 2018-07-17 皇家飞利浦有限公司 用于验证距离测量的系统
CN108701380A (zh) * 2016-01-13 2018-10-23 3Db数据接驳股份公司 用于安全距离测量的方法、装置和系统
WO2019067105A1 (en) * 2017-09-29 2019-04-04 Apple Inc. MOBILE COMMUNICATION AND TELEMETRY DEVICE USING AN AUTOMATIC FUNCTIONALITY ACCESS CONTROL SYSTEM
US20200150262A1 (en) * 2018-11-09 2020-05-14 Samsung Electronics Co., Ltd. Method and apparatus for controlling ranging in wireless communication system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107251621A (zh) * 2015-02-13 2017-10-13 高通股份有限公司 高效测距
CN106043232A (zh) * 2015-04-02 2016-10-26 大众汽车有限公司 用于交通运输工具用无线电钥匙的距离确定和认证
CN108291960A (zh) * 2015-11-23 2018-07-17 皇家飞利浦有限公司 用于验证距离测量的系统
CN108701380A (zh) * 2016-01-13 2018-10-23 3Db数据接驳股份公司 用于安全距离测量的方法、装置和系统
CN107438230A (zh) * 2016-05-27 2017-12-05 苹果公司 安全无线测距
WO2019067105A1 (en) * 2017-09-29 2019-04-04 Apple Inc. MOBILE COMMUNICATION AND TELEMETRY DEVICE USING AN AUTOMATIC FUNCTIONALITY ACCESS CONTROL SYSTEM
US20200150262A1 (en) * 2018-11-09 2020-05-14 Samsung Electronics Co., Ltd. Method and apparatus for controlling ranging in wireless communication system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
XIAOMI: "FS_Ranging Security and authorization issues", 3GPP DRAFT; S1-204099, 3RD GENERATION PARTNERSHIP PROJECT (3GPP), MOBILE COMPETENCE CENTRE ; 650, ROUTE DES LUCIOLES ; F-06921 SOPHIA-ANTIPOLIS CEDEX ; FRANCE, vol. SA WG1, no. Online; 20201109 - 20201118, 3 November 2020 (2020-11-03), Mobile Competence Centre ; 650, route des Lucioles ; F-06921 Sophia-Antipolis Cedex ; France , XP051950429 *

Also Published As

Publication number Publication date
CN115606216A (zh) 2023-01-13

Similar Documents

Publication Publication Date Title
WO2022016431A1 (zh) 切换小区的方法、装置、通信设备及存储介质
WO2023184561A1 (zh) 中继通信方法、装置、通信设备及存储介质
WO2022000361A1 (zh) Ue之间的定位方法及装置、通信设备及存储介质
WO2022178723A1 (zh) 测量间隔的配置方法、装置、通信设备及存储介质
WO2022205341A1 (zh) 测量间隔预配置处理方法、装置、通信设备及存储介质
WO2022120735A1 (zh) 无线通信的方法、装置、通信设备及存储介质
WO2022141095A1 (zh) 辅助ue的选择方法、装置及存储介质
WO2022222005A1 (zh) 通信设备检测方法、装置、通信设备和存储介质
WO2022110057A1 (zh) 无线传输的方法、装置、通信设备及存储介质
WO2022222006A1 (zh) 测距方法、装置、通信设备及存储介质
WO2022222145A1 (zh) 终端能力信息的上报方法、装置、通信设备及存储介质
WO2022204889A1 (zh) 波束测量的方法、装置、通信设备及存储介质
US20230199896A1 (en) Method and apparatus for transferring service, communication device and storage medium
WO2023142090A1 (zh) 信息传输方法、装置、通信设备和存储介质
WO2023142089A1 (zh) 信息传输方法、装置、通信设备和存储介质
WO2023216259A1 (zh) 卫星覆盖信息确定方法、装置、通信设备和存储介质
WO2022188073A1 (zh) 测量参考信号的方法、装置、通信设备及存储介质
WO2023070685A1 (zh) 中继通信的方法、装置、通信设备及存储介质
WO2024164337A1 (zh) 定位服务的授权方法、装置、通信设备及存储介质
WO2023216257A1 (zh) 信号覆盖信息确定方法、装置、通信设备和存储介质
WO2023245354A1 (zh) 安全保护方法、装置、通信设备及存储介质
WO2023142093A1 (zh) Ue发现消息保护方法、装置、通信设备及存储介质
WO2022077475A1 (zh) 语音通信的方法、装置、通信设备及存储介质
WO2022027484A1 (zh) 随机接入的方法、装置、通信设备及存储介质
WO2022183452A1 (zh) 波束恢复的方法、装置、通信设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21937257

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18287453

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21937257

Country of ref document: EP

Kind code of ref document: A1