A time delay calculation method, device and computer readable storage medium
By recording the signaling and data time difference at key moments at the data sending and receiving ends to calculate the delay, the problem of the accuracy of delay calculation under unstable network conditions is solved, and high-precision delay measurement and low traffic consumption are achieved.
Patent Information
- Application Number
- CN202211185816.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2042-09-27
AI Technical Summary
In existing technologies for real-time network data transmission systems, latency calculation relies on network time synchronization, making it difficult to measure accurately when the network is unstable.
By recording the key moments when the data sender and receiver send signaling and the key moments when data is sent and received, the delay is calculated to avoid time synchronization. The network delay is calculated using the time difference between signaling and data.
It improves the accuracy and precision of latency calculation and measurement without the need for time synchronization, reduces network traffic consumption, and does not affect the transmission of existing bitstreams.
Smart Images

Figure CN115801636B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission technology, and in particular to a delay calculation method, device, and computer-readable storage medium. Background Technology
[0002] Data latency is a crucial metric in real-time network data transmission systems. A common method for automated data latency measurement is to first synchronize the time of the acquisition and encoding device with the time of the playback device, ensuring they are on the same time base. Then, an absolute timestamp from the data acquisition time is added to the transmitted data to obtain the local playback time. Because they are on the same time base through synchronization, the latency of the data can be directly calculated. However, this method relies on the network time synchronization mechanism, which is often difficult to accurately achieve due to network instability. Summary of the Invention
[0003] The main technical problem solved by this invention is to provide a delay calculation method, device and computer-readable storage medium that can improve the accuracy of delay calculation without the need for time synchronization.
[0004] To solve the above-mentioned technical problems, one technical solution adopted by the present invention is: providing a delay calculation method, which includes: obtaining the request signaling sending time of the data receiving end sending the pull request signaling and the request signaling receiving time of the data sending end receiving the pull request signaling; obtaining the response signaling sending time of the data sending end sending the pull response signaling and the response signaling receiving time of the data receiving end receiving the pull response signaling; obtaining the data sending time and the data receiving time, wherein the data sending time is the time when the data sending end sends the transmitted data and the data receiving time is the time when the data receiving end receives the transmitted data; and calculating the network delay using the request signaling sending time, request signaling receiving time, response signaling sending time, response signaling receiving time, data sending time, and data receiving time.
[0005] The calculation of network latency using request signaling transmission time, request signaling reception time, response signaling transmission time, response signaling reception time, data transmission time, and data reception time includes: obtaining the signaling network latency of pull request signaling and pull response signaling using the request signaling transmission time, request signaling reception time, response signaling transmission time, and response signaling reception time; and obtaining the data network latency using the signaling network latency, request signaling transmission time, request signaling reception time, data transmission time, and data reception time.
[0006] The process of obtaining the signaling network delay of the pull request signaling and the pull response signaling using the request signaling sending time, request signaling receiving time, response signaling sending time, and response signaling receiving time includes: obtaining a first time difference between the request signaling sending time and the response signaling receiving time; obtaining a second time difference between the request signaling receiving time and the response signaling sending time; subtracting the second time difference from the first time difference to obtain the sum of the signaling network delays of the pull request signaling and the pull response signaling; and obtaining the signaling network delay of the pull request signaling and the pull response signaling using the sum of the signaling network delays, wherein the signaling network delay of the pull request signaling and the signaling network delay of the pull response signaling are equal.
[0007] The process of obtaining the data network delay using signaling network delay, request signaling transmission time, request signaling reception time, data transmission time, and data reception time includes: obtaining the third time difference between the request signaling transmission time and the data reception time; obtaining the fourth time difference between the request signaling reception time and the data transmission time; subtracting the fourth time difference from the third time difference, and then subtracting the signaling network delay to obtain the data network delay.
[0008] The delay calculation method further includes: obtaining the encoding delay of the data sending end in encoding the transmitted data, obtaining the rendering delay of the data receiving end in rendering the transmitted data; and adding the data network delay, rendering delay and encoding delay together to obtain the total delay of the transmitted data.
[0009] The transmitted data is the first frame of the video data.
[0010] The delay calculation method further includes: obtaining the data encoding completion time of the current frame data and the data encoding completion time of the previous frame data to obtain the encoding time difference; obtaining the data rendering completion time of the current frame data and the data rendering completion time of the previous frame data to obtain the rendering time difference; subtracting the rendering time difference from the encoding time difference to obtain the data playback delay; the current frame data is video frame data other than the first frame data.
[0011] The delay calculation method further includes: when the rendering time difference is greater than or equal to the encoding time difference, the data playback delay of the current frame data is added to the total delay of the previous frame data to obtain the total delay of the current frame data, and the data playback delay of the current frame data is obtained by subtracting the encoding time difference from the rendering time difference; when the rendering time difference is less than the encoding time difference, the total delay of the previous frame data is subtracted from the data playback delay of the current frame data to obtain the total delay of the current frame data, and the data playback delay of the current frame data is obtained by subtracting the rendering time difference from the encoding time difference.
[0012] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is to provide a delay calculation device, which includes a processor for executing the above-mentioned delay calculation method.
[0013] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is to provide a computer-readable storage medium for storing instruction / program data, which can be executed to implement the above-mentioned delay calculation method.
[0014] The beneficial effects of this invention are as follows: Unlike existing technologies, this invention calculates the data frame delay by separately recording the key moments when the data sender and receiver transmit signaling, as well as the key moments when data is transmitted and received. It eliminates the need for time synchronization between the data sender and receiver, resulting in a simple solution with high measurement accuracy. It also avoids adding new network data and does not affect the transmission of existing data streams. Attached Figure Description
[0015] Figure 1 This is a flowchart illustrating one embodiment of the delay calculation method of this application;
[0016] Figure 2 This is a flowchart illustrating another implementation of the time delay calculation method in this application;
[0017] Figure 3 This is a flowchart illustrating a specific implementation of the video data transmission method of this application;
[0018] Figure 4 This is a flowchart illustrating the method for calculating the total delay of the first frame of data in this application;
[0019] Figure 5 This is a flowchart illustrating the method for calculating the total delay of non-first frame data in this application;
[0020] Figure 6 This is a schematic diagram of the delay calculation device in the embodiments of this application;
[0021] Figure 7 This is a schematic diagram of the delay calculation device in the embodiments of this application;
[0022] Figure 8 This is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of this application. Detailed Implementation
[0023] To make the objectives, technical solutions, and effects of the present invention clearer and more explicit, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0024] A real-time network video transmission system includes a data sender and a data receiver. The data receiver pulls the stream from the data sender and presents the data. Generally, the data sender is a camera, and the data receiver is a player. The camera acquires video images, encodes them, and sends them to the player. The player decodes and plays the video. Due to latency during network transmission, the player cannot play the video completely synchronously. Therefore, video latency is an important indicator in a real-time network video transmission system. This application provides a latency calculation method that calculates the video latency by recording key moments when the data sender and data receiver send signaling, as well as key moments when data is sent and received. This method eliminates the need for time synchronization between the data sender and data receiver, is simple, and offers high measurement accuracy. It does not add new network data, does not affect the transmission of existing bitstreams, and reduces the additional network traffic consumption caused by transmitting absolute timestamp data, as network time synchronization is not required.
[0025] Please see Figure 1 , Figure 1 This is a flowchart illustrating one embodiment of the delay calculation method of this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily reflect that result. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, this embodiment includes:
[0026] S110: Obtain the request signaling sending time of the data receiving end sending the pull request signaling and the request signaling receiving time of the data sending end receiving the pull request signaling.
[0027] Both the data receiver and the data sender have their own time bases. The data receiver sends a pull request signaling to the data sender to establish a connection and initiate video data preparation. The sending and receiving times of the request signaling from both ends are recorded. The sending and receiving times are directly derived from the data receiver's and data sender's time bases.
[0028] S130: Obtain the response signaling sending time of the data sender sending the pull response signaling and the response signaling receiving time of the data receiver receiving the pull response signaling.
[0029] After receiving the pull request signaling, the data sender confirms the connection with the data receiver and packages a pull response signaling message, sending it to the data receiver. The sending time and receiving time of the response signaling message are recorded. The sending time is directly obtained from the data sender's time base, and the receiving time is also directly obtained from the data receiver's time base.
[0030] S150: Obtain data transmission time and data reception time.
[0031] The data sending end acquires video data and encodes and sends it frame by frame. Specifically, the transmitted data is encoded and sent to the data receiving end. The data sending time and data receiving time are recorded. The data sending time is the time when the data sending end sends the transmitted data, and the data receiving time is the time when the data receiving end receives the transmitted data. Both the data sending and receiving times are directly obtained from the data sending end's time base.
[0032] S170: Calculate network latency using request signaling transmission time, request signaling reception time, response signaling transmission time, response signaling reception time, data transmission time, and data reception time.
[0033] The network latency is directly calculated by combining the request signaling reception time, response signaling transmission time, and data transmission time obtained from the data sender's time reference, and by performing calculations between the request signaling transmission time, response signaling reception time, and data reception time obtained from the data receiver's time reference.
[0034] In public network environments, time synchronization is often difficult to achieve or has poor accuracy. However, in this implementation, the latency of the data display is calculated by separately recording the key moments when the data sender and receiver transmit signaling and the key moments when the data is transmitted and received. This eliminates the need for time synchronization between the data sender and receiver, resulting in a simple solution with high measurement accuracy, no new network data, and no impact on the transmission of existing bitstreams.
[0035] After receiving the streaming request signaling, the data sending end transmits the acquired video data frame by frame to the data receiving end. Specifically, the data sending end acquires the first frame of data, encodes it, and sends the encoded data to the data receiving end. The data receiving end then plays and renders the received data, displaying the image on the screen. There is a time difference between the time the data sending end acquires the transmitted data and the time the data receiving end displays it; this time difference is the total delay of the first frame. Therefore, for the first frame of video data, the network latency is the network latency of the current transmitted data, and the total latency is the sum of the network latency, video rendering latency, and encoding latency.
[0036] After the data sending end completes the transmission of the first frame of data, it begins preparing to send the second frame. While the data receiving end renders the previous frame, the sending end completes the encoding and transmission of the second frame, and the receiving end continues rendering and playback of the second frame. Similarly, subsequent data transmissions and displays are performed. Therefore, for video data other than the first frame, the playback delay includes the playback delay of the currently transmitted data, and the total delay is the sum of the playback delay of the currently transmitted data and the total delay of the previous frame.
[0037] In one implementation, the delay of the first frame of data is calculated. See also... Figure 2 , Figure 2 This is a flowchart illustrating another implementation of the time-delay calculation method described in this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily reflect that result. Figure 2 The illustrated process sequence is limited. For example... Figure 2 As shown, this embodiment includes:
[0038] S210: Obtain the request signaling sending time of the pull request signaling sent by the data receiver and the request signaling receiving time of the pull request signaling received by the data sender; obtain the response signaling sending time of the pull response signaling sent by the data sender and the response signaling receiving time of the pull response signaling received by the data receiver; obtain the data sending time and the data receiving time.
[0039] S230: Obtain the signaling network delay of pull request signaling and pull response signaling by using the request signaling sending time, request signaling receiving time, response signaling sending time and response signaling receiving time.
[0040] The data sending end and the data receiving end process the time information under their respective time bases. The data receiving end obtains the first time difference between the request signaling transmission time and the response signaling reception time; the data sending end obtains the second time difference between the request signaling reception time and the response signaling transmission time.
[0041] Subtracting the second time difference from the first time difference yields the network transmission time for the entire information exchange process, which is the sum of the signaling network delays of the pull request signaling and the pull response signaling. Since the data volume difference between the pull request and pull response signaling is small, their transmission durations can be considered equal, meaning the signaling network delays of the pull request and pull response signaling are equal. Dividing the sum of the signaling network delays by two gives the signaling network delay of both the pull request and pull response signaling.
[0042] S250: Data network delay is obtained by using signaling network delay, request signaling transmission time, request signaling reception time, data transmission time and data reception time.
[0043] The data receiving end obtains the third time difference between the request signaling sending time and the data receiving time; the data sending end obtains the fourth time difference between the request signaling receiving time and the data sending time.
[0044] Subtracting the fourth time difference from the third time difference yields the sum of the signaling network delay for transmitting the pull request signaling and the data network delay for transmitting the first frame of data. Subtracting the signaling network delay obtained in step S230 from the time difference again yields the data network delay.
[0045] S270: Add the data network delay, rendering delay, and encoding delay together to obtain the total delay of data transmission.
[0046] The total data transmission latency is the time between receiving data at the data sender and displaying / playing the data at the data receiver. Specifically, the data sender encodes the transmitted data, calculating the encoding latency using the encoding start and completion times. The transmitted data is then sent to the data receiver, which renders the data to display it on the screen, calculating the rendering latency using the rendering start and completion times. Finally, the data network latency, rendering latency, and encoding latency are added together to obtain the total data transmission latency.
[0047] In this implementation, a time model is established to measure the latency of the first frame by recording key moments when the data sender and receiver transmit signaling, as well as key moments when data is transmitted and received. Since there is no cross-device time difference calculation in the latency calculation, time synchronization between the data sender and receiver is unnecessary. Furthermore, considering the possibility of increased or decreased latency in subsequent data frames, the latency of each subsequent video frame is iteratively measured by calculating the playback rendering time difference and the encoding time interval difference. This method is simple, has high measurement accuracy, does not add new network data, and does not affect the transmission of existing bitstreams.
[0048] The data sending end acquires video data in real time. During data encoding, an encoding timestamp is generated, which is the encoding completion time. The encoding interval between two adjacent frames can be calculated using the timestamps of the two frames, i.e., the encoding time difference. This time difference can be considered as the image delay when the two frames are generated at the data sending end. The video encoding timestamp is generally transmitted to the data receiving end as part of the video data. For the data receiving end, the display duration of each frame is recorded as the rendering duration, i.e., the rendering time difference. This duration is the time difference between the completion of the rendering of two adjacent frames. Therefore, if the rendering duration of each frame at the data receiving end is the same as the encoding interval at the data sending end, i.e., the encoding time difference equals the rendering time difference, it means that the rendering duration of each frame at the data receiving end and the encoding duration at the data sending end remain stable, without introducing new delays. The delay of each frame during playback is always the delay of the first frame.
[0049] In one implementation, the data encoding time of the current frame data and the data encoding time of the previous frame data are obtained to obtain the encoding time difference; the data receiving end obtains the data rendering completion time of the current frame data and the data rendering completion time of the previous frame data to obtain the rendering time difference. When the encoding time difference and the rendering time difference are equal, it indicates that the transmission of the current frame data has not increased the data playback delay, and the total delay of the current frame data is still the same as the total delay of the previous frame data.
[0050] When the encoding time difference is less than the rendering time difference, if network conditions are poor and jitter occurs, and no new video frames are available for playback and rendering in a short period, causing the playback and rendering time of the previous frame to exceed its encoding interval, the rendering time difference of the current frame data minus the encoding time difference yields the data playback delay introduced by the current frame data. The total delay of the current frame data is obtained by adding the data playback delay of the current frame data to the total delay of the previous frame data. If subsequent video frames have playback and rendering times exceeding the encoding interval, the delay increases according to this rule.
[0051] When the encoding time difference is greater than the rendering time difference, if the data receiver accelerates the playback of the previous frame to reduce latency, causing the playback and rendering time of the previous frame to be less than its encoding interval, then the reduced playback latency of the current frame is obtained by subtracting the rendering time difference from the encoding time difference. The total latency of the current frame is then calculated by subtracting the reduced playback latency of the current frame from the total latency of the previous frame. If subsequent video frames also have playback and rendering times shorter than the encoding interval, the latency decreases according to this rule.
[0052] In one specific implementation, the data transmitter is a camera, and the data receiver is a player. Please refer to [link / reference needed]. Figure 3 , Figure 3 This is a flowchart illustrating a specific implementation of the video data transmission method of this application. For example... Figure 3As shown, tn represents the time obtained from the player's time base, and Tn represents the time obtained from the camera's time base. The player sends a streaming request signal to the camera and records the sending time t1 on the player's side. The camera receives and records the receiving time T1. The camera then sends a streaming response signal to the player and records the sending time t2 on the camera's side. The player receives and records the receiving time T2. After sending the streaming response signal, the camera acquires the currently captured video and transmits data frame by frame. First, it acquires the first frame of data at time T3, encodes it, and records the encoding completion time T4. The first frame is then sent to the player, which records the receiving time t3. The player plays and renders the first frame, recording the rendering completion time t4. Video data transmission continues using the same method. The camera records the times T5, T6, T7, etc., when each encoding is completed and the data is sent to the player, and the player records the times t5, t6, t7, etc., when each rendering is completed.
[0053] Please see Figure 4 , Figure 4 This is a flowchart illustrating the method for calculating the total delay of the first frame data in this application. After starting the streaming playback, the request signaling sending time t1, request signaling receiving time T1, response signaling sending time t2, and response signaling receiving time T2 are recorded sequentially. The first frame data acquisition time is further recorded as T3, data sending time T4, data receiving time t3, and rendering completion time t4. The delay generated during the first frame video frame acquisition and encoding process is T4-T3, the delay generated during network transmission is t3-T4, and the delay generated during playback rendering is t4-t3.
[0054] First, the sum of the pull request signaling delay and the data network delay of the first frame data is obtained by (t3-t1)-(T4-T1), i.e., T1-t1+t3-T4. Because the data volume of video data and signaling data differs significantly, the delay cannot be simply halved. Further confirmation of the pull request signaling delay T1-t1 is needed. Since the data volume of the pull request signaling and the pull response signaling is not significantly different, their transmission durations can be considered equal. Therefore, it can be determined by... The transmission time T1-t1 of the pull request signaling is calculated. Therefore, the data network delay of the first frame of data is:
[0055]
[0056] The delay T4-T3 caused by the acquisition and encoding process of the first frame of data, and the data network delay. After receiving the frame data, the player decodes and renders it, resulting in a delay of t4-t3. The camera feeds back the times T1, T2, T3, and T4 related to the delay calculation to the player. Combining the player's delay calculation-related time measurements t1, t2, t3, and t4, the total delay of the first frame data is calculated as follows:
[0057]
[0058] In the calculation process of the above formula, the subtraction of time points is either the subtraction of two time points on the playback side or the subtraction of two time points on the device side (camera), so there is no need for time synchronization.
[0059] like Figure 3 As shown, the encoded timestamps T4, T5, ..., Tn of each frame from the camera are transmitted to the player client as part of the bitstream during the streaming process. This existing timestamp information, combined with playback rendering information, is used to calculate the increase or decrease in latency for each subsequent frame. Through continuous iterative calculations, the latency of the currently playing video frame is obtained. Please refer to [link / reference]. Figure 5 , Figure 5 This is a flowchart illustrating the method for calculating the total delay of non-first frame data in this application.
[0060] Based on the calculation of the first frame delay, the delay of non-first frame data is further calculated. The encoding completion time T4 of the first frame data and the playback rendering completion time t4 are obtained.
[0061] In one specific implementation, the network does not experience jitter. The interval t5-t4 between the time when the player finishes playing and rendering the second frame of data and the time when the player finishes playing and rendering the first frame of data is equal to the device's encoding interval T5-T4. The player does not increase or decrease the delay when playing and rendering compared to the camera's acquisition and encoding. It can be considered that the delay when playing the second frame is the same as the delay when playing the first frame. Similarly, when the playback and rendering interval is equal to the encoding interval, the delay of the Nth frame is the delay of the (N-1)th frame.
[0062] In another embodiment, such as Figure 3As shown in the data of the 3rd frame, network jitter caused the network transmission time of the 3rd frame data to be too long. As a result, the time interval between the time when the player finishes playing and rendering the 3rd frame data (t6) and the time when the player finishes playing and rendering the 2nd frame data (t5) will be relatively large. This playback rendering interval (t6-t5) is greater than the camera's encoding interval (T6-T5). This means that the player introduces an additional delay (t6-t5)-(T6-T5) when playing the data compared to the camera's acquisition and encoding. Therefore, the delay of the 3rd frame data is the delay of the 2nd frame data playback plus (t6-t5)-(T6-T5). Similarly, when the playback rendering interval is greater than the encoding interval, the delay of the Nth frame data is the delay of the N-1th frame data plus (tn-t(n-1))-(Tn-T(n-1))). Where tn is the time when the Nth frame of data playback and rendering is completed, t(n-1) is the time when the (N-1)th frame of data playback and rendering is completed, Tn is the time when the Nth frame of data encoding is completed, and T(n-1) is the time when the (N-1)th frame of data encoding is completed.
[0063] In another embodiment, such as Figure 3 The fourth frame of data shown is played without network jitter. However, the player sped up playback to reduce latency. Therefore, the interval between the time the player finishes rendering the fourth frame (t7) and the time the player finishes rendering the third frame (t6) is relatively small. This playback rendering interval (t7-t6) is less than the device's encoding interval (T7-T6), meaning the player's playback latency is reduced by (T7-T6)-(t7-t6) compared to the camera's capture encoding latency. Therefore, the latency of the fourth frame is the same as the latency of the third frame during playback. The delay is calculated by subtracting (T7-T6)-(t7-t6) from the time interval. Similarly, when the playback rendering interval is less than the encoding interval, the delay of the Nth frame video is the delay of the (N-1)th frame video minus (Tn-T(n-1)-(tn-t(n-1)), where tn is the time when the playback rendering of the Nth frame video is completed, t(n-1) is the time when the playback rendering of the (N-1)th frame video is completed, Tn is the time when the encoding of the Nth frame video is completed, and T(n-1) is the time when the encoding of the (N-1)th frame video is completed.
[0064] Therefore, the latency of the currently playing frame is calculated iteratively by the difference between the latency of the first frame and the rendering and encoding intervals of each subsequent frame. This eliminates the need for network time synchronization, improving the accuracy of latency calculations even under unstable network conditions. Furthermore, the absence of network time synchronization reduces the need for frequent absolute timestamp data transmission, minimizing network bandwidth consumption and improving video transmission efficiency.
[0065] Please see Figure 6 , Figure 6This is a schematic diagram of the delay calculation device according to an embodiment of this application. In this embodiment, the delay calculation device includes a first acquisition module 61, a second acquisition module 62, a third acquisition module 63, and a calculation module 64.
[0066] The system comprises three modules: a first acquisition module 61, which acquires the sending time of the request signaling for the data receiving end's pull request signaling and the receiving time of the request signaling for the data sending end's pull request signaling; a second acquisition module 62, which acquires the sending time of the response signaling for the data sending end's pull response signaling and the receiving time of the response signaling for the data receiving end's pull response signaling; and a third acquisition module 63, which acquires the data sending time and the data receiving time, where the data sending time is the time when the data sending end sends the transmitted data and the data receiving time is the time when the data receiving end receives the transmitted data. A calculation module 64 calculates the data network latency using the request signaling sending time, request signaling receiving time, response signaling sending time, response signaling receiving time, data sending time, and data receiving time. This latency calculation device records key moments during signaling transmission and data transmission and reception at both the data sending and receiving ends, and calculates the latency of the data display. It eliminates the need for time synchronization between the data sending and receiving ends, resulting in a simple solution with high measurement accuracy, no new network data, and no impact on the transmission of existing data streams.
[0067] Please see Figure 7 , Figure 7 This is a schematic diagram of the delay computing device according to an embodiment of this application. In this embodiment, the delay computing device 71 includes a processor 72.
[0068] Processor 72 can also be referred to as a CPU (Central Processing Unit). Processor 72 may be an integrated circuit chip with signal processing capabilities. Processor 72 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor, or processor 72 can be any conventional processor.
[0069] The delayed computing device 71 may further include a memory (not shown) for storing instructions and data required for the processor 72 to run.
[0070] The processor 72 is used to execute instructions to implement the method provided by any embodiment of the delay calculation method of this application and any non-conflicting combination thereof.
[0071] Please see Figure 8 , Figure 8This is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of this application. The computer-readable storage medium 81 in this embodiment stores instruction / program data 82. When executed, this instruction / program data 82 implements the method provided by any embodiment of the delay calculation method of this application and any non-conflicting combination thereof. The instruction / program data 82 can be formed into a program file and stored in the storage medium 81 in the form of a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) or processor can execute all or part of the steps of the methods in various embodiments of this application. The aforementioned storage medium 81 includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or terminal devices such as computers, servers, mobile phones, and tablets.
[0072] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0073] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0074] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method of delay computation, characterized by, The method comprises: acquiring a request signaling sending time of the data receiving end sending a pull stream request signaling and a request signaling receiving time of the data sending end receiving the pull stream request signaling; acquiring a response signaling sending time of the data sending end sending a pull stream response signaling and a response signaling receiving time of the data receiving end receiving the pull stream response signaling; acquiring a data sending time and a data receiving time, the data sending time being a time of the data sending end sending transmission data, and the data receiving time being a time of the data receiving end receiving the transmission data; calculating a network delay by using the request signaling sending time, the request signaling receiving time, the response signaling sending time, the response signaling receiving time, the data sending time and the data receiving time; the calculating a network delay by using the request signaling sending time, the request signaling receiving time, the response signaling sending time, the response signaling receiving time, the data sending time and the data receiving time comprises: acquiring a signaling network delay of the pull stream request signaling and the pull stream response signaling by using the request signaling sending time, the request signaling receiving time, the response signaling sending time and the response signaling receiving time; acquiring a data network delay by using the signaling network delay, the request signaling sending time, the request signaling receiving time, the data sending time and the data receiving time; the acquiring a data network delay by using the signaling network delay, the request signaling sending time, the request signaling receiving time, the data sending time and the data receiving time comprises: acquiring a third time difference between the request signaling sending time and the data receiving time and a fourth time difference between the request signaling receiving time and the data sending time; subtracting the fourth time difference from the third time difference and then subtracting the signaling network delay to obtain the data network delay.
2. The delay time calculation method according to claim 1, characterized by, the acquiring a signaling network delay of the pull stream request signaling and the pull stream response signaling by using the request signaling sending time, the request signaling receiving time, the response signaling sending time and the response signaling receiving time comprises: acquiring a first time difference between the request signaling sending time and the response signaling receiving time and a second time difference between the request signaling receiving time and the response signaling sending time; subtracting the second time difference from the first time difference to obtain a sum of the signaling network delays of the pull stream request signaling and the pull stream response signaling; acquiring the signaling network delays of the pull stream request signaling and the pull stream response signaling by using the sum of the signaling network delays, wherein the signaling network delay of the pull stream request signaling is equal to the signaling network delay of the pull stream response signaling.
3. The delay time calculation method according to claim 2, characterized by, The method further comprises: acquiring an encoding delay of the data sending end encoding processing the transmission data and a rendering delay of the data receiving end rendering processing the transmission data; adding the data network delay, the rendering delay and the encoding delay to obtain a total delay of the transmission data.
4. The method of claim 1-3, wherein the transmission data is first frame data of video data. The method further comprises:
5. The time delay calculation method according to any one of claims 1 to 3, characterized in that, obtaining a data encoding completion time of the current frame data and a data encoding completion time of the previous frame data to obtain an encoding time difference; obtaining a data rendering completion time of the current frame data and a data rendering completion time of the previous frame data to obtain a rendering time difference; subtracting the rendering time difference from the encoding time difference to obtain a data play delay; the current frame data is video frame data other than the first frame data of the video data. The method further comprises:
6. The delay time calculation method according to claim 5, characterized by, when the rendering time difference is greater than or equal to the encoding time difference, adding the data play delay of the current frame data to the total delay of the previous frame data to obtain the total delay of the current frame data, the data play delay of the current frame data being obtained by subtracting the encoding time difference from the rendering time difference; when the rendering time difference is less than the encoding time difference, subtracting the data play delay of the current frame data from the total delay of the previous frame data to obtain the total delay of the current frame data, the data play delay of the current frame data being obtained by subtracting the rendering time difference from the encoding time difference. A processor is configured to execute instructions to implement the method of any one of claims 1-6.
7. A time delay computing device characterized by, A computer readable storage medium is configured to store instructions / program data capable of being executed to implement the method of any one of claims 1-6.
8. A computer-readable storage medium, characterized in that,
Citation Information
Patent Citations
Multimedia information processing method and device and storage medium
CN112118527A
Audio and video transmission, playing and delay detection method and device based on CDN (Content Delivery Network)
CN113301397A