Audio and video lag detection method and electronic equipment

By adaptively adjusting the benchmark rate in electronic devices and identifying network rate fluctuations for audio and video services, the problems of high load and low accuracy in audio and video freeze detection in existing technologies are solved, achieving more efficient freeze detection.

CN120676134AActive Publication Date: 2025-09-19HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410294885.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-12
Publication Date
2025-09-19
Estimated Expiration
2044-03-12

AI Technical Summary

Technical Problem

Existing audio and video freeze detection methods have high load, low detection accuracy and complex implementation, making them unsuitable for deployment in electronic devices.

Method used

By adaptively adjusting the benchmark rate, the first and second network rates of audio and video services are counted, the fluctuation range of the network rate is identified, and whether a freeze occurs is determined.

Benefits of technology

It improves the coverage and detection accuracy of jamming tests in audio and video scenarios, reduces the load, is simple to implement, and is suitable for deployment in electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120676134A_ABST
    Figure CN120676134A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of terminals, in particular to an audio and video lag detection method and electronic equipment, and can improve the accuracy of lag detection. The method is applied to an electronic device having access to a network, and comprises the following steps: outputting data of an audio and video service; the audio and video service corresponds to a first preset rate and a second preset rate; the first preset rate is lower than the second preset rate; when the network rate of the electronic equipment is lower than a first preset rate, the audio and video service is lagged; counting a first network rate of the electronic equipment in the first time period; counting a second network rate of the electronic equipment in a second time period; the second time period is a time period after the first time period; when the second network rate is between the first preset rate and the second preset rate and the decrease amount of the second network rate exceeds a first threshold value, identifying that the audio and video service is lagged; wherein the decline amount indicates a downward fluctuation amplitude of the second network rate compared with the first network rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a method for detecting audio and video freeze and an electronic device. Background Art

[0002] With the continuous development of network information technology, electronic devices can provide users with a variety of network audio and video services. Network audio and video services are services that transmit audio and / or video data in real time over the internet. Examples of network audio and video services include: live streaming services such as watching or starting live broadcasts, audio services such as making and receiving audio calls, video services such as making and receiving video calls, and video conferencing services. Once connected to a Wi-Fi or cellular network, electronic devices are capable of providing users with a variety of network audio and video services.

[0003] Conventional technology allows electronic devices to detect playback freezes while performing network audio and video services. This allows them to switch networks in a timely manner to avoid freezes, ensuring smooth playback and providing users with a better viewing experience. However, conventional freeze detection methods suffer from inaccurate detection. Summary of the Invention

[0004] The embodiments of the present application provide an audio and video freeze detection method and electronic device, which can adaptively adjust the reference rate, thereby helping to improve the accuracy of freeze detection.

[0005] In a first aspect, a method for detecting audio and video freeze is provided, which is applied to an electronic device that has been connected to a network. The electronic device outputs data of an audio and video service, and the audio and video service corresponds to a first preset rate and a second preset rate. The first preset rate is lower than the second preset rate. When the network rate of the electronic device is lower than the first preset rate, the data output of the audio and video service freezes. In the process of outputting the data of the audio and video service, the electronic device counts the first network rate in the first time period and the second network rate in the second time period. The first network rate can reflect the network rate required for the audio and video service in the first time period, and therefore can be used as a benchmark rate for judging whether the audio and video service is frozen. When the second network rate is between the first preset rate and the second preset rate, and the decrease in the second network rate exceeds the first threshold, that is, when the amplitude of the downward fluctuation of the second network rate compared to the first network rate exceeds the first threshold, the audio and video service freeze is identified.

[0006] The electronic device can adaptively determine the real-time network rate (first network rate) in the current scenario as a reference rate. Based on this reference rate, it measures the fluctuation amplitude of the network rate to accurately identify jamming, thereby improving the jamming test coverage in audio and video scenarios and helping to improve the accuracy of jamming tests. In addition, the load is low and the implementation is simple, which is conducive to deployment in electronic devices.

[0007] In a possible implementation of the first aspect, the first network rate includes a first uplink rate and a first downlink rate, and the second network rate includes a second uplink rate and a second downlink rate. The first preset rate includes the first preset uplink rate and the first preset downlink rate, and the second preset rate includes the second preset uplink rate and the second preset downlink rate. The first threshold includes a second threshold and a third threshold. Audio and video service freeze is identified when the second uplink rate is between the first preset uplink rate and the second preset uplink rate, and the second downlink rate is between the first preset downlink rate and the second preset downlink rate, and a first decrease in the second uplink rate exceeds the second threshold and / or a second decrease in the second downlink rate exceeds the third threshold. The first decrease indicates the magnitude of the downward fluctuation of the second uplink rate compared to the first uplink rate, and the second decrease indicates the magnitude of the downward fluctuation of the second downlink rate compared to the first downlink rate. Audio and video services require not only downloading data from the internet but also uploading data to the internet. Therefore, the present application uses the first uplink rate as a reference to identify whether the fluctuation of the second uplink rate exceeds the second threshold. Based on the first downlink rate, the application also identifies whether the fluctuation of the second downlink rate exceeds the third threshold. The electronic device can identify the jam only when both the second downlink rate and the second uplink rate meet the aforementioned conditions, which can further improve the accuracy of jam identification.

[0008] In a possible implementation of the first aspect, the first network rate is a first uplink rate, the second network rate is a second uplink rate, the first preset rate is a first preset uplink rate, and the second preset rate is a second preset uplink rate. Then, when the second uplink rate is between the first preset uplink rate and the second preset uplink rate, and the decrease in the second uplink rate exceeds a first threshold, the electronic device identifies that the audio and video service is stuck. In the present application, only the uplink rate can be used to identify whether there is a freeze, which can improve recognition efficiency, reduce recognition time, reduce the amount of calculation, and thus help save power consumption.

[0009] In a possible implementation of the first aspect, the first network rate is a first downlink rate, the second network rate is a second downlink rate, the first preset rate is a first preset downlink rate, and the second preset rate is a second preset downlink rate. Then, when the second downlink rate is between the first preset downlink rate and the second preset downlink rate, and the decrease in the second downlink rate exceeds a first threshold, the electronic device identifies that the audio and video service is stuck. In the present application, only the downlink rate can be used to identify whether there is a stuck, which can improve recognition efficiency, reduce recognition time, reduce the amount of calculation, and thus help save power consumption.

[0010] In a possible implementation of the first aspect, when the second uplink rate is lower than the first preset uplink rate and / or the second downlink rate is lower than the first preset downlink rate, the audio and video service is identified as being stuck. When the second uplink rate is higher than the second preset uplink rate, and the second downlink rate is higher than the second preset downlink rate, the audio and video service is identified as not being stuck. In the present application, as long as one of the second uplink rate and the second downlink rate is lower than the corresponding preset rate, the electronic device identifies being stuck. If all of the second uplink rate and the second downlink rate are higher than the corresponding preset rates, the electronic device identifies being not stuck. This implementation provides another possible implementation of an electronic device identifying being stuck.

[0011] In a possible implementation of the first aspect, one of the second uplink rate and the second downlink rate is between the corresponding first preset rate and the second preset rate, the other second rate is higher than the corresponding second preset rate, and when the rate drop between the corresponding first preset rate and the second preset rate exceeds the corresponding threshold, the audio and video service is identified as stuck. In the present application, when the second network rate includes the second uplink rate and the second downlink rate, there is a situation where one of the second uplink rate and the second downlink rate is between the corresponding first preset rate and the second preset rate, and the other rate is higher than the corresponding second preset rate. The electronic device can calculate the drop corresponding to the rate between the corresponding first preset rate and the second preset rate, and when the drop exceeds the corresponding threshold, the electronic device identifies stuck. When the drop does not exceed the corresponding threshold, the electronic device identifies no stuck. This implementation provides another possible implementation of an electronic device identifying stuck.

[0012] In a possible implementation of the first aspect, an electronic device stores a first mapping relationship and a second mapping relationship. The first mapping relationship includes a mapping relationship between multiple continuous first uplink rate intervals and multiple second thresholds; the multiple continuous first uplink rate intervals are divided by the uplink rate interval between the first preset uplink rate and the second preset uplink rate. The second mapping relationship includes a mapping relationship between multiple continuous first downlink rate intervals and multiple third thresholds; the multiple continuous first downlink rate intervals are divided by the downlink rate interval between the first preset downlink rate and the second preset downlink rate. After counting the second network rate in the second time period, the electronic device can also determine the second threshold based on the first mapping relationship and the first uplink rate. The third threshold is determined based on the second mapping relationship and the first downlink rate. This implementation provides a possible implementation method for an electronic device to obtain the second threshold and the third threshold. The present application sets different drop thresholds for different rate intervals (the first uplink rate interval and the first downlink rate interval). The different drop thresholds can be empirical values ​​or obtained through testing, which helps to improve accuracy.

[0013] In a possible implementation of the first aspect, the electronic device may first determine, based on the first uplink rate, a first uplink rate range to which the first uplink rate belongs. Subsequently, the electronic device may determine a second threshold value based on the first uplink rate range and the first mapping relationship. The electronic device may first determine, based on the first downlink rate, a first downlink rate range to which the first downlink rate belongs. Subsequently, the electronic device may determine a third threshold value based on the first downlink rate range and the second mapping relationship. This implementation provides a possible implementation method for an electronic device to obtain the second and third threshold values ​​based on a mapping relationship.

[0014] In a possible implementation of the first aspect, the multiple second thresholds corresponding to the multiple first uplink rate intervals are different, and the second threshold increases successively as the rate increases. In this application, the lower the network rate, the smaller the allowable downward fluctuation range of the network rate (the second threshold). The higher the network rate, the larger the allowable downward fluctuation range of the network rate (the second threshold).

[0015] In a possible implementation of the first aspect, the multiple third thresholds corresponding to the multiple first downlink rate intervals are different, and the third threshold increases successively as the rate increases. In the present application, the lower the network rate, the smaller the allowable downward fluctuation range of the network rate (the third threshold). The higher the network rate, the larger the allowable downward fluctuation range of the network rate (the third threshold).

[0016] In a possible implementation of the first aspect, after the electronic device counts the first network rate in the first time period, the electronic device may first identify whether the first network rate is between the first preset rate and the second preset rate. If the first network rate is between the first preset rate and the second preset rate, the electronic device counts the second network rate in the second time period. If the first network rate is lower than the first preset rate, the electronic device identifies a freeze, and the electronic device may update the connected network and re-count the first network rate until the first network rate is between the first preset rate and the second preset rate, and then count the second network rate. If the first network rate is higher than the second preset rate, the electronic device re-counts the first network rate until the first network rate is between the first preset rate and the second preset rate, and then counts the second network rate. That is, only when the first network rate is between the first preset network rate and the second preset network rate can the first network rate be used as a reference rate for the second network rate to determine freeze.

[0017] In a possible implementation of the first aspect, the first network rate includes a first uplink rate and a first downlink rate. After calculating the first network rate for a first time period, the electronic device may first identify whether the first uplink rate is between a first preset uplink rate and a second preset uplink rate, and whether the first downlink rate is between the first preset downlink rate and the second preset downlink rate. If the first uplink rate is between the first preset uplink rate and the second preset uplink rate, and the first downlink rate is between the first preset downlink rate and the second preset downlink rate, the electronic device calculates the second network rate for the second time period. If some or all of the first uplink rate and the first downlink rate are lower than the corresponding first preset rate, the electronic device updates the connected network and recalculates the first network rate until the first network rate is between the first preset rate and the second preset rate, and then calculates the second network rate. If some or all of the first uplink rate and the first downlink rate are higher than the corresponding second preset rate, the electronic device recalculates the first network rate until the first network rate is between the first preset rate and the second preset rate. That is to say, the first uplink rate is between the first preset uplink rate and the second preset uplink rate, and the first downlink rate is between the first preset downlink rate and the second preset downlink rate. Only then can the first uplink rate be used as the benchmark rate of the second uplink rate to judge the jamming, and the first downlink rate can be used as the benchmark rate of the second downlink rate to judge the jamming.

[0018] In a possible implementation of the first aspect, after the electronic device identifies a freeze in the audio or video service, when the duration between the last time the first network rate was obtained and the current time is a preset duration, the electronic device re-counts the first network rate and the second network rate, and performs freeze detection based on the re-counted first network rate and second network rate. In the present application, the electronic device periodically counts the first network rate, adaptively modifies the reference rate, and identifies freezes at the new reference rate. It is capable of adaptively obtaining the first network rate under different clarity and / or content, and identifying freezes.

[0019] In a possible implementation of the first aspect, the second network rate of the mobile phone in the second time period is periodically counted within a preset duration. For each of the multiple second network rates periodically counted, when the second network rate is between the first preset rate and the second preset rate, and the decrease in the second network rate exceeds a first threshold, the audio and video service freeze is identified. In this application, the electronic device can set an effective duration (preset duration) for the first network rate, count the second network rate multiple times within the effective duration, and identify freezes based on the first network rate.

[0020] In one possible implementation of the first aspect, the electronic device may, after recognizing that the electronic device is executing an audio or video service, execute the freeze detection method provided in the embodiments of the present application. The electronic device may identify whether the electronic device is executing an audio or video service by identifying the current interface and / or hardware, such as a camera, microphone, or speaker, being used.

[0021] In a second aspect, the present application provides an electronic device, comprising: a memory, a communication module, and one or more processors; the communication module receives and sends data according to the control of the processor to achieve communication between the electronic device and other electronic devices; the memory and the display are coupled to the processor; wherein the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of the first aspects.

[0022] In a third aspect, the present application provides a chip system that can be applied to an electronic device including a memory. The chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected via a circuit. The interface circuit is configured to receive a signal from the memory and send the signal to the processor, the signal including a computer instruction stored in the memory. When the processor executes the computer instruction, the electronic device performs the method of the first aspect and any possible design thereof.

[0023] In a fourth aspect, the present application provides a computer-readable storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method according to the first aspect and any possible design thereof.

[0024] In a fifth aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method according to the first aspect and any possible design thereof.

[0025] It can be understood that the beneficial effects that can be achieved by the electronic device of any possible design of the second aspect, the chip system of the third aspect, the computer-readable storage medium of the fourth aspect, and the computer program product of the fifth aspect can be referred to the beneficial effects in the first aspect and any possible design thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0027] Figure 2 A schematic diagram of the software architecture of an electronic device provided in an embodiment of the present application;

[0028] Figure 3 A flowchart of a method for detecting audio or video freeze is provided in an embodiment of the present application;

[0029] Figure 4 A schematic diagram of an interface for an audio and video service provided in an embodiment of the present application;

[0030] Figure 5 A schematic diagram of an interface for another audio and video service provided in an embodiment of the present application;

[0031] Figure 6 A schematic diagram of a first time period and a second time period provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] With the continuous development of network information technology, electronic devices can provide users with a variety of online audio and video services. These services may include, for example, live streaming services such as watching or starting live broadcasts, audio services such as making or receiving audio calls, video services such as making or receiving video calls, and video conferencing services. Online audio and video services are services that transmit audio and / or video data in real time over the internet. For example, electronic devices can provide users with online audio and video services after connecting to a Wi-Fi or cellular network.

[0033] Electronic devices may experience stuttering when performing network audio and video services. Stuttering refers to the phenomenon of video freezes, screen distortion, and other playback issues when displaying an image, or stuttering when playing audio data. The cause of stuttering in electronic devices is related to the content of the video data, the parameters of the audio and / or video data (such as clarity and playback sound effects), and network quality.

[0034] In conventional technology, after detecting playback freeze, the electronic device can promptly change the network currently connected to the electronic device to provide users with a better user experience. For example, the electronic device performs a video call service based on a cellular network. The electronic device recognizes that a freeze has occurred. The electronic device can switch to a Wi-Fi network to perform a video call service based on the Wi-Fi network to avoid freezes. Alternatively, the electronic device can change the current network standard, such as switching from a fifth-generation mobile communication technology network to a fourth-generation mobile communication technology network. Alternatively, the electronic device can switch the currently connected base station.

[0035] Existing playback freeze detection methods have high load, low detection accuracy, and are complex to implement, making them unsuitable for deployment in electronic devices. Below, we use video freeze detection as an example to illustrate several common detection methods.

[0036] In some embodiments, the electronic device can analyze the difference in image information between two adjacent video frames frame by frame. If the difference in image information between the two frames is greater than a threshold, it is considered that a freeze has occurred. If the difference in image information between the two frames is less than a threshold, it is considered that no freeze has occurred. The image information can be information such as the position of a person or object in the image, the proportion of the person or object in the image, and the time point when the person or object appears in the image. The recognition accuracy of frame-by-frame analysis is high, but the load is extremely large.

[0037] In other embodiments, the electronic device can analyze whether a freeze occurs based on the time information of the electronic device calling the decoder or encoder. For example, when a user is watching a live broadcast on the Internet, the electronic device can receive video frames sent from the Internet and call the decoder to decode the video frames. The electronic device can obtain the time information of two adjacent calls to the decoder, and based on the time information of the two adjacent calls to the decoder, obtain the duration of the electronic device processing a single frame of video. The electronic device can determine whether a freeze occurs when the electronic device processes this frame of video based on the duration. For example, if the duration is greater than a threshold, it is considered that a freeze occurs. This detection method has a high load and is complex to implement. In addition, since different audio and video applications correspond to different decoders and different encoders have different durations for processing images, this method is not accurate and is not suitable for deployment in electronic devices.

[0038] In other embodiments, an electronic device can determine whether video playback has stalled based on the network speed. For example, if the electronic device's current network speed is lower than the minimum rate requirement, stalling is considered to have occurred. However, the minimum rate requirement required for audio and video playback is related to the content and / or clarity of the audio and video. For example, clarity includes high definition, standard definition, and smooth playback. The minimum rate requirement required for high definition is higher than that required for standard definition, which is higher than the minimum rate requirement required for smooth playback. Content can include, for example, gaming videos and chat videos. The minimum rate requirement required for live gaming broadcasts is higher than that required for live chat broadcasts. In particular, in live streaming scenarios, users can change the video clarity or content at any time. In other words, in audio and video services, the minimum rate requirement required for playback changes in real time with changes in clarity and content. This means that the minimum rate requirement can vary significantly within the same scenario. However, because electronic devices currently cannot obtain information such as audio and video clarity and / or content, it is impossible to determine the corresponding minimum rate requirement. Therefore, stall detection methods typically use a preset minimum rate requirement to compare with the current network speed to determine whether there is stalling.

[0039] Using this minimum rate requirement to detect freezes can lead to inaccurate identification and the inability to accurately detect freezes in real time. For example, when watching live streaming services, a mobile phone's built-in minimum rate requirement is 5Mbps. A user is watching an HD video, assuming their required minimum rate requirement is 25Mbps, and the current network speed is 10Mbps. In reality, the current network speed cannot meet the data transmission requirements, and the electronic device may experience freezes, but the device may not detect them. For another example, a mobile phone's built-in minimum rate requirement is 50Mbps. A user is watching an HD video, assuming their required minimum rate requirement is 25Mbps, and the current network speed is 35Mbps. Playback is smooth, but the phone may detect freezes. Similarly, different audio data resolutions have different minimum rates. For example, audio data resolutions can range from standard, ultra-high, and lossless, with corresponding minimum rates increasing in order. Using similar methods to detect audio freezes also presents similar issues.

[0040] To this end, an embodiment of the present application provides an audio and video freeze detection method, which is applicable to electronic devices connected to the network, and the electronic device can adaptively detect freezes. Specifically, in the process of outputting audio and video service data, since the clarity and / or content of the audio and video service changes, the electronic device can use the first network rate in the first time period as the reference threshold to calculate the amplitude of the downward fluctuation of the second network rate in the second time period. Since the first network rate can reflect the network rate required by the current audio and video service, it can be used as the minimum network requirement for determining whether the audio and video service is frozen. When the amplitude of the downward fluctuation of the second network rate exceeds the preset amplitude, the electronic device recognizes freezes. In this way, the electronic device can adaptively determine the reference rate (first network rate) and accurately identify freezes based on the fluctuation amplitude of the reference rate according to the second network rate, thereby improving the freeze test coverage in audio and video scenarios and helping to improve the accuracy of freeze tests. In addition, the load is low, the implementation is simple, and it is more suitable for deployment in electronic devices.

[0041] The method provided in the embodiment of the present application can be applied to electronic devices with data processing capabilities and display screens. The above-mentioned electronic devices may include mobile phones, tablet computers, laptops, personal computers (PCs), ultra-mobile personal computers (UMPCs), handheld computers, netbooks, smart home devices (such as smart TVs, smart screens, large screens, smart speakers, smart air conditioners, etc.), personal digital assistants (PDAs), wearable devices (such as smart watches, smart bracelets, etc.), vehicle-mounted devices, virtual reality devices, etc., and the embodiment of the present application does not impose any restrictions on this. In the embodiment of the present application, the above-mentioned electronic devices are electronic devices that can run operating systems and install applications. Optionally, the operating system running on the electronic device can be system, system, System, etc.

[0042] For example, please refer to Figure 1 , which shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, an audio module 130, a speaker 130A, a microphone 130B, a display 140, a communication module 150, a power module 160, an input device 170, a sensor module 180, a camera 190, etc. The sensor module 180 may include a pressure sensor, a touch sensor, etc.

[0043] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0044] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU). Different processing units may be independent components or integrated into one or more processors. In some embodiments, the electronic device 100 may also include one or more processors 110.

[0045] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0046] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0047] The internal memory 121 can be used to store one or more computer programs, each of which includes instructions. The processor 110 can execute the above instructions stored in the internal memory 121, thereby causing the electronic device 100 to execute the application running method provided in some embodiments of the present application, as well as various applications and data management. In some embodiments, the processor 110 can execute the instructions stored in the internal memory 121 and / or the instructions stored in the memory provided in the processor 110, so that the electronic device 100 executes the audio and video freeze detection method provided in the embodiments of the present application.

[0048] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 130, the speaker 130A, the microphone 130B, and the application processor. The speaker 130A, also known as a "speaker", is used to convert audio electrical signals into sound signals.

[0049] The microphone 130B, also called a "microphone" or "speaker", is used to convert sound signals into electrical signals. A user can speak by putting their mouth close to the microphone 130B to input the sound signal into the microphone 130B.

[0050] The communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2 and the communication module 150.

[0051] The communication module 150 can provide wireless communication solutions including cellular, Wi-Fi, Bluetooth (BT), wireless data transmission modules (e.g., 433MHz, 868MHz, 915MHz) applied to the electronic device 100. The communication module 150 can be one or more devices integrating at least one communication processing module. The communication module 150 receives electromagnetic waves via antenna 1 or antenna 2, filters and frequency modulates the electromagnetic wave signals, and sends the processed signals to the processor 110. The communication module 150 can also receive the signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through antenna 1 or antenna 2.

[0052] Electronic device 100 implements display functionality through a GPU, display screen 140, and an application processor. The GPU is a microprocessor for image processing that connects display screen 140 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0053] Display screen 140 is used to display images, videos, etc. Display screen 140 includes a display panel. In some embodiments, electronic device 100 may include one or N display screens 140, where N is a positive integer greater than 1. In the embodiments of the present application, display screen 140 may be used to display a UI and receive user operations on the UI.

[0054] The power module 160 can be used to supply power to various components included in the electronic device 100. In some embodiments, the power module 160 can be a battery, such as a rechargeable battery.

[0055] The input device 170 may include a keyboard, a mouse, etc. The keyboard is used to input English letters, numbers, punctuation marks, etc. into the electronic device 100 , thereby issuing commands to the electronic device 100 and inputting data.

[0056] The electronic device 100 can implement a shooting function through an ISP, a camera 190, a video codec, a GPU, a display screen 140, and an application processor. The ISP is used to process data fed back by the camera 190. The camera 190 is used to capture still images or videos. In some embodiments, the electronic device 100 includes 1 or N cameras 190, where N is a positive integer greater than 1. The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy. The video codec is used to compress or decompress digital video.

[0057] Take the above-mentioned electronic device 100 as an example, which is a mobile phone. The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes the Android system of the layered architecture as an example to illustrate the software structure of the electronic device 100. The software structure is as follows: Figure 2 shown.

[0058] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into six layers: application layer, application framework layer, system library layer, and kernel layer, from top to bottom.

[0059] Among them, the application layer can include a series of application packages.

[0060] like Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, social networking and other applications.

[0061] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 2 As shown, the application framework layer may include a content provider, a view system, a resource manager, a notification manager, an input system, a rate statistics module, a freeze identification module, and the like.

[0062] The input system monitors the phone's input module (such as the touchscreen driver) and converts the parameters input by the input module into usable events, passing them to the relevant upper-level modules. For example, the input system monitors the phone's touchscreen through the touchscreen driver and converts the touch parameters generated by the touch input into usable events, passing them to the upper-level app.

[0063] Content providers are used to store and retrieve data and make it accessible to applications. Data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0064] The view system includes visual controls, such as controls for displaying text and images. The view system can be used to build the display interface of an application.

[0065] The rate statistics module is configured to calculate a first network rate within a first time period while the mobile phone is operating audio and video services. The first network rate may include a first uplink rate, a first downlink rate, or both. For example, the rate statistics module may obtain the uplink rate for each second within the first time period from the communication module and calculate the rate within the first time period, which is the first uplink rate. The rate statistics module may also obtain the downlink rate for each second within the first time period from the communication module and calculate the rate within the first time period, which is the first downlink rate.

[0066] The rate statistics module can also count a second network rate within a second time period. The second network rate can be a second uplink rate, a second downlink rate, or a second uplink rate and a second downlink rate. For example, the rate statistics module can obtain the uplink rate for each second within the second time period from the communication module and count the rate within the second time period, which is the second uplink rate. The rate statistics module can also obtain the downlink rate for each second within the second time period from the communication module and count the rate within the second time period, which is the second downlink rate.

[0067] The communication module may be a hardware module for controlling the reception and transmission of audio and video data.

[0068] The jam identification module is used to identify jams based on a first network rate in a first time period and a second network rate in a second time period.

[0069] The notification manager enables applications to display notification information in the status bar, which can be used to convey informational messages and disappear automatically after a short stay without user interaction.

[0070] The Android Runtime consists of core libraries and a virtual machine (VM). The Android Runtime is responsible for scheduling and management of the Android system. The core libraries consist of two parts: one containing the Java language's callable functions and the other the Android core library. The application layer and the application framework layer run in the VM. The VM executes the Java files in the application layer and application framework layer as binary files. The VM is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0071] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0072] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0073] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0074] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0075] A 2D graphics engine is a drawing engine for 2D drawings.

[0076] The core layer may include touch screen driver, display driver, sensor driver and audio driver, etc.

[0077] Taking a mobile phone as an example, the following describes an audio and video freeze detection method and an electronic device provided by an embodiment of the present application in conjunction with the accompanying drawings.

[0078] Figure 3 This is a flow chart of a method for detecting audio and video freeze provided in an embodiment of the present application. Figure 3 As shown, the method may include:

[0079] S301, the mobile phone accesses the network, executes audio and video services and outputs data of the audio and video services.

[0080] The network may be a Wi-Fi network, or a cellular network (also called a mobile network), etc.

[0081] Audio and video services are those that are sensitive to real-time network rates, such as online audio and video services that require a continuous network connection. Audio and video services may include audio services, video services, live webcast services, and the like. Audio services may include services for answering or making audio calls. Video services may include services for answering or making video calls, web conference services, and the like. Live webcast services may include watching live webcasts or starting live webcasts. Data for audio and video services may be audio data and / or video data. For example, data for audio services may be audio data, and data for video services may be audio data and video data. Audio data output by a mobile phone includes audio data output by a speaker of the mobile phone or audio data output by the mobile phone through headphones, speakers, and other devices. Video data output by a mobile phone includes video data output by a display screen of the mobile phone or video data output by the mobile phone through an extended screen.

[0082] The mobile phone is installed with audio and video software, which may include a user interface (UI). The user can operate on the UI interface to trigger the mobile phone to execute audio and video services and output audio and video service data. The audio and video software may be, for example, live broadcast software, such as The audio and video software may also be various instant messaging software, such as

[0083] For example, Figure 4 As shown, in the audio call service scenario, when mobile phone A initiates a voice call to mobile phone B, mobile phone A can display a voice call interface 401, which includes information about the audio call recipient, a cancel button, a microphone switch, a speaker switch, etc. Mobile phone B can display a voice call interface 402, which includes an answer button, a hang-up button, and information about the initiator of the audio call. In response to the user clicking the answer button on interface 402 of mobile phone B, mobile phone B establishes an audio call connection with mobile phone A. After the audio call connection is successfully established, mobile phone A starts to execute the audio call service, or is called making an audio call service. Of course, mobile phone B can also start to execute the audio call service and output audio data, or is called answering the audio call service. In the embodiment of the present application, the mobile phone in S301 can include mobile phone A, can also include mobile phone B, or can also include mobile phone A and mobile phone B. That is, the devices on both sides of the audio call can use the solution in the embodiment of the present application to perform freeze detection.

[0084] In a video call service scenario, when mobile phone A initiates a video call with mobile phone B, mobile phone A may display a video call interface 403, which includes information about the video call recipient, a cancel button, a camera switch, a camera toggle switch, and more. Mobile phone B may display a video call interface 404, which includes information about the video call initiator, an answer button, a hang-up button, a camera switch, a camera toggle switch, and more. In response to the user clicking the answer button on mobile phone B's interface 404, a video call connection is established between mobile phone B and mobile phone A. After the video call connection is successfully established, mobile phone A begins executing the video call service and outputs audio and video data, also known as making a video call. Of course, mobile phone B may also execute the video call service and output audio and video data, also known as answering the video call service. The mobile phones in the embodiments of the present application may include mobile phone A, mobile phone B, or both mobile phone A and mobile phone B. That is, both devices on the video call can implement freeze detection using the solution in the embodiments of the present application.

[0085] like Figure 5 As shown, in the live broadcast service scenario, exemplarily, in the live broadcast service scenario, the mobile phone can display the main interface, which can include the application icon of the live broadcast APP. In response to the user clicking the application icon, the mobile phone displays the live broadcast interface 501 or the live broadcast interface 502, and the mobile phone starts to execute the live broadcast service and output audio and video data. Exemplarily, in the live broadcast service scenario, the mobile phone can display the live broadcast interface 505. Specifically, the mobile phone can display the creation interface 503 of the live broadcast APP, which includes the start live broadcast button 504. In response to the user clicking the start live broadcast button 504, the mobile phone can display the start live broadcast interface 505, and the mobile phone starts to execute the live broadcast service and output audio and video data.

[0086] Audio and video services are sensitive to network speed. When the network speed is high, audio and video services play smoothly. When the network speed is low, audio and video services may be stuck. Therefore, in an embodiment of the present application, the mobile phone can identify whether there is a hitch based on the network speed. The network speed includes the downlink rate and the uplink rate. The downlink rate refers to the rate at which the mobile phone downloads data from the network, and the uplink rate refers to the rate at which the mobile phone uploads data to the network. The units of the uplink rate and the downlink rate can be megabits per second (Mbps). For example, while the mobile phone is performing audio and video services, the mobile phone can continue to execute S302.

[0087] S302: The mobile phone collects statistics on a first network rate within a first time period.

[0088] The first network rate may include a first uplink rate, a first downlink rate, or a first uplink rate and a first downlink rate. The following describes this solution by taking the case where the first network rate includes the first uplink rate and the first downlink rate as an example.

[0089] Optionally, S302 may also be: after the mobile phone recognizes that the mobile phone is executing the audio and video service, the mobile phone counts the first network rate within the first time period.

[0090] When the mobile phone is performing audio and video services, it can display the corresponding interface and / or call the corresponding hardware such as camera, microphone, speaker, etc. Therefore, the mobile phone can identify whether the mobile phone is performing audio and video services by identifying the current interface and / or the call status of hardware such as camera, microphone, speaker. For example, when the mobile phone is performing an audio call service, the interface displayed is as follows: Figure 4 Then, when the mobile phone recognizes interface 401 or interface 402 and recognizes that the microphone is on, the mobile phone can recognize that the audio call service is currently being executed. When the mobile phone executes the video call service, the mobile phone displays the following Figure 4 Then, when the mobile phone recognizes interface 403 or interface 404, and recognizes that the microphone state is on and the camera state is on, the mobile phone can recognize that the video call service is currently being executed. When the mobile phone executes the live broadcast service, the interface displayed on the mobile phone is as follows Figure 5 501 or 502, and the phone calls the speaker. When the phone recognizes interface 501 or 502 and recognizes that the speaker is on, the phone can recognize that the live streaming service is currently being executed. When the phone is executing the live streaming service, the phone displays an interface such as interface 505, and the phone calls the microphone and / or camera. When the phone recognizes interface 505 and recognizes that the microphone and / or camera are on, the phone recognizes that the live streaming service is currently being executed.

[0091] It should be noted that the interfaces of different audio and video software providing the above-mentioned audio and video services may be different. When implementing the solution of this application, the specific identified interface is not limited to the interface shown in the above example. The above interface is only an example.

[0092] In a specific implementation, the mobile phone can identify whether the currently displayed interface is the interface for the audio and video service based on the activity currently running on the mobile phone. The activity contains the interface that the user can see and use for interaction. When the activity is in the running state, the interface contained in the activity is displayed on the current display screen. The mobile phone can identify whether the currently running activity is the interface corresponding to the audio and video service based on the identifier of the currently running activity. For example, the identifier can be carried in the attribute information of the activity.

[0093] The mobile phone may store a whitelist containing preset identifiers for audio and video services. The whitelist includes at least one preset identifier for an audio and video service. The mobile phone may obtain identifier 1 from the attribute information of the currently running activity. If the mobile phone identifies identifier 1 as being in the whitelist, it determines that the mobile phone is currently executing an audio and video service. Furthermore, the mobile phone pre-stores a mapping relationship between preset identifiers and audio and video services. For example, the preset identifier corresponding to the audio call service may be 1, the preset identifier corresponding to the video call service may be 2, the preset identifier corresponding to the video conferencing service may be 3, the preset identifier corresponding to the live streaming service may be 4, and the preset identifier corresponding to the live streaming service may be 5. Based on the obtained preset identifier and the pre-stored mapping relationship, the mobile phone identifies the specific audio and video service currently being executed. Different audio and video services correspond to different first and second preset rates. After identifying the specific audio and video service currently being executed, the mobile phone can obtain the first and second preset rates corresponding to the audio and video service. If identifier 1 of the currently running activity is not in the whitelist, the mobile phone determines that the mobile phone is not executing an audio or video service.

[0094] The specific duration of the first time period can be M seconds, where M is an integer greater than or equal to 1. After the mobile phone recognizes that the mobile phone is performing audio or video services, the mobile phone can begin to count the first network rate within M seconds. Alternatively, the mobile phone may only begin to count the first network rate within M seconds after the mobile phone has performed audio or video services for a certain period of time. This embodiment of the present application does not specifically limit this.

[0095] For example, the mobile phone can obtain the uplink rate and downlink rate of each second. Afterwards, the mobile phone can determine the first uplink rate based on the M uplink rates. For example, the first uplink rate within M seconds can be obtained by averaging the M uplink rates. For another example, the mode of the M uplink rates can be obtained to obtain the first uplink rate within M seconds. Similarly, the mobile phone can determine the first downlink rate based on the M downlink rates. For example, the first downlink rate within M seconds can be obtained by averaging the M downlink rates. For another example, the mode of the M downlink rates can be obtained to obtain the first downlink rate within M seconds. Wherein, when M is equal to 1, the first uplink rate within the first time period can be the uplink rate of this second, and the first downlink rate within the first time period can be the downlink rate of this second.

[0096] The first network rate can reflect the network rate required for audio and video services during the first time period and can serve as the minimum rate requirement for determining whether the current audio and video services are lag-free. Specifically, the first uplink rate can reflect the minimum uplink rate requirement for audio and video services during the first time period. The first downlink rate reflects the minimum downlink rate requirement for audio and video services during the first time period. Optionally, after obtaining the first network rate, the mobile phone can further execute S303.

[0097] S303: The mobile phone identifies whether the first network rate is between a first preset rate and a second preset rate.

[0098] The audio and video service has a first preset rate and a second preset rate. The first preset rate is lower than the second preset rate. When the audio and video service is executed, if the mobile phone's network rate is lower than the first preset rate, the audio and video service will be interrupted.

[0099] Furthermore, the first preset rate may include a first preset uplink rate and / or a first preset downlink rate. The second preset rate may include a second preset uplink rate and / or a second preset downlink rate. Exemplarily, the first preset rate may be a minimum rate, and the second preset rate may be an optimal rate. The first preset uplink rate may be a minimum uplink rate, and the first preset downlink rate may be a minimum downlink rate. The second preset uplink rate may be an optimal uplink rate, and the second preset downlink rate may be an optimal downlink rate. The first uplink rate and the second uplink rate constitute an uplink rate interval, and the first downlink rate and the second downlink rate constitute a downlink rate interval.

[0100] The minimum downlink rate can be the minimum download rate required by the audio and video service, and the optimal downlink rate can be the maximum download rate required by the multimedia service. The minimum uplink rate can be the minimum upload rate required by the multimedia service, and the optimal uplink rate can be the maximum upload rate required by the multimedia service.

[0101] The first preset rate and the second preset rate can be preconfigured in the mobile phone. The first preset rate, such as the first preset uplink rate and the second preset uplink rate, and the second preset rates, such as the first preset downlink rate and the second preset downlink rate, can be empirical values. Alternatively, the first preset rate and the second preset rate can be derived from testing. An example of a possible testing method is provided below.

[0102] For example, in audio and video call scenarios, the mobile phone can continuously reduce the current uplink rate until lag occurs, and the uplink rate at the time of lag is used as the first preset uplink rate. The mobile phone can also continuously reduce the downlink rate until lag occurs, and the downlink rate at the time of lag is used as the first preset downlink rate. The second preset uplink rate and the second preset downlink rate can be preset maximum values, at which the mobile phone does not experience lag.

[0103] Taking online live streaming as an example, different video content and different video resolutions require different network speeds. Therefore, the mobile phone can determine the first preset uplink rate and first preset downlink rate for different resolutions, the first preset downlink rate and first preset uplink rate for different video content, and the first preset downlink rate and first preset uplink rate for various combinations of different resolutions and video content by reducing the network speed until lag occurs. Exemplary combinations include high-definition game live streaming, standard-definition game live streaming, smooth game live streaming, high-definition chat live streaming, standard-definition chat live streaming, and smooth chat live streaming. The mobile phone then uses the first preset downlink rate with the smallest median value among the multiple first preset downlink rates as the first preset downlink rate for watching online live streaming, and uses the first preset uplink rate with the smallest median value among the multiple first preset uplink rates as the first preset uplink rate for watching online live streaming. The second preset uplink rate and the second preset downlink rate can be preset maximum values. At the second preset uplink rate and the second preset downlink rate, the mobile phone will not experience lag regardless of whether the video content is game live streaming or chat live streaming, or whether the resolution is high-definition, standard-definition, or smooth.

[0104] For the same audio and video service, the corresponding first preset uplink rate and first preset downlink rate can be the same or different, and the second preset uplink rate and second preset downlink rate can be the same or different. Specifically, audio call services, video call services, and video conferencing services not only require uploading users' audio and video data to the internet, but also require real-time downloading of audio and video data from the other end user to ensure the normal operation of the call service. That is, neither party in the call can experience any lag. Therefore, the corresponding first preset uplink rate and first preset downlink rate for these services can be the same, and the second preset uplink rate and second preset downlink rate can be the same. For example, the corresponding uplink rate range for the audio call service can be 10Mbps-500Mbps, with 10Mbps being the first preset uplink rate and 500Mbps being the second preset uplink rate. The downlink rate range can be 10Mbps-500Mbps, with 10Mbps being the first preset downlink rate and 500Mbps being the second preset downlink rate. On the other hand, live streaming services require real-time uploading of audio and video data to the internet, so the corresponding uplink rate is higher, while the downlink rate can be lower. For example, the second preset uplink rate for live streaming is higher, while the first preset uplink rate is higher. Live streaming requires real-time downloading of audio and video data from the internet, so the corresponding downlink rate is higher, while the downlink rate can be lower. For example, the second preset downlink rate for live streaming is higher, while the first preset downlink rate is higher.

[0105] As mentioned above, the audio and video service can be any one of an audio call service, a video call service, a live broadcast service, and a live broadcast service. Among them, each audio and video service includes a corresponding uplink rate interval and a downlink rate interval. The uplink rate intervals corresponding to different audio and video services may be the same or different. Specifically, different audio and video services may correspond to the same or different first preset uplink rates, and different audio and video services may correspond to the same or different second preset uplink rates. The downlink rate intervals corresponding to different audio and video services may be the same or different. Specifically, different audio and video services may correspond to the same or different first preset downlink rates, and different audio and video services may correspond to the same or different second preset downlink rates.

[0106] For example, Table 1 shows the uplink rate ranges and downlink rate ranges corresponding to different audio and video services.

[0107] Table 1

[0108]

[0109] Specifically, after identifying the audio and video service being executed by the mobile phone and calculating the first network rate, such as the first uplink rate and the first downlink rate, the mobile phone can determine whether the first uplink rate is between the first preset uplink rate and the second preset uplink rate corresponding to the currently executed audio and video service, and whether the first downlink rate is between the first preset downlink rate and the second preset downlink rate corresponding to the currently executed audio and video service. If the first uplink rate is between the first preset uplink rate and the second preset uplink rate, and the first downlink rate is between the first preset downlink rate and the second preset downlink rate, the mobile phone can execute S304. If the first uplink rate is not between the first preset uplink rate and the second preset uplink rate, and / or the first downlink rate is not between the first preset downlink rate and the second preset downlink rate, the mobile phone can re-execute S302 and S303 until the first downlink rate is between the first preset downlink rate and the second preset downlink rate, and the first downlink rate is between the first preset downlink rate and the second preset downlink rate, and then the mobile phone executes S304.

[0110] The situation where the first uplink rate is not between the first preset uplink rate and the second preset uplink rate, and / or the first downlink rate is not between the first preset downlink rate and the second preset downlink rate includes: any one of the first uplink rate and the second uplink rate or all of the rates are not between the corresponding first preset rate and the second preset rate. For example, the first uplink rate and the first downlink rate are both lower than the first preset rate. For another example, the first uplink rate and the first downlink rate are both higher than the second preset rate. For another example, of the first uplink rate and the second uplink rate, one rate is between the corresponding first preset rate and the second preset rate, and the other rate is lower than the corresponding first preset rate. For another example, of the first uplink rate and the second uplink rate, one rate is between the corresponding first preset rate and the second preset rate, and the other rate is higher than the corresponding second preset rate.

[0111] If part or all of the first uplink rate and the first downlink rate are lower than the first preset rate, the mobile phone may first switch to the currently connected network and re-execute S302 and S303. If part or all of the first uplink rate and the first downlink rate are higher than the second preset rate, the mobile phone may directly re-execute S302 and S303.

[0112] Optionally, the first network rate may be the first uplink rate, the first preset rate may be the first preset uplink rate, and the second preset rate may be the second preset uplink rate. S303 may specifically include: the mobile phone identifying whether the first uplink rate is between the first preset uplink rate and the second preset uplink rate. If the first uplink rate is between the first preset uplink rate and the second preset uplink rate, the mobile phone may execute S304. If the first uplink rate is not between the first preset uplink rate and the second preset uplink rate, the mobile phone may re-execute S302 and S303 until the first uplink rate is between the first preset uplink rate and the second preset uplink rate, at which point the mobile phone executes S304. The first uplink rate not being between the first preset uplink rate and the second preset uplink rate includes: the first uplink rate being lower than the first preset uplink rate, or the first uplink rate being higher than the second preset uplink rate. If the first uplink rate is lower than the first preset uplink rate, the mobile phone may update the connected network and re-execute S302 and S303 until the first uplink rate is between the first preset uplink rate and the second preset uplink rate, at which point the mobile phone executes S304. When the first uplink rate is higher than the second preset uplink rate, the mobile phone may not update the connected network, and the mobile phone may directly re-execute S302 and S303 until the first uplink rate is between the first preset uplink rate and the second preset uplink rate, and then execute S304.

[0113] Optionally, the first network rate may be a first downlink rate, the first preset rate may be a first preset uplink rate, and the second preset rate may be a second preset downlink rate. S303 may specifically include: the mobile phone identifying whether the first downlink rate is between the first preset downlink rate and the first preset downlink rate. If the first downlink rate is between the first preset downlink rate and the second preset downlink rate, the mobile phone may execute S304. If the first downlink rate is not between the first preset downlink rate and the second preset downlink rate, the mobile phone may re-execute S302 and S303 until the first downlink rate is between the first preset downlink rate and the second preset downlink rate, at which point the mobile phone executes S304. The situation where the first downlink rate is not between the first preset downlink rate and the second preset downlink rate includes: the first downlink rate is lower than the first preset downlink rate, or the first downlink rate is higher than the second preset downlink rate. If the first downlink rate is lower than the first preset downlink rate, the mobile phone may update the connected network and re-execute S302 and S303 until the first downlink rate is between the first preset downlink rate and the second preset downlink rate, at which point S304 is executed. When the first downlink rate is higher than the second preset downlink rate, the mobile phone may not update the connected network, and the mobile phone may directly re-execute S302 and S303 until the first downlink rate is between the first preset downlink rate and the second preset downlink rate, and then execute S304.

[0114] S304: When the first network rate is between the first preset rate and the second preset rate, the mobile phone collects statistics of the second network rate in the second time period.

[0115] The second network rate may include a second uplink rate, a second downlink rate, a second uplink rate and a second downlink rate. The following takes the second network rate including the second uplink rate and the second downlink rate as an example to introduce this solution.

[0116] The second time period may be a time period after the first time period. The second time period may be continuous with the first time period. For example, Figure 6 As shown in a, the first time period may be from the 1st second to the 15th second, and the second time period may be from the 16th second to the 18th second. Alternatively, the second time period may be discontinuous with the first time period. For example, the first time period may be from the 1st second to the 15th second, and the second time period may be from the 19th second to the 22nd second. This embodiment of the present application does not specifically limit this.

[0117] The specific duration of the second time period can be N seconds, where N is an integer greater than or equal to 1. The duration of the second time period can be the same as or different from the duration of the first time period. For example, N and M are both 10. Alternatively, N is 20 and M is 10. Optionally, M is greater than N. For example, N is 5 and M is 30. Optionally, N and M are both 1.

[0118] For example, the mobile phone can obtain the uplink rate and downlink rate of each second. Afterwards, the mobile phone can determine the second uplink rate based on the N uplink rates. For example, the second uplink rate within N seconds can be obtained by averaging the N uplink rates. For another example, the second uplink rate within N seconds can be obtained by taking the mode of the N uplink rates. Similarly, the mobile phone can determine the second downlink rate based on the N downlink rates. For example, the second downlink rate within N seconds can be obtained by averaging the N downlink rates. For another example, the second downlink rate within N seconds can be obtained by taking the mode of the N downlink rates. When N is equal to 1, the second uplink rate of the second time period can be the uplink rate of this second, and the second downlink rate of the second time period can be the downlink rate of this second.

[0119] After determining the second network rate, the mobile phone may continue to identify whether there is a freeze based on the second network rate, the first network rate, the first preset rate, and the second preset rate.

[0120] S305: The mobile phone identifies whether the second network rate is between the first preset rate and the second preset rate.

[0121] Specifically, the mobile phone identifies whether the second uplink rate is between the first preset uplink rate and the second preset uplink rate, and whether the second downlink rate is between the first preset downlink rate and the second preset downlink rate. If the second uplink rate is between the first preset uplink rate and the second preset uplink rate, and the second downlink rate is between the first preset downlink rate and the second preset downlink rate, the mobile phone may execute S306.

[0122] Optionally, the second network rate may be a second uplink rate, and S305 may specifically be: the mobile phone identifies whether the second uplink rate is between the first preset uplink rate and the second preset uplink rate. If the second uplink rate is between the first preset uplink rate and the second preset uplink rate, the mobile phone may execute S306.

[0123] Optionally, the second network rate may be a second downlink rate, and S305 may specifically be: the mobile phone identifies whether the second downlink rate is between the first preset downlink rate and the first preset downlink rate. If the second downlink rate is between the first preset downlink rate and the first preset downlink rate, the mobile phone may execute S306.

[0124] S306: If the second network rate is between the first preset rate and the second preset rate, the mobile phone calculates a decrease in the second network rate.

[0125] Specifically, if the second uplink rate is between the first preset uplink rate and the second preset uplink rate, and the second downlink rate is between the first preset downlink rate and the second preset downlink rate, the mobile phone calculates a first decrease in the second uplink rate and a second decrease in the second downlink rate.

[0126] The first decrease can be equal to the difference between the second uplink rate and the first uplink rate. The second decrease can be equal to the difference between the second downlink rate and the first downlink rate. That is, using the first uplink rate M seconds before N seconds as the reference rate, the amplitude of the downward fluctuation of the second uplink rate relative to the reference rate over N seconds is calculated. Using the first downlink rate M seconds before N seconds as the reference, the amplitude of the downward fluctuation of the second downlink rate relative to the reference rate over N seconds is calculated.

[0127] Optionally, the first decrease amount may be a ratio, for example, the first decrease amount may be the ratio of the difference between the second downlink rate and the first downlink rate to the first downlink rate. The second decrease amount may be a ratio, for example, the second decrease amount may be the ratio of the difference between the second uplink rate and the first uplink rate to the first uplink rate. A downward fluctuation in the second uplink rate and / or the second downlink rate may be caused by network instability, network congestion, or other reasons, which are not specifically limited in this embodiment of the present application.

[0128] Optionally, the second network rate may be a second uplink rate. In this case, S306 may specifically include: if the second uplink rate is between the first preset uplink rate and the second preset uplink rate, the mobile phone calculates a decrease in the second uplink rate. The decrease in the second uplink rate may be the first decrease, which is not further described herein.

[0129] Optionally, the second network rate may be a second downlink rate. In this case, S306 may specifically include: if the second downlink rate is between the first preset downlink rate and the first preset downlink rate, the mobile phone calculates a decrease in the second downlink rate. The decrease in the second downlink rate may be the aforementioned second decrease amount, which is not further described herein.

[0130] Afterwards, the mobile phone compares the drop amount with a threshold value to identify a freeze. Specifically, the mobile phone may continue to execute S307.

[0131] S307: When the decrease in the second network rate exceeds a first threshold, identify that the audio and video service is stuck.

[0132] The first threshold may include a second threshold and a third threshold. S306 may specifically be: identifying audio and video service freeze when the first drop in the second uplink rate exceeds the second threshold and / or the second drop in the second downlink rate exceeds the third threshold.

[0133] Specifically, if the first drop is greater than or equal to the second threshold and the second drop is greater than or equal to the third threshold, it means that the drop in the second downlink rate is higher than the preset value and the drop in the second uplink rate is higher than the preset value, then the mobile phone recognizes that a jam has occurred. Alternatively, if the first drop is greater than or equal to the second threshold and the second drop is less than the third threshold, it means that the drop in the second downlink rate is higher than the preset value, then the mobile phone recognizes that a jam has occurred. Alternatively, if the first drop is less than the second threshold and the second drop is greater than or equal to the third threshold, it means that the drop in the second uplink rate is higher than the preset value, then the mobile phone recognizes that a jam has occurred. In other words, if either the first drop or the second drop is greater than or equal to its corresponding threshold, then the mobile phone recognizes that a jam has occurred.

[0134] The second threshold is a threshold for the amount of decrease in the preset uplink rate. The third threshold is a threshold for the amount of decrease in the preset downlink rate. The second and third thresholds can be pre-configured in the mobile phone. The second and third thresholds can be specific preset values. The second and third thresholds can be fixed values ​​configured in the mobile phone. For example, the second threshold can be 30Mbps and the third threshold can be 50Mbps. Alternatively, the second threshold can be 5% and the third threshold can be 10%. The second threshold and the third threshold for the same audio and video service can be the same or different. The second thresholds corresponding to different audio and video services can be the same or different, and the third thresholds corresponding to different audio and video services can be the same or different.

[0135] Optionally, the second threshold and the third threshold are variable. Exemplarily, the mobile phone includes a first mapping relationship between an uplink rate and a second threshold. The mobile phone includes a second mapping relationship between a downlink rate and a third threshold. The mobile phone can determine the second threshold based on the first uplink rate and the first mapping relationship. The mobile phone can determine the third threshold based on the first downlink rate and the second mapping relationship.

[0136] Exemplarily, the first mapping relationship may be a mapping relationship between multiple first uplink rate intervals and multiple second thresholds. The multiple first uplink rate intervals may be continuous. The multiple first uplink rate intervals may be divided by the uplink rate interval consisting of the lowest uplink rate to the best uplink rate. The multiple first uplink rate intervals may be, for example, [lowest uplink rate, uplink rate 1], (uplink rate 1, uplink rate 2], ..., (uplink rate i-1, uplink rate i], (uplink rate i, best uplink rate].

[0137] In some embodiments, uplink rate i = lowest uplink rate + i * fixed step size. That is, starting from the lowest uplink rate, the uplink rate interval consisting of the lowest uplink rate and the best uplink rate is divided into multiple first uplink rate intervals using a fixed step size.

[0138] In other embodiments, uplink rate i = uplink rate i-1 + variable step size i. When i = 1, uplink rate i-1 is the minimum uplink rate. Optionally, variable step size 1, ..., and variable step size i increase sequentially. For example, variable step size 1, ..., and variable step size i increase sequentially in multiples. As an example, variable step size i = i * variable step size 1. For example, variable step size 1 is 100Mbps, variable step size 2 is 200Mbps, and variable step size 3 is 300Mbps, etc. As another example, variable step size i = 2i * variable step size 1. For example, variable step size 1 is 100Mbps, variable step size 2 is 400Mbps, and variable step size 3 is 600Mbps, etc. For another example, variable step size 1, ..., and variable step size i increase randomly sequentially. The embodiments of the present application do not specifically limit this. An example is given below. For example, the minimum uplink rate corresponding to the video call service is 10Mbps, and the optimal uplink rate is 1000Mbps. The multiple first uplink rate intervals are [10Mbps, 100Mbps], (100Mbps, 300Mbps], (300Mbps, 600Mbps], and (600Mbps, 1000Mbps], respectively.

[0139] Each of the multiple first uplink rate intervals has a corresponding second threshold. For example, [lowest uplink rate, uplink rate 1] corresponds to the second threshold y1, [uplink rate 1, uplink rate 2] corresponds to the second threshold y2, ..., [uplink rate i-1, uplink rate i] corresponds to the second threshold y (i-1) , [uplink rate i, optimal uplink rate] corresponds to the second threshold y i Among them, y1, ..., y i The values ​​increase successively. This is because in order to avoid the jamming caused by fluctuations in network speed, the lower the network speed, the smaller the downward fluctuation of the network speed is allowed to be. The higher the network speed, the larger the downward fluctuation of the network speed is allowed to be. Continuing with the example in the previous article, the second threshold corresponding to the first uplink speed range [10Mbps, 100Mbps] is 3%, the second threshold corresponding to [100Mbps, 300Mbps] is 8%, the second threshold corresponding to [300Mbps, 600Mbps] is 10%, and the second threshold corresponding to [600Mbps, 1000Mbps] is 15%.

[0140] The mobile phone can determine the second threshold value corresponding to the first uplink rate based on the first uplink rate obtained by statistics and the first mapping relationship. Specifically, the mobile phone can first determine the first uplink rate interval to which the first uplink rate belongs based on the first uplink rate obtained by statistics. Afterwards, the second threshold value is determined based on the first mapping relationship. Exemplarily, the mobile phone calculates the first uplink rate to be 360Mbps. The mobile phone recognizes that the first uplink rate belongs to the first uplink rate interval (300Mbps, 600Mbps]. Further, the mobile phone determines that the second threshold value corresponding to the first uplink rate interval (300Mbps, 600Mbps] is 10%.

[0141] Similarly, the second mapping relationship can be a mapping relationship between multiple first downlink rate intervals and multiple third thresholds. Among them, the multiple first downlink rate intervals can be continuous. The multiple first downlink rate intervals can be divided by the downlink rate interval consisting of the lowest downlink rate to the best downlink rate. The multiple first downlink rate intervals can be, for example, [lowest downlink rate, downlink rate 1], (downlink rate 1, downlink rate 2], ..., (downlink rate k-1, downlink rate k], (downlink rate k, best downlink rate].

[0142] In some embodiments, downlink rate k = minimum downlink rate + k * fixed step size. That is, starting from the minimum downlink rate, the numerical interval formed by the minimum downlink rate and the optimal downlink rate is divided into multiple first downlink rate intervals using a fixed step size.

[0143] In other embodiments, downlink rate k = downlink rate k-1 + variable step size k. When k = 1, downlink rate k-1 is the minimum downlink rate. Optionally, variable step sizes 1, ..., and k increase sequentially. For example, variable step sizes 1, ..., and k increase sequentially in multiples. For another example, variable step sizes 1, ..., and k increase randomly. This embodiment of the present application does not specifically limit this.

[0144] Each of the multiple first downlink rate intervals has a corresponding third threshold. For example, [lowest downlink rate, downlink rate 1] corresponds to the second threshold x1, [downlink rate 1, downlink rate 2] corresponds to the third threshold x2, ..., [downlink rate k-1, downlink rate i] corresponds to the third threshold x (k-1) , [downlink rate k, optimal downlink rate] corresponds to the third threshold x k . Among them, x1, ..., x kThe values ​​of increase successively. For example, the minimum uplink rate corresponding to watching live broadcast is 300Mbps, and the optimal uplink rate is 2500Mbps. The multiple first uplink rate intervals are [300Mbps, 400Mbps], (400Mbps, 600Mbps], (600Mbps, 1000Mbps], (1000Mbps, 1600Mbps], (1600Mbps, 1500Mbps], respectively. The corresponding third thresholds may be, for example, 3%, 6%, 10%, 13%, and 19% respectively.

[0145] The mobile phone can determine the third threshold value corresponding to the second downlink rate based on the first downlink rate obtained by statistics and the second mapping relationship. Specifically, the mobile phone can first determine the first downlink rate interval to which the first downlink rate belongs based on the statistically obtained average value of the first downlink rate. Afterwards, the third threshold value is determined based on the first mapping relationship. For example, taking watching live broadcast on the Internet as an example, the mobile phone calculates the first downlink rate to be 1600Mbps. The mobile phone recognizes that the first downlink rate belongs to the first downlink rate interval (1000Mbps, 1600Mbps]. Further, the mobile phone determines that the third threshold value corresponding to the first downlink rate interval (1000Mbps, 1600Mbps) is 13%.

[0146] Optionally, the second network rate may be a second uplink rate, and S307 may specifically be: when the decrease in the second uplink rate exceeds a first threshold, the mobile phone identifies a freeze. The first threshold may be the second threshold, and the specific implementation is not repeated here.

[0147] Optionally, the second network rate may be a second downlink rate, and S307 may specifically be: when the decrease in the second downlink rate exceeds a first threshold, the mobile phone identifies a freeze. The first threshold may be the third threshold, and the specific implementation is not repeated here.

[0148] Optionally, the above method also includes S308.

[0149] S308 : When the decrease in the second network rate does not exceed the first threshold, it is determined that the audio and video service is not stuck.

[0150] Specifically, when the first decrease amount is less than the second threshold and the second decrease amount is less than the third threshold, it is determined that the audio and video service is not stuck.

[0151] Optionally, the second network rate may be a second uplink rate, and S308 may specifically be: if the decrease in the second uplink rate does not exceed a first threshold, identifying that the audio and video service is not stuck. The first threshold may be the second threshold.

[0152] Optionally, the second network rate may be a second downlink rate, and S308 may specifically be: when a decrease in the second downlink rate does not exceed a first threshold, identifying that the audio and video service is not stuck.

[0153] That is, if the mobile phone recognizes that the second network rate is between the first preset rate and the second preset rate, the mobile phone can execute S306-S308. If the mobile phone recognizes that the second network rate is not between the first preset rate and the second preset rate, the mobile phone can execute S309-S310.

[0154] S309: The mobile phone recognizes that the second network rate is lower than the first preset rate and recognizes that the audio and video service is stuck.

[0155] Specifically, if the mobile phone recognizes that the second uplink rate is less than the first preset uplink rate and / or the second downlink rate is less than the first preset downlink rate, the mobile phone recognizes that the current audio and video service is stuck. That is, if some or all of the second uplink rate and the second downlink rate are lower than the corresponding first preset rate, the mobile phone recognizes that the audio and video service is stuck. Exemplarily, if the mobile phone recognizes that the second uplink rate is lower than the first preset uplink rate and the second downlink rate is lower than the first preset downlink rate, the mobile phone recognizes that the audio and video service is stuck. If the mobile phone recognizes that the second uplink rate is lower than the first preset uplink rate and the second downlink rate is between the first preset downlink rate and the second preset downlink rate, the mobile phone recognizes that the audio and video service is stuck. If the mobile phone recognizes that the second uplink rate is lower than the first preset uplink rate and the second downlink rate is higher than the second preset downlink rate, the mobile phone recognizes that the audio and video service is stuck. As another example, if the mobile phone recognizes that the second downlink rate is lower than the first preset downlink rate and the second uplink rate is lower than the first preset uplink rate, the mobile phone recognizes that the audio and video service is stuck. If the mobile phone recognizes that the second downlink rate is lower than the first preset downlink rate and the second uplink rate is between the first preset uplink rate and the second preset uplink rate, the mobile phone recognizes that the audio and video service is stuck. If the mobile phone detects that the second downlink rate is lower than the first preset downlink rate and the second uplink rate is higher than the second preset uplink rate, the mobile phone will detect that the audio and video service is stuck. In other words, if either the second uplink rate or the second downlink rate is lower than the minimum rate corresponding to the audio and video service, the mobile phone will determine that the current stuck has occurred.

[0156] Optionally, the second network rate may be a second uplink rate, and S309 may specifically be: the mobile phone recognizes that the second uplink rate is lower than the first preset uplink rate, and recognizes that the current audio and video service is stuck.

[0157] Optionally, the second network rate may be a second downlink rate, and S309 may specifically be: the mobile phone recognizes that the second downlink rate is lower than the first preset downlink rate, and recognizes that the current audio and video service is stuck.

[0158] S310: The mobile phone recognizes that the second network rate is higher than the second preset rate and recognizes that the audio and video services are not interrupted.

[0159] Specifically, the mobile phone recognizes that the second uplink rate is higher than the first preset uplink rate and the second downlink rate is the first preset downlink rate, and the mobile phone recognizes that the current audio and video service is not interrupted. That is, both the second uplink rate and the second downlink rate are higher than the corresponding second preset rates, and the mobile phone recognizes that the audio and video service is not interrupted.

[0160] Optionally, the second network rate may be a second uplink rate, and S310 may specifically be: the mobile phone recognizes that the second uplink rate is higher than the first preset uplink rate, and recognizes that the current audio and video service is not stuck.

[0161] Optionally, the second network rate may be a second downlink rate, and S310 may specifically be: the mobile phone recognizes that the second downlink rate is higher than a second preset downlink rate, and recognizes that the current audio and video service is not stuck.

[0162] For example, taking the live streaming service in Table 1 as an example, when the mobile phone recognizes that the live streaming service has started, the mobile phone counts the first uplink rate of M seconds as 30Mbps and the first downlink rate as 1000Mbps. Then the mobile phone counts the second uplink rate and the second downlink rate for the next N seconds. Assuming that the second uplink rate is 80Mbps, which is lower than the first preset uplink rate and / or the second downlink rate is 260Mbps, which is lower than the first preset downlink rate, the mobile phone recognizes that there is a freeze. Assuming that the second uplink rate is 1000Mbps, which is greater than the second preset uplink rate, and the second downlink rate is 2900Mbps, which is greater than the second preset downlink rate, the mobile phone recognizes that there is no freeze at present.

[0163] Optionally, in the case where the second network rate includes a second uplink rate and a second downlink rate, another possible situation is that one of the second uplink rate and the second downlink rate is between the corresponding first preset rate and the second preset rate, and the other second rate is higher than the corresponding second preset rate. For example, the second uplink rate is between the first preset uplink rate and the second preset uplink rate and the second downlink rate is higher than the second preset downlink rate. Continuing with the example of watching live broadcasts in Table 1, for example, the second uplink rate is 500Mbps and the second downlink rate is 3000Mbps. For another example, the second downlink rate is between the first preset downlink rate and the second preset downlink rate and the second uplink rate is higher than the second preset uplink rate. Continuing with the example of watching live broadcasts in Table 1, for example, the second uplink rate is 2000Mbps and the second downlink rate is 1800Mbps. In this case, the mobile phone can execute S311 (not shown in the figure).

[0164] S311: When one of the second uplink rate and the second downlink rate is between the corresponding first preset rate and the second preset rate, the other second rate is higher than the corresponding second preset rate, and the decrease in the second rate exceeds the corresponding threshold, the audio and video service is identified as being stuck.

[0165] For example, if the second uplink rate is between the first preset uplink rate and the second preset uplink rate and the second downlink rate is higher than the second preset downlink rate, the mobile phone can calculate a first decrease in the second uplink rate. If the first decrease exceeds a second threshold, the mobile phone identifies a freeze. If the first decrease does not exceed the second threshold, the mobile phone identifies no freeze.

[0166] For another example, when the second downlink rate is between the first preset downlink rate and the second preset downlink rate and the second uplink rate is higher than the second preset uplink rate, the mobile phone can calculate a second decrease in the second downlink rate. If the second decrease exceeds a third threshold, the mobile phone identifies a lag. If the second decrease does not exceed the third threshold, the mobile phone identifies no lag.

[0167] Furthermore, the mobile phone can set an effective duration for the first network rate. During the effective duration, the mobile phone can calculate the second network rate multiple times and use the first network rate as a benchmark to identify freezes. Optionally, S303 can be: periodically calculating the second network rate of the mobile phone in the second time period within a preset duration.

[0168] The preset duration may be the effective duration of the first network rate, for example, Figure 6 As shown in b, the preset duration can be 30 seconds, such as the duration from the 16th to the 45th second. Within the preset duration, the mobile phone periodically calculates the second network rate, such as obtaining the second network rate every 3 seconds. For example, the mobile phone can start counting at the 16th second. At the 18th second, the mobile phone can calculate the second network rate from the 16th to the 18th second, at the 21st second, the second network rate from the 19th to the 21st second, at the 24th second, the second network rate from the 22nd to the 24th second, and so on, until the duration between the start of counting and the current counting time reaches the preset duration. That is, within the preset duration, the mobile phone can calculate the second network rate of at least one second time period. Starting from the start of counting, the mobile phone can periodically calculate the second network rate of the mobile phone within the second time period within the preset duration, with the duration of the second time period as a period. For each of the multiple periodically obtained second network rates, the mobile phone can perform the method shown in S304-S311 to identify lag.

[0169] Furthermore, the mobile phone can periodically calculate the first network rate, adaptively modify the reference rate, and identify freezes based on the new reference rate. Optionally, the mobile phone can periodically calculate the first network rate at intervals of a preset duration. After S308, the mobile phone can also execute S312.

[0170] S312: When the time from the last time the first network rate was obtained to the current time is the preset time, the method shown in S302-S311 is re-executed.

[0171] like Figure 6 As shown in b in FIG, the preset duration is 30 seconds. The mobile phone obtains the first network rate at the 15th second. 30 seconds later, the mobile phone re-calculates the first network rate for the first time period and re-executes the method shown in S303-S311. Optionally, the mobile phone can stop executing the aforementioned jamming identification method at the 45th second and resume executing the aforementioned jamming identification method after obtaining the first network rate at the 60th second.

[0172] Optionally, the mobile phone can continue to perform the aforementioned method for identifying freezes before updating the first network rate. For example, the mobile phone can continue to measure the second network rate, such as measuring the second network rate from 46 to 48 seconds at the 48th second, and then measuring the second network rate from 58 to 59 seconds at the 60th second. The freezes can then be identified based on the second network rate and the unupdated first network rate until the mobile phone updates the first network rate.

[0173] In this way, the mobile phone can periodically execute the following operations while executing audio and video services and outputting data of the audio and video services: Figure 3 The method shown in S302-S312 in the above process is repeated until the mobile phone stops executing the audio and video service. For example, in an audio call or video call service, the call initiator or the call receiver clicks the hang-up button on the call interface, and the mobile phone stops executing the audio call or video call service. For another example, in a live broadcast scenario, specifically in a live broadcast scenario, the user exits the Figure 5 In the interface 501 or the interface 502 shown, the mobile phone stops watching the live broadcast service.

[0174] It can be seen that the embodiment of the present application provides a method for detecting audio and video freezes, in which the electronic device can adaptively adjust the reference rate (the first uplink rate and the first downlink rate), and then identify freezes based on the fluctuation of the network rate, thereby improving the coverage of freeze tests in audio and video scenarios and helping to improve the accuracy of freeze tests. This solution is based on adaptive statistics of network rates in audio and video service scenarios, and can obtain the first network rate under different clarity and / or content, identify freezes, and ultimately guide the mobile phone to optimize the network, thereby improving the user's Internet experience.

[0175] The present application embodiment provides an electronic device, which includes: a memory, a display screen, and one or more processors. The display screen is coupled to the processor. The memory is used to store computer program code. The computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can perform the various functions or steps performed by the mobile phone in the above method embodiment. The structure of the electronic device can refer to Figure 1 The structure of the electronic device 100 is shown.

[0176] The embodiment of the present application further provides a computer storage medium, which includes computer instructions. When the computer instructions are in the above electronic device (such as Figure 1 When the method is executed on the electronic device 100 shown in the figure, the electronic device is enabled to perform each function or step in the above method embodiment.

[0177] The embodiment of the present application further provides a computer program product, which, when executed on a computer, enables the computer to execute the functions or steps in the above method embodiment.

[0178] An embodiment of the present application further provides a chip system, which includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected via lines. For example, the interface circuit can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit can be used to send signals to other devices (such as a processor). Exemplarily, the interface circuit can read instructions stored in the memory and send the instructions to the processor. When the instruction is executed by the processor, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiment of the present application.

[0179] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0180] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0181] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0182] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0183] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0184] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for detecting audio and video freeze, characterized in that: Applied to an electronic device that has accessed a network, the method includes: Outputting audio and video service data; the audio and video service corresponds to a first preset rate and a second preset rate; the first preset rate is lower than the second preset rate; when the network rate of the electronic device is lower than the first preset rate, the audio and video service is interrupted; Counting a first network rate of the electronic device in a first time period; Counting a second network rate of the electronic device in a second time period, wherein the second time period is a time period after the first time period; When the second network rate is between the first preset rate and the second preset rate, and the decrease in the second network rate exceeds a first threshold, the audio and video service freeze is identified; wherein the decrease indicates the magnitude of the downward fluctuation of the second network rate compared to the first network rate.

2. The method according to claim 1, characterized in that The first network rate includes a first uplink rate and a first downlink rate, and the second network rate includes a second uplink rate and a second downlink rate; the first preset rate includes a first preset uplink rate and a first preset downlink rate, and the second preset rate includes a second preset uplink rate and a second preset downlink rate; The first threshold includes a second threshold and a third threshold; When the second network rate is between the first preset rate and the second preset rate, and a decrease in the second network rate exceeds a first threshold, identifying the audio and video service freeze includes: When the second uplink rate is between the first preset uplink rate and the second preset uplink rate, the second downlink rate is between the first preset downlink rate and the second preset downlink rate, and the first decrease in the second uplink rate exceeds the second threshold and / or the second decrease in the second downlink rate exceeds the third threshold, the audio and video service freeze is identified; wherein the first decrease indicates the amplitude of the downward fluctuation of the second uplink rate compared with the first uplink rate; and the second decrease indicates the amplitude of the downward fluctuation of the second downlink rate compared with the first downlink rate.

3. The method according to claim 2, characterized in that The method further comprises: When the second uplink rate is lower than the first preset uplink rate and / or the second downlink rate is lower than the first preset downlink rate, identifying a freeze in the audio and video service; or, When the second uplink rate is higher than the second preset uplink rate, and the second downlink rate is higher than the second preset downlink rate, identifying that the audio and video service is not interrupted; or, The audio and video service freeze is identified when one of the second uplink rate and the second downlink rate is between the corresponding first preset rate and the second preset rate, the other rate is higher than the corresponding second preset rate, and the rate drop between the corresponding first preset rate and the second preset rate exceeds the corresponding threshold.

4. The method according to any one of claims 2 to 3, characterized in that: After counting the second network rate in the second time period, the method further includes: Determining the second threshold based on a first mapping relationship and the first uplink rate; wherein the first mapping relationship includes a mapping relationship between multiple consecutive first uplink rate intervals and multiple second thresholds; the multiple consecutive first uplink rate intervals are divided by the uplink rate interval between the first preset uplink rate and the second preset uplink rate; The third threshold is determined based on a second mapping relationship and the first downlink rate; wherein the second mapping relationship includes a mapping relationship between multiple consecutive first downlink rate intervals and multiple third thresholds; the multiple consecutive first downlink rate intervals are divided by the downlink rate interval between the first preset downlink rate and the second preset downlink rate.

5. The method according to claim 4, characterized in that The multiple second thresholds corresponding to the multiple first uplink rate intervals are different, and as the rate increases, the second threshold increases successively; the multiple third thresholds corresponding to the multiple first downlink rate intervals are different, and as the rate increases, the third threshold increases successively.

6. The method according to claim 2, characterized in that The counting of the second network rate of the electronic device in the second time period includes: When the first uplink rate is between the first preset uplink rate and the second preset uplink rate, and the first downlink rate is between the first preset downlink rate and the second preset downlink rate, the second network rate of the electronic device in the second time period is counted.

7. The method according to any one of claims 1 to 6, characterized in that The counting of the second network rate of the electronic device in the second time period includes: The second network rate of the electronic device in the second time period is periodically counted within a preset time period.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: When the duration between the last time the first network rate was counted and the current time is a preset duration, the first network rate and the second network rate are recounted, and jam detection is performed based on the recounted first network rate and the second network rate.

9. The method according to claim 1, characterized in that The first network rate is a first uplink rate, the second network rate is a second uplink rate, the first preset rate is a first preset uplink rate, and the second preset rate is a second preset uplink rate; or, The first network rate is a first downlink rate, the second network rate is a second downlink rate, the first preset rate is a first preset downlink rate, and the second preset rate is a second preset downlink rate.

10. The method according to any one of claims 1 to 9, characterized in that The audio and video service is any one of an audio call service, a video call service, a video conferencing service, and a webcast service.

11. An electronic device comprising: The electronic device includes: a memory, a communication module, and one or more processors; the communication module receives and sends data according to the control of the processor to realize communication between the electronic device and other electronic devices; the memory and the display are coupled to the processor; wherein the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1 to 10.

12. A computer-readable storage medium, characterized in that The method comprises computer instructions, which, when executed on an electronic device, enable the electronic device to execute the method according to any one of claims 1 to 10.

13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Monitoring method and detecting device for streaming media buffering

    CN109391847A

  • Method and device for detecting video lag, computer equipment and storage medium

    CN110996094A

  • Video lag prediction method and device and computer readable storage medium

    CN116684690A