Time delay determination method, communication device, chip and storage medium

By generating and parsing MPDUs containing delay information in Wi-Fi networks and combining them with clock domain synchronization between the application layer and the MAC layer, this approach solves the problems of large errors or high complexity in one-way delay measurement in existing technologies, achieving high-precision one-way delay measurement.

CN120768804APending Publication Date: 2025-10-10伟光有限公司(CN)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511206735.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-09-13
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

Existing technologies for measuring the one-way delay of Wi-Fi network messages have problems such as large errors or the need for additional protocol modules and hardware support, resulting in high complexity.

Method used

By generating an MPDU containing delay information on the first device side and parsing the delay information on the second device side, combined with the clock domain synchronization of the application layer and the MAC layer, the one-way delay of the message can be accurately measured.

Benefits of technology

A one-way delay determination method is implemented that does not require additional software or hardware support and has high measurement accuracy, thereby reducing complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120768804A_ABST
    Figure CN120768804A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a time delay determination method, communication equipment, a chip and a storage medium. The time delay determination method at a first equipment end comprises the following steps: determining first equipment time delay based on first time when an application layer generates a first message and second time when an antenna sends a signal corresponding to the first message; generating a medium access control (MAC) protocol data unit (MPDU) based on the first message, wherein the MPDU comprises time delay information which is stored in the first field and represents the time delay of the first equipment; and transmitting the MPDU to the second device.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Divisional Explanation

[0002] This application is a divisional application of the Chinese patent with the application date of September 13, 2022, the application number of 202211110965.7, and the invention name of "Time Delay Determination Method, Communication Device, Chip and Storage Medium". TECHNICAL FIELD

[0003] Embodiments of the present application relate to the field of communication technology, in particular to a time delay determination method, a communication device, a chip and a storage medium. BACKGROUND

[0004] With the development of Internet of Things technology, more and more devices in life are connected to Wi-Fi networks, and in order to obtain better audio-visual experience, people usually need these devices to work together. For example, there is a mobile phone, two Wi-Fi sound boxes and a television in a family, and people want to cast the video in the mobile phone to the television while synchronously playing the corresponding audio on the two sound boxes. To achieve the above-mentioned synchronization function, it becomes more and more important to accurately measure the one-way time delay of Wi-Fi network messages.

[0005] Currently, there are two ways to determine the one-way time delay of messages. The first way is to first measure the round-trip time delay, that is, the sending device records the time of the request message, the receiving device replies to the response message after receiving the request message, and the sending device records the time when the response message is received. The difference between the two times is the sum of the two-way time delay, and the one-way time delay is obtained by dividing 2. The second way is to first synchronize the time of the sending device and the receiving device using the precise time protocol, and then record the sending time of the message at the sending device and the receiving time of the message at the receiving device. The difference between the receiving time and the sending time is the one-way time delay.

[0006] However, the first way is actually based on the assumption that the round-trip time delay is equal, and the one-way time delay calculated based on this assumption will have a large error. The second way requires additional protocol modules and hardware facilities to support time synchronization, and the network nodes also need to support the corresponding protocol, which has high complexity. SUMMARY

[0007] Embodiments of the present application provide a time delay determination method, a communication device, a chip and a storage medium.

[0008] The technical solution of the embodiments of the present application is as follows:

[0009] In a first aspect, the embodiments of the present application provide a time delay determination method, executed at a first device end, comprising:

[0010] determine a first device latency based on a first time at which a first message is generated at an application layer and a second time at which a signal corresponding to the first message is transmitted by an antenna;

[0011] generate a media access control (MAC) protocol data unit (MPDU) based on the first message, the MPDU including latency information representing the first device latency stored in a first field; and

[0012] transmit the MPDU to a second device.

[0013] In a second aspect, an embodiment of the present application provides a latency determination method executed at a second device, the method comprising:

[0014] receiving an MPDU from a first device, wherein the MPDU is generated by the first device based on a first message;

[0015] parsing, from the MPDU, latency information representing a first device latency stored in a first field; and

[0016] determining a transmission latency of the first message based on the latency information and a second device latency of the second device.

[0017] In a third aspect, an embodiment of the present application provides a communication device, comprising a processor configured to:

[0018] determine a first device latency based on a first time at which a first message is generated at an application layer and a second time at which a signal corresponding to the first message is transmitted by an antenna;

[0019] generate a MPDU based on the first message, the MPDU including latency information representing the first device latency stored in a first field.

[0020] In a fourth aspect, an embodiment of the present application provides a communication device, comprising a processor configured to:

[0021] parse, from an MPDU received from a first device, latency information representing a first device latency stored in a first field, wherein the MPDU is generated by the first device based on a first message;

[0022] determine a transmission latency of the first message based on the latency information and a second device latency of the communication device.

[0023] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor configured to invoke and run a computer program from a memory, so that a communication device installed with the chip executes the latency determination method executed at the first device.

[0024] In a sixth aspect, an embodiment of the present application provides a chip including a processor configured to invoke and run a computer program from a memory, so that a communication device installed with the chip performs the time delay determination method executed at the second device end.

[0025] In a seventh aspect, an embodiment of the present application provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the time delay determination method.

[0026] The embodiment of the present application provides a time delay determination method, a communication device, a chip and a storage medium. The time delay determination method executed at the first device end comprises: determining a first device time delay based on a first time of generating a first message at an application layer and a second time of transmitting a signal corresponding to the first message by an antenna; generating a medium access control (MAC) protocol data unit (MPDU) based on the first message, the MPDU comprising time delay information representing the first device time delay stored in a first field; and transmitting the MPDU to a second device. The technical solution provided by the embodiment of the present application provides a scheme for accurately measuring a real-time one-way time delay of a message from generation to reception. The scheme does not need additional software and hardware support, has low complexity, and has high accuracy. BRIEF DESCRIPTION OF DRAWINGS

[0027] Figure 1 An exemplary segmented time delay schematic diagram is provided for the embodiment of the present application.

[0028] Figure 2 A flowchart of a time delay determination method is provided for the embodiment of the present application. Figure 1 ;

[0029] Figure 3 An exemplary HTS field format schematic diagram is provided for the embodiment of the present application.

[0030] Figure 4 An exemplary Service field format schematic diagram is provided for the embodiment of the present application.

[0031] Figure 5 An exemplary A-MPDU aggregation packet format schematic diagram is provided for the embodiment of the present application.

[0032] Figure 6 A flowchart of a time delay determination method is provided for the embodiment of the present application. Figure 2 ;

[0033] Figure 7 An exemplary communication scenario schematic diagram is provided for the embodiment of the present application.

[0034] Figure 8 An exemplary message transmission time delay schematic diagram is provided for the embodiment of the present application.

[0035] Figure 9 A schematic diagram of the structure of a communication device provided in an embodiment of the present application Figure 1 ;

[0036] Figure 10 A schematic diagram of the structure of a communication device provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0038] The following will specifically describe the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems through embodiments and in conjunction with the accompanying drawings. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0039] In addition, the technical solutions described in the embodiments of the present application can be arbitrarily combined without conflict.

[0040] It should be noted that, in the embodiment of the present application, the segment delay of the message in the network can be as follows: Figure 1 The specific meanings of each delay are as follows:

[0041] Operating system path delay: It indicates the time required for the message to be generated, queued in the operating system protocol stack, and sent to the MAC send queue through the Wi-Fi driver. Figure 1 It is represented as T1-T0.

[0042] Media access path delay: It indicates the time required for a message to enter the sending queue of the MAC layer and then enter the sending control module. Figure 1 It is expressed as T2-T1.

[0043] Channel access delay: It indicates the time required for a message to be encapsulated into a Wi-Fi MAC protocol data unit (MPDU) and then sent in accordance with the 802.11 protocol to compete for a channel or the time required to wait for the peer end to allocate a sending opportunity. If the MPDU data packet containing the message fails to be sent, the time required for retransmission is also included. Figure 1 It is expressed as T3-T2.

[0044] Physical layer and radio frequency delay: the MAC layer sends the MPDU header to the PHY layer, and the time taken for the MPDU header to appear on the air interface in the symbol corresponding to the MPDU header. The time required for the encoding and modulation of the PHY, digital-to-analog conversion, radio frequency path, etc. is represented as T4-T3 in Figure 1

[0045] It should be noted that in the embodiments of the present application, the transmission delay of the time-sensitive message can cover various delays of the message in the one-way transmission stage. The following describes the delay determination method in detail.

[0046] The embodiments of the present application provide a delay determination method, which is executed at the first device end, and the first device can be any communication device such as a mobile phone, a tablet computer, etc. Figure 2 The flow of the delay determination method provided by the embodiments of the present application is shown in Figure 1 As shown in Figure 2 , in the embodiments of the present application, the delay determination method executed at the first device end mainly includes the following steps:

[0047] S101, determining the first device delay based on the first time at which the first message is generated at the application layer and the second time at which the signal corresponding to the first message is sent by the antenna.

[0048] In the embodiments of the present application, the first device can determine the first device delay based on the first time at which the first message is generated at the application layer and the second time at which the signal corresponding to the first message is sent by the antenna.

[0049] It should be noted that in the embodiments of the present application, the first message is generated at the application layer by the first device, and the time at which the first message is generated at the application layer is the first time.

[0050] In the embodiments of the present application, the first message is a time-sensitive message, and the first device can specifically identify whether the first message is a time-sensitive message based on the message information in the first message and / or the special mark corresponding to the first message at the driver layer.

[0051] It should be noted that in the embodiments of the present application, the specific manner in which the first device identifies the first message as a time-sensitive message at the driver layer includes but is not limited to: protocol type-based identification, address value-based identification, port number-based identification, and special mark notification by the upper layer application, etc.

[0052] It should be noted that in the embodiments of the present application, the first device can estimate the second time based on the sending time of the signal corresponding to the first message from the MAC layer to the antenna and the transmission delay from the MAC layer to the antenna.

[0053] ​It should be noted that in the embodiments of the present application, the signal corresponding to the first message waits for an opportunity to be sent to the antenna at the MAC layer, and the time when the sending opportunity is waited for is the sending time from the MAC layer to the antenna. The transmission delay from the MAC layer to the antenna is usually fixed and can be measured in advance. The first device can specifically add the transmission delay from the MAC layer to the antenna to the sending time of the signal corresponding to the first message from the MAC layer to the antenna as the estimated second time.

[0054] It should be noted that in the embodiments of the present application, the first time is the generation time of the first message, and the second time is the estimated time when the signal corresponding to the first message is sent from the first device. The first device can determine the time difference between the second time and the first time as the first device delay. The first device delay is actually the delay of the first message in the first device.

[0055] In the embodiments of the present application, the first device further synchronizes the clock domain of the MAC layer to the application layer through the driving layer and the operating system in sequence; the first time, the second time and the first device delay are times counted based on the clock domain of the MAC layer.

[0056] It should be noted that the clock domains of different network layers can be different, and for this purpose, the clock domain of the MAC layer can be taken as a reference to be synchronized to each layer. Specifically, the MAC layer can provide an interface for obtaining the clock domain of the MAC layer to the driving layer, the driving layer can further provide an interface for obtaining the clock domain of the MAC layer to the operating system layer, and the operating system layer can further provide an interface for obtaining the clock domain of the MAC layer to the application layer. In this way, the application layer can synchronize the clock domain of the MAC layer, so that the first time, the second time and the first device delay are all times counted based on the clock domain of the MAC layer, and the accuracy of the delay determination is ensured.

[0057] S102, generating an MPDU based on the first message, the MPDU including delay information representing the first device delay stored in a first field.

[0058] In the embodiments of the present application, after the first device determines the first device delay, the first device further generates an MPDU based on the first message, and the MPDU includes delay information representing the first device delay stored in a first field.

[0059] It should be noted that in the embodiments of the present application, the first device can perform MAC layer encapsulation on the first message at the MAC layer to generate the MPDU.

[0060] It should be noted that in the embodiment of the present application, the MPDU includes a first field, and the first field stores latency information indicating the latency of the first device, for example, data of a certain number of bits indicating the latency of the first device. The first field may be the HTC field of the MPDU header.

[0061] It should be noted that, in an embodiment of the present application, the MPDU may further include a latency indicator, which is used to indicate that the MPDU includes latency information of the first device. For example, it may be a control identifier controlID corresponding to the latency information. The latency indicator may also be stored in the first field, i.e., the HTC field.

[0062] Figure 3 The following is a schematic diagram of an exemplary format of the HTC field provided in the embodiment of the present application. Figure 3 As shown, in an embodiment of the present application, the HTC field uses a newly added delay indication identifier control ID, and the control ID indicates that the subsequent control information field is delay information indicating the delay of the first device.

[0063] It should be noted that the current HTC field has 26 bits available. The range that can be represented in microseconds is 0-67 seconds, the range that can be represented in 100 ns is 0-6.7 seconds, and the range that can be represented in 10 ns is 0-0.67 seconds. The range can be dynamically negotiated based on the required accuracy. Table 1 lists a method for dynamically negotiating the range, where A represents a positive integer value.

[0064] Table 1

[0065] Control ID value Representation range A 0-67s A+1 0-6.7s A+2 0-0.67s

[0066] If the length of the HTC field is subsequently extended, the field for writing the delay information can be dynamically extended together so that the field can represent a wider range and provide higher accuracy.

[0067] It should be noted that in an embodiment of the present application, the delay information representing the delay of the first device can be divided into two parts of data, one part of the data can be stored in the first field, that is, the HTC field, and the other part of the data can also be stored in the Service field when the MPDU is further encapsulated in the physical layer PHY.

[0068] Figure 4 The following is a schematic diagram of an exemplary format of the Service field provided in the embodiment of the present application. Figure 4As shown, bit7-bit15 in the Service field in the PHY header is a reserved field, and bit7-bit15 can be used in combination with the HTC field to represent the delay information of the first device delay to increase its representation range or improve the representation accuracy.

[0069] S103: Send the MPDU to the second device.

[0070] In an embodiment of the present application, the first device may send the MPDU to the second device after generating the MPDU.

[0071] It should be noted that, in the embodiment of the present application, the first device may send the MPDU in a manner different from the aggregated MAC protocol data unit A-MPDU.

[0072] It should be noted that in an embodiment of the present application, the first device may determine to send the MPDU in a manner different from the A-MPDU when the driver layer identifies that the first message is a delay-sensitive message. For example, the first device may send the MPDU in a standalone manner.

[0073] It should be noted that the format of the A-MPDU aggregation packet is as follows: Figure 5 As shown, the protocol stipulates that when all MPDU messages of the same message type are aggregated and sent, the HTC field in the A-MPDU aggregation packet is the same, where T PHY+RF Indicates the transmission delay from the MAC layer to the antenna, T 1-1 Indicates the time when the message is obtained, T CURT1 、T CURT3 Indicates different times on the time axis. The time from the generation of the HTC field to the time the RF sends out each MPDU in an A-MPDU is actually different, such as Figure 5 As shown, the HTC field needs to be calculated when sub-MPDU1 is sent, but the actual delay-sensitive message is in sub-MPDU3 and should be expressed as T CURT3 To calculate the value of HTC, T CURT3 -T CURT1 To reduce such errors, it is proposed to send delay-sensitive packets in a non-A-MPDU aggregation mode.

[0074] It should be noted that in the embodiments of the present application, after the first device sends the MPDU to the second device, the first device can further perform the following steps: in the case that the response of the second device to the MPDU is not received, determining the updated first device time delay based on the first time and the target time of the first device for sending the signal corresponding to the first message, the target time being after the second time; regenerating the MPDU based on the first message, the regenerated MPDU including the time delay information representing the updated first device time delay stored in the first field; and sending the regenerated MPDU to the second device.

[0075] The embodiments of the present application provide a time delay determination method, which is performed at the second device end. Figure 6 The embodiments of the present application provide a time delay determination method, which is performed at the second device end. Figure 2 As shown in FIG. 2, the time delay determination method performed at the second device end mainly includes the following steps: Figure 6

[0076] S201, receiving the MPDU from the first device; wherein the MPDU is generated by the first device based on the first message.

[0077] In the embodiments of the present application, the second device can receive the MPDU from the first device.

[0078] It should be noted that in the embodiments of the present application, as described above in the time delay determination method performed at the first device end, the MPDU is generated by the first device based on the first message.

[0079] It should be noted that in the embodiments of the present application, in the case that the MPDU from the first device is received, the second device can further send the response to the MPDU to the first device to inform the first device that the MPDU sent by the first device has been received.

[0080] S202, parsing the time delay information representing the first device time delay stored in the first field from the MPDU.

[0081] In the embodiments of the present application, the first device receives the MPDU, and can parse the time delay information stored in the first field from the MPDU.

[0082] It should be noted that in the embodiments of the present application, as described above in the time delay determination method performed at the first device end, the MPDU includes the time delay information representing the first device time delay stored in the first field, based on which the second device can parse the MPDU to obtain the time delay information representing the first device time delay from the first field, so as to obtain the first device time delay according to the time delay information.

[0083] ​It should be noted that in the embodiments of the present application, the MPDU further comprises a time delay indication identifier, and the time delay indication identifier is used to indicate that the MPDU comprises the time delay information of the first device.

[0084] It should be noted that in the embodiments of the present application, the second device can identify whether the first message is a time delay sensitive message based on the time delay indication identifier.

[0085] S203, determining the transmission time delay of the first message based on the time delay information and the second device time delay.

[0086] In the embodiments of the present application, the second device can determine the transmission time delay of the first message based on the time delay information and the second device time delay in the case that the time delay information is obtained.

[0087] In the embodiments of the present application, the second device determines the second device time delay based on the fourth time at which the first message is received by the application layer and the third time at which the signal corresponding to the first message is received by the antenna; the first message is parsed from the MPDU.

[0088] It should be noted that in the embodiments of the present application, the second device estimates the third time based on the time at which the first message is received by the MAC layer and the transmission time delay from the antenna to the MAC layer.

[0089] It should be noted that in the embodiments of the present application, the time at which the first message is received by the MAC can be directly obtained, and the transmission time delay from the antenna to the MAC layer is usually fixed and can be measured in advance. Specifically, the second device can subtract the transmission time delay from the antenna to the MAC layer from the time at which the first message is received by the MAC layer as the estimated third time.

[0090] It should be noted that in the embodiments of the present application, the fourth time is the time at which the first message is received by the application layer, and the third time is the estimated time at which the signal corresponding to the first message is received by the antenna. The second device can determine the time delay of the second device as the time difference between the fourth time and the third time. The time delay of the second device is actually the time delay of the first message in the second device.

[0091] In the embodiments of the present application, the second device further synchronizes the clock domain of the MAC layer to the application layer through the driver layer and the operating system in sequence; the third time, the fourth time and the second device time delay are times counted based on the clock domain of the MAC layer.

[0092] It can be understood that in the embodiments of the present application, the third time, the fourth time and the second device time delay are all times counted based on the clock domain of the MAC layer, which ensures the accuracy of the time delay determination.

[0093] It can be understood that in the embodiments of the present application, the second device can obtain the first device delay according to the delay information parsed from the MPDU. The first device delay is actually the delay of the generation of the first message in the first device, and the second device delay is actually the delay of the transmission of the first message to the second device in the second device. Based on this, the second device can determine the transmission delay of the first message as the sum of the first device delay and the second device delay.

[0094] It should be noted that in the embodiments of the present application, the second device determines the transmission delay of the first message, and can also consider the air interface transmission delay between the first device and the second device. Specifically, the second device can determine the transmission delay of the first message as the sum of the air interface transmission delay, the first device delay and the second device delay.

[0095] It can be understood that in the embodiments of the present application, the air interface transmission delay between devices can be considered in the transmission delay of the first message to improve the accuracy of the finally determined transmission delay. Of course, the air interface transmission delay can also be ignored, and can be determined according to actual requirements and application scenarios, which is not limited in the embodiments of the present application.

[0096] It should be noted that in the embodiments of the present application, the air interface transmission delay can be measured by first measuring the air interface distance using the FTM protocol, and then dividing the distance by the speed of light.

[0097] The following takes the communication scenario shown in Figure 7 , and the delay diagram of message transmission shown in Figure 8 as an example to completely describe the determination method of the one-way delay. The delay-sensitive message, i.e. the first message, is generated by device 1, forwarded by device 2, and finally reaches the application layer of device 3. In one scenario, device 1 can be a mobile phone, device 2 can be a router, and device 3 can be a television. The specific device type is not limited in the embodiments of the present application.

[0098] It should be noted that in the embodiments of the present application, Figure 8 , APP represents the application layer, OS represents the operating system, and Driver represents the driver layer.

[0099] Referring to Figure 7 and Figure 8 , the detailed steps of the high-precision one-way delay determination include:

[0100] Step 1: Device 1 records the generation time T 1-1 of the delay-sensitive message when the message is generated in the application layer.

[0101] Step 2: Device 1 identifies the packet as a latency sensitive packet at the driver layer and determines to send it in a manner different from A-MPDU. The identification can include but not limited to protocol type, address value, port number, or special marking from upper layer application, etc.

[0102] Step 3: The latency sensitive packet goes through the driver layer of device 1 to the sending queue and waits for the sending opportunity in the queue.

[0103] Step 4: Device 1 calculates the sending time T 1-2 :

[0104] T 1-2 = T CURT 1+D (PHY+RF)1

[0105] where T CURT1 is the sending time from MAC layer to antenna, and D (PHY+RF)1 is the transmission delay from MAC layer to antenna, which is usually fixed and can be measured in advance.

[0106] Step 5: Device 1 calculates the latency D1 of the packet at the device at the MAC layer:

[0107] D1 = T 1-2 -T 1-1

[0108] Step 6: Device 1 fills in the control ID of the latency indication in the HTC field of the packet, and fills in the latency Daccu1 in the control information field.

[0109] Since device 1 is the generating device of the latency sensitive packet, Daccu1 = D1.

[0110] Step 7: Device 1 sends the MPDU generated based on the packet to the PHY layer at the MAC layer, and sends it to the PHY layer of device 2 through the antenna.

[0111] It should be noted that device 2 will send a corresponding response to device 1 when receiving the MPDU. If device 1 does not receive the response of device 2, device 1 will wait for the sending opportunity from step 4 again.

[0112] Step 8: Device 2 can parse the MPDU sent by device 1, get the HTC field of the packet at the MAC layer and parse the Control ID, then determine that the packet is a latency sensitive packet, estimate the receiving time T 2-1 of the HTC field at the antenna of device 2, and store the control information field as the latency Daccu1.

[0113] T 2-1 = T CURT2 -D (RF+PHY)

[0114] where T CURT2 is the time of receiving the packet at MAC layer, D (RF+PHY) is the transmission delay from antenna to MAC layer.

[0115] Step 9: Device 2 provides the packet together with the sensitive delay flag, the receiving time T 2-1 and the delay Daccu1 and optional air interface transmission time D a1 to the driver layer at MAC layer.

[0116] Step 10: Device 2 discovers that the packet needs to be forwarded to device 3 at the driver layer, and from the information provided by MAC layer, it knows that the packet is a delay sensitive packet, then device 2 provides the packet together with the receiving time T 2-1 and Daccu1 to the MAC layer, and informs that the packet is sent in an independent way.

[0117] Step 11: The delay sensitive packet waits for a sending opportunity at MAC layer in device 2.

[0118] Step 12: Device 2 calculates the sending time T 2-2: of the HTC field of the packet at antenna at the moment when it is ready to send the HTC field of the packet.

[0119] T 2-2 = T CURT3 + D (PHY+RF)2

[0120] where T CURT3 is the time of sending at MAC layer, D (PHY+RF)2 is the transmission delay from MAC layer to antenna.

[0121] Step 13: Device 2 calculates the delay D2 of the delay sensitive packet at the device at MAC layer:

[0122] D2 = T 2-2 - T 2-1

[0123] Step 14: Device 2 fills in the delay indication flag control ID in the HTC field of the packet, and fills in the accumulated delay Daccu2 in the control information field;

[0124] Daccu2 = D2 + D a1 + Daccu1.

[0125] Step 15: Device 2 sends the MPDU generated based on the packet to the PHY layer from the MAC layer, and sends it to the PHY layer of device 3 through the antenna.

[0126] It should be noted that device 3 will send a corresponding response to device 2 when receiving the MPDU. If device 2 does not receive the response of device 3, device 2 will re-wait for the sending opportunity from step 12.

[0127] Step 16: Device 3 can parse the MPDU sent by device 2, get the HTC field of the packet at the MAC layer and parse the Control ID, then determine that the packet is a delay-sensitive packet, and estimate the receiving time T of the HTC field at the antenna of device 3 3-1 , and store the control information field as the accumulated delay Daccu2.

[0128] T 3-1 = T CURT4 - D (RF+PHY)3

[0129] Wherein, T CURT4 is the time of receiving the packet at the MAC layer, and D( RF+PHY)3 is the transmission delay from the antenna to the MAC layer.

[0130] Step 17: Device 3 provides the packet to the application layer at the MAC layer together with the sensitive delay mark, the receiving time T 3-1 and Daccu2, and the optional air interface transmission delay D a2 .

[0131] Step 18: Device 3 records the arrival time T 3-2 of the packet when receiving the packet at the application layer, and calculates Daccu3.

[0132] Daccu3 = T 3-2 - T 3-1 + D a2 + Daccu2

[0133] Daccu3 is the transmission delay of the packet.

[0134] It should be noted that in the embodiments of the present application, a method for identifying delay-sensitive messages at the driver layer using the message protocol type, address value, port number, or notification from the upper layer is proposed; a method for identifying messages as delay-sensitive messages based on the Control ID at the MAC layer is also proposed; a method for addressing the issue of inconsistent time acquisition between modules in a Wi-Fi device by using the MAC layer clock domain as a reference, with the MAC layer providing an interface to the Driver layer, the Driver to the OS layer, and the OS layer to the APP layer; a method for sending delay-sensitive messages in a non-A-MPDU aggregation manner is proposed, which reduces the error in delay calculation within each device caused by the A-MPDU sending method; a method for calculating the cumulative path delay of the message at the MAC layer and using the HTC field to carry the cumulative path delay of the message can provide each message with real-time delay on the complete path. This approach addresses the need for special messages or auxiliary devices to measure latency. The cumulative delay calculation takes into account the time Wi-Fi spends waiting for a transmission opportunity or the time it takes for a transmission failure to retransmit, improving the accuracy of delay calculation. The proposed method calculates the delay within the device at the MAC layer, compensating for the delay from the MAC layer to the RF layer, further improving the accuracy of delay measurement. The proposed method dynamically negotiates the required time accuracy in the HTC to meet the varying time accuracy requirements of different applications, or the time accuracy requirements of the same application at different times. The proposed method combines the HTC field with the reserved fields in the Service field to expand the range of delay representation or improve delay representation accuracy.

[0135] An embodiment of the present application provides a communication device. Figure 9 A schematic diagram of the structure of a communication device provided in an embodiment of the present application Figure 1 .like Figure 9 As shown, in an embodiment of the present application, the communication device 1 includes a processor 301, and the processor 301 is configured to:

[0136] Parsing delay information representing a delay of the first device stored in a first field from an MPDU received from the first device, wherein the MPDU is generated by the first device based on the first message;

[0137] A transmission delay of the first message is determined based on the delay information and a second device delay of the communication device.

[0138] In an embodiment of the present application, the MPDU further includes a delay indication flag, and the delay indication flag is used to indicate that the MPDU includes delay information of the first device.

[0139] In one embodiment of the present application, the processor 301 is further configured to:

[0140] The MPDU is sent in a different manner than an aggregated MAC protocol data unit A-MPDU.

[0141] In one embodiment of the present application, the processor 301 is further configured to:

[0142] The second time is estimated based on a sending time of a signal corresponding to the first message from the MAC layer to the antenna and a transmission delay from the MAC layer to the antenna.

[0143] In one embodiment of the present application, the processor 301 is further configured to:

[0144] At the driver layer, based on the message information in the first message and / or the special mark corresponding to the first message, it is identified whether the first message is a delay-sensitive message.

[0145] In one embodiment of the present application, the processor 301 is further configured to:

[0146] The clock domain of the MAC layer is synchronized to the application layer through the driver layer and the operating system in sequence; the first time, the second time and the first device delay are the times based on the clock domain timing of the MAC layer.

[0147] In one embodiment of the present application, the first field is the high throughput control HTC field of the MPDU header.

[0148] In an embodiment of the present application, the delay indication identifier is stored in the first field.

[0149] In one embodiment of the present application, the processor 301 is further configured to:

[0150] If no response to the MPDU is received from the second device, determining an updated first device latency based on the first time and a target time for the antenna to transmit a signal corresponding to the first message, wherein the target time is after the second time.

[0151] regenerating an MPDU based on the first message, where the regenerated MPDU includes the delay information representing the updated first device delay stored in the first field; and

[0152] Sending the regenerated MPDU to the second device.

[0153] Figure 10 A schematic diagram of the structure of a communication device provided in an embodiment of the present application Figure 2 .like Figure 10 As shown, in an embodiment of the present application, the communication device 2 includes: a processor 401, and the processor 401 is configured to:

[0154] Parsing delay information representing a delay of the first device stored in a first field from an MPDU received from the first device, wherein the MPDU is generated by the first device based on the first message;

[0155] A transmission delay of the first message is determined based on the delay information and a second device delay of the communication device.

[0156] In an embodiment of the present application, the MPDU further includes a delay indication flag, and the delay indication flag is used to indicate that the MPDU includes delay information of the first device.

[0157] In one embodiment of the present application, the processor 401 is further configured to:

[0158] Based on the delay indication identifier, it is identified whether the first message is a delay-sensitive message.

[0159] In one embodiment of the present application, the processor 401 is further configured to:

[0160] The second device delay is determined based on a fourth time when the application layer receives the first message and a third time when the antenna receives the signal corresponding to the first message; the first message is parsed from the MPDU.

[0161] In one embodiment of the present application, the processor 401 is further configured to:

[0162] The third time is estimated based on the time when the MAC layer receives the first message and the transmission delay from the antenna to the MAC layer.

[0163] In one embodiment of the present application, the processor 401 is further configured to:

[0164] The clock domain of the MAC layer is synchronized to the application layer through the driver layer and the operating system in sequence; the third time, the fourth time and the second device delay are the times based on the clock domain timing of the MAC layer.

[0165] An embodiment of the present application also provides a chip, including a processor, for calling and running a computer program from a memory, so that a communication device equipped with the chip executes the above-mentioned delay determination method executed on the first device side.

[0166] An embodiment of the present application further provides a chip, including a processor, configured to call and run a computer program from a memory, so that a communication device equipped with the chip executes the above-mentioned method for determining the delay at the second device end.

[0167] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned delay determination method when executed by a processor. The computer-readable storage medium can be a volatile memory (volatile memory), such as a random-access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (Read-Only Memory, ROM), a flash memory (flash memory), a hard disk drive (HDD) or a solid-state drive (SSD); or it can be a respective device including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant

[0168] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.

[0169] The present application is described with reference to the implementation flow charts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flow charts and / or block diagrams, as well as the combination of processes and / or boxes in the flow charts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the implementation flow charts. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0170] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which is implemented in the implementation flow diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0171] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process described in the flowchart. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0172] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this utility model should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for determining a time delay, characterized in that: Executed on a first device, the method includes: Determine a first device latency based on a first time at which the application layer generates a first message and a second time at which the antenna transmits a signal corresponding to the first message; generating a medium access control MAC protocol data unit MPDU based on the first message, wherein the MPDU includes delay information representing a delay of the first device stored in a first field; and The MPDU is sent to the second device.

2. The method according to claim 1, wherein The MPDU further includes a delay indication flag, where the delay indication flag is used to indicate that the MPDU includes delay information of the first device.

3. The method according to claim 1, wherein The method further comprises: The MPDU is sent in a different manner than an aggregated MAC protocol data unit A-MPDU.

4. The method according to claim 1, wherein The method further comprises: The second time is estimated based on the sending time of the signal corresponding to the first message from the MAC layer to the antenna and the transmission delay from the MAC layer to the antenna.

5. The method according to claim 1, wherein The method further comprises: At the driver layer, based on the message information in the first message and / or the special mark corresponding to the first message, it is identified whether the first message is a delay-sensitive message.

6. The method according to claim 1, wherein The method further comprises: The clock domain of the MAC layer is synchronized to the application layer through the driver layer and the operating system in sequence; the first time, the second time and the first device delay are the times based on the clock domain timing of the MAC layer.

7. The method according to claim 1, wherein The first field is a high throughput control HTC field of the MPDU header.

8. The method according to claim 2, wherein The delay indication identifier is stored in the first field.

9. The method according to claim 1, wherein The method further comprises: If no response to the MPDU is received from the second device, determining an updated first device latency based on the first time and a target time for the antenna to transmit a signal corresponding to the first message, wherein the target time is after the second time. regenerating an MPDU based on the first message, where the regenerated MPDU includes the delay information representing the updated first device delay stored in the first field; and Sending the regenerated MPDU to the second device.

10. A method for determining latency, performed on a second device, comprising: receiving an MPDU from a first device, wherein the MPDU is generated by the first device based on a first message; Parsing the delay information representing the first device delay stored in the first field from the MPDU; and The transmission delay of the first message is determined based on the delay information and the second device delay.

11. A communication device, characterized in that: The method comprises a processor, wherein the processor is configured to execute the delay determination method according to any one of claims 1 to 9.

12. A communication device, characterized in that: The device comprises a processor configured to execute the delay determination method according to claim 10.