US-12621746-B2 - Method for determining transmission delay and electronic device
Abstract
A method includes that a first frame from a second electronic device may carry sending time information of the sent first frame, and the first frame is a device discovery beacon frame used for device discovery, a synchronization beacon frame used for synchronization, or a service discovery frame used for service discovery in Wi-Fi aware. After receiving the first frame, a first electronic device may determine a first transmission delay between the first electronic device and the second electronic device based on the sending time information of the first frame and a first time point at which the first frame is received.
Inventors
- Songping Yao
Assignees
- HUAWEI TECHNOLOGIES CO., LTD.
Dates
- Publication Date
- 20260505
- Application Date
- 20210924
- Priority Date
- 20201013
Claims (20)
- 1 . A method implemented by a first electronic device, wherein the method comprises: receiving, from a second electronic device, a first frame at a first time point, wherein the first frame comprises a first field carrying first sending time information of the first frame, and wherein the first frame is a device discovery beacon frame, a synchronization beacon frame, or a service discovery frame of neighbor awareness networking (NAN); and determining a first transmission delay of a first transmission link that is between the first electronic device and the second electronic device based on the first time point and the first sending time information, wherein when the first transmission delay does not meet a transmission requirement, the method further comprises: selecting a second transmission link that is between the first electronic device and the second electronic device and that has a second transmission delay that meets the transmission requirement; and transmitting data to the second electronic device via the second transmission link.
- 2 . The method of claim 1 , wherein the first field is a first reserved field for a NAN attribute field in the first frame.
- 3 . The method of claim 1 , wherein the first field comprises a first attribute field comprising a first bit indicating that the first field is carrying the first sending time information, a sending time field comprising a second bit indicating a sending time point at which the second electronic device sends the first frame, and a first length field comprising a third bit indicating a length of the sending time field.
- 4 . The method of claim 1 , wherein when the first electronic device is not synchronized with the second electronic device, determining the first transmission delay comprises: determining a third transmission delay between the first electronic device and the second electronic device based on the first time point and the first sending time information; and calibrating, after the first electronic device is synchronized with the second electronic device, the third transmission delay based on clock information for calibration in a synchronization process to obtain the first transmission delay.
- 5 . The method of claim 1 , further comprising sending, to a third electronic device, a second frame carrying a second field comprising the first transmission delay, wherein the second frame is a synchronization beacon frame or a service discovery frame of NAN.
- 6 . The method of claim 5 , wherein the second field is a second reserved field for a NAN attribute field in the second frame.
- 7 . The method of claim 5 , wherein the second field comprises a second attribute field comprising a first bit indicating that the second field is carrying the first sending time information, a transmission delay field comprising a second bit indicating the first transmission delay, and a second length field comprising a third bit indicating a length of the transmission delay field.
- 8 . The method of claim 1 , further comprising sending, to a fourth electronic device, a third frame comprising a third field carrying second sending time information of the third frame, wherein a fourth transmission delay between the fourth electronic device and the first electronic device is based on the second sending time information, and wherein the third frame is a service discovery frame, a synchronization beacon frame, or a device discovery beacon frame.
- 9 . A first electronic device, comprising: a memory configured to store instructions; and one or more processors coupled to the memory and configured to: receive, from a second electronic device, a first frame sent at a first time point, wherein the first frame comprises a first field carrying first sending time information of the first frame received from the second electronic device, and wherein the first frame is a device discovery beacon frame, a synchronization beacon frame, or a service discovery frame of neighbor awareness networking (NAN); and determine a first transmission delay of a first transmission link that is between the first electronic device and the second electronic device based on the first time point and the first sending time information, wherein when the first transmission delay does not meet a transmission requirement, the one or more processors are further configured to: select a second transmission link that is between the first electronic device and the second electronic device and that has a second transmission delay that meets the transmission requirement; and transmit data to the second electronic device via the second transmission link.
- 10 . The first electronic device of claim 9 , wherein the first field is a first reserved field for a NAN attribute field in the first frame.
- 11 . The first electronic device of claim 9 , wherein the first field comprises a first attribute field comprising a first bit indicating that the first field is carrying the first sending time information, a sending time field comprising a second bit indicating a sending time point at which the second electronic device sends the first frame, and a first length field comprising a third bit indicating a length of the sending time field.
- 12 . The first electronic device of claim 9 , wherein the one or more processors are further configured to: determine a third transmission delay between the first electronic device and the second electronic device based on the first time point and the first sending time information; and calibrate the third transmission delay based on clock information for calibration in a synchronization process to obtain the first transmission delay when the first electronic device is synchronized with the second electronic device.
- 13 . The first electronic device of claim 9 , wherein the one or more processors are further configured to send, to a third electronic device, a second frame comprising a second field carrying the first transmission delay, wherein the second frame is a synchronization beacon frame or a service discovery frame of NAN.
- 14 . The first electronic device of claim 13 , wherein the second field is a second reserved field for a NAN attribute field in the second frame.
- 15 . The first electronic device of claim 13 , wherein the second field comprises a second attribute field comprising a first bit indicating that the second field is carrying the first transmission delay, a transmission delay field comprising a second bit indicating the first transmission delay, and a second length field comprising a third bit indicating a length occupied by the transmission delay field.
- 16 . The first electronic device of claim 9 , wherein the one or more processors are further configured to send, to a fourth electronic device, a third frame comprising a third field carrying second sending time information of the third frame, wherein a fourth transmission delay between the fourth electronic device and the first electronic device is based on the second sending time information, and wherein the third frame is a service discovery frame, a synchronization beacon frame, or a device discovery beacon frame.
- 17 . A computer program product comprising computer-executable instructions that are stored on a non-transitory computer-readable storage medium and that, when executed by one or more processors, cause a first electronic device to: receive, from a second electronic device, a first frame at a first time point, wherein the first frame comprises a first field carrying first sending time information of the first frame received from the second electronic device, and wherein the first frame is a device discovery beacon frame, a synchronization beacon frame, or a service discovery frame of neighbor awareness networking (NAN); and determine a first transmission delay of a first transmission link that is between the first electronic device and the second electronic device based on the first time point and the first sending time information, wherein when the first transmission delay does not meet a transmission requirement, the instructions when executed by the one or more processors are, further cause the first electronic device to: select a second transmission link that is between the first electronic device and the second electronic device and that has a second transmission delay that meets the transmission requirement; and transmit data to the second electronic device via the second transmission link.
- 18 . The computer program product of claim 17 , wherein the first field comprises a first attribute field comprising a first bit indicating that the first field is carrying the first sending time information, a sending time field comprising a second bit indicating a sending time point at which the second electronic device sends the first frame, and a first length field indicating a length of the sending time field.
- 19 . The computer program product of claim 17 , wherein the instructions when executed by the one or more processors, further cause the first electronic device to: determine a third transmission delay between the first electronic device and the second electronic device based on the first time point and the first sending time information; and calibrate the third transmission delay based on clock information for calibration in a synchronization process to obtain the first transmission delay after the first electronic device is synchronized with the second electronic device.
- 20 . The computer program product of claim 17 , wherein the instructions when executed by the one or more processors, further cause the first electronic device to send, to a third electronic device, a second frame comprising, a second field carrying the first transmission delay, wherein the second frame is a synchronization beacon frame or a service discovery frame of NAN.
Description
CROSS-REFERENCE TO RELATED APPLICATIONS This is a U.S. National Stage of International Patent Application No. PCT/CN2021/120217 filed on Sep. 24, 2021, which claims priority to Chinese Patent Application No. 202011095023.7 filed on Oct. 13, 2020. Both of the aforementioned applications are hereby incorporated by reference in their entireties. TECHNICAL FIELD This application relates to the communications field, and more specifically, to a method for determining a transmission delay and an electronic device in the communications field. BACKGROUND In wireless fidelity (wireless-fidelity, Wi-Fi) aware (Aware), electronic devices may discover each other, and after discovering each other, may establish a connection, and transmit data through the established connection. However, in a data transmission process between two electronic devices, an electronic device does not know a transmission delay between the electronic device and the other electronic device. Consequently, a transmission requirement may fail to be met. For example, some data has a high requirement for a transmission delay. In this case, if there is a relatively high transmission delay between two electronic devices, a transmission requirement cannot be met. Therefore, a method for determining a transmission delay is urgently needed. SUMMARY Embodiments of this application provides a method liar determining a transmission delay and an electronic device. According to a first aspect, a method for determining a transmission delay is provided. The method may be performed by a first electronic device, and the first electronic device may be an apparatus, such as a chip system, able to support a function needed by the first electronic device to perform the method. The method includes: A first electronic device receives, at a first time point, a first frame sent by a second electronic device, where a first field in the first frame carries first sending time information of the first frame sent by the second electronic device, and the first frame is a device discovery beacon frame, a synchronization beacon frame, or a service discovery frame of neighbor awareness networking NAN. The first electronic device determines a first transmission delay between the first electronic device and the second electronic device based on the first time point and the first sending time information. In the foregoing technical solution, the first frame sent by the second electronic device may carry the sending time information of the sent first frame. In addition, the first frame is a device discovery beacon frame used for device discovery, a synchronization beacon frame used for synchronization, or a service discovery frame used for service discovery in Wi-Fi aware. After receiving the first frame, the first electronic device may determine the first transmission delay between the first electronic device and the second electronic device based on the sending time information of the first frame and the first time point at which the first frame is received. Therefore, the method for determining a transmission delay is provided. This avoids overheads that are generated because dedicated signaling or a dedicated channel is used for delay detection. In addition, if dedicated signaling or a dedicated channel is used, more time is needed to determine a transmission delay. In this embodiment of this application, a device discovery beacon frame, a synchronization beacon frame, or a service discovery frame is used to carry sending time information of the frame, which helps reduce time that is needed to determine a transmission delay. It should be noted that the device discovery beacon frame, the synchronization beacon frame, or the service discovery frame mentioned in this embodiment of this application refers to a frame type instead of a specific frame. Optionally, the second electronic device may be a master device in a NAN cluster. The second electronic device may send a device discovery beacon frame, a synchronization beacon frame, or a service discover frame. Optionally, the second electronic device may be a non-master device in a synchronized state in the NAN cluster. The second electronic device may send a synchronization beacon frame or a service discovery frame. Optionally, the second electronic device may be a non-master device in an unsynchronized state in the NAN cluster. In this case, the second electronic device may send a service discovery frame. The device discovery frame is used by the master device in the NAN cluster to discover a device, and the synchronization beacon frame is used to synchronize an unsynchronized device with a synchronized device in the NAN cluster. The service discovery frame is used for an unsynchronized device or a synchronized device in the NAN cluster to exchange capabilities. Optionally, if the second electronic device that sends the first frame is the master device in the NAN cluster, the first electronic device may be a non-master device in the N