Delay acquisition method, apparatus, device, storage medium, and program product

By storing latency statistics in a hash table, the problem of linked list storage limitations is solved, enabling efficient and multi-dimensional latency acquisition and improving the accuracy and efficiency of network evaluation.

CN119865448BActive Publication Date: 2026-01-02CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510019303.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2026-01-02
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

In existing technologies, the number of message records stored in a linked list is limited. When the threshold is reached and no acknowledgment message is obtained, the round-trip time cannot be calculated, resulting in failure to obtain the time delay.

Method used

Hash tables are used to store latency statistics. Latency statistics can be retrieved from hash tables by identifying data packets, user devices, and business data. Hash tables can store up to 1 billion items, avoiding the storage limitations of linked lists.

Benefits of technology

It improves the accuracy and efficiency of latency acquisition, enables the acquisition of latency statistics from multiple dimensions, avoids latency loss due to linked list storage limitations, and improves the accuracy of network evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865448B_ABST
    Figure CN119865448B_ABST
Patent Text Reader

Abstract

The application discloses a time delay acquisition method and device, equipment, a storage medium and a program product, relates to the technical field of communication, and is used for avoiding the fact that the round-trip time cannot be acquired when a linked list is used to acquire the round-trip time. The method comprises the following steps: determining a hash table corresponding to a target dimension from at least one hash table corresponding to a dimension, based on a dimension identifier of the target dimension; the target dimension comprises at least one of a data message dimension, a user equipment dimension and a service dimension; the hash table is used for storing a dimension identifier of a corresponding dimension and time delay statistical information of the corresponding dimension; and the time delay statistical information is acquired from the hash table corresponding to the target dimension. The application is applied to a scene of acquiring time delay.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, and in particular to a time delay obtaining method and device, equipment, storage medium and program product. BACKGROUND

[0002] Round-Trip Time (RTT) is a loopback time delay calculation method based on Transmission Control Protocol (TCP) protocol. A sending terminal device can send a data packet (also referred to as a sending packet) to a receiving terminal device based on the TCP protocol. The receiving terminal device receives the data packet and generates an Acknowledge (ACK) packet (also referred to as a response packet) of the data packet, and then returns the ACK packet to the sending terminal device. Further, the Round-Trip Time (also referred to as RTT time delay or transmission time delay) of the group of data packets can be obtained according to the time difference between the ACK packet and the data packet.

[0003] Currently, the Round-Trip Time can be calculated by using a linked list. The records of the data packet and the ACK packet are stored in the linked list. Each time an ACK packet is obtained, the record of the data packet corresponding to the ACK packet is queried from the linked list, so as to calculate the Round-Trip Time according to the time difference between the obtained ACK packet and the obtained data packet.

[0004] However, before the records of the packets are stored in the linked list, the number threshold of the records of the packets stored in the linked list needs to be set in advance, and the number of the records of the packets that can be stored in the linked list is small. If the number of the records of the data packets stored in the linked list reaches the number threshold, and the ACK packet has not been obtained, the Round-Trip Time cannot be obtained. SUMMARY

[0005] The present application provides a time delay obtaining method and device, equipment, storage medium and program product, which are used to solve the technical problem that if the number of the records of the data packets stored in the linked list reaches the number threshold, and the ACK packet has not been obtained, the Round-Trip Time cannot be obtained when the time delay is obtained by using the linked list.

[0006] To achieve the above object, the present application adopts the following technical solutions:

[0007] In a first aspect, a time delay obtaining method is provided. The method comprises: determining a hash table corresponding to a target dimension from at least one hash table corresponding to each dimension based on a dimension identifier of the target dimension, wherein the target dimension comprises at least one of a data packet dimension, a user equipment dimension, and a service dimension; the hash table is used to store the dimension identifier of the corresponding dimension and time delay statistical information of the corresponding dimension; and obtaining the time delay statistical information from the hash table corresponding to the target dimension.

[0008] In a possible implementation, the target dimension is a data message dimension, and the dimension identifier of the data message dimension is determined based on a sequence number of the sending message and a message length of the sending message, or determined based on a sequence number of the response message; and the time delay statistical information corresponding to the data message dimension comprises a time stamp of the sending message and / or a time stamp of the response message.

[0009] In a possible implementation, the method further comprises: receiving a target sending message, and storing a time stamp of the target sending message in a table entry corresponding to the target sending message in the hash table; one target sending message corresponds to one target response message; receiving a target response message, and storing a time stamp of the target response message in the table entry corresponding to the target sending message.

[0010] In a possible implementation, the method further comprises: receiving a plurality of target sending messages, and storing a time stamp of each target sending message in a table entry corresponding to the target sending message in the hash table; the plurality of target sending messages are a plurality of continuously sent messages; the plurality of target sending messages correspond to one target response message; receiving the target response message, and storing a time stamp of the target response message in a table entry corresponding to a last target sending message in the hash table; the last target sending message is a last sent message in the plurality of target sending messages.

[0011] In a possible implementation, the target dimension further comprises a user equipment dimension, and the dimension identifier of the user equipment dimension is a network address of a user equipment; and the time delay statistical information corresponding to the user equipment dimension comprises at least one of an average round-trip time of at least one round-trip time, a maximum round-trip time in the at least one round-trip time, a minimum round-trip time in the at least one round-trip time, a number of round-trip times less than a first preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the first preset value and less than a second preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the second preset value and less than a third preset value in the at least one round-trip time, and a number of round-trip times greater than or equal to the third preset value in the at least one round-trip time; and the round-trip time is determined based on the time delay statistical information corresponding to the data message dimension.

[0012] In a possible implementation, the target dimension further includes a service dimension, a dimension identifier of the service dimension is an identifier of a service for which the sending packet is used to perform and / or an identifier of a service for which the response packet is used to perform; and the time delay statistical information corresponding to the service dimension includes at least one of an average round-trip time of at least one round-trip time, a maximum round-trip time in the at least one round-trip time, a minimum round-trip time in the at least one round-trip time, a number of round-trip times less than a first preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the first preset value and less than a second preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the second preset value and less than a third preset value in the at least one round-trip time, and a number of round-trip times greater than or equal to the third preset value in the at least one round-trip time.

[0013] In a possible implementation, in a case where the sending packet is a retransmission packet, the time delay statistical information corresponding to the data packet dimension further includes a retransmission timeout of the sending packet.

[0014] In a possible implementation, the sending packet and / or the response packet are forwarded between the sending end device and the receiving end device through a base station; in a case where an identifier of a base station forwarding the sending packet is different from an identifier of a base station forwarding the response packet, the round-trip time between the sending end device and the receiving end device is a cross-base-station round-trip time.

[0015] In a possible implementation, in a case where a position at which the sending packet and the response packet are collected is located between an access network and a core network, the sending end device is a user equipment, and the receiving end device is a server, the round-trip time is used to represent a time delay of the core network; in a case where the position at which the sending packet and the response packet are collected is located between the access network and the core network, the sending end device is a server, and the receiving end device is a user equipment, the round-trip time is used to represent a transmission time delay of the access network; the access network includes the user equipment and the base station; and the core network includes a user plane network element and the server.

[0016] In a possible implementation, the hash table includes a plurality of table entries; and a quantity of the plurality of table entries is determined based on at least one of a quantity of interfaces at which the packet is collected, an interface rate, a network address category, a transmission time delay statistical period, and a data entry deletion period.

[0017] In a second aspect, a time delay acquisition apparatus is provided, and the time delay acquisition apparatus includes a transmission unit and a processing unit; the processing unit is configured to determine, based on a dimension identifier of a target dimension, a hash table corresponding to the target dimension from at least one hash table corresponding to a respective dimension; the target dimension includes at least one of a data packet dimension, a user equipment dimension, and a service dimension; the hash table is used to store the dimension identifier of the corresponding dimension and time delay statistical information of the corresponding dimension; and the transmission unit is configured to acquire the time delay statistical information from the hash table corresponding to the target dimension.

[0018] In a possible implementation, the target dimension is a data message dimension, and a dimension identifier of the data message dimension is determined based on a sequence number of the sending message and a message length of the sending message, or determined based on a sequence number of the response message; and the time delay statistical information corresponding to the data message dimension comprises a time stamp of the sending message and / or a time stamp of the response message.

[0019] In a possible implementation, the transmission unit is further configured to receive a target sending message; and the processing unit is further configured to store a time stamp of the target sending message in the entry corresponding to the target sending message in the hash table; one target sending message corresponds to one target response message; the transmission unit is further configured to receive the target response message; and the processing unit is further configured to store a time stamp of the target response message in the entry corresponding to the target sending message.

[0020] In a possible implementation, the transmission unit is further configured to receive a plurality of target sending messages; and the processing unit is configured to store a time stamp of each corresponding target sending message in the entry corresponding to the target sending message in the hash table; the plurality of target sending messages are a plurality of continuously sent messages; the plurality of target sending messages correspond to one target response message; the transmission unit is further configured to receive the target response message; and the processing unit is further configured to store a time stamp of the target response message in the entry corresponding to the last target sending message in the hash table; the last target sending message is the last sent message in the plurality of target sending messages.

[0021] In a possible implementation, the target dimension further comprises a user equipment dimension, and a dimension identifier of the user equipment dimension is a network address of a user equipment; and the time delay statistical information corresponding to the user equipment dimension comprises at least one of an average round-trip time of at least one round-trip time, a maximum round-trip time in the at least one round-trip time, a minimum round-trip time in the at least one round-trip time, a number of round-trip times less than a first preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the first preset value and less than a second preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the second preset value and less than a third preset value in the at least one round-trip time, and a number of round-trip times greater than or equal to the third preset value in the at least one round-trip time; and the round-trip time is determined based on the time delay statistical information corresponding to the data message dimension.

[0022] In a possible implementation, the target dimension further includes a service dimension, a dimension identifier of the service dimension is an identifier of a service for which the sending packet is used to perform and / or an identifier of a service for which the response packet is used to perform; and the delay statistical information corresponding to the service dimension includes at least one of an average round-trip delay of at least one round-trip delay, a maximum round-trip delay in the at least one round-trip delay, a minimum round-trip delay in the at least one round-trip delay, a number of round-trip delays less than a first preset value in the at least one round-trip delay, a number of round-trip delays greater than or equal to the first preset value and less than a second preset value in the at least one round-trip delay, a number of round-trip delays greater than or equal to the second preset value and less than a third preset value in the at least one round-trip delay, and a number of round-trip delays greater than or equal to the third preset value in the at least one round-trip delay.

[0023] In a possible implementation, in a case where the sending packet is a retransmission packet, the delay statistical information corresponding to the data packet dimension further includes a retransmission timeout of the sending packet.

[0024] In a possible implementation, the sending packet and / or the response packet are forwarded between the sending end device and the receiving end device through a base station; in a case where an identifier of a base station forwarding the sending packet is different from an identifier of a base station forwarding the response packet, the round-trip delay between the sending end device and the receiving end device is a cross-base-station round-trip delay.

[0025] In a possible implementation, in a case where a location where the sending packet and the response packet are collected is located between an access network and a core network, the sending end device is a user equipment, and the receiving end device is a server, the round-trip delay is used to represent a delay of the core network; in a case where the location where the sending packet and the response packet are collected is located between the access network and the core network, the sending end device is a server, and the receiving end device is a user equipment, the round-trip delay is used to represent a transmission delay of the access network; the access network includes the user equipment and the base station; and the core network includes a user plane network element and the server.

[0026] In a possible implementation, the hash table includes a plurality of table entries; and a quantity of the plurality of table entries is determined based on at least one of a quantity of interfaces at which the packet is collected, an interface rate, a network address category, a transmission delay statistical period, and a data entry deletion period.

[0027] In a third aspect, an electronic device includes a processor and a memory; the memory is configured to store one or more programs including computer execution instructions; and the processor is configured to execute the computer execution instructions stored in the memory, so that the electronic device performs a delay acquisition method according to the first aspect.

[0028] In a fourth aspect, a computer readable storage medium storing one or more programs including instructions which, when executed by a computer, cause the computer to perform a time delay acquisition method according to the first aspect is provided.

[0029] In a fifth aspect, a computer program product is provided, when computer instructions are run on an electronic device, the electronic device performs a time delay acquisition method according to the first aspect.

[0030] The present application provides a time delay acquisition method, device, equipment, storage medium and program product, which are applied to the scene of time delay acquisition. When network evaluation is needed, a hash table corresponding to a target dimension can be determined from at least one hash table corresponding to a dimension for storing time delay statistical information based on a dimension identifier of the target dimension including at least one of a data packet dimension, a user equipment dimension and a service dimension. Further, time delay statistical information is acquired from the hash table corresponding to the target dimension to perform network evaluation based on the time delay statistical information which can reflect network conditions. That is, the number of hash tables capable of storing time delay statistical information is much larger than that of linked lists. By using hash tables to replace linked lists to store time delay statistical information, the problem that the number of stored related information is small and the number threshold of stored related information is easily reached, thereby causing the time delay to be unable to be acquired, can be avoided. Moreover, the hash table can be used to acquire time delay statistical information of multiple different dimensions, thereby improving the accuracy of network evaluation.

[0031] Through the above method, the base station can acquire time delay statistical information from the hash table corresponding to the target dimension based on the dimension identifier of the target dimension to perform network evaluation according to the time delay statistical information. Thus, the technical problem that the round trip time delay cannot be acquired when the number of records of data packets stored in the linked list reaches the number threshold and the acknowledgement packet has not been acquired is solved. BRIEF DESCRIPTION OF DRAWINGS

[0032] Figure 1 A structure diagram of a time delay acquisition system provided for an embodiment of the present application;

[0033] Figure 2 A flowchart of a time delay acquisition method provided for an embodiment of the present application Figure 1 ;

[0034] Figure 3 A flowchart of a time delay acquisition method provided for an embodiment of the present application Figure 2 ;

[0035] Figure 4 A structure diagram of a data packet dimension hash table provided for an embodiment of the present application;

[0036] Figure 5A flowchart of a time delay acquisition method provided for an embodiment of the present application Figure 3 ;

[0037] Figure 6 A structure diagram of a hash table for returning one response message for multiple sending messages provided for an embodiment of the present application

[0038] Figure 7 A structure diagram of a hash table of a user equipment dimension provided for an embodiment of the present application

[0039] Figure 8 A structure diagram of a hash table of a service dimension provided for an embodiment of the present application

[0040] Figure 9 A structure diagram of a hash table corresponding to a cross-base station RTT time delay provided for an embodiment of the present application

[0041] Figure 10 A diagram of acquiring an uplink RTT time delay and a downlink RTT time delay provided for an embodiment of the present application

[0042] Figure 11 A structure diagram of a time delay acquisition device provided for an embodiment of the present application

[0043] Figure 12 A structure diagram of an electronic device provided for an embodiment of the present application. DETAILED DESCRIPTION

[0044] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.

[0045] In the description of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this document is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can mean that A exists alone, A and B exist together, and B exists alone. In addition, "at least one" "multiple" means two or more. "First", "second", etc. do not limit the quantity and execution order, and "first", "second", etc. also do not necessarily mean different.

[0046] With the rapid development of the Internet and the Internet of Things, the network traffic data of operators increases in geometric quantity. Network congestion, wireless environment, routing hop number, distance length, terminal problem and service provider network are important links affecting user service experience. How to present the user network experience in the massive data is an important challenge faced by operators.

[0047] The current mobile network evaluation optimization method mainly reflects the network situation through wireless parameters and traffic rate. However, when analyzing the user's perception through the traditional wireless parameters and traffic rate, the user's current service needs to be judged first. Moreover, the wireless parameter collection point is not concentrated, and the whole network user data cannot be obtained, and the statistical data is based on the cell base station level data, and the network experience of each user cannot be given. Although the wireless parameters and traffic rate collected by the probe can reflect the user's network experience to a certain extent. However, it is greatly affected by the user's operation behavior and is limited by the user's use behavior, and the network quality of the user cannot be effectively analyzed.

[0048] The RTT delay is a loopback delay calculation method based on the TCP protocol. When the user equipment sends a TCP data packet (that is, a data packet sent based on the TCP protocol), the other party will confirm the data packet, and then through the time difference between the confirmation packet and the sent data packet, the transmission delay of the group of data packets can be known. That is, the RTT delay is the time elapsed from the start of sending data by the sending party to the reception of the confirmation message from the receiving party by the sending party.

[0049] The RTT delay is usually determined by three parts: the propagation time of the link, the processing time of the end system, and the cache and queuing time of the intermediate nodes such as routers and base stations in the network. Under normal circumstances, the transmission time of the data packet and the processing time are relatively fixed, and the RTT delay will fluctuate under network congestion. Specifically, the ACK packet will affect the RTT delay, and the TCP will send the ACK packet in the following scenarios: (1) one sending packet is received, a 200ms timer is started, and the second sending packet does not come until the 200ms timer expires, so the ACK packet for the sending packet is sent, which is called delayed sending. (2) one sending packet is received, a 200ms timer is started, and the second sending packet comes before the timer expires, so two sending packets correspond to one ACK packet. (3) one sending packet is received, a 200ms timer is started, and the second sending packet comes before the timer expires, so the ACK packet for the sending packet is sent along with the content, which is called piggyback sending. (4) Whenever TCP receives an out-of-order data that exceeds the expected sequence number, it always sends an ACK with the expected sequence number. (5) Window update or also called opening window (when the receiving end window reaches the maximum, the data in the receiving buffer is pushed to the process, causing the receiving buffer to be empty), notifying the sending end that it can continue to send.

[0050] The rules of the above ACK message sending can be seen that in the normal environment of the network and the terminal, the ACK message will be sent in a very short time, and in the extreme case, the ACK message will be sent in 200 ms, so the main reason affecting the large RTT delay is still the quality of the network or the congestion of the network. In summary, the RTT delay is one of the important indicators for measuring the network transmission performance, which can reflect the speed and stability of data transmission in the network.

[0051] Generally, the shorter the RTT delay, the faster the network transmission, and vice versa. Therefore, by monitoring the RTT delay in TCP, the performance of the network can be judged, so as to reflect the current service use of the user and present the user service experience. Moreover, the RTT delay is calculated through the interaction between data messages, which is not limited by the user's behavior, and can well reflect the quality of the network currently used by the user. Therefore, it is feasible to evaluate the network quality used by the user by using the RTT delay.

[0052] Currently, the RTT delay is mainly calculated by using the flow plus linked list method, taking the Internet Protocol (Internet Protocol, IP) five-tuple as a data flow of a user's service, and storing each TCP data message of the data flow in the form of a linked list. When the ACK message is obtained, it is checked whether the TCP data message corresponding to the ACK message exists in the linked list. If the TCP data message exists, the RTT delay is calculated according to the ACK message and the TCP data message. This method needs to pre-set the number of TCP data messages stored in the linked list. If the data flow is particularly long and no ACK message is obtained, the linked list will be full and unable to record the subsequent RTT delay.

[0053] To solve the above problems, the application provides a delay acquisition method, which uses a HASH table (also known as a hash table) to record the RTT delay, and the maximum storage item of the HASH table can reach 1 billion. Therefore, there is no RTT delay missing caused by the number limitation of the linked list. Moreover, the HASH table has a faster query efficiency than the linked list, and does not need to set the maximum number of TCP message storage in the linked list, so there is no RTT delay missing. Moreover, the fields for calculating the RTT delay can be expanded, and the base stations and time passed by the data packets in the uplink and downlink of the RTT delay can be recorded, which can be used to analyze the RTT delay across base stations and bearers, and determine whether the high RTT delay is caused by frequent switching, thereby providing an important index basis for network evaluation and optimization.

[0054] In addition, by measuring uplink and downlink RTT latency, it is possible to determine whether the poor user service experience is caused by the network side (also known as the core network) or the radio side (also known as the access network). Thus, RTT latency can be used to assess the perception of mobile network users and locate areas with poor user service experience.

[0055] The latency acquisition method provided in this application embodiment can be applied to latency acquisition systems. Figure 1 A schematic diagram of a delay acquisition system is shown. Figure 1 As shown, the latency acquisition system 10 includes a transmitting device 11, a receiving device 12, and an electronic device 13. The transmitting device 11, the receiving device 12, and the electronic device 13 can be connected via a wired or wireless means, and this embodiment of the invention does not limit the connection.

[0056] Electronic device 13 can collect latency statistics between transmitting device 11 and receiving device 12, store latency statistics between transmitting device 11 and receiving device 12 in a hash table, determine the hash table corresponding to the target dimension from the hash tables corresponding to at least one dimension based on the dimension identifier of the target dimension, and obtain latency statistics between transmitting device 11 and receiving device 12 from the hash table corresponding to the target dimension.

[0057] Electronic device 13 can be a base station device, a desktop computer (also known as a desktop computer), a server, or a server cluster composed of multiple servers.

[0058] The transmitting device 11 and the receiving device 12 can be user equipment or a web server (also called a server). User equipment (UE) can be a device with wireless transceiver capabilities. User equipment can be a mobile phone, tablet, computer with wireless transceiver capabilities, virtual reality (VR) terminal, augmented reality (AR) terminal, wireless terminal in industrial control, wireless terminal in self-driving, wireless terminal in remote medical care, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, etc. The embodiments disclosed herein do not limit the application scenarios.

[0059] The server can be a single physical server located in the core network, or can also be a server cluster composed of multiple servers. Alternatively, the server cluster can also be a distributed cluster. Alternatively, the server can be a cloud server. The embodiments of the present application do not limit the specific implementation mode of the server.

[0060] A time delay acquisition method provided by the embodiments of the present application will be described below in combination with the drawings. As shown in the figure, the time delay acquisition method provided by the embodiments of the present application is applied to an electronic device, and the method comprises S201-S202: Figure 2

[0061] S201, determining a hash table corresponding to a target dimension from at least one hash table corresponding to each dimension based on a dimension identifier of the target dimension.

[0062] The target dimension comprises at least one of a data message dimension, a user equipment dimension, and a service dimension; and the hash table is used to store a dimension identifier of the corresponding dimension and time delay statistical information of the corresponding dimension.

[0063] Optionally, the time delay statistical information can be a timestamp of collected data messages, or average time delay, maximum time delay, and minimum time delay between multiple round-trip time delays of data messages transmitted between a sending end device and a receiving end device, etc. The data message can be a message transmitted based on a TCP protocol, i.e., a TCP message.

[0064] When it is necessary to evaluate the network, the electronic device can collect data messages transmitted between the sending end device and the receiving end device, and store the timestamp of the collected data messages in the corresponding hash table (which can be a hash table corresponding to the data message dimension), or store average time delay, maximum time delay, and minimum time delay information based on the timestamp of the data message in the corresponding hash table (which can be a hash table corresponding to the user equipment dimension or the service dimension).

[0065] The user equipment can be the sending end device or the receiving end device. The dimension identifier of the data message dimension can be the sum of the sequence number of the sending message and the message length of the sending message, or the sequence number of the reply message corresponding to the sending message. The dimension identifier of the user equipment dimension can be the IP address of the user equipment. The dimension identifier of the service dimension can be the service name.

[0066] The electronic device can determine the hash table corresponding to the target dimension from at least one hash table corresponding to each dimension based on the dimension identifier of the target dimension. For example, the electronic device can determine the hash table corresponding to the data message dimension from the hash table corresponding to the data message dimension and the hash table corresponding to the user equipment dimension based on the dimension identifier of the data message dimension.

[0067] ​S202, obtaining the time delay statistical information from the hash table corresponding to the target dimension.

[0068] Optionally, the electronic device can obtain the time delay statistical information from the hash table corresponding to the target dimension. For example, the electronic device can obtain the time stamp of the data packet transmitted between the sending device and the receiving device from the hash table corresponding to the data packet dimension, and calculate the round-trip time delay between the sending device and the receiving device according to the time stamp of the data packet transmitted between the sending device and the receiving device, to evaluate the network quality of the network between the sending device and the receiving device. The greater the round-trip time delay, the worse the network quality, and the smaller the round-trip time delay, the better the network quality.

[0069] For example, the electronic device can obtain the average time delay, the maximum time delay, and the minimum time delay and other information based on the time stamp of the data packet corresponding to each of the plurality of user devices from the hash table corresponding to the user device dimension, to evaluate the difference in network quality between different user devices.

[0070] The present application can obtain time delay statistical information through a hash table, and the maximum number of storage items of the hash table can reach 1 billion. Compared with the chain table used in the related art, the number of time delay statistical information that can be stored by the hash table is much larger than that of the chain table, and there is no RTT time delay missing caused by the number limitation of the chain table. By replacing the chain table with the hash table to store the time delay statistical information, the problem of being unable to obtain the time delay caused by the small number of related information stored by the chain table and the threshold of the number of stored related information being easily reached can be avoided. Moreover, the query efficiency of the hash table is faster than that of the chain table, which can improve the efficiency of network evaluation. In addition, the hash table can be used to obtain time delay statistical information of multiple different dimensions, which can improve the accuracy of network evaluation.

[0071] In one possible implementation, the target dimension is a data packet dimension, the dimension identifier of the data packet dimension is determined based on the sequence number of the sending packet and the packet length of the sending packet, or determined based on the sequence number of the response packet; and the time delay statistical information corresponding to the data packet dimension includes the time stamp of the sending packet and / or the time stamp of the response packet.

[0072] Optionally, the dimension identifier of the data packet dimension can be the sum of the sequence number (also referred to as Sequence number) of the sending packet and the length of the sending packet (also referred to as TCP Segment Len), or the sequence number (also referred to as Acknowledgment number) of the response packet corresponding to the sending packet. That is, the Sequence number + TCP Segment Len or Acknowledgment number of the data packet is taken as the key value of the hash table. The delay statistical information corresponding to the data packet dimension can include the timestamp of the sending packet and / or the timestamp of the response packet corresponding to the sending packet.

[0073] The electronic device can determine the difference between the timestamp of the response packet corresponding to a sending packet and the timestamp of the sending packet as the RTT delay between the sending device and the receiving device.

[0074] It should be noted that according to the characteristics of the TCP packet, Sequence number + TCP Segment Len = Acknowledgment number, and according to the timestamps of two data packets with TCP Segment Len greater than 0, the RTT delay can be obtained. That is, the timestamp of the Acknowledgment number of the response packet minus the timestamp of the Sequence number of the sending packet. For example, the Sequence number of a sending packet is 2566503740, the TCP Segment Len is 437, and the timestamp is 14:16:13.095735000. The Acknowledgment number of another ACK packet is 2566504177, and the timestamp is 14:16:13.111225000. Since Sequence number + TCP Segment Len = Acknowledgment number, the following ACK packet is the response packet of the preceding sending packet, and the RTT delay = timestamp of ACK packet - timestamp of sending packet = 14:16:13.111225000 - 14:16:13.095735000, the RTT delay is 0.01549s. In this way, the RTT delay between the sending device and the receiving device is 0.01549s.

[0075] According to the dimension identifier of the data packet dimension, the hash table can be queried to obtain the delay statistical information corresponding to the data packet dimension, and then the round-trip delay corresponding to each group of data packets can be obtained, so that network evaluation can be performed according to the round-trip delay corresponding to each group of data packets.

[0076] In a design, such as Figure 3 As shown in the embodiment of this application, a latency acquisition method is provided, and before step S201 above, the method further includes S301-S302:

[0077] S301. Receive the target message and store the timestamp of the target message in the corresponding entry of the hash table.

[0078] Optionally, the electronic device can receive a target transmission message corresponding to a user equipment (i.e., a target transmission message sent by the user equipment or a target transmission message received by the user equipment), and store the timestamp of the target transmission message and the IP address of the user equipment in the corresponding entry of the hash table. The timestamp of the target transmission message can indicate the time when the electronic device received the target transmission message.

[0079] S302. Receive the target response message and store the timestamp of the target response message in the entry corresponding to the target sent message.

[0080] Optionally, the electronic device can receive the target response message corresponding to the user equipment and store the timestamp of the target response message in the entry corresponding to the target sent message. That is, the timestamp of the target sent message and the timestamp of the target response message corresponding to the target sent message are stored in the same entry of a hash table. The timestamp of the target response message can indicate the time when the electronic device received the target response message.

[0081] Optionally, when the sequence number + TCP SegmentLen + user IP of a sent message received by the electronic device does not match an entry in the HASH table, it means that this data packet is not recorded in the HASH table (i.e., the timestamp of the data packet is not stored in the HASH table). The electronic device can add the data packet as a new data packet to the HASH table and record the timestamp of the data packet.

[0082] When the electronic device receives an Acknowledgment number of a certain response packet + user IP hits the table entry of the hash table (i.e. the time stamp of the sending packet of the response packet has been stored in the hash table), it means that the sending packet corresponding to the response packet and the Sequence number + TCP Segment Len is successfully paired, then the electronic device can record the time stamp of the response packet corresponding to the Acknowledgment number + user IP, and subtract the time stamp of the sending packet corresponding to the Sequence number + TCP Segment Len from the time stamp of the response packet corresponding to the Acknowledgment number + user IP to obtain the corresponding round-trip delay.

[0083] As shown in the example, Figure 4 The first table entry of the hash table of the data packet dimension can store the IP address of the user equipment 1 (i.e. user IP1), the packet stamp of the Sequence number (i.e. the sequence number of the sending packet) 1 + TCP Segment Len (i.e. the packet length of the sending packet) 1 corresponding to the user equipment 1 and the packet stamp of the Acknowledgment number (i.e. the sequence number of the response packet) 1, the second table entry can store the packet stamp of the Sequence number 2 + TCP Segment Len 2 and the packet stamp of the Acknowledgment number 2. The third table entry can store the IP address of the user equipment 2 (i.e. user IP2), the packet stamp of the Sequence number 1 + TCP Segment Len 1 corresponding to the user equipment 2 and the packet stamp of the Acknowledgment number 1, the fourth table entry can store the packet stamp of the Sequence number 2 + TCP Segment Len 2 and the packet stamp of the Acknowledgment number 2, and the fifth table entry can store the packet stamp of the Sequence number 3 + TCP Segment Len 3 and the packet stamp corresponding to the Acknowledgment number 3.

[0084] As shown in the example, Figure 4As shown, the application can realize matching of the sending packet and the acknowledgement packet of the RTT delay by putting the same Sequence number+TCP Segment Len+user IP and Acknowledgment number+user IP into a table entry of the HASH table. The method avoids the problem of long time consumption in searching the same Acknowledgment number as the Sequence number+TCP Segment Len in the linked list. Moreover, it is not necessary to define the maximum supported number of Sequence number+TCP Segment Len in the linked list in advance. In the test in the existing network, under the condition of 1 10-gigabit transmission rate Ethernet (GE) port rate, the HASH table entries required for RTT delay calculation are about 1 million, and the current HASH table and server memory can meet the requirement.

[0085] In a possible implementation, in the case that the sending packet is a retransmission packet, the delay statistical information corresponding to the data packet dimension further includes: retransmission timeout of the sending packet.

[0086] Optionally, when the electronic device receives the target sending packet, the electronic device can determine whether the target sending packet is a retransmission packet. If the Sequence number+TCP Segment Len+user IP of a certain sending packet received by the electronic device does not hit the table entry of the HASH table, it is indicated that the sending packet is not a retransmission packet. If the Sequence number+TCP Segment Len+user IP of the sending packet hits the table entry of the HASH table, it is indicated that the sending packet is a retransmission packet.

[0087] In the case that the sending packet is a retransmission packet, the electronic device can store the retransmission timeout (RTO) of the sending packet into the table entry corresponding to the sending packet, and replace the timestamp of the original sending packet with the timestamp corresponding to the Sequence number and TCP Segment Len of the sending packet. In subsequent calculation of the RTT delay, the difference between the timestamp of the acknowledgement packet corresponding to the retransmission packet and the timestamp of the retransmission packet is added to the RTO value to obtain the RTT delay.

[0088] It should be noted that the TCP protocol starts a timer in the handshake process, and if no acknowledgement packet is received within the timer time, the sending packet will be retransmitted, and the timeout time of the retransmission is called RTO. The relationship between RTT and RTO is: due to the uncertainty of the network, each RTT is dynamically changed, and RTO is also dynamically changed.

[0089] The application can calculate the final RTT delay in the manner of RTT+RTO when sending a data packet for retransmission, so as to more accurately reflect the network delay.

[0090] In one design, as shown in FIG. 1, the embodiment of the application provides a time delay acquisition method, which comprises the following steps: Figure 5 Before step S201, the method further comprises steps S401-S402.

[0091] S401, receiving a plurality of target sending packets, and storing the time stamp of the corresponding target sending packet in the table item corresponding to each target sending packet of the hash table.

[0092] The plurality of target sending packets are a plurality of continuously sent packets, and the plurality of target sending packets correspond to one target response packet.

[0093] S402, receiving a target response packet, and storing the time stamp of the target response packet in the table item corresponding to the last target sending packet of the hash table.

[0094] The last sending packet is the last sent packet in the plurality of target sending packets.

[0095] Optionally, for the case that the electronic device receives a plurality of continuously sent packets, and the plurality of continuously sent packets correspond to one response packet, the electronic device can receive the plurality of continuously sent packets, and store the time stamp of the corresponding sending packet in the table item corresponding to each sending packet of the hash table. Specifically, when the electronic device receives a sending packet each time, the electronic device can search in the HASH table by using the Sequence number-TCP Segment Len of the sending packet. If the packet corresponding to the Sequence number-TCP Segment Len is not found, or the found packet has been paired with an ACK packet, it is indicated that the sending packet is the first packet in the plurality of continuously sent packets. Then, the determined total length of the continuously unconfirmed packets (i.e., TCP_total_len) is stored in the table item corresponding to the sending packet, and the TCP Segment Len of the sending packet is recorded in a global set (i.e., TCP Segment set).

[0096] If the Sequence number-TCP Segment Leni (TCP Segment Leni is the length in TCP Segment Set) of a sending packet received by the electronic device does not match the Acknowledgment number in the HASH table, the TCP Segment Leni of the Sequence number is obtained, and the TCP_total_len of the present packet is set as TCP_total_len of the previous sending packet + TCP Segment Leni of the previous sending packet based on the item number of the Sequence number-TCP Segment Leni in the HASH table.

[0097] If the Acknowledgment number of a reply packet received by the electronic device matches the Sequence number+TCP Segment Len, the RTT delay is the difference between the time stamp of the reply packet and the time stamp of the sending packet obtained by searching the HASH table with the Acknowledgment number minus TCP_total_len.

[0098] For example, as shown in Figure 6 the electronic device first receives a Sequence number1 packet of user IP1, and uses Sequence number1-TCP Segment Len1 to search the HASH table. If no packet is found or the found item already has a corresponding ACK packet, the TCP_total_len value is recorded as 0, and the TCP Segment Len1 of the Sequence number1 packet is recorded in a global set TCP Segment set. Subsequently, the electronic device receives a Sequence number2 packet, and uses Sequence number2-TCP Segment Len2 to search the HASH table to obtain the Sequence number1 packet, i.e. TCP Segment Leni is TCP Segment Len2.

[0099] Since Sequence number1 packet has no ACK confirmation packet, Sequence number2 packet records TCP_total_len2, which is TCP_total_len1+TCP Segment Len2.

[0100] Similarly, Sequence number3 packet gets Sequence number2 packet by HASH of Sequence number3-TCP Segment Len3. Since Sequence number2 packet has no ACK confirmation packet, Sequence number3 packet records TCP_total_len3, which is TCP_total_len2+TCP Segment Len3. At this time, if an ACK packet is received, the Acknowledgment number (i.e. the sequence number of the reply packet) 3=Sequence number3+TCP Segment Len3, then calculate Acknowledgment number3-TCP_total_len3, and get the packet of Sequence number1+TCP Segment Len1 after querying the HASH table. Subtract the timestamp of Sequence number1+TCP Segment Len1 from the timestamp of the Acknowledgment number3 of the ACK packet to get the RTT delay.

[0101] For example, as Figure 6As shown, the first table entry of the hash table of the multiple sending packets returning one response packet can store the timestamp corresponding to Sequence number1+TCP Segment Len1+user IP1 and TCP_total_len1=0, the second table entry can store the packet timestamp of Sequence number2+TCP Segment Len2+user IP1 and TCP_total_len2=TCP_total_len1+TCP Segment Leni, the third table entry can store the packet timestamp of Sequence number3+TCP Segment Len3+user IP1 and TCP_total_len3=TCP_total_len2+TCP Segment Leni, the fourth table entry can store the packet timestamp of Sequence number4+TCP Segment Len4+user IP1 and Acknowledgment number4, and the fifth table entry can store the packet timestamp of Sequence number1+TCP Segment Len1+user IP2 and Acknowledgment number1.

[0102] In the case of multiple continuous sending packets returning one response packet, the application can find the first sending packet without a response packet in the multiple continuous sending packets by using the packet backtracking method when the response packet is received, so as to calculate a more accurate RTT delay value according to the timestamp of the response packet and the timestamp of the first sending packet.

[0103] In a possible implementation, the target dimension further includes a user equipment dimension, a dimension identifier of the user equipment dimension being a network address of a user equipment; and the time delay statistical information corresponding to the user equipment dimension including at least one of an average round-trip time of at least one round-trip time, a maximum round-trip time in the at least one round-trip time, a minimum round-trip time in the at least one round-trip time, a number of round-trip times less than a first preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the first preset value and less than a second preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the second preset value and less than a third preset value in the at least one round-trip time, and a number of round-trip times greater than or equal to the third preset value in the at least one round-trip time; and the round-trip time being determined based on the time delay statistical information corresponding to the data packet dimension.

[0104] Optionally, after calculating the RTT latency based on the timestamps of the data packets in the data packet-level HASH table, the calculated RTT latency can be filled into the user equipment-level HASH table to complete the calculation of the RTT latency statistics at the user equipment level. The network address of the user equipment can be the user equipment's IP address, also known as the user's IP address.

[0105] For example, the first preset value can be 50ms, the second preset value can be 200ms, and the third preset value can be 1000ms. Figure 7 As shown, based on Figure 4 After calculating the RTT latency in the HASH table, it can be mapped to the user equipment-level HASH table. Once the mapping of the RTT latency in the user equipment-level HASH table is successful, two RTT latencies for user IP1 can be calculated: one is the RTT latency obtained based on the packet stamp of Sequence number (i.e., the sequence number of the sent packet) 1 + TCP SegmentLen (i.e., the length of the sent packet) 1 and the packet stamp of Acknowledgment number (i.e., the sequence number of the acknowledgment packet) 1 corresponding to user equipment 1, and the other is the RTT latency obtained based on the packet stamp of Sequence number 2 + TCP SegmentLen 2 and Acknowledgment number 1 corresponding to user equipment 1. The calculations are as follows: (1) Average RTT delay, maximum RTT delay, minimum RTT delay, the number of RTT delays less than 50ms (also known as the number of occurrences), the number of RTT delays greater than or equal to 50ms and less than 200ms, the number of RTT delays greater than or equal to 200ms and less than 1000ms, and the number of RTT delays greater than or equal to 1000ms. Further, the entries in the hash table corresponding to the user IP are found (the first entry for user IP1, the second entry for user IP2), and the calculated RTT delays for each user IP are then filled back into the corresponding hash table entries.

[0106] This application can obtain various latency statistics at the user device level through a hash table at the user device level, thereby enabling network evaluation based on these statistics and improving the accuracy of network evaluation.

[0107] In a possible implementation, the target dimension further includes a service dimension, a dimension identifier of the service dimension is an identifier of a service for which a message is sent to perform and / or an identifier of a service for which a message is replied to perform; and the time delay statistical information corresponding to the service dimension includes at least one of an average round-trip time delay of at least one round-trip time delay, a maximum round-trip time delay in the at least one round-trip time delay, a minimum round-trip time delay in the at least one round-trip time delay, a number of round-trip time delays less than a first preset value in the at least one round-trip time delay, a number of round-trip time delays greater than or equal to the first preset value and less than a second preset value in the at least one round-trip time delay, a number of round-trip time delays greater than or equal to the second preset value and less than a third preset value in the at least one round-trip time delay, and a number of round-trip time delays greater than or equal to the third preset value in the at least one round-trip time delay.

[0108] Optionally, the RTT time delay of the service dimension refers to that the RTT time delay of a data stream of an IP five-tuple is combined according to a user IP and a service identifier. The RTT time delay counted according to the user IP and the service identifier includes an average RTT time delay, a maximum RTT time delay, a minimum RTT time delay, and a number of segmented RTT time delays (i.e., a number of RTT time delays less than a first preset value, a number of RTT time delays greater than or equal to the first preset value and less than a second preset value, a number of RTT time delays greater than or equal to the second preset value and less than a third preset value, and a number of RTT time delays greater than or equal to the third preset value) in each period when each user equipment performs a corresponding service.

[0109] Specifically, the electronic device can map a plurality of data streams (source IP (i.e., user IP) + destination IP + source port + destination port) with the same user IP and service identifier to one table entry of a HASH table, and identify the service identifier according to a system file (HOST) or a service name (ServerName) in a first data packet of each data stream, and map the same user IP and service identifier, destination IP, source port, and destination port to the same key IP and key port (including key sport and key dport).

[0110] Afterwards, after analyzing each data packet, the destination IP, source port and destination port of the data packet can be used to query the key IP, key sport and key dport corresponding to the destination IP, source port and destination port of the user IP in the HASH table corresponding to the user IP+service identification, and the average RTT delay, maximum RTT delay, minimum RTT delay and number of segmented statistical RTT delays of the user of the merged flow can be stored in the table entry of the HASH table corresponding to the user IP+key IP+key sport+key dport. Flow merging refers to merging data streams of multiple data sources into one data stream, and then performing real-time analysis on the merged data stream.

[0111] As known from the above, the HASH table of the RTT delay of the service dimension is calculated at the granularity of user IP+key IP+key port, that is, the average RTT delay, maximum RTT delay, minimum RTT delay and number of statistical RTT delays in the partition can be calculated at the granularity of user IP+key IP+key port, and then mapped to the RTT delay of the service dimension through IP+key IP+key port.

[0112] For example, as shown in Figure 8 The electronic device can identify the user IP of a certain data stream in the multiple data streams (the destination IP+source port+destination port of each data stream in the multiple data streams can be different, for example, the destination IP is destination IP1, destination IP2 and destination IP3 respectively) as user IP1 and the service identification as service identification 1 based on HOST (i.e. system file) or ServerName (i.e. service name), and further map the destination IP, source port and destination port corresponding to the user IP1 and service identification 1 to key IP1+key sport1+key dport1.

[0113] The first table entry of the HASH table of the service dimension can store the average RTT delay, the maximum RTT delay, the minimum RTT delay, the number of RTT delays less than 50 ms, the number of RTT delays greater than or equal to 50 ms and less than 200 ms, the number of RTT delays greater than or equal to 200 ms and less than 1000 ms, and the number of RTT delays greater than or equal to 1000 ms corresponding to the user IP1+keyIP1+key sport1+keydport1. The delay information stored in the first table entry can be obtained based on the RTT delays obtained from the packet stamps of Sequence number (i.e., the sequence number of the sent packet) 1+TCP Segment Len (i.e., the packet length of the sent packet) 1 and Acknowledgment number (i.e., the sequence number of the reply packet) 1, and the RTT delays obtained from the packet stamps of Sequence number 2+TCP Segment Len 2 and Acknowledgment number 2 when the user equipment 1 performs the service identified by service identifier 1.

[0114] The second table entry of the HASH table of the service dimension can store the average RTT delay, the maximum RTT delay, the minimum RTT delay, the number of RTT delays less than 50 ms, the number of RTT delays greater than or equal to 50 ms and less than 200 ms, the number of RTT delays greater than or equal to 200 ms and less than 1000 ms, and the number of RTT delays greater than or equal to 1000 ms corresponding to the user IP1+keyIP2+key sport2+keydport2. The delay information stored in the second table entry can be obtained based on the RTT delays obtained from the packet stamps of Sequence number 3+TCP Segment Len 3 and Acknowledgment number 3 when the user equipment 1 performs the service identified by service identifier 2.

[0115] The third table entry of the HASH table of the service dimension can store the average RTT delay, the maximum RTT delay, the minimum RTT delay, the number of RTT delays less than 50 ms, the number of RTT delays greater than or equal to 50 ms and less than 200 ms, the number of RTT delays greater than or equal to 200 ms and less than 1000 ms, and the number of RTT delays greater than or equal to 1000 ms corresponding to the user IP2+keyIP1+key sport1+keydport1. The delay information stored in the third table entry can be the RTT delay based on the packet stamp of Sequence number1+TCPSegment Len1 and the packet stamp of Acknowledgment number1 when the user equipment 2 performs the service identified by service identifier 1, and the RTT delay based on the packet stamp of Sequence number2+TCP Segment Len2 and the packet stamp of Acknowledgment number2.

[0116] The application can combine multiple data streams into one service of a user by querying the uniform IP four-tuple of the data stream as a key value and then performing HASH mapping according to each data stream used by the user, and then perform RTT delay statistics on the service of the user, to obtain a HASH table of the service dimension, so that network evaluation can be performed according to the delay statistics information of the service dimension, to improve the accuracy of network evaluation.

[0117] In a possible implementation, the sending terminal device and the receiving terminal device forward the sending packet and / or the reply packet through a base station; in the case where the identifier of the base station forwarding the sending packet is different from the identifier of the base station forwarding the reply packet, the round-trip delay between the sending terminal device and the receiving terminal device is a cross-base-station round-trip delay.

[0118] Optionally, the electronic device can record the base station forwarding a certain sending message and the base station forwarding the corresponding response message of the sending message in the HASH table of the data message dimension respectively, so as to know whether the two base stations corresponding to each calculated RTT delay are the same, if not, it is considered as a cross-base-station RTT delay. If the same, it is considered as a non-cross-base-station RTT delay. And it can be known whether the two base stations corresponding to the maximum RTT delay are the same base station, and the cross-base-station RTT delay related information such as whether the maximum RTT delay is cross-base-station, the maximum RTT delay in the cross-base-station RTT delay, the first cross-base-station RTT delay, the last cross-base-station RTT delay, and the number of cross-base-station RTT delays are recorded respectively, so as to evaluate the influence of switching base station on user traffic according to the cross-base-station RTT delay related information. For example, if the cross-base-station RTT delay is greater than the non-cross-base-station RTT delay, it means that switching base station will cause the delay of user traffic to become larger.

[0119] The definition of the flag of the cross-base-station RTT delay is shown in Formula I:

[0120]

[0121] Wherein, SN+TCP len represents the sequence number of the sending message + the message length, ACK represents the sequence number of the response message, SNbase station represents the base station forwarding the sending message, ACKbase station represents the base station forwarding the response message, and flag is 1, indicating that the RTT delay is a cross-base-station RTT delay, and flag is 0, indicating that the RTT delay is a non-cross-base-station RTT delay.

[0122] The definition of the flag of whether the maximum RTT delay is a cross-base-station delay is shown in Formula II:

[0123]

[0124] Wherein, MAX(RTTi) represents the maximum RTT delay, and flagmaxrtt is 1, indicating that the maximum RTT delay is a cross-base-station delay, and flagmaxrtt is 0, indicating that the maximum RTT delay is a non-cross-base-station delay.

[0125] The definition of the maximum RTT delay in the cross-base-station RTT delay (i.e. RTT2gnodeb) is shown in Formula III:

[0126] RTT2gnodeb = {(gnodeb11, gnodeb12), (gnodebn1, gnodebn2)} Formula III

[0127] MAX(RTTi) and flag = 1

[0128] Wherein, (gnode11, gnodeb12) are two base stations corresponding to the first RTT delay across base stations of the maximum RTT delay, (gnoden1, gnodebn2) are two base stations corresponding to the last RTT delay across base stations of the maximum RTT delay.

[0129] As shown in the example, Figure 9 As shown in the example, the base station corresponding to Sequence number (i.e. the sequence number of the sent packet) 1 + TCP Segment Len (i.e. the packet length of the sent packet) 1 of user IP1 in the hash table and the base station corresponding to Acknowledgment number (i.e. the sequence number of the reply packet) 1 are the same, the base station corresponding to Sequence number 2 + TCP Segment Len 2 and the base station corresponding to Acknowledgment number 2 are different, so there is a situation of crossing base stations for user IP1. The maximum RTT delay in the RTT delay across base stations is the difference between the timestamp of Acknowledgment number 2 and the timestamp of Sequence number 2 + TCP Segment Len 2. The first RTT delay across base stations and the last RTT delay across base stations are also the difference between the timestamp of Acknowledgment number 2 and the timestamp of Sequence number 2 + TCP Segment Len 2, and the number of RTT delays across base stations is 1.

[0130] The maximum RTT delay in the RTT delay across base stations for user IP2 is the maximum RTT delay in the RTT delays corresponding to Sequence number 1 + TCP Segment Len 1, Sequence number 2 + TCP Segment Len 2 and Sequence number 3 + TCP Segment Len 3, the first RTT delay across base stations is the difference between the timestamp of Acknowledgment number 1 and the timestamp of Sequence number 1 + TCP Segment Len 1, the last RTT delay across base stations is the difference between the timestamp of Acknowledgment number 3 and the timestamp of Sequence number 3 + TCP Segment Len 3, and the number of RTT delays across base stations is 3.

[0131] The present application can count the related information of the RTT delay across base stations, and then evaluate the influence of switching base stations on user traffic according to the related information of the RTT delay across base stations.

[0132] In one possible implementation, when the location of the collected and transmitted messages and the response messages is between the access network and the core network, the sending device is a user equipment, and the receiving device is a server, the round-trip time is used to characterize the latency of the core network; when the location of the collected and transmitted messages and the response messages is between the access network and the core network, the sending device is a server, and the receiving device is a user equipment, the round-trip time is used to characterize the transmission latency of the access network; the access network includes: user equipment and base stations; the core network includes: user plane functions (UPFs) and servers.

[0133] Optionally, when the location where the electronic device collects and sends messages and response messages is between the access network and the core network, the sending device is a server, and the receiving device is a user equipment, the calculated RTT delay is used to characterize the transmission delay of the access network. When the location where the electronic device collects and sends messages and response messages is between the access network and the core network, the sending device is a user equipment, and the receiving device is a server, the calculated RTT delay is used to characterize the transmission delay of the core network.

[0134] The access network may also include the IP Radio Access Network (RAN). The access network may also include the IP bearer network.

[0135] For example, such as Figure 10 As shown, the location (i.e., the collection point) for electronic equipment to collect and send messages and response messages is located between the IP RAN and the IP bearer network. When the user equipment sends a send message to the server and the server returns a response message to the user equipment, the RTT delay is the uplink RTT delay, and the RTO of the retransmitted message is the uplink RTO. When the server sends a send message to the user equipment and the user equipment returns a response message to the server, the RTT delay is the downlink RTT delay, and the RTO of the retransmitted message is the downlink RTO.

[0136] It should be noted that, Figure 10 Uplink RTT latency is the loopback latency between the UPF and the server, including latency generated by network elements, the IP bearer network, and the server. Downlink RTT latency is the loopback latency between the base station and the user equipment, including latency generated by the base station, the UE, and the IP RAN. Uplink RTT latency can be used to locate problems on the network side (i.e., the core network), while downlink RTT latency can be used to locate problems on the radio side (access network). For example, if the uplink RTT latency is greater than the downlink RTT latency, it indicates a problem on the network side.

[0137] In a possible implementation, the hash table includes a plurality of table entries; and the number of the plurality of table entries is determined based on at least one of the number of interfaces for collecting the packet, the interface rate, the network address category, the transmission delay statistical period, and the data item deletion period.

[0138] Optionally, when the RTT delay is calculated by using the HASH table, the number of data items (also referred to as table entries) of the HASH table needs to be considered, and factors affecting the number of data items of the HASH table mainly include the number of interfaces for collecting the packet (i.e., the sending packet and the reply packet), the data flow of each interface (also referred to as the interface rate), the user statistical period (also referred to as the transmission delay statistical period), and the HASH table data item deletion period (also referred to as the data item deletion period). The number of data items can be positively correlated with the number of interfaces for collecting the packet, the interface rate, the network address category, the transmission delay statistical period, and the data item deletion period.

[0139] For example, it is assumed that the number of data items (i.e., the number of table entries of the HASH table) of the HASH table is HN, the number of interfaces is IN, the interface rate is RA, the IP category (i.e., the network address category) is IPT, the user statistical period is UP, the HASH table data item deletion period is HP, and the coefficient is a. The maximum number of data items of the HASH table is 1<<27, i.e., 227=134,217,728. When the number of interfaces is 2, the interface rate (i.e., the single interface rate) of one interface is 6 Gbps, the IP category is Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6), and the user statistical period and the HASH table data item deletion period change, the number of data items of the HASH table mapping table can be as shown in Table 1.

[0140] Table 1

[0141]

[0142] As can be seen from Table 1, the number of data items of the HASH table is linearly related to the user statistical period and the HASH table data item deletion period. Since the interface mode of the server is the same, if the single interface rate is the same, HN=IN*RA*IPT*UP*HP*a. According to the data tested above, the coefficient a can be obtained. When the maximum number of data items of the HASH table is 120,000,000 (for the purpose of simplifying calculation, 227 is 120 million), the maximum number of data items of the HASH table mapping table can be as shown in Table 2.

[0143] It should be noted that when the HASH table occupies a maximum of 120000000 data items, the combination of the number of interfaces that can be accessed, the user statistical period and the HASH table data item deletion period can be as shown in Table 2. Considering that the HASH table is too large, the Central Processing Unit (CPU) cannot completely delete the HASH table, and therefore the HASH table data item deletion period should be controlled to be 64s or less. In this way, the maximum number of interfaces that can be supported is 40 interfaces. By setting the maximum number of data items of the HASH table, the number of interfaces, the single interface rate, the IP category, the user statistical period or the size of the HASH table data item deletion period can be reasonably set, so as to avoid that the number of interfaces, the single interface rate, the IP category, the user statistical period or the HASH table data item deletion period is too large, resulting in that the HASH table is overloaded.

[0144] Table 2

[0145]

[0146] The application can control the size of the HASH table based on the number of interfaces collecting packets, the interface rate, the network address category, the transmission delay statistical period and the data item deletion period, so that the size of the HASH table can be flexibly controlled to store and process more delay statistical information.

[0147] The above mainly introduces the scheme provided by the embodiments of the application from the perspective of the method. In order to realize the above functions, it contains the hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present text can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the application.

[0148] The embodiments of the application can divide a delay acquisition method into functional modules according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated in one processing module. The above integrated module can be realized in the form of hardware or in the form of a software functional module. Optionally, the division of the modules in the embodiments of the application is illustrative, and is only a logical functional division. Actual implementation can have another division manner.

[0149] Figure 11 A structure diagram of a delay acquisition device provided by the embodiments of the application is shown in FIG. 2. As shown in FIG. 2, the delay acquisition device comprises an interface module 21, a HASH table module 22, a delay calculation module 23 and a delay storage module 24.Figure 11 As shown in the first aspect, a time delay obtaining apparatus 110 is configured to avoid the situation that the time delay cannot be obtained when the time delay is obtained using a linked list, for example, for performing Figure 2 As shown in the first aspect, a time delay obtaining method is provided. The time delay obtaining apparatus 110 comprises a transmission unit 1101 and a processing unit 1102.

[0150] The processing unit 1102 is configured to determine, based on a dimension identifier of a target dimension, a hash table corresponding to the target dimension from at least one hash table corresponding to at least one dimension; the target dimension comprises at least one of a data packet dimension, a user equipment dimension, and a service dimension; and the hash table is configured to store a dimension identifier of a corresponding dimension and time delay statistical information of the corresponding dimension.

[0151] The transmission unit 1101 is configured to obtain the time delay statistical information from the hash table corresponding to the target dimension.

[0152] In a possible implementation, the target dimension is the data packet dimension, the dimension identifier of the data packet dimension is determined based on a sequence number of a sending packet and a packet length of the sending packet, or determined based on a sequence number of a response packet; and the time delay statistical information corresponding to the data packet dimension comprises a time stamp of the sending packet and / or a time stamp of the response packet.

[0153] In a possible implementation, the transmission unit 1101 is further configured to receive a target sending packet; the processing unit 1102 is further configured to store a time stamp of the target sending packet in a table entry corresponding to the target sending packet in the hash table; one target sending packet corresponds to one target response packet; the transmission unit 1101 is further configured to receive the target response packet; and the processing unit 1102 is further configured to store a time stamp of the target response packet in the table entry corresponding to the target sending packet.

[0154] In a possible implementation, the transmission unit 1101 is further configured to receive a plurality of target sending packets; the processing unit 1102 is configured to store a time stamp of each target sending packet in a table entry corresponding to the target sending packet in the hash table; the plurality of target sending packets are a plurality of continuously sent packets; the plurality of target sending packets correspond to one target response packet; the transmission unit 1101 is further configured to receive the target response packet; and the processing unit 1102 is further configured to store a time stamp of the target response packet in a table entry corresponding to a last target sending packet in the hash table; the last target sending packet is a last sent packet in the plurality of target sending packets.

[0155] In a possible implementation, the target dimension further includes a user equipment dimension, a dimension identifier of the user equipment dimension being a network address of the user equipment; the time delay statistical information corresponding to the user equipment dimension includes at least one of an average round-trip time of at least one round-trip time, a maximum round-trip time in the at least one round-trip time, a minimum round-trip time in the at least one round-trip time, a number of round-trip times less than a first preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the first preset value and less than a second preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the second preset value and less than a third preset value in the at least one round-trip time, and a number of round-trip times greater than or equal to the third preset value in the at least one round-trip time; and the round-trip time is determined based on the time delay statistical information corresponding to the data message dimension.

[0156] In a possible implementation, the target dimension further includes a service dimension, a dimension identifier of the service dimension being an identifier of a service for which the sending message is used to perform and / or an identifier of a service for which the response message is used to perform; the time delay statistical information corresponding to the service dimension includes at least one of an average round-trip time of at least one round-trip time, a maximum round-trip time in the at least one round-trip time, a minimum round-trip time in the at least one round-trip time, a number of round-trip times less than a first preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the first preset value and less than a second preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the second preset value and less than a third preset value in the at least one round-trip time, and a number of round-trip times greater than or equal to the third preset value in the at least one round-trip time.

[0157] In a possible implementation, in a case where the sending message is a retransmission message, the time delay statistical information corresponding to the data message dimension further includes a retransmission timeout of the sending message.

[0158] In a possible implementation, the sending message and / or the response message are forwarded between the sending end device and the receiving end device through a base station; in a case where an identifier of a base station forwarding the sending message is different from an identifier of a base station forwarding the response message, the round-trip time between the sending end device and the receiving end device is a cross-base-station round-trip time.

[0159] In a possible implementation, in a case where a position at which the sending message and the response message are collected is located between an access network and a core network, the sending end device is a user equipment, and the receiving end device is a server, the round-trip time is used to represent a time delay of the core network; in a case where the position at which the sending message and the response message are collected is located between the access network and the core network, the sending end device is the server, and the receiving end device is the user equipment, the round-trip time is used to represent a transmission time delay of the access network; the access network includes the user equipment and the base station; and the core network includes a user plane network element and the server.

[0160] In a possible implementation, the hash table includes a plurality of table entries; a number of the plurality of table entries is determined based on at least one of a number of interfaces of the packet collection device, an interface rate, a network address category, a transmission delay statistical period, and a data item deletion period.

[0161] In a case where the functions of the above-described integrated modules are implemented in the form of hardware, the embodiments of the present application provide a possible structural schematic diagram of an electronic device involved in the above-described embodiments. As shown in Figure 12 An electronic device 120 is configured to avoid a problem that a round-trip time cannot be acquired when a round-trip time is acquired using a linked list, for example, is configured to perform a round-trip time acquisition method as shown in Figure 2 The electronic device 120 includes a processor 1201, a memory 1202, and a bus 1203. The processor 1201 and the memory 1202 can be connected through the bus 1203.

[0162] The processor 1201 is a control center of the communication device, and can be one processor or a general term of a plurality of processing elements. For example, the processor 1201 can be a general central processing unit (CPU), or other general-purpose processors, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0163] As an embodiment, the processor 1201 can include one or more CPUs, for example, the CPU 0 and the CPU 1 as shown in Figure 12

[0164] The memory 1202 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium or other magnetic storage devices, or any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0165] ​As a possible implementation, the memory 1202 can exist independently of the processor 1201, or the memory 1202 can be connected to the processor 1201 via the bus 1203, for storing instructions or program codes. When the processor 1201 invokes and executes the instructions or program codes stored in the memory 1202, the method for obtaining time delay provided in the embodiments of the present application can be implemented.

[0166] In another possible implementation, the memory 1202 can also be integrated with the processor 1201.

[0167] The bus 1203 can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, and the like. For the sake of presentation, Figure 12 Only one thick line is used in the figure to represent the bus, but it does not mean that there is only one bus or only one type of bus.

[0168] It should be noted that, Figure 12 The structure shown does not constitute a limitation on the electronic device 120. In addition to Figure 12 the components shown, the electronic device 120 can include more or fewer components than shown, or combine some components, or different arrangement of components.

[0169] As an example, the functions of the transmission unit 1101 and the processing unit 1102 in the time delay obtaining apparatus 110 are the same as the functions of the processor 1201 in the Figure 11 Figure 12

[0170] Optionally, as shown in Figure 12 the electronic device 120 provided by the embodiments of the present application can further include a communication interface 1204.

[0171] The communication interface 1204 is configured to connect with other devices via a communication network. The communication network can be an Ethernet, a wireless access network, a wireless local area network (WLAN), or the like. The communication interface 1204 can include a receiving unit for receiving data, and a sending unit for sending data.

[0172] In one design, the communication interface in the electronic device provided by the embodiments of the present application can also be integrated in the processor. ​​

[0173] Those skilled in the art can clearly understand the above-mentioned technical solutions from the description of the above-mentioned embodiments. For the convenience and brevity of description, only the above-mentioned division of functional units is exemplified. In actual application, the above-mentioned functions can be completed by different functional units according to needs, that is, the internal structure of the device is divided into different functional units to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0174] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores instructions. When a computer executes the instructions, the computer executes each step in the method flow shown in the method embodiments.

[0175] The embodiment of the present application provides a computer program product. When computer instructions run on an electronic device, the electronic device executes a time delay acquisition method in the method embodiments.

[0176] The computer readable storage medium may, for example, be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a register, a hard disk, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any other suitable combination of the above, or any other form of computer readable storage medium.

[0177] An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be part of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC).

[0178] In the embodiments of the present application, the computer readable storage medium can be any tangible medium containing or storing a program, which can be used or combined with an instruction execution system, device or apparatus.

[0179] Since the electronic device, the computer readable storage medium, and the computer program product in the embodiments of the present application can be applied to the above method, the technical effects that can be obtained thereby can also be referred to the above method embodiments, and the embodiments of the present application will not be described here again.

[0180] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application.

Claims

1. A method for obtaining a time delay, characterized by, The method comprises: determining a hash table corresponding to a target dimension from at least one hash table corresponding to a respective dimension based on a dimension identifier of the target dimension; the target dimension comprising at least one of a data message dimension, a user equipment dimension, and a service dimension; and the hash table being configured to store a dimension identifier of a corresponding dimension and time delay statistical information of the corresponding dimension; obtaining time delay statistical information from the hash table corresponding to the target dimension; the target dimension being the data message dimension, the dimension identifier of the data message dimension being determined based on a sequence number of a sending message and a message length of the sending message, or based on a sequence number of a response message; and the time delay statistical information corresponding to the data message dimension comprising a timestamp of the sending message and / or a timestamp of the response message; the target dimension further comprising the user equipment dimension, the dimension identifier of the user equipment dimension being a network address of a user equipment; and the time delay statistical information corresponding to the user equipment dimension comprising at least one of an average round-trip time of at least one round-trip time, a maximum round-trip time of the at least one round-trip time, a minimum round-trip time of the at least one round-trip time, a number of round-trip times less than a first preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the first preset value and less than a second preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the second preset value and less than a third preset value in the at least one round-trip time, and a number of round-trip times greater than or equal to the third preset value in the at least one round-trip time; and the round-trip time being determined based on the time delay statistical information corresponding to the data message dimension; the target dimension further comprising the service dimension, the dimension identifier of the service dimension being an identifier of a service performed by the sending message and / or an identifier of a service performed by the response message; and the time delay statistical information corresponding to the service dimension comprising at least one of an average round-trip time of at least one round-trip time, a maximum round-trip time of the at least one round-trip time, a minimum round-trip time of the at least one round-trip time, a number of round-trip times less than a first preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the first preset value and less than a second preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the second preset value and less than a third preset value in the at least one round-trip time, and a number of round-trip times greater than or equal to the third preset value in the at least one round-trip time.

2. The method of claim 1, wherein, The method further comprises: receiving a target sending message and storing a timestamp of the target sending message in a table entry corresponding to the target sending message in the hash table; and one target sending message corresponding to one target response message; receiving a target response message and storing a timestamp of the target response message in the table entry corresponding to the target sending message.

3. The method of claim 1, wherein, The method further comprises: receiving a plurality of target sending packets, and storing a timestamp of a corresponding target sending packet in each table entry corresponding to the target sending packet in the hash table; the plurality of target sending packets are a plurality of continuously sent packets; the plurality of target sending packets correspond to a target response packet; receiving a target response packet, and storing a timestamp of the target response packet in a table entry corresponding to a last target sending packet in the hash table; the last target sending packet is a last sent packet in the plurality of target sending packets.

4. The method according to any one of claims 1 to 3, characterized in that, In a case where the sending packet is a retransmission packet, the time delay statistical information corresponding to the data packet dimension further comprises a retransmission timeout of the sending packet.

5. The method according to any one of claims 1-3, characterized in that, The sending end device and the receiving end device forward the sending packet and / or the response packet through a base station; in a case where an identifier of a base station forwarding the sending packet is different from an identifier of a base station forwarding the response packet, a round-trip time delay between the sending end device and the receiving end device is a cross-base-station round-trip time delay.

6. The method according to any one of claims 1-3, characterized in that, In a case where a position where the sending packet and the response packet are collected is located between an access network and a core network, the sending end device is a user equipment, and the receiving end device is a server, the round-trip time delay is used to represent a time delay of the core network; In a case where the position where the sending packet and the response packet are collected is located between the access network and the core network, the sending end device is the server, and the receiving end device is the user equipment, the round-trip time delay is used to represent a transmission time delay of the access network; The access network comprises the user equipment and the base station; and the core network comprises a user plane network element and the server.

7. The method according to any one of claims 1-3, characterized in that, The hash table comprises a plurality of table entries; a quantity of the plurality of table entries is determined based on at least one of an interface quantity of a collection packet, an interface rate, a network address category, a transmission time delay statistical period, and a data item deletion period.

8. A delay acquisition apparatus characterized by comprising: The time delay acquisition apparatus comprises a transmission unit and a processing unit. The processing unit is configured to determine a hash table corresponding to a target dimension based on a dimension identifier of the target dimension from at least one hash table corresponding to at least one dimension; the target dimension comprises at least one of a data packet dimension, a user equipment dimension, and a service dimension; and the hash table is used to store the dimension identifier of the corresponding dimension and time delay statistical information of the corresponding dimension. The transmission unit is configured to acquire the time delay statistical information from the hash table corresponding to the target dimension; the target dimension is the data packet dimension; the dimension identifier of the data packet dimension is determined based on a sequence number of a sending packet and a packet length of the sending packet, or is determined based on a sequence number of a response packet; and the time delay statistical information corresponding to the data packet dimension comprises a timestamp of the sending packet and / or a timestamp of the response packet. The target dimension further includes the user equipment dimension, a dimension identifier of the user equipment dimension being a network address of a user equipment; the time delay statistical information corresponding to the user equipment dimension including at least one of: an average round-trip time of at least one round-trip time, a maximum round-trip time in the at least one round-trip time, a minimum round-trip time in the at least one round-trip time, a number of round-trip times less than a first preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the first preset value and less than a second preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the second preset value and less than a third preset value in the at least one round-trip time, and a number of round-trip times greater than or equal to the third preset value in the at least one round-trip time; the round-trip time being determined based on the time delay statistical information corresponding to the data packet dimension; The target dimension further includes the service dimension, a dimension identifier of the service dimension being an identifier of a service for which the sending packet is used to perform and / or an identifier of a service for which the response packet is used to perform; the time delay statistical information corresponding to the service dimension including at least one of: an average round-trip time of at least one round-trip time, a maximum round-trip time in the at least one round-trip time, a minimum round-trip time in the at least one round-trip time, a number of round-trip times less than a first preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the first preset value and less than a second preset value in the at least one round-trip time, a number of round-trip times greater than or equal to the second preset value and less than a third preset value in the at least one round-trip time, and a number of round-trip times greater than or equal to the third preset value in the at least one round-trip time.

9. An electronic device, comprising: Comprise: a processor and a memory; wherein the memory is configured to store one or more programs, the one or more programs comprising computer-executable instructions, and when the electronic device is running, the processor executes the computer-executable instructions stored in the memory, so that the electronic device executes the method in any one of claims 1-7.

10. A computer-readable storage medium storing one or more programs, the one or more programs comprising instructions for: The one or more programs comprise instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1-7.

11. A computer program product, characterised in that, The computer program product comprises computer instructions, when the computer instructions are run on an electronic device, the electronic device executes the method of any one of claims 1-7.

Citation Information

Patent Citations

  • User behavior statistical method and device based on user events

    CN101951623A

  • Data processing method and device and electronic equipment

    CN116938753A