Method, apparatus, and device for determining quality of audio and video stream, and computer-readable storage medium
11601492 · 2023-03-07
Assignee
Inventors
- Hanshu Hong (Nanjing, CN)
- Zhenwei Zhang (Nanjing, CN)
- Tengxiang Zhang (Nanjing, CN)
- Feng Dong (Nanjing, CN)
Cpc classification
G06V20/46
PHYSICS
H04L43/08
ELECTRICITY
International classification
H04L43/08
ELECTRICITY
Abstract
A method for determining quality of an audio and video stream includes: obtaining a key indicator for a target audio and video stream, the key indicator including at least one of the following indicators within a reference time period: a maximum quantity of continuously lost packets, an average packet receiving time interval, an average packet receiving time interval variance, or a quantity of stream interruptions; and determining a QoE of the target audio and video stream based on the key indicator.
Claims
1. A method for determining quality of an audio and video stream, the method comprising: obtaining a key indicator within a reference time period for a target audio and video stream, the key indicator comprising a maximum quantity of continuously lost packets, the obtaining the key indicator comprising: obtaining a maximum quantity of continuously lost packets value for each sub-time period of a plurality of sub-time periods in the reference time period; and selecting a largest maximum quantity of continuously lost packets value as the maximum quantity of continuously lost packets; and determining a quality of experience (QoE) of the target audio and video stream based on the key indicator.
2. The method according to claim 1, wherein the obtaining the key indicator for the target audio and video stream comprises: collecting feature information of the target audio and video stream, the feature information comprising a quantity of data packets received by a receive end of the target audio and video stream within the reference time period and comprising a sequence number corresponding to the data packet received by the receive end.
3. The method according to claim 1, wherein the maximum quantity of continuously lost packets indicates a maximum quantity of continuously lost data packets of the target audio and video stream within the reference time period, and the lost data packet comprises a data packet that has been sent by a transmit end of the target audio and video stream but has not been received by the receive end of the target audio and video stream.
4. The method according to claim 1, wherein the average packet receiving time interval indicates an average value of a plurality of receiving time intervals that are used for receiving the target audio and video stream and that are in any sub-time period in the reference time period, and each time interval of the plurality of receiving time intervals indicates an interval between time points for receiving two adjacent data packets.
5. The method according to claim 1, wherein the key indicator further comprises at least one of the following indicators: a packet loss rate, an average delay, or an average jitter.
6. The method according to claim 1, the key indicator comprising at least two indicators, and the determining the quality of experience (QoE) of the target audio and video stream based on the key indicator comprises: determining a uniform reference unit for various indicators for the target audio and video stream; performing weighted summation on the various indicators after the uniform reference unit is determined to obtain a summation score; using a difference between a full score and the summation score as a score of the target audio and video stream; and indicating the QoE of the target audio and video stream using the score of the target audio and video stream, wherein the full score indicates an upper limit of the QoE.
7. The method according to claim 1, wherein the determining the quality of experience (QoE) of the target audio and video stream based on the key indicator comprises: inputting the key indicator into a trained quality determining model; using a score output by the quality determining model as a score of the target audio and video stream; and indicating the QoE of the target audio and video stream using the score.
8. The method according to claim 1, wherein after the determining quality of experience (QoE) of the target audio and video stream based on the key indicator, the method further comprising: generating an alarm when the QoE of the target audio and video stream does not meet a requirement.
9. A network device, the network device comprising: a memory storing instructions; and a processor coupled to the memory, the processor is configured to execute the instructions to implement: obtaining a key indicator within a reference time period for a target audio and video stream, the key indicator comprising a maximum quantity of continuously lost packets, the obtaining the key indicator comprising: obtaining a maximum quantity of continuously lost packets value for each sub-time period of a plurality of sub-time periods in the reference time period; and selecting a largest maximum quantity of continuously lost packets value as the maximum quantity of continuously lost packets; and determining a quality of experience (QoE) of the target audio and video stream based on the key indicator.
10. The network device according to claim 9, wherein the processor further executes the instructions to implement: collecting feature information of the target audio and video stream, the feature information comprising a quantity of data packets received by a receive end of the target audio and video stream within the reference time period and comprising a sequence number corresponding to the data packet received by the receive end.
11. The network device according to claim 9, wherein the maximum quantity of continuously lost packets indicates a maximum quantity of continuously lost data packets of the target audio and video stream within the reference time period, and the lost data packet comprises a data packet that has been sent by a transmit end of the target audio and video stream but has not been received by the receive end of the target audio and video stream.
12. The network device according to claim 9, wherein the average packet receiving time interval indicates an average value of a plurality of receiving time intervals that are used for receiving the target audio and video stream and that are in any sub-time period in the reference time period, and each time interval of the plurality of receiving time intervals indicates an interval between time points for receiving two adjacent data packets.
13. The network device according to claim 9, wherein the key indicator further comprises at least one of the following indicators: a packet loss rate, an average delay, or an average jitter.
14. The network device according to claim 9, the key indicator comprising at least two indicators, and wherein the processor further executes the instructions to implement: determining a uniform reference unit for various indicators for the target audio and video stream; performing weighted summation on the various indicators after the uniform reference unit is determined to obtain a summation score; using a difference between a full score and the summation score as a score of the target audio and video stream; and indicating the QoE of the target audio and video stream using the score of the target audio and video stream, wherein the full score indicates an upper limit of the QoE.
15. The network device according to claim 9, wherein the processor further executes the instructions to implement: inputting the key indicator into a trained quality determining model; using a score output by the quality determining model as a score of the target audio and video stream; and indicating the QoE of the target audio and video stream using the score.
16. The network device according to claim 9, wherein the processor further executes the instructions to implement: generating an alarm when the QoE of the target audio and video stream does not meet a requirement.
17. A non-transitory computer-readable storage medium comprising instructions which, when executed by a computer, cause the computer to carry out the following steps: obtaining a key indicator within a reference time period for a target audio and video stream, the key indicator comprising a maximum quantity of continuously lost packets, the obtaining the key indicator comprising: obtaining a maximum quantity of continuously lost packets value for each sub-time period of a plurality of sub-time periods in the reference time period; and selecting a largest maximum quantity of continuously lost packets value as the maximum quantity of continuously lost packets; and determining a quality of experience (QoE) of the target audio and video stream based on the key indicator.
18. The method according to claim 1, wherein the maximum quantity of continuously lost packets comprises a maximum sequence number difference in packet sequence numbers of received packets received during the reference time period.
19. The network device according to claim 9, wherein the maximum quantity of continuously lost packets comprises a maximum sequence number difference in packet sequence numbers of received packets received during the reference time period.
Description
BRIEF DESCRIPTION OF DRAWINGS
(1)
(2)
(3)
(4)
(5)
DESCRIPTION OF EMBODIMENTS
(6) Terms used in DESCRIPTION OF EMBODIMENTS of this application are only used to explain specific embodiments of this application, and are not intended to limit this application.
(7) An embodiment of this application provides a method for determining quality of an audio and video stream. The method may be applied to a hardware implementation environment shown in
(8) Based on the hardware structure shown in
(9) 201: Obtain a key indicator for a target audio and video stream, where the key indicator includes at least one of the following indicators within a reference time period: a maximum quantity of continuously lost packets, an average packet receiving time interval, an average packet receiving time interval variance, and a quantity of stream interruptions.
(10) The target audio and video stream includes a plurality of data packets, and the plurality of data packets are transmitted one by one from a transmit end to a receive end in a streaming media manner. The data packet includes any one of audio data, video data, or data obtained by mixing the audio data and the video data. Content or a format of the target audio and video stream is not limited in this embodiment.
(11) Through obtaining the key indicator, within the reference time period, of the target audio and video stream, QoE of the target audio and video stream can be subsequently determined based on the obtained key indicator. Duration of the reference time period is not limited in this embodiment, and may be selected according to an actual requirement or experience. For example, the duration of the reference time period is 60 s (unit: second), or is a value other than 60 s.
(12) For example, the key indicators include one, two, three, or four of the maximum quantity of continuously lost packets, the average packet receiving time interval, the average packet receiving time interval variance, and the quantity of stream interruptions within a reference time period. Certainly, in addition to at least one of the foregoing four indicators, in a possible implementation, the key indicator further includes at least one of the following indicators: a packet loss rate, an average delay, and an average jitter. For example, in this embodiment, the maximum quantity of continuously lost packets, the average packet receiving time interval, the average packet receiving time interval variance, and the quantity of stream interruptions, the packet loss rate, the average delay, and the average jitter are all used as key indicators for the target audio and video stream. In this case, the key indicators for the target audio and video stream include seven different indicators.
(13) It can be understood that the foregoing seven indicators are merely examples, and a quantity of indicators or indicators included in the key indicators is not limited in this embodiment. Another indicator other than the indicator in the foregoing example may also be used as the key indicator for calculating the QoE of the target audio and video stream.
(14) In a possible implementation, the obtaining a key indicator for a target audio and video stream includes the following steps shown in 2011 and 2012.
(15) 2011: Collect feature information of the target audio and video stream, where the feature information includes a quantity of data packets received by the receive end of the target audio and video stream within the reference time period and a sequence number corresponding to the data packet received by the receive end.
(16) Because the target audio and video stream includes a plurality of data packets, each data packet corresponds to a sequence number. For example, the sequence number corresponding to the data packet is used to indicate a sequence in which the data packet is sent. For example, a sequence number corresponding to a first sent data packet is 1, a sequence number corresponding to a second sent data packet is 2, and so on.
(17) For example, a counter is configured for the receive end of the target audio and video stream. Therefore, the receive end determines, by using the counter, a quantity of data packets received by the receive end. Alternatively, the receive end can obtain a quantity of data packets through calculation based on sequence numbers corresponding to the data packets. For example, if a sequence number corresponding to a data packet that is first received by the receive end within the reference time period is 1, and a sequence number corresponding to a last received data packet is 5, the receive end can obtain through calculation that a quantity of received data packets is 5.
(18) The foregoing feature information is information used to calculate the maximum quantity of continuously lost packets, the average packet receiving time interval, the average packet receiving time interval variance, and the quantity of stream interruptions in the reference time period. For a case in which the key indicator includes the packet loss rate, the average delay, and the average jitter, the feature information further includes: a quantity of data packets sent by the transmit end of the target audio and video stream within the reference time period and a delay of each data packet, and the delay includes but is not limited to a transmission time of the data packet between the transmit end and the receive end.
(19) The quantity of the audio and video data packets sent by the transmit end may alternatively be determined through counting by using the counter, or may be determined by using sequence numbers of the data packets. Details are not described herein. For a delay of the data packet, the transmit end adds a timestamp to the data packet during sending the data packet. The timestamp is used to indicate a time at which the data packet is sent. Therefore, after receiving the data packet, the receive end can determine the transmission time of the data packet between the transmit end and the receive end by calculating a difference between a receiving time of the data packet and the sending time indicated by the timestamp.
(20) It should be noted that the network device can collect the feature information by receiving the feature information reported by the transmit end and the receive end of the target audio and video stream. Alternatively, the network device may further separately send a feature information obtaining request to the transmit end and the receive end, and receive, based on the obtaining request, feature information returned by the transmit end and the receive end. In this way, various types of feature information are collected. After the feature information is collected, the key indicator can be further determined based on the feature information. For details, refer to step 2012.
(21) 2012: Calculate, based on the feature information, at least one of the following indicators: the maximum quantity of continuously lost packets, the average packet receiving time interval, the average packet receiving time interval variance, and the quantity of stream interruptions, and use at least one indicator obtained through calculation as the key indicator for the target audio and video stream.
(22) It can be understood that, when any indicator is calculated based on the feature information, calculation is performed based on one or more types of feature information. In other words, not all key indicators are calculated based on all types of feature information. The following separately describes definitions and calculation processes of the foregoing seven indicators.
(23) Packet loss rate: A packet loss rate indicates a ratio of lost data packets within the reference time period to all data packets sent by the transmit end. During calculation of the packet loss rate, a ratio of a quantity of data packets received by the receive end to the quantity of data packets sent by the transmit end is determined, and the packet loss rate is determined based on the ratio.
(24) The lost data packet refers to a data packet that has been sent by the transmit end of the target audio and video stream but has not been received by the receive end of the target audio and video stream. A process of determining the packet loss rate based on the ratio includes: determining a percentage of a difference between 1 and the ratio as the packet loss rate. For example, if the transmit end has sent 100 data packets within the reference time period, and the receive end has received 90 data packets within the reference time period, the packet loss rate is 1− 90/100=10%.
(25) Maximum quantity of continuously lost packets: The maximum quantity of continuously lost data packets indicates a maximum quantity of continuously lost packets in the target audio and video streams within the reference time period. During calculation, a sequence number difference between sequence numbers corresponding to every two adjacent data packets received by the receive end is first calculated, to obtain a plurality of sequence number differences. Then, a maximum sequence number difference in the plurality of sequence number differences is used as the maximum quantity of continuously lost packets.
(26) For example, the reference time period includes a plurality of sub-time periods. For example, the reference time period is 60 s, and the reference time period includes six sub-time periods whose duration is 10 s. In this embodiment, one or more quantities of continuously lost packets are obtained in each sub-time period, and a plurality of quantities of continuously lost packets are obtained in the plurality of sub-time periods. Then, a largest quantity of continuously lost packets in the plurality of quantities of continuously lost packets is used as the maximum quantity of continuously lost packets within the reference time period. Certainly, the foregoing case is merely an example. In this embodiment, a quantity of continuously lost packets may be recorded each time a data packet loss is detected within the reference time period. At the end of the reference time period, a largest quantity of continuously lost packets is selected from recorded quantities of continuously lost packets as the maximum quantity of continuously lost packets.
(27) For example, in this embodiment, a sequence number X.sub.n corresponding to an n.sup.th data packet received by the receive end and a sequence number X.sub.n+k corresponding to an (n+1).sup.th data packet received by the receive end are recorded. The n.sup.th data packet and the (n+1).sup.th data packet are two adjacent data packets received by the receive end, and n and n+k are used to distinguish sequence numbers corresponding to different data packets. Then, a sequence number difference between the sequence number corresponding to the n.sup.th received data packet and the sequence number corresponding to the (n+1).sup.th received data packet is calculated. To be specific, the sequence number difference is k.sub.n+1=X.sub.n−X.sub.n+k.
(28) According to this calculation manner, a plurality of sequence number differences can be obtained through calculation based on a plurality of data packets received within the reference time period. For example, if m data packets are received, (m−1) sequence number differences can be obtained through calculation. Then, a maximum sequence number difference is selected from the plurality of sequence number differences as the maximum quantity of continuously lost packets. n, k, and m are all positive integers not less than 1, and values of n, k, and m are not limited in this embodiment.
(29) It should be noted that a reason of using the maximum quantity of continuously lost packets as one of the key indicators in this embodiment is as follows: The packet loss rate can reflect only average QoE within a time period, but cannot reflect a sudden QoE change status at each time point in the time period. A granularity of the packet loss rate in the time period is relatively coarse, and therefore accuracy of determined QoE is affected.
(30) For example, a data packet is received at a fixed receiving speed. If no data packet is received for 0.5 s within a reference time period of 10 s, a packet loss rate is 5%. Therefore, if the QoE is determined by using only the packet loss rate, it is usually determined that the QoE is relatively good because the packet loss rate of 5% is relatively small. However, in practice, QoE in duration is to 2s earlier or later than the duration of 0.5 s in which no data packet is received is affected, causing poor audio-visual experience of a user. In this case, it is determined, based on the maximum quantity of continuously lost packets, that the QoE is relatively poor, which is consistent with an actual situation. It can be learned that, using the maximum quantity of continuously lost packets as the key indicator for determining the QoE can make the determined QoE more practical and accurate.
(31) Based on this reason, in addition to the maximum quantity of continuously lost packets, another indicator, for example, maximum continuous packet loss duration, that can reflect a sudden QoE change status, may be used as a key indicator for determining the QoE of the target audio and video stream in this embodiment.
(32) Average packet receiving time interval: The average packet receiving time interval is used to indicate an average value of a plurality of receiving time intervals that are used for receiving the target audio and video stream and that are in any sub-time period in the reference time period, and each of the plurality of receiving time intervals is used to indicate an interval between time points for receiving two adjacent data packets. During calculation of the average packet receiving time interval, duration of a sub-time period needs to be determined, and a ratio of the duration of the sub-time period to the quantity of data packets received by the receive end is used as the average packet receiving time interval.
(33) For example, if the duration of the sub-time period is 1000 ms (unit: ms), and the quantity of data packets received by the receive end within 1000 ms is 50, the average packet receiving time interval is: 1000/50=20 ms.
(34) Average packet receiving time interval variance: The average packet receiving time interval variance is a variance of a plurality of average packet receiving time intervals within the reference time period, and one of the plurality of average packet receiving time intervals corresponds to one sub-time period in the reference time period. A variance corresponding to a plurality of average packet receiving time intervals is calculated, and the variance obtained through calculation can be used as the average packet receiving time interval variance.
(35) It can be understood that, an average packet receiving time interval can be obtained through calculation in each sub-time period of the reference time period, and at least two average packet receiving time intervals are required for calculating the average packet receiving time interval variance. Therefore, there are also at least two sub-time periods included in the reference time period. Therefore, the average packet receiving time interval variance can be obtained through calculation based on an average packet receiving time interval corresponding to each time sub-time period in the reference time period. An average packet time interval variance s.sup.2 may be calculated based on a plurality of average packet receiving time intervals according to the following formula:
s.sup.2=[(s.sub.1−s.sub.0)+(s.sub.2−s.sub.0)+ . . . +(s.sub.n−1−s.sub.0)+(s.sub.n−s.sub.0)]/n, where
s.sub.1, s.sub.2, s.sub.n−1, . . . , and s.sub.n are n average packet receiving time intervals, n≥2, and s.sub.0 is an average value of n average packet receiving time intervals.
(36) For example, if there are 10 average packet receiving time intervals: s.sub.1, s.sub.2, . . . , s.sub.10, and an average value of the 10 average packet receiving time intervals is s.sub.0, the average packet receiving time interval variance s.sup.2 is calculated according to the following formula:
s.sup.2=[(s.sub.1−s.sub.0).sup.2+(s.sub.2−s.sub.0).sup.2+ . . . +(s.sub.10−s.sub.0).sup.2]/10
(37) In a process of transmitting the audio and video stream in the streaming media manner, the audio and video stream is usually divided into a plurality of slices (data packets), so that the audio and video stream is transmitted in form of slices. A size of each slice is generally fixed. Therefore, the average packet receiving time interval and the average packet receiving time interval variance can reflect a network status, and further reflect the QoE of the audio and video stream. If the network status is good, the average packet receiving time interval is short, the variance is small, and the QoE is good. If the network status is poor, the average packet receiving time interval is long, the variance is large, and the QoE is poor.
(38) Average delay: The average delay is an average value of delays corresponding to various data packets transmitted within the reference time period. During calculation, an average value of transmission times, between the transmit end and the receive end, of the various data packets received by the receive end is used as the average delay.
(39) For any data packet, a transmission time of the any data packet between the transmit end and the receive end is a difference between a sending time and a receiving time, and the difference is a delay of the any data packet. J[i] represents a delay of an i.sup.th data packet, Arrive[i] represents a receiving time of the i.sup.th data packet, and Send[i] represents a sending time of the i.sup.th data packet. In this case, J[i]=Arrive[i]−Send[i].
(40) The average delay is an average value of delays of a plurality of data packets. The average delay is calculated according to the following formula:
J=(J[1]+J[2]+ . . . +J[n])/n, where
(41) J[1], J[2], . . . , and J[n] are delays of n data packets, and n≥2.
(42) For example, if there are four data packets, delays of the four data packets are respectively J[1], J[2], J[3], and J[4]. Therefore, the average delay J is calculated according to the following formula:
J=(J[1]+J[2]+J[3]+J[4])/4
(43) Average jitter: The average jitter indicates fluctuation of a delay corresponding to each data packet in the reference time period. During calculation, a time difference between transmission times of every two adjacent data packets between the transmit end and the receive end is calculated to obtain a plurality of time differences, and an average value of the plurality of time differences is used as the average jitter.
(44) The average jitter is used to indicate fluctuation of the delay. The average jitter is calculated according to the following formula:
Average Jitter={(|J[2]−J[1]|)+(|J[3]−J[2]|)+(|J[n]−J[n−1]|)}/(n−1), where
(45) J[1], J[2], . . . , and J[n] are delays of n data packets, and (n−1) is a quantity of time differences obtained through calculation based on the delays of the n data packets.
(46) Assuming that delays of four data packets are J[1], J[2], J[3], and J[4], the average jitter can be calculated according to the following formula:
Average Jitter={(|J[2]−J[1]|)+(|J[3]−J[2]|)+(|J[4]−J[3]|)}/3
(47) Quantity of stream interruptions: The quantity of stream interruptions is a quantity of times that duration in which the receive end of the target audio and video stream receives no data packet in the reference time period is greater than a time threshold.
(48) The quantity of stream interruptions is a quantity of stream interruptions within the reference time period. In this embodiment, that no data packet is received within the reference time period is considered as one stream interruption. For example, the reference time period is 60 s and the reference duration is 1 s, and if no data packet is received in a time period 10 s to 11 s or a time period 50 s to 51 s, the quantity of stream interruptions within the reference time period of 60 s is 2. Certainly, the reference duration is not limited in this embodiment. In addition to 1 s in the foregoing description, the reference duration may alternatively be another value.
(49) In this embodiment, a reason of using the quantity of stream interruptions as one of the key indicators is as follows: In the process of transmitting the audio and video stream in the streaming media manner, a source code rate of the audio and video stream may be changed by a device for generating the audio and video stream, and transmission rates of different data packets included in the audio and video stream are different. This causes a frame freezing phenomenon. Indicators such as the packet loss rate, the average delay, and a throughput all reflect an overall frame freezing phenomenon in a time period, but cannot reflect a change of the frame freezing phenomenon at different time points in the time period. Therefore, the frame freezing phenomenon needs to be reflected, at a finer granularity, by using the quantity of stream interruptions.
(50) In addition, if network quality deteriorates in the process of transmitting the audio and video stream, the transmit end of the audio and video stream terminates sending of a data packet, or re-establishes a connection to the receive end of the audio and video stream for transmitting a data packet. In this case, the frame freezing phenomenon also occurs. It can be learned that there are a plurality of cases that may cause the frame freezing phenomenon in the process of transmitting the audio and video stream. Therefore, the frame freezing phenomenon needs to be reflected, at a finer granularity, by using the quantity of stream interruptions.
(51) 202: Determine the QoE of the target audio and video stream based on the key indicator for the target audio and video stream.
(52) In an example embodiment, the determining the QoE of the target audio and video stream based on the key indicator for the target audio and video stream includes but is not limited to determining a score of the target audio and video stream based on the key indicator for the target audio and video stream, and indicating different QoE by using different scores. This ensures that the determined QoE of the target audio and video stream has a relatively fine granularity.
(53) In a possible implementation, the key indicator includes at least two indicators, and the process includes: determining a uniform reference unit for various indicators for the target audio and video stream, and performing weighted summation on the various indicators after the uniform reference unit is determined, to obtain a summation score; and using a difference between a full score and the summation score as a target score of the target audio and video stream, and indicating the QoE of the target audio and video stream by using the target score of the target audio and video stream, where the full score is used to indicate an upper limit of the QoE.
(54) For example, in this embodiment, a reference unit corresponding to the packet loss rate is percentage (%), and reference units corresponding to the average packet receiving time interval, the average delay, and the average jitter are all millisecond. Using the average packet receiving time interval as an example, the average packet receiving time interval obtained through calculation is 0.02 s in a unit of second. In this case, before a target score is calculated by using the average packet receiving time interval, the value 0.02 s needs to be adjusted to 20 ms in a unit of millisecond. In addition, weights corresponding to various indicators are set or adjusted as required, and the weights corresponding to the various indicators are not limited in this embodiment.
(55) It can be learned from the description in 2012 that there are a plurality of average packet receiving time intervals within the reference time period, and a respective obtained quantity of other six indicators other than the average packet receiving time interval is usually one within the reference time period. Therefore, when the key indicators include both the average packet receiving time interval and any one of the other six indicators, an average value of at least two average packet receiving time intervals within the reference time period is calculated in this embodiment, the average value of the average packet receiving time intervals is used as representative data of the average packet receiving time interval, and then a weight is set for the representative data. In a subsequent calculation process, weighted summation is performed based on the representative data and the weight corresponding to the representative data.
(56) For ease of description, each indicator is represented by an abbreviation. Table 1 lists correspondences between abbreviations and indicators.
(57) TABLE-US-00001 TABLE 1 Full name name Abbreviation Packet loss rate loss rate LR Maximum quantity of loss max LM continuously lost packets Average packet receiving time receive time RT interval Average packet receiving time square deviation of SRT interval variance receive time Quantity of stream flow cut FC interruptions Average delay delay D Average jitter jitter J
(58) According to Table 1, using an example in which the full score is represented as R.sub.0, the target score R may be calculated according to the following formula:
R=R.sub.0−(a.sub.1.Math.LR+a.sub.2.Math.LM+a.sub.3.Math.RT+a.sub.4.Math.SRT+a.sub.5.Math.FC+a.sub.6.Math.D+a.sub.7.Math.J)
(59) The target score R can vary between 0 and R.sub.0 by using different weights and indicators. A smaller difference between the target score R and the full score R.sub.0, namely, a larger target score R, indicates better QoE indicated by the target score R. Correspondingly, a smaller difference between the target score R and 0, namely, a smaller target score R, indicates poorer QoE indicated by the target score R. For example, the full score R.sub.0 may be set to 5, or may be set to another score.
(60) For example, the full score R.sub.0 is not set in this embodiment. After weighted summation is performed on the various indicators after the uniform reference unit is determined, an obtained summation score is directly used as the target score R′. In other words, R′ is calculated according to the following formula:
R′=a.sub.1.Math.LR+a.sub.2.Math.LM+a.sub.3.Math.RT+a.sub.4.Math.SRT+a.sub.5.Math.FC+a.sub.6.Math.D+a.sub.7.Math.J
(61) In this case, a larger target score R′ indicates poorer QoE indicated by R′. Correspondingly, a smaller target score R′ indicates better QoE indicated by R′.
(62) It should be noted that, in a case of a plurality of average packet receiving time intervals, an averaging value of the plurality of average packet receiving time intervals may be obtained and used in weighted summation. Alternatively, the average packet receiving time intervals each may be used in the weighted summation. A calculation manner in which the average packet receiving time interval is used in the weighted summation is not limited in this embodiment.
(63) In a possible implementation, the foregoing calculation process can be performed by using a model. To be specific, the determining QoE of the target audio and video stream based on the key indicator for the target audio and video stream includes: inputting the key indicator into a trained quality determining model; and using a score output by the quality determining model as a score of the target audio and video stream, and indicating the QoE of the target audio and video stream by using the score of the target audio and video stream.
(64) Referring to
(65) In a possible implementation, referring to
(66) When QoE indicated by the target score is relatively poor, the QoE does not meet a requirement. A case in which a higher target score indicates better QoE is used as an example. If the target score is less than a threshold, it indicates that the QoE indicated by the target score does not meet a condition. Therefore, a quality prompt message of the target audio and video stream needs to be output. For example, the quality prompt message may be “quality of a current audio and video stream is poor, and timely adjustment is required”, so that the current target audio and video stream is changed to an audio and video stream with a lower sampling rate. This ensures QoE of the target audio and video stream.
(67) In conclusion, in this embodiment, the QoE of the audio and video stream is determined by using at least one of the following indicators: the maximum quantity of continuously lost packets, the average packet receiving time interval, the average packet receiving time interval variance, and the quantity of stream interruptions, and the determined QoE is relatively accurate. In addition, weighted summation is further performed on the various indicators after a uniform reference unit is determined, and the target score is calculated based on the summation score. Then, the QoE is indicated by using the target score, so that the QoE has a relatively fine granularity.
(68) As shown in
(69) The apparatus 400 further includes a determining module 402 configured to determine a QoE of the target audio and video stream based on the key indicator for the target audio and video stream. For a function performed by the determining module 402, refer to the related descriptions of 202 shown in
(70) In a possible implementation, the obtaining module 401 is configured to collect feature information of the target audio and video stream. The feature information includes a quantity of data packets received by a receive end of the target audio and video stream in the reference time period and includes a sequence number corresponding to the data packet received by the receive end. The obtaining module 401 calculates, based on the feature information, at least one of the following indicators: the maximum quantity of continuously lost packets, the average packet receiving time interval, the average packet receiving time interval variance, and the quantity of stream interruptions, and use at least one indicator obtained through calculation as the key indicator for the target audio and video stream.
(71) In a possible implementation, the maximum quantity of continuously lost packets is used to indicate a maximum quantity of continuously lost data packets of the target audio and video stream within the reference time period, and the lost data packet is a data packet that has been sent by a transmit end of the target audio and video stream but has not been received by the receive end of the target audio and video stream.
(72) In a possible implementation, the average packet receiving time interval is used to indicate an average value of a plurality of receiving time intervals that are used for receiving the target audio and video stream and that are in any sub-time period in the reference time period, and each of the plurality of receiving time intervals is used to indicate an interval between time points for receiving two adjacent data packets.
(73) In a possible implementation, the average packet receiving time interval variance is a variance of a plurality of average packet receiving time intervals within the reference time period, and one of the plurality of average packet receiving time intervals corresponds to one sub-time period in the reference time period.
(74) In a possible implementation, the quantity of stream interruptions is a quantity of times that duration in which the receive end of the target audio and video stream receives no data packet within the reference time period is greater than a time threshold.
(75) In a possible implementation, the key indicator further includes at least one of the following indicators: a packet loss rate, an average delay, and an average jitter.
(76) In a possible implementation, the key indicator includes at least two indicators. The determining module 402 is configured to: determine a uniform reference unit for various indicators for the target audio and video stream, and perform weighted summation based on the various indicators after the uniform reference unit is determined, to obtain a summation score; and use a difference between a full score and the summation score as a score of the target audio and video stream, and indicate the QoE of the target audio and video stream by using the score of the target audio and video stream, where the full score is used to indicate an upper limit of the QoE.
(77) In a possible implementation, the determining module 402 is configured to: input the key indicator into a trained quality determining model; and use a score output by the quality determining model as a score of the target audio and video stream, and indicate the QoE of the target audio and video stream by using the score of the target audio and video stream.
(78) In a possible implementation, the apparatus 400 further includes: an alarm module, configured to generate an alarm when the QoE of the target audio and video stream does not meet a requirement.
(79) In conclusion, in this embodiment, the QoE of the audio and video stream is determined by using at least one of the following indicators: the maximum quantity of continuously lost packets, the average packet receiving time interval, the average packet receiving time interval variance, and the quantity of stream interruptions, and the determined QoE is relatively accurate. In addition, weighted summation is further performed on the various indicators after a uniform reference unit is determined, and the target score is calculated based on the summation score. Then, the QoE is indicated by using the target score, so that the QoE has a relatively fine granularity.
(80) It should be understood that, when the apparatus 400 provided in
(81) An embodiment of this application provides an electronic device. The electronic device includes a memory and a processor. The memory stores at least one instruction, and the processor loads and executes the at least one instruction to implement the method provided in any example embodiment of this application.
(82) Referring to
(83) The memory 501 stores instructions, and the processor 502 loads and executes the instructions to implement any one of the foregoing methods for determining quality of an audio and video stream.
(84) The interface 503 is used for wireless or wired communication with another device in a network. For example, the interface 503 may be a network adapter. For example, the device 500 for determining quality of an audio and video stream may communicate with a server through the interface 503.
(85) It should be understood that
(86) Further, in an optional embodiment, the memory may include a read-only memory and a random access memory, and provide an instruction and data to the processor. The memory may further include a non-volatile random access memory. For example, the memory may further store information of a device type.
(87) An embodiment of this application provides a communications apparatus. The apparatus includes a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other through an internal connection channel. The memory is configured to store instructions. The processor is configured to execute the instructions stored in the memory, to control the transceiver to receive a signal, and control the transceiver to send a signal. In addition, when the processor executes the instructions stored in the memory, the processor is enabled to perform the method provided in any one of the example embodiments of this application.
(88) Optionally, there are one or more processors and one or more memories.
(89) Optionally, the memory may be integrated with the processor, or the memory and the processor may be separately disposed.
(90) In a specific implementation process, the memory may be a non-transitory memory, such as a read-only memory (ROM). The memory and the processor may be integrated into one chip, or may be disposed in different chips. A type of the memory and a manner in which the memory and the processor are disposed are not limited in this embodiment of this application.
(91) An embodiment of this application provides a computer program product. The computer program product includes computer program code. When the computer program code is run by a computer, the computer is enabled to perform the method provided in any one of the foregoing example embodiments of this application.
(92) An embodiment of this application provides a computer-readable storage medium. The computer-readable storage medium stores programs or instructions. When the programs or the instructions are run on a computer, the method provided in any one of the example embodiments of this application is performed.
(93) An embodiment of this application provides a chip, including a processor, configured to invoke and run instructions stored in a memory, so that a communications device in which the chip is installed performs the method provided in any one of the example embodiments of this application.
(94) An embodiment of this application provides a chip, including an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected to each other through an internal connection channel. The processor is configured to execute code in the memory. When the code is executed, the processor is configured to perform the method provided in any one of the example embodiments of this application.
(95) It should be understood that the processor may be a central processing unit (CPU), or may be another general purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or another programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like. The general purpose processor may be a microprocessor, any conventional processor or the like. It should be noted that the processor may be a processor that supports an advanced RISC machines (ARM) architecture.
(96) Further, in an optional embodiment, the memory may include a read-only memory and a random access memory, and provide an instruction and data to the processor. The memory may further include a non-volatile random access memory. For example, the memory may further store information of a device type.
(97) The memory may be a volatile memory or a non-volatile memory, or may include both a volatile memory and a non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), and is used as an external cache. For example but not limitation, many forms of RAMs are available, for example, a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchlink dynamic random access memory (SLDRAM), and a direct rambus random access memory (DR RAM).
(98) This application provides computer programs. When the computer programs are executed by a computer, a processor or the computer may be enabled to perform corresponding steps and/or procedures in the foregoing method embodiments.
(99) All or some of the foregoing embodiments may be implemented by using software, hardware, firmware, or any combination thereof in the foregoing embodiments. When software is used for implementation, all or some of the embodiments may be implemented in a form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or some of the procedures or functions according to this application are generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or another programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or may be transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, an optical fiber, or a digital subscriber line) or wireless (for example, infrared, radio, or microwave) manner. The computer-readable storage medium may be any usable medium accessible by a computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, an optical disc), a semiconductor medium (for example, a solid-state drive (SSD)), or the like.