Network state detection method, terminal device, and computer-readable storage medium
Through the information interaction between the baseband processor and the application processor, the data packet cache time in the cache queue is used to detect the network status, solving the problem of network congestion during video services under the cellular mobile network, and achieving more efficient audio and video data transmission.
Patent Information
- Application Number
- PCT/CN2024/096413
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-02
- Filing Date
- 2024-05-30
- Publication Date
- 2025-02-06
AI Technical Summary
When performing video services under cellular mobile networks, the uncertainty of network status leads to network congestion, which in turn affects the timely transmission of audio and video data, and causes problems such as video stuttering.
Through the information interaction between the baseband processor and the application processor, the cache duration of data packets in the cache queue is used to detect the network status. The specific method includes the baseband processor reporting the cache time, the application processor judging the network status based on the cache time, and adjusting the sending code rate of the data packets or cleaning the cache queue if necessary.
It improves the timeliness and accuracy of network status detection, reduces video lag, and improves the quality of audio and video data transmission.
Smart Images

Figure CN2024096413_06022025_PF_FP_ABST
Abstract
Description
Network status detection method, terminal device and computer-readable storage medium
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on August 2, 2023, with application number 202310967619.9 and application name “Network status detection method, terminal device and computer-readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the technical field of terminal devices, and in particular to a network status detection method, a terminal device, and a computer-readable storage medium. Background Art
[0003] With the rapid development of mobile internet technology and the widespread adoption of smart devices, more and more users are using cellular mobile devices to access video services, such as video calls, outdoor live broadcasts, and online conferencing. The quality of audio and video data transmission depends heavily on the cellular network status. When the network status is poor, network congestion may occur between the terminal device and the access network equipment, making it difficult for audio and video data to be transmitted in a timely manner, which can easily lead to problems such as video freezes. Therefore, accurate and timely detection of network status is critical to ensuring video transmission quality.
[0004] Summary of the Invention
[0005] Embodiments of the present application provide a network status detection method, a terminal device, and a computer-readable storage medium, which can improve the timeliness and accuracy of network status detection through information interaction between an application processor and a baseband processor.
[0006] To achieve the above objectives, this application adopts the following technical solutions:
[0007] In a first aspect, a network status detection method is provided, which is applied to a terminal device, wherein the terminal device includes a baseband processor and an application processor; the method includes: the baseband processor sends a cache duration of data packets in a cache queue to the application processor; the cache queue is established for the baseband processor and is used to cache data packets to be sent; the application processor obtains the network status of the terminal device based on the cache duration.
[0008] Exemplarily, when the cache duration is greater than a first preset duration threshold, the network status of the terminal device is a congested state; when the cache duration is less than the first preset duration threshold, the network status of the terminal device is a normal state.
[0009] The solution provided in the first aspect above implements network status detection based on information interaction between the baseband processor and the application processor of the terminal device. Specifically, the baseband processor can report the cache duration of the data message in the cache queue to the network detection module in the application processor. After receiving the cache duration of the data message reported by the baseband processor, the network detection module can determine the uplink network status of the terminal device based on the cache duration of the data message reported by the baseband processor. Compared to implementing network status detection through message interaction between the sender and the receiver, the embodiment of the present application uses the cache status of the data message in the baseband processor to dynamically determine the network status, which can not only obtain the network quality in a timely manner, but also ensure the accuracy of the network status.
[0010] As a possible implementation, when the cache duration of a data packet in the cache queue exceeds a first preset duration threshold, the baseband processor sends the cache duration of the data packet in the cache queue to the application processor. Alternatively, after receiving a query instruction from the application processor, the baseband processor sends the cache duration of the data packet in the cache queue to the application processor. This prevents the baseband processor from frequently sending the cache duration to the application processor, effectively reducing power consumption associated with cache duration transmission.
[0011] As one possible implementation, the query command is sent when the network is congested. The application processor sends the query command to the baseband processor at a set time interval. This allows timely monitoring of network status changes by sending query commands to the baseband processor at set time intervals when the network is congested. This allows the data packet transmission rate to be adjusted accordingly, improving transmission quality.
[0012] As a possible implementation method, after the application processor obtains the network status of the terminal device based on the cache duration, the method further includes: when the network status is congested, reducing the data message transmission rate; or, when the network status is normal, increasing the data message transmission rate; wherein the congested state is a network state in which the cache duration is greater than a first preset duration threshold, and the normal state is a network state in which the cache duration is less than the first preset duration threshold. In this way, when the network status is congested, by reducing the data message transmission rate, the amount of data sent can be reduced, preventing excessive data volume from further aggravating network congestion. When the network status is normal, by increasing the data message transmission rate, the data message transmission efficiency can be improved, thereby enhancing the user experience.
[0013] As one possible implementation, the method further includes: the application processor determining an adjustment range for reducing or increasing the transmission bitrate based on the duration interval within which the buffer duration falls; different adjustment ranges correspond to different duration intervals. Thus, the transmission bitrate is adjusted based on the adjustment range corresponding to the duration interval within which the buffer duration falls, reducing the complexity of bitrate adjustment, enabling timely adaptation to network conditions, and improving the user experience.
[0014] As a possible implementation, the method further includes: the baseband processor sending a bandwidth threshold to the application processor; wherein the transmission bit rate of the data message is less than the bandwidth threshold. In this way, by sending the bandwidth threshold to the application processor, the application processor can be prevented from exceeding the bandwidth threshold when adjusting the transmission bit rate.
[0015] As a possible implementation, the method further includes: when the cache duration exceeds a second preset duration threshold, the application processor sending a purge instruction to the baseband processor; wherein the purge instruction instructs the baseband processor to purge data packets from the cache queue; and the second preset duration threshold is greater than the first preset duration threshold. In this manner, by purging data packets from the cache queue, bandwidth usage by invalid data can be reduced during network congestion, and the transmission delay of valid data can be lowered, allowing newly generated data packets to be transmitted promptly.
[0016] As a possible implementation, the method further includes: upon receiving a key frame request, the application processor sending a purge instruction to the baseband processor; wherein the purge instruction instructs the baseband processor to purge data packets from a cache queue, wherein the key frame request is sent by a data receiving device corresponding to the terminal device. In this manner, by purging data packets from the cache queue, bandwidth usage by invalid data can be reduced during network congestion, allowing the latest key frames to be sent to the recipient in a timely manner.
[0017] As a possible implementation, the method further includes: upon receiving a key frame request and the cache duration is greater than a third preset duration threshold, the application processor sending a cleanup instruction to the baseband processor; wherein the cleanup instruction is used to instruct the baseband processor to clean up data packets in the cache queue, and the key frame request is sent by the data receiving device corresponding to the terminal device. In this way, by cleaning up data packets in the cache queue based on the cache duration and key frame request, the problem of the data receiving device frequently initiating key frame requests, resulting in the deletion of re-encoded key frames before they are sent from the cache queue, can be avoided, thereby ensuring that the latest key frames can be successfully sent to the recipient.
[0018] As a possible implementation, the cleaning instruction includes message marking information, which instructs the baseband processor to clean up data messages in the cache queue that have the same message identification information. In this way, by cleaning up messages in the cache queue based on the message marking information, data messages can be accurately cleaned and resource waste can be reduced.
[0019] As a possible implementation method, the data message is an audio and video data message generated by the instant messaging software. In this way, video freeze during instant messaging can be effectively reduced.
[0020] In the second aspect, a terminal device is provided, which includes a baseband processor and an application processor; the baseband processor includes a perception and reporting module, and the application processor includes an interactive service module and a network detection module; the interactive service module is used to exchange information between the perception and reporting module and the network detection module; the perception and reporting module is used to send the cache duration of the data packets in the cache queue to the network detection module through the interactive service module, and the cache queue is established for the baseband processor and is used to cache the data packets to be sent; the network detection module is used to obtain the network status of the terminal device based on the cache duration.
[0021] The interactive service module encapsulates an interactive API interface between the baseband processor and the application layer. Exemplarily, the interactive API interface may include an information upload API interface for the perception reporting module to report information to the network detection module, and an information delivery API interface for the network detection module to deliver information to the perception reporting module.
[0022] Exemplarily, when the cache duration is greater than a first preset duration threshold, the network status of the terminal device is a congested state; when the cache duration is less than the first preset duration threshold, the network status of the terminal device is a normal state.
[0023] The solution provided in the second aspect above implements network status detection based on information interaction between the baseband processor and the application processor of the terminal device. Specifically, the baseband processor can report the cache duration of the data message in the cache queue to the network detection module in the application processor. After receiving the cache duration of the data message reported by the baseband processor, the network detection module can determine the uplink network status of the terminal device based on the cache duration of the data message reported by the baseband processor. Compared to implementing network status detection through message interaction between the sender and the receiver, the embodiment of the present application uses the cache status of the data message in the baseband processor to dynamically determine the network status, which can not only obtain the network quality in a timely manner, but also ensure the accuracy of the network status.
[0024] As one possible implementation, the sensing and reporting module is configured to send the cache duration of the data packets in the cache queue to the network detection module via the interactive service module when the cache duration of the data packets in the cache queue exceeds a first preset duration threshold; or, upon receiving a query instruction sent by the network detection module via the interactive service module, send the cache duration of the data packets in the cache queue to the network detection module via the interactive service module. This prevents the baseband processor from frequently sending the cache duration to the application processor, effectively reducing power consumption associated with cache duration transmission.
[0025] As one possible implementation, the query command is sent when the network is congested. The application processor sends the query command to the baseband processor at a set time interval. This allows timely monitoring of network status changes by sending query commands to the baseband processor at set time intervals when the network is congested. This allows the data packet transmission rate to be adjusted accordingly, improving transmission quality.
[0026] As a possible implementation method, the network detection module is also used to: reduce the sending code rate of data packets when the network state is congested; or increase the sending code rate of data packets when the network state is normal; wherein the congested state is a network state in which the cache duration is greater than a first preset duration threshold, and the normal state is a network state in which the cache duration is less than the first preset duration threshold. In this way, when the network state is congested, by reducing the sending code rate of data packets, the amount of data sent can be reduced to prevent excessive data volume from further aggravating network congestion. When the network state is normal, by increasing the sending code rate of data packets, the transmission efficiency of data packets can be improved to enhance user experience.
[0027] As one possible implementation, the network detection module is specifically configured to determine an adjustment range for reducing or increasing the sending bitrate based on the duration interval of the cache duration. Different duration intervals correspond to different adjustment ranges. This reduces the complexity of bitrate adjustment, allowing for timely adaptation to network conditions and improving the user experience.
[0028] As a possible implementation, the perception and reporting module is further configured to send a bandwidth threshold to the network detection module via the interactive service module; wherein the data packet transmission bit rate is less than the bandwidth threshold. Thus, by sending the bandwidth threshold to the application processor, the application processor can be prevented from exceeding the bandwidth threshold when adjusting the transmission bit rate.
[0029] As one possible implementation, when the cache duration exceeds a second preset duration threshold, the network detection module sends a cleanup instruction to the perception and reporting module via the interactive service module. The cleanup instruction instructs the perception and reporting module to clean up the data packets in the cache queue. The second preset duration threshold is greater than the first preset duration threshold. This cleanup of data packets in the cache queue can reduce bandwidth usage by invalid data during network congestion, lower the transmission delay of valid data, and ensure that newly generated data packets can be sent promptly.
[0030] As one possible implementation, upon receiving a key frame request, the network detection module sends a cleanup instruction to the perception and reporting module via the interactive service module. This cleanup instruction instructs the perception and reporting module to clean up the data packets in the cache queue. The key frame request is sent by the data receiving device corresponding to the terminal device. This cleanup of the data packets in the cache queue can reduce bandwidth usage by invalid data during network congestion, allowing the latest key frames to be delivered to the recipient in a timely manner.
[0031] As a possible implementation, when a key frame request is received and the cache duration is greater than a third preset duration threshold, the network detection module sends a cleanup instruction to the perception reporting module via the interactive service module. The cleanup instruction instructs the perception reporting module to clean up the data packets in the cache queue. The key frame request is sent by the data receiving device corresponding to the terminal device. In this way, by cleaning up the data packets in the cache queue based on the cache duration and key frame request, it is possible to avoid the problem of the data receiving device frequently initiating key frame requests, resulting in the re-encoded key frames being deleted before they are sent from the cache queue. This ensures that the latest key frames can be successfully sent to the recipient.
[0032] As one possible implementation, the cleanup instruction includes message marking information, instructing the sensing and reporting module to clear data packets with the same message identification information from the cache queue. By clearing messages from the cache queue based on the message marking information, data packets can be accurately cleared, reducing resource waste.
[0033] As a possible implementation method, the data message is an audio and video data message generated by the instant messaging software. In this way, video freeze during instant messaging can be effectively reduced.
[0034] In a third aspect, an electronic device is provided, comprising: a processor coupled to a memory, the processor being configured to execute a computer program stored in the memory, so that the electronic device executes the method described in any possible implementation manner in the first aspect.
[0035] According to a fourth aspect, a processor is provided, wherein the processor is configured to execute the method described in any possible implementation manner of the first aspect.
[0036] In a fifth aspect, a communication system is provided, which includes one or more terminal devices and one or more network devices.
[0037] In a sixth aspect, a computer-readable storage medium is provided, comprising: a computer program or instructions; when the computer program or instructions are run on a computer, the computer is caused to execute the method described in any possible implementation method of the first aspect.
[0038] In a seventh aspect, a computer program product is provided, comprising a computer program or instructions, which, when executed on a computer, causes the computer to execute the method described in any possible implementation of the first aspect.
[0039] In an eighth aspect, a chip system is provided, comprising a processing circuit and a storage medium storing computer program instructions; the computer program instructions, when executed by the processing circuit, implement the method of any possible implementation of the first aspect. The chip system may be composed of a chip alone, or may include a chip and other discrete components.
[0040] In a ninth aspect, a terminal device is provided, comprising a memory and one or more processors; the memory is coupled to the one or more processors, and the one or more processors are used to execute a computer program stored in the memory, so that the terminal device executes a method as in any possible implementation of the first aspect; wherein the one or more processors include a baseband processor and an application processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] FIG1 is a schematic diagram showing the principle of network status detection in conventional technology;
[0042] FIG2 is a schematic diagram of the architecture of a communication system provided in an embodiment of the present application;
[0043] FIG3 is a schematic diagram of one of the application scenarios of the communication system provided in an embodiment of the present application;
[0044] FIG4 is a second schematic diagram of an application scenario of the communication system provided in an embodiment of the present application;
[0045] FIG5 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0046] FIG6 is a schematic diagram showing one of the principles of a network status detection method according to an embodiment of the present application;
[0047] FIG7 is a second schematic diagram of the principle of the network status detection method provided in an embodiment of the present application;
[0048] FIG8 is a third schematic diagram of the principle of the network status detection method provided in an embodiment of the present application;
[0049] FIG9 is a flow chart of a method for detecting network status according to an embodiment of the present application;
[0050] FIG10 is one of the interaction sequence diagrams of the network status detection method provided in an embodiment of the present application;
[0051] FIG11 is a schematic diagram of a receiving frame rate effect according to an embodiment of the present application;
[0052] FIG12 is a fourth schematic diagram of the principle of the network status detection method provided in an embodiment of the present application;
[0053] FIG13 is a second interactive sequence diagram of the network status detection method provided in an embodiment of the present application;
[0054] FIG14 is a fifth schematic diagram of the principle of the network status detection method provided in an embodiment of the present application;
[0055] FIG15 is a third interactive sequence diagram of the network status detection method provided in an embodiment of the present application;
[0056] FIG16 is a second schematic diagram of the effect of the received frame rate provided in an embodiment of the present application;
[0057] FIG17 is a second flow chart of a network status detection method according to an embodiment of the present application;
[0058] FIG18 is a third flow chart of the network status detection method provided in an embodiment of the present application;
[0059] FIG19 is a fourth flow chart of a network status detection method according to an embodiment of the present application;
[0060] FIG20 is a fifth flow chart of the network status detection method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0062] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
[0063] Additionally, in the embodiments of this application, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as an "exemplary" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner.
[0064] As described in the background, with the rapid development of mobile internet technology and the widespread adoption of smart terminals, more and more users are using terminal devices to access video services over cellular mobile networks, such as video calls, outdoor live broadcasts, and online conferences. The quality of audio and video data transmission depends heavily on the network status of the cellular mobile network. When the network status is poor, network congestion may occur between the terminal device and the access network equipment, making it difficult for audio and video data to be transmitted in a timely manner, which can easily lead to problems such as video freezes. Therefore, accurate and timely detection of network status is critical to ensuring video transmission quality.
[0065] Currently, the detection of network quality during audio and video data transmission is mostly accomplished through the Real-time Transport Protocol (RTP) and the Real-time Transport Control Protocol (RTCP).
[0066] RTP / RTCP is a protocol standard proposed by the Internet Engineering Task Force (IETF). The corresponding RFC is RFC3550. The RTP protocol specifies a standard datagram format for transmitting audio and video over the Internet. RTP is used to provide end-to-end real-time transmission services for various multimedia data types, such as voice, images, and faxes. RTP provides timing information and stream synchronization for end-to-end real-time transmission over the Internet, but does not guarantee quality of service; this is provided by RTCP.
[0067] The types of RTCP packets include sender report (SR) and receiver report (RR), where the sender refers to an application or terminal device that sends RTP data packets, and the receiver refers to an application or terminal device that only receives RTP data packets.
[0068] The sender report (SR) consists of three parts: the first is the RTCP header, which contains information such as version, padding, length, and synchronization source identifier (SSRC). The second part is sender information, including the Network Time Protocol (NTP) timestamp, RTP timestamp, number of packets sent, and number of bytes sent. The third part is the receive report block, which carries statistical information about the continuous data stream reception, including the number of lost packets, the maximum sequence number of received data packets, arrival time jitter, the time of last SR reception, and the delay since last SR reception. The receiver report (RR) is similar to the sender report, but does not contain sender information, so it is not described here.
[0069] As shown in Figure 1, Figure 1 is a schematic diagram of the principle of network status detection in conventional technology. The sender sends RTP messages (audio and video streams) and SR messages to the receiver. The receiver receives the RTP messages and sends RR messages to the sender. The sender can calculate the packet loss rate, jitter, delay and other information through the contents of the SR messages and RR messages, so as to infer the network transmission quality and adjust the sending rate based on the inferred network quality to improve network congestion.
[0070] However, this method of network status detection relies on the message reply from the receiving end, which has a lag and the detection results are not accurate. Moreover, when the network is interrupted and the RTCP message cannot be transmitted normally, the detection mechanism fails and the sending end cannot perceive the network abnormality in time.
[0071] Based on the above problems, an embodiment of the present application provides a network status detection method, which implements network status detection based on the baseband processor and application processor of the terminal device. Among them, the baseband processor can report the cache duration of the data message in the cache queue to the network detection module in the application processor. After receiving the cache duration of the data message reported by the baseband processor, the network detection module can determine the uplink network status of the terminal device based on the cache duration of the data message reported by the baseband processor. Compared with using the message interaction between the sender and the receiver to realize network status detection, the embodiment of the present application uses the cache status of the data message in the baseband processor to dynamically determine the network status, which can not only obtain the network quality in a timely manner, but also ensure the accuracy of the network status.
[0072] To facilitate understanding, an explanation of relevant terms is given first.
[0073] Socket: Also known as "socket", applications usually send requests to the network or respond to network requests through "socket".
[0074] Quintuple: usually refers to source IP address, source port, destination IP address, destination port and transport layer protocol.
[0075] Key frame: refers to the frame that plays a decisive role among the frames that make up an animation.
[0076] The network status detection method provided in the embodiment of the present application can be applied to the communication system of the mobile communication network, such as the 4th generation (4G) mobile communication system, such as the long term evolution (LTE) system, the world-wide interoperability for microwave access (WiMAX) communication system, the fifth generation (5G) mobile communication system, such as the new radio (NR) system, and future communication systems such as the sixth generation (6G) mobile communication system. The communication system may include at least one terminal device and at least one access network device. The terminal device and the access network device can exchange information based on air interface resources, such as signaling, audio stream, or video stream.
[0077] Please refer to Figure 2, which is a schematic diagram of the architecture of a communication system applicable to the network status detection method provided in an embodiment of the present application. As shown in Figure 2, the communication system may include at least one terminal device, at least one access network device, and at least one server. A communication connection can be established between the terminal device and the access network device, and information can be exchanged between the terminal device and the access network device. A communication connection can also be established between the access network device and the server.
[0078] Taking at least one terminal device including terminal device 100a and terminal device 100b, at least one access network device including access network device 200a and access network device 200b, and at least one server including server 300a and server 300b as an example, a communication connection can be established between terminal device 100a and access network device 200a to enable information exchange between terminal device 100a and access network device 200a. A communication connection can be established between terminal device 100b and access network device 200b to enable information exchange between terminal device 100b and access network device 200b. Access network device 200a can establish a communication connection with server 300a to obtain service information from server 300a and send it to terminal device 100a, or receive service information from terminal device 100a and send it to server 300a. The access network device 200b can establish a communication connection with the server 300a to obtain information from the server 300a and send it to the terminal device 100b, or receive information from the terminal device 100b and send it to the server 300a. The terminal device 100a or the terminal device 100b can also establish a connection with the server 300b to send signaling to the server 300b or receive signaling from the server 300b. For example, the signaling can be call signaling.
[0079] In addition, the at least one server may further include a server 300c. The terminal device 100a or the terminal device 100b may further establish a connection with the server 300c to obtain from the server 300c a destination address of the server (e.g., server 300a or server 300b) corresponding to the information to be sent, such as a destination Internet Protocol (IP) address and a destination port number.
[0080] Among them, the above-mentioned access network equipment is a device located on the network side of the above-mentioned communication system, and has wireless transceiver functions or a chip or chip system that can be set in the device, used to provide network (such as cellular mobile network) services for terminal devices. The above-mentioned access network equipment includes but is not limited to various types of base stations, node B (Node B, NB), base station controller (base station controller, BSC), base transceiver station (base transceiver station, BTS), home base station (for example, home evolved NodeB, or home Node B, HNB), baseband unit (baseband unit, BBU), wireless relay node, wireless backhaul node, transmission point (transmission and reception point, TRP or transmission point, TP), etc., and can also be 5G, such as gNB in the new radio (new radio, NR) system, or transmission point (TRP or TP), one or a group of (including multiple antenna panels) antenna panels of a base station in the 5G system, or it can also be a network node constituting a gNB or transmission point, such as a baseband unit (BBU), or a distributed unit (DU), a road side unit (RSU) with base station function, etc.
[0081] The above-mentioned server is a device with data processing and data receiving and sending functions, or a chip or chip system that can be set in the device. For example, the server can be a signaling server, a server for interactive business information (such as a media server), a domain name system (DNS) server, or a terminal router system (TRS) server. Exemplarily, the signaling server may include an account management server, which can be used to perform registration, information maintenance, and information query functions of the call device; in addition, the signaling server may also include a signaling forwarding server, which is responsible for the transmission of call signaling such as calling, answering, and rejecting between devices. The media server can be used to establish a route between the media server and the end-side device, and is responsible for forwarding audio, video, and media control data between call devices. Under the framework of the RTP or RTCP protocol, the media server is responsible for forwarding RTP or RTCP messages. Both the DNS server and the TRS server can be used to provide the IP address and port number of the protocol message.
[0082] Exemplarily, the server 300a may be a server for exchanging service information, such as a media server; the server 300b may be a signaling server; and the server 300c may be a DNS server or a TRS server.
[0083] The terminal device is a terminal that accesses the above-mentioned communication system and has a wireless transceiver function or a chip or chip system that can be set at the terminal. The terminal device can also be called an access terminal, a user unit, a user station, a mobile station, a mobile station, a remote station, a remote terminal, a mobile device, a user terminal, a terminal, a wireless communication device, a user agent or a user device. The terminal device in the embodiment of the present application can be a mobile phone, a tablet computer, a computer with a wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical care, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a vehicle-mounted terminal, an RSU with terminal function, etc. The terminal device of the present application can also be a vehicle-mounted module, vehicle-mounted module, vehicle-mounted component, vehicle-mounted chip or vehicle-mounted unit that is built into the vehicle as one or more components or units. The vehicle can implement the uplink transmission method provided by the present application through the built-in vehicle-mounted module, vehicle-mounted module, vehicle-mounted component, vehicle-mounted chip or vehicle-mounted unit.
[0084] Based on the system architecture shown in Figure 2, the communication system provided by the embodiment of the present application can be applied to scenarios such as outdoor live broadcasts, video calls, and online conferences. As shown in Figure 3, Figure 3 is a schematic diagram of an outdoor live broadcast scenario. After the terminal device corresponding to the live broadcast end generates an audio and video stream, it transmits the audio and video stream to the access network device. After receiving the audio and video stream, the access network device sends the audio and video stream to the media server, so that the audio and video stream is forwarded to the terminal device corresponding to the audience end through the media server. In this way, the audience can watch the audio and video of the live broadcast end. Among them, the media server can forward the audio and video stream to the terminal device corresponding to the audience end through the access network device in the area where the audience end is located.
[0085] As shown in Figure 4, Figure 4 is a schematic diagram of a video call and online conference scenario. After the terminal device of participant 1 generates an audio and video stream, it transmits the audio and video stream to the access network device. After receiving the audio and video stream, the access network device sends the audio and video stream to the media server, which forwards the audio and video stream to the terminal device corresponding to participant 2. In this way, participant 2 can view the audio and video of participant 1. Correspondingly, when the terminal device corresponding to participant 2 generates an audio and video stream, it can also transmit the audio and video stream to the access network device through the media server. After receiving the audio and video stream, the access network device sends the audio and video stream to participant 1. In this way, participant 1 can view the audio and video of participant 2. The audio and video generated by the terminal device corresponding to participant 2 can also be transmitted to the media server through the access network device in the area.
[0086] For ease of understanding, the structure of the terminal device provided in the embodiment of the present application is described below. Please refer to Figure 5, which is a schematic diagram of the structure of the terminal device provided in the embodiment of the present application. As shown in Figure 5, the terminal device 100 includes a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, an antenna 1, an antenna 2, a mobile communication module 140, a wireless communication module 150, an audio module 160, a speaker 160A, a receiver 160B, a microphone 160C, an earphone jack 160D, a display 170, a sensor module 180, a camera 190, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0087] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal 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.
[0088] 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), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0089] The controller can be the nerve center and command center of the terminal device. It can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.
[0090] 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 access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0091] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0092] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus interfaces. The processor 110 can be coupled to the touch sensor 180K, charger, flash, camera 190, etc. through different I2C bus interfaces.
[0093] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 160 via the I2S bus to enable communication between the processor 110 and the audio module 160.
[0094] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 160 and the wireless communication module 150 can be coupled via a PCM bus interface. In some embodiments, the audio module 160 can also transmit audio signals to the wireless communication module 150 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0095] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
[0096] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 170 and the camera 190. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), and the like.
[0097] The GPIO interface can be configured via software. It can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 190, display 170, wireless communication module 150, audio module 160, sensor module 180, and the like. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
[0098] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the terminal device 100 and to transfer data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect to other terminal devices, such as AR devices.
[0099] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt a different interface connection method from the above embodiment, or a combination of multiple interface connection methods.
[0100] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 140, the wireless communication module 150, the modem processor and the baseband processor.
[0101] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0102] The mobile communication module 140 can provide wireless communication solutions including 2G / 3G / 4G / 5G applied to the terminal device 100. The mobile communication module 140 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
[0103] The mobile communication module 140 can receive electromagnetic waves via the antenna 1, filter, amplify, and perform other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 140 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 140 can be provided in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 140 can be provided in the same device as at least some of the modules of the processor 110.
[0104] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs the sound signal through the audio device or displays an image or video through the display screen 170. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 140 or other functional modules.
[0105] The wireless communication module 150 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. applied to the terminal device 100. The wireless communication module 150 can be one or more devices integrating at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 150 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0106] In some embodiments, antenna 1 of terminal device 100 is coupled to mobile communication module 140 , and antenna 2 is coupled to wireless communication module 150 , so that terminal device 100 can communicate with the network and other devices through wireless communication technology.
[0107] The terminal device 100 implements display functions through a GPU, display screen 170, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 170 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0108] The terminal device 100 can implement the shooting function through the ISP, camera 190, video codec, GPU, display screen 170 and application processor.
[0109] Video codecs are used to compress or decompress digital video. Terminal device 100 may support one or more video codecs. This allows terminal device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0110] 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 terminal 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.
[0111] The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the terminal device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0112] The terminal device 100 can implement audio functions such as music playback and recording through the audio module 160, the speaker 160A, the receiver 160B, the microphone 160C, the headphone jack 160D, and the application processor.
[0113] The audio module 160 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 160 can also be used to encode and decode audio signals. In some embodiments, the audio module 160 can be provided in the processor 110, or some functional modules of the audio module 160 can be provided in the processor 110.
[0114] Based on the structure shown in Figure 5, the embodiment of the present application takes the application processor and the baseband processor as an example to illustrate the network status detection method provided by the embodiment of the present application. Please refer to Figure 6, which is a schematic diagram of the principle of the network status detection method provided by the embodiment of the present application. As shown in Figure 6, the above-mentioned application processor is connected to the baseband processor (also known as a modem, a modem core, or a baseband chip). The above-mentioned application processor may include functions for implementing the following functional modules: an application layer, an application framework layer, a kernel layer, a driver layer, and a network interface controller (NIC) layer, wherein the application layer may include a series of application packages, such as call, music, video and other applications, and the application layer may also include encoding modules, such as audio encoding and video encoding. The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. A kernel protocol stack is built in the kernel layer, and the kernel protocol stack includes a user datagram protocol (UDP) layer, an Internet Protocol (IP) layer, and an Ethernet protocol (Ethernet) layer. The specific implementation of the kernel protocol stack can be referenced in existing technologies for kernel protocol stack implementation principles, and will not be repeated here. The driver layer includes a device driver. The network interface controller (NIC) layer includes a forwarding module for forwarding data between the application processor and the baseband processor.
[0115] The baseband processor may include functions for implementing the following functional modules: packet data convergence protocol (PDCP) layer, radio link control layer protocol (RLC) layer, medium access control (MAC) layer and physical layer (PHY).
[0116] In the instant messaging scenario, when the application generates an audio and video stream, the generated audio and video stream is encoded by the encoding module, encapsulated by the RTP protocol and the RTCP protocol and enters the kernel protocol stack. It is encapsulated in sequence by the UDP layer, IP layer and Ethernet layer in the kernel protocol stack to obtain a data message, and the data message is sent to the device driver, which is sent to the forwarding module. After receiving the data message, the forwarding module sends the data message to the baseband processor. The PDCP layer in the baseband processor sends the data message to the RLC layer. After the data message is processed in sequence by the RLC layer, the MAC layer and the PHY layer, it is sent to the access network device through the air interface. The data message is forwarded to the server by the access network device, so that the data message is forwarded to the terminal device corresponding to the recipient through the server. It can be understood that the data message is the audio and video data message generated by the instant messaging software.
[0117] Please refer to Figure 7. In an embodiment of the present application, the baseband processor can establish a cache queue based on the PDCP layer, and the data message sent by the forwarding module to the baseband processor can be placed in the cache queue for caching. After that, the PDCP layer can send the data messages in the cache queue in sequence according to the order in which the data messages are placed. When the data message is successfully sent to the access network device, the data message will be cleared from the cache queue accordingly.
[0118] In the embodiment of the present application, an entry time is generated for each data packet after it enters the cache queue. By monitoring the entry time of each data packet, the cache duration of each data packet in the cache queue can be obtained. The cache duration of each data packet in the cache queue is the difference between the current time and the entry time of the data packet entering the cache queue.
[0119] Considering that when network congestion occurs, the data transmission rate is slow, which will cause the cache time of data packets in the cache queue to become longer. Therefore, the embodiment of the present application can detect whether the network is congested by the cache time of data packets in the cache queue.
[0120] In order to obtain the cache duration of data packets in the cache queue and detect the network status based on the cache duration, in the embodiment of the present application, the application layer also includes a network detection module and an interaction toolkit (interaction SDK), and the application framework layer also includes an interaction service module. The network detection module is used to detect and adjust the network status, and the interaction service module is used to implement cross-core information exchange between the application layer and the baseband processor in the application processor.
[0121] In an embodiment of the present application, the interactive service module encapsulates an interactive API interface between the baseband processor and the application layer. Exemplarily, the interactive API interface may include an information upload API interface for the baseband processor to report information to the application layer, and an information delivery API interface for the application layer to deliver information to the baseband processor.
[0122] The interactive SDK is used to expose the interactive API interface encapsulated by the interactive service module to the application layer, so that the network detection module in the application layer can interact with the interactive service module through the interactive SDK, and then realize cross-core information interaction between the interactive service module and the baseband processor, wherein data interaction is carried out between the interactive service module and the baseband processor through the forwarding module.
[0123] Based on the terminal device architecture diagram shown in FIG7 , in an embodiment of the present application, the baseband processor can monitor the cache duration of data packets in the cache queue, determine the cache duration of the data packets in the cache queue, and then report the cache duration of the data packets in the cache queue to the interactive service module via the forwarding module. The interactive service module transparently transmits the cache duration to the network detection module in the application layer via the interactive SDK. After obtaining the cache duration, the network detection module can determine the current network status of the terminal device based on the cache duration.
[0124] For example, the cache duration of data packets in the cache queue can be monitored through the PDCP in the baseband processor, and the cache duration of data packets in the cache queue can be reported to the information upload API interface in the interactive service module through the forwarding module, and the cache duration can be transmitted to the network detection module in the application layer through the interactive SDK.
[0125] It should be noted that in the embodiment of the present application, the PDCP in the baseband processor serves as a sensing and reporting module for monitoring the cache duration of data packets in the cache queue and reporting the cache duration. Monitoring the cache duration of data packets in the cache queue and reporting the cache duration can also be implemented by other modules in the baseband processor that have sensing and reporting functions. The specific configuration can be based on actual conditions and is not specifically limited in the embodiment of the present application.
[0126] In some embodiments of the present application, after obtaining the cache duration, the network detection module can compare the cache duration with a first preset duration threshold. If the cache duration is greater than the first preset duration threshold, it can be determined that the current network state is a congested state. If the cache duration is less than or greater than the first preset duration threshold, it can be determined that the current network state is a normal state, that is, no congestion occurs.
[0127] The first preset duration threshold can be set according to the cache duration of the data message in the cache queue under normal network conditions. Exemplarily, the first preset duration threshold is greater than the cache duration of the data message in the cache queue under normal network conditions. For example, in a real-time fourth-generation mobile communication technology (4G) network, when the network state is normal, that is, when the network is not congested, the cache duration of the data message in the cache queue is less than 50ms, then the first preset duration threshold can be greater than 50ms. Preferably, the first preset duration threshold can be set to 200ms.
[0128] The specific value of the first preset duration threshold can be set according to business requirements, and is not specifically limited in the embodiment of the present application.
[0129] Considering that there are multiple data packets stored in the cache queue, and the time when each data packet enters the cache queue may be different, the cache duration of each data packet in the cache queue is different. In order to reduce complexity and improve processing efficiency, in an embodiment of the present application, the baseband processor can only report the cache duration of the data packet that first enters the current cache queue, that is, the baseband processor can only report the cache duration of the data packet that enters the current cache queue the earliest. After the network detection module obtains the cache duration of the data packet that enters the current cache queue the earliest reported by the baseband processor, it compares the cache duration with the first preset duration threshold. If the cache duration is greater than the first preset time threshold, it is determined that the current network state is a congested state. If the cache duration is less than or equal to the first preset duration threshold, it can be determined that the current network state is a normal state.
[0130] In an optional embodiment, the baseband processor can report the cache time of each data packet in the cache queue to the network detection module. After obtaining the cache time of each data packet in the cache queue, the network detection module can calculate the average cache time of each data packet to obtain the average cache time, and then compare the average cache time with a first preset time threshold. If the average cache time is greater than the first preset time threshold, it is determined that the current network state is a congested state. If the average cache time is less than or equal to the first preset time threshold, it can be determined that the current network state is a normal state.
[0131] Taking into account that the data packet at the head of the cache queue is usually the first data packet to be sent out in the cache queue, in order to reduce complexity, obtain the current network status in a timely manner, and improve processing efficiency, in an embodiment of the present application, the baseband processor can also only report the cache time of the data packet at the head of the cache queue. After the network detection module obtains the cache time of the data packet at the head of the cache queue reported by the baseband processor, the cache time of the data packet at the head of the queue is compared with the first preset time threshold. When the cache time of the data packet at the head of the queue is greater than the first preset time threshold, it can be determined that the current network is in a congested state. When the cache time of the data packet at the head of the queue is not greater than the first preset time threshold, it can be determined that the current network state is normal.
[0132] Taking into account that the baseband processor will consume power when reporting the cache duration of the data message in the cache queue to the network detection module, in order to reduce power consumption, in an embodiment of the present application, the baseband processor can transmit the cache duration of the data message in the cache queue to the network detection module when the cache duration of the data message in the cache queue is greater than the first preset duration threshold. In this way, frequent transmission of the cache duration is avoided, which can effectively reduce power consumption.
[0133] Exemplarily, the baseband processor may report the cache duration of the data packet at the head of the cache queue when the cache duration of the data packet at the head of the cache queue is greater than a first preset duration threshold.
[0134] It can be understood that when the resources and data processing capabilities of devices such as the baseband processor and application processor are sufficient, the baseband processor can also report the cache duration of the data packets in the cache queue in real time, or report the cache duration of the data packets in the cache queue according to a preset period. The specific settings can be based on actual needs.
[0135] In an embodiment of the present application, the network detection module can send a first preset duration threshold to the baseband processor through the information sending API interface in the interactive service module, so that the baseband processor can determine the transmission time point of the cache duration of the data packet in the cache queue based on the first preset duration threshold, that is, when the monitoring shows that the cache duration is greater than the first preset duration threshold, the cache duration of the data packet in the cache queue is reported to the network detection module.
[0136] To improve the quality of data transmission, in an embodiment of the present application, after the network detection module obtains the network status, it can also adjust the data packet transmission rate based on the network status so that the data volume of the data packet to be sent can meet the current network throughput, thereby improving the data transmission quality. The data packet transmission rate refers to the amount of data transmitted per unit time.
[0137] For example, if the current network state is congested, the sending code rate of the data message can be reduced to reduce the amount of data sent and prevent the excessive amount of data from further aggravating network congestion. If the current network state is normal, the sending code rate of the data message can be increased to improve the transmission efficiency of the data message and enhance the user experience.
[0138] To quickly alleviate network congestion, when reducing the data packet sending rate, the longer the buffering period, the greater the reduction in the sending rate. To improve data transmission efficiency and user experience, when increasing the data packet sending rate, the shorter the buffering period, the greater the increase in the sending rate.
[0139] In order to promptly obtain the effect of the network status after the sending code rate is adjusted, in an embodiment of the present application, after obtaining that the network status is congested, the network detection module can also start a polling thread and send a query instruction to the baseband processor at a set time interval to instruct the baseband processor to report the cache length of the data message in the cache queue.
[0140] Based on this, in an embodiment of the present application, the baseband processor may further send the cache duration of the data message in the cache queue to the network detection module after receiving the query instruction sent by the network detection module.
[0141] During the polling process, for each query, after the network detection module obtains the cache time length sent by the baseband processor, if the cache time length is still greater than the first preset time length threshold, that is, when the network status obtained by polling is still congested, the sending code rate of the data message can continue to be reduced. If the cache time length is less than the first preset time length threshold, that is, when the network congestion status obtained by polling is released, the polling thread can be terminated and the sending code rate of the data message can be increased.
[0142] In the embodiments of the present application, a terminal device has a bandwidth threshold, which is the maximum amount of data that can be transmitted per unit time. When the baseband processor sends a data packet to the access network device, it must first obtain the bandwidth authorized by the access network device for the terminal device and then transmit the data packet over the air interface according to the authorized bandwidth. This prevents the data packet transmission rate from exceeding the authorized bandwidth. The bandwidth authorized by the access network device to the terminal device is the bandwidth threshold. Therefore, when the data packet transmission rate is increased, the increased data rate cannot exceed the bandwidth threshold.
[0143] To facilitate the network detection module's adjustment of the data message transmission bit rate, in an embodiment of the present application, the baseband processor may also transmit the bandwidth threshold to the network detection module when transmitting the buffering duration to the network detection module. Accordingly, the query instruction sent by the network detection module to the baseband processor is used to instruct the baseband processor to report the buffering duration and bandwidth threshold of the data messages currently in the buffer queue.
[0144] Please refer to Figure 8. The PDCP in the baseband processor monitors the cache duration and bandwidth threshold of the data packets in the cache queue, and reports the cache duration and bandwidth threshold of the data packets in the cache queue to the interactive service module through the forwarding module. The interactive service module transmits the cache duration and bandwidth threshold to the network detection module in the application layer through the interactive SDK. After obtaining the cache duration, if the cache duration is greater than the first preset duration threshold, the network detection module can reduce the sending code rate of the data message, and can start a polling thread, and periodically send query instructions to the interactive service module through the interactive SDK. The interactive service module sends the query instructions to the PDCP in the baseband processor through the forwarding module. According to the query instruction, the PDCP reports the cache duration and bandwidth threshold of the data message in the current cache queue to the forwarding module. The forwarding module reports the cache duration and bandwidth threshold of the data message in the current cache queue to the interactive service module. The interactive service module uploads the cache duration and bandwidth threshold of the data message in the current cache queue to the network detection module through the interactive SDK. The network detection module detects the cache duration of the data message in the current cache queue. If the cache duration of the data message in the current cache queue is still greater than the first preset duration threshold, that is, the network is continuously congested, the sending code rate of the data message is reduced. If the cache duration of the data message in the current cache metric is less than the first preset duration threshold, that is, the network congestion is relieved, the polling thread is terminated, and the sending code rate of the data message is increased with the bandwidth threshold as the upper limit.
[0145] In an embodiment of the present application, the network detection module can transmit the query instruction to the baseband processor through the information delivery API interface in the interactive service module.
[0146] To facilitate the network detection module's adjustment of the data packet transmission rate, thereby promptly adapting to the network environment and improving the user experience, in this embodiment, after obtaining the data packet's buffering duration, the transmission rate adjustment range can be determined based on the duration interval in which the buffering duration falls. Different duration intervals correspond to different adjustment ranges.
[0147] Take the first preset duration threshold of 200ms as an example for explanation. When the first preset duration threshold is 200ms, the duration interval can be set to (0, 200ms), (200ms, 500ms), [500ms, 1000ms), [1000ms, +∞). When the cache duration is in the duration interval of (0, 200ms), it means that the network is not congested. Therefore, the adjustment range of the sending bit rate can be set to increase by 20%. When the cache duration is in the duration interval of (200ms, 500ms), it means that the network is not congested. Therefore, the adjustment range of the sending bit rate can be set to increase by 20%. s), it indicates that the network congestion is relatively mild. Therefore, the adjustment range of the sending bit rate can be set to decrease by 20%. When the cache time is in the time interval of [500ms, 1000ms), it indicates that the network congestion is relatively severe. Therefore, the adjustment range of the sending bit rate can be set to decrease by 40%. When the cache time is in the time interval of [1000ms, +∞), it indicates that the network congestion is very severe. Therefore, the adjustment range of the sending bit rate can be set to decrease by 60%.
[0148] As shown in Figure 9, Figure 9 is a flow chart of a network status detection method provided by an embodiment of the present application. First, the baseband processor monitors the cache duration in the cache queue. When the cache duration is greater than 200ms, the baseband processor reports the cache duration to the interactive service module. The interactive service module uploads the cache duration to the application layer. The application layer determines the cache duration. When the cache duration exceeds 200ms, a polling thread is started. Through a timer, a query instruction is sent to the baseband processor at a set time interval (such as 500ms) to determine the duration interval in which the cache duration is located. If the cache duration is within the duration interval of (200ms, 500ms), the data message transmission rate is reduced by 20%. If the cache duration is within the duration interval of [500ms, 1000ms), the data message transmission rate is reduced by 40%. If the cache duration is within the duration interval of [1000ms, +∞), the data message transmission rate is reduced by 60%.
[0149] If the cache duration obtained from polling is less than 200ms, the congestion is determined to be relieved, the polling thread is stopped, and a determination is made as to whether the data message sending rate is less than the bandwidth threshold after increasing by 20%. If so, the data message sending rate is increased by 20%. If so, the data message sending rate is adjusted to the bandwidth threshold.
[0150] In some implementations, when it is determined that the sending code rate is still less than the bandwidth threshold after increasing by 20%, the sending code rate may be increased again until the sending code rate of the data message is adjusted to the bandwidth threshold or a set code rate threshold.
[0151] It is understandable that after the application layer determines that the congestion is relieved and increases the sending bit rate, it can wait for the next report from the baseband processor. When the baseband processor monitors again and finds that the cache time of the data message in the cache queue is greater than 200ms, it will trigger the reporting process again, that is, report the cache time of the data message in the cache queue.
[0152] It should be noted that in the embodiment of the present application, a minimum sending code rate is set. During the process of polling to adjust the sending code rate, the reduced sending code rate cannot be lower than the minimum sending code rate threshold to avoid service interruption.
[0153] It is understandable that after adjusting the sending bit rate of the data message, the network detection module can send the adjusted sending bit rate to the encoding module. In this way, the encoding module can encode and send the generated audio and video stream according to the adjusted sending bit rate.
[0154] The embodiment of the present application sets the correspondence between the duration interval and the adjustment amplitude. After obtaining the cache duration of the data message, the sending code rate of the data message can be adjusted according to the adjustment amplitude corresponding to the duration interval in which the cache duration is located, so that the data transmission can better and faster adapt to the current network status, improve the quality of data transmission, and provide users with a better experience.
[0155] For ease of understanding, the network status detection method provided in the embodiment of the present application is described by taking audio and video services as an example and combining the step flow shown in FIG10 .
[0156] S101: The audio and video application is started and the baseband processor information is registered for monitoring.
[0157] Among them, when the audio and video application of the application layer is started and the audio and video service (such as video call service) begins, the network detection module in the application layer can register the baseband processor information monitoring through the interactive service module, so that the baseband processor can monitor the cache duration of the data message.
[0158] In an optional embodiment, in order to reduce power consumption, in step S101, the network detection module can also pass the first preset duration threshold to the baseband processor through the interactive service module when registering the baseband processor information monitoring. In this way, the baseband processor can report when the cache duration is greater than the first preset duration threshold during the process of monitoring the cache duration of the data message, thereby reducing the power consumption occupied by data reporting.
[0159] S102: Transmit the data message to the baseband processor.
[0160] Among them, after the audio and video application in the application layer generates audio and video streams, the generated audio and video streams are encoded and encapsulated by the RTP protocol and RTCP protocol, and then enter the kernel protocol stack. The kernel protocol stack encapsulates the data message and sends the data message to the device driver. The device driver sends it to the forwarding module, and then sends it to the perception reporting module (such as PDCP) in the baseband processor through the forwarding module.
[0161] S103: The baseband processor adds the data message to a cache queue.
[0162] S104: The baseband processor authorizes the access network device to set the bandwidth threshold.
[0163] Among them, the perception reporting module in the baseband processor can initiate a bandwidth authorization request to the access network device. After receiving the authorization request, the access network device can send the authorized bandwidth to the perception reporting module in the baseband processor, where the authorized bandwidth is the bandwidth threshold.
[0164] Taking into account that the bandwidth threshold may change with the network environment, in an embodiment of the present application, the baseband processor can complete the authorization of the bandwidth threshold with the access network device at a set time interval.
[0165] S105: Send the data packets in the buffer queue over the air interface according to the bandwidth threshold.
[0166] S106: Monitor the buffering time of the data packets in the buffer queue to determine the buffering time of the data packets in the buffer queue.
[0167] S107: Send the cache duration to the application processor.
[0168] In order to facilitate the application processor to adjust the sending of data packets, the perception reporting module in the baseband processor can also send a bandwidth threshold when sending the cache duration to the application processor.
[0169] Exemplarily, the perception reporting module in the baseband processor may transmit the cache duration and bandwidth threshold to the interactive service module, and the interactive service module may transparently transmit the cache duration and bandwidth threshold to the network detection module in the application processor.
[0170] In order to reduce power consumption during transmission of cache duration and bandwidth threshold, in some embodiments, the perception reporting module in the baseband processor can send the cache duration and bandwidth threshold in the cache queue to the application processor when the cache duration is greater than a first preset duration threshold.
[0171] S108: If the buffering time is greater than a first preset time threshold, determine that the network state is a congested state, and reduce the sending code rate of the data message.
[0172] Among them, after obtaining the cache duration and bandwidth threshold, the network detection module compares the cache duration with the first preset duration threshold. If the cache duration is greater than the first preset duration threshold, it indicates that the network is congested, and the sending bit rate of the data message is reduced to reduce the amount of data sent.
[0173] In an optional embodiment, when the cache duration is less than the first preset duration threshold, it indicates that the network status is normal. At this time, an attempt can be made to increase the data packet transmission rate to improve data transmission efficiency. It should be noted that the increased transmission rate cannot exceed the bandwidth threshold.
[0174] S109: Start the polling thread and send a query instruction to the baseband processor.
[0175] In an embodiment of the present application, after adjusting the sending code rate of the data message, a polling thread can be started to send a query instruction to the baseband processor at a set time interval to timely obtain the impact of the adjustment of the sending code rate on the network status.
[0176] After starting the polling thread, the network detection module can send a query instruction to the interactive service module, which then sends it to the baseband processor. The query instruction is used to instruct the baseband processor to feedback the cache duration and bandwidth threshold of the data packets in the current cache queue.
[0177] S110: The baseband processor sends the cache duration and bandwidth threshold of the data packets in the current cache queue to the application processor.
[0178] Among them, after receiving the query instruction, the perception reporting in the baseband processor executes the query instruction and reports the cache duration and bandwidth threshold of the data message in the current cache queue to the network detection module through the interactive service module.
[0179] S111: If the buffering time of the data message in the current buffer queue is greater than the first preset time threshold, it is determined that the network state is a congested state, and the sending code rate of the data message is continuously adjusted.
[0180] S112: If the cache duration of the data message in the current cache queue is not greater than the first preset duration threshold, determine that the network state is decongested, stop polling, and increase the sending bit rate of the data message with the bandwidth threshold as the upper limit.
[0181] Among them, after obtaining the cache time length fed back by the baseband processor according to the query instruction, the network detection module compares the cache time length with the first preset time length threshold. If the cache time length of the data message in the current cache queue is greater than the first preset time length threshold, it is determined that the network state is a congested state, and the sending code rate of the data message continues to be adjusted. If the cache time length of the data message in the current cache queue is not greater than the first preset time length threshold, it is determined that the network state is decongested, polling is stopped, and the sending code rate of the data message is increased with the bandwidth threshold as the upper limit.
[0182] The embodiment of the present application realizes cross-core information interaction between the application layer and the baseband processor in the application processor by adding a network detection module and an interactive SDK in the application layer and an interactive service module in the application framework layer. In this way, the baseband processor can directly report the cache duration of the data message in the cache queue to the network detection module in the application processor. After receiving the cache duration of the data message reported by the baseband processor, the network detection module can realize network status detection according to the cache duration reported by the baseband processor, thereby improving the timeliness and accuracy of network detection.
[0183] At the same time, the embodiments of the present application adjust the data message transmission bit rate based on the data message cache duration reported by the baseband processor, allowing the transmission of data messages to adapt to network conditions in a timely manner, thereby improving the quality of data transmission. Applying the technical solutions provided by the embodiments of the present application to video call services in high-speed scenarios, such as video calls on high-speed trains, can improve video call clarity by 30%, increase the received frame rate by 70%, and reduce video freezes by 10%.
[0184] As shown in Table 1, Table 1 shows the index values obtained through testing of the call quality of the video call service in a high-speed scenario. It can be seen from Table 1 that, compared with the conventional technical solution, the embodiment of the present application has an improvement in the proportion of video clarity resolution above 720 and the proportion of receiving frame rate above 11, a decrease in the sending delay, and a more obvious improvement in the receiving frame rate, as shown in Figure 11. (a) in Figure 11 is a receiving frame rate diagram of the embodiment of the present application, and (b) in Figure 11 is a receiving frame rate diagram of the conventional technical solution.
[0185] Table 1
[0186] The embodiment of the present application adjusts the sending bit rate of the data message according to the network status, so that the data volume of the data message to be sent can fluctuate within a small range of the current network throughput. In scenarios such as video calls, it can ensure that the video receiving end can watch the video uninterruptedly and smoothly, thereby improving call quality and viewing experience.
[0187] In order to further improve the quality of data transmission in a state of network congestion, the embodiment of the present application can also clear the data packets in the cache queue when the network is congested, thereby reducing the bandwidth occupied by invalid data and reducing the transmission delay of valid data.
[0188] In some embodiments of the present application, the network detection module of the application layer detects the cache duration after obtaining the cache duration of the data message in the cache queue reported by the baseband processor. If the cache duration is greater than the second preset duration threshold, a clearing instruction can be sent to the baseband processor to instruct the baseband processor to clear the data message in the cache queue.
[0189] Among them, the second preset time threshold is greater than the first preset time threshold. The second preset time threshold can be set based on business needs. For example, in a video call scenario, the second preset time threshold can be set between 2s and 3s. For example, if the second preset time threshold is 3s, when it exceeds 3s, the data packets in the cache queue still cannot be transmitted normally, then the data packets in the cache queue can be cleared so that the latest audio and video data packets can be sent in time.
[0190] As shown in Figure 12, when the network detection module detects that the cache time of the data message reported by PDCP is greater than the second preset time threshold after obtaining the cache time, it can send a cleanup instruction to the interactive service module through the interactive SDK. The interactive service module transmits the cleanup instruction to the PDCP in the baseband processor. After receiving the cleanup instruction, the PDCP can execute the cleanup instruction to clean up the data messages in the cache queue.
[0191] For ease of understanding, the network status detection method provided in the embodiment of the present application is described by taking audio and video services as an example and combining the step flow shown in FIG13 .
[0192] S201: The audio and video application is started and the baseband processor information is registered for monitoring.
[0193] S202: Transmit the data message to the baseband processor.
[0194] S203: The baseband processor adds the data message to a cache queue.
[0195] S204: The baseband processor authorizes the access network device to set the bandwidth threshold.
[0196] S205: Send the data packets in the buffer queue over the air interface according to the bandwidth threshold.
[0197] S206: Monitor the buffering time of the data packets in the buffer queue to determine the buffering time of the data packets in the buffer queue.
[0198] S207: Send the cache duration to the application processor.
[0199] Among them, steps S201 to S207 can refer to steps S101 to S107 and are not described in detail here.
[0200] S208: If the cache duration is greater than a second preset duration threshold, a clearing instruction is sent to the baseband processor.
[0201] Among them, after obtaining the cache duration, the network detection module in the application processor compares the cache duration with the second preset duration threshold. If the cache duration is greater than the second preset threshold, a cleanup instruction is sent to the interactive service module, and the interactive service module transmits the cleanup instruction to the perception upload module in the baseband processor.
[0202] S209: The baseband processor clears the data messages in the cache queue according to the clearing instruction.
[0203] Among them, after receiving the cleaning instruction, the perception reporting module in the baseband processor can execute the cleaning and clean up the data messages in the cache queue.
[0204] In order to reduce data loss, in an optional embodiment, after obtaining the cache duration, the network detection module compares the cache duration with a first preset duration threshold and a second preset duration threshold. If the cache duration is greater than the second preset duration threshold, a cleanup instruction is sent to the baseband processor to instruct the baseband processor to clean up the data packets in the cache queue. If the cache duration is less than or equal to the second preset duration threshold and greater than the first preset duration threshold, the data packet transmission rate can be adjusted first and the polling thread is started. During the polling process, for each query, if the cache duration is greater than the second preset duration threshold, a cleanup instruction is sent to the baseband processor to instruct the baseband processor to clean up the data packets in the cache queue. If the cache duration is less than or equal to the second preset duration threshold and greater than the first preset duration threshold, the transmission rate is adjusted. If the cache duration is less than or equal to the first preset duration threshold, the polling is terminated and the data packet transmission rate is increased. The increased transmission rate cannot exceed the bandwidth threshold. In this way, when network congestion occurs, it can be adjusted by adjusting the bit rate and cleaning up the packets to improve the quality of data transmission and enhance the user experience.
[0205] In audio and video scenarios, when network congestion occurs, key frames may be lost or incomplete during transmission, resulting in the receiving device being unable to successfully decode the key frame. After the receiving device fails to decode the key frame, it sends a key frame request to the sender, indicating that the key frame needs to be resent. Upon receiving the key frame request, the sender re-encodes the key frame and sends it to the receiving device.
[0206] In order to ensure that the latest key frame can be sent to the data receiving device in a timely manner, in some embodiments of the present application, the network detection module may also send a cleanup instruction to the baseband processor after receiving the key frame request reported by the data receiving device, to instruct the baseband processor to clean up the data packets in the cache queue.
[0207] As shown in Figure 14, after the network detection module receives the key frame request sent by the data receiving device, it can send a cleanup instruction to the interactive service module through the interactive SDK. The interactive service module transmits the cleanup instruction to the PDCP in the baseband processor. After receiving the cleanup instruction, the PDCP can execute the cleanup instruction to clean up the data packets in the cache queue.
[0208] Considering that when the network is jittery or congested, the data receiving device may frequently initiate key frame requests. If the data packets in the cache queue are cleared only based on key frame requests, the re-encoded key frames may be deleted before they are sent from the cache queue, resulting in the data never being sent. Based on this, in some embodiments of the present application, the data packets in the cache queue can also be cleared based on the key frame requests and the cache duration of the data packets currently in the cache queue.
[0209] Exemplarily, after receiving a key frame request reported by a data receiving device, the network detection module detects whether the cache duration of the data message in the current cache queue is greater than a third preset duration threshold. If it is greater than the third preset duration threshold, a cleanup instruction is sent to the baseband processor to instruct the baseband processor to clean up the data message in the cache queue. If it is not greater than the third preset duration threshold, there is no need to send a cleanup instruction to the baseband processor.
[0210] In an embodiment of the present application, after the network detection module receives a key frame request reported by a data receiving device, if it detects that the cache duration of the data message in the current cache queue is greater than a third preset duration threshold, it indicates that the network is congested and the latest key frame may not be sent to the data receiving device in time. Therefore, the data message in the cache queue can be cleared to avoid invalid data messages occupying bandwidth and ensure that the latest key frame can be sent to the data receiving device in time.
[0211] If it is detected that the cache duration of the data message in the current cache queue is not greater than the third preset duration threshold, it means that the newly generated key frame can be sent to the data receiving device in a short time. Therefore, when the cache duration of the data message is not greater than the third preset duration threshold, there is no need to clean up the data message in the cache queue. The newly generated key frame is sent to the baseband processor and placed in the cache queue to be sent to the data receiving device.
[0212] In an embodiment of the present application, the third preset duration threshold may be greater than the first preset duration threshold, or may be less than or equal to the first preset duration threshold. It may be specifically set according to business requirements and is not specifically limited here.
[0213] For ease of understanding, the network status detection method provided in the embodiment of the present application is described by taking audio and video services as an example and combining the step flow shown in FIG15 .
[0214] S301: The audio and video application is started and the baseband processor information is registered for monitoring.
[0215] S302: Transmit the data message to the baseband processor.
[0216] S303: The baseband processor adds the data message to a cache queue.
[0217] S304: The baseband processor authorizes the access network device to set the bandwidth threshold.
[0218] S305: Send the data packets in the buffer queue over the air interface according to the bandwidth threshold.
[0219] S306: Monitor the buffering time of the data packets in the buffer queue to determine the buffering time of the data packets in the buffer queue.
[0220] S307: Send the cache duration to the application processor.
[0221] Among them, steps S301 to S307 can refer to steps S101 to S107 and are not described in detail here.
[0222] S308: The application processor receives the key frame request, and the cache duration is greater than the third preset duration threshold, and sends a clearing instruction to the baseband processor.
[0223] S309: The baseband processor clears the data messages in the cache queue according to the clearing instruction.
[0224] When the network detection module in the application processor receives a key frame request from a data receiving device, it compares the cache duration in the current cache queue with a third preset duration threshold. If the cache duration in the current cache queue exceeds the third preset duration threshold, it can send a cleanup instruction to the interactive service module, which then transparently transmits the cleanup instruction to the perception upload module in the baseband processor. After receiving the cleanup instruction, the perception reporting module in the baseband processor can execute the cleanup and then clean up the data packets in the cache queue.
[0225] It can be understood that when the network detection module sends a cleanup instruction to the baseband processor, the network detection module can trigger the encoding module to re-encode the key frame, and after protocol encapsulation, send it to the cache queue in the baseband processor through the forwarding module to be resent to the data receiving device.
[0226] Accordingly, if the cache duration in the current cache queue is not greater than the third preset duration threshold, the encoding module can be triggered to re-encode the key frame, and after protocol encapsulation, it is sent to the cache queue in the baseband processor through the forwarding module to be resent to the data receiving device.
[0227] In an optional embodiment, to improve data transmission quality, during network congestion, transmission bitrate adjustment can be combined with keyframe request processing. For example, during the transmission bitrate adjustment process, if a keyframe request is received, as long as the current cache duration is detected to be greater than a third preset duration threshold, a purge instruction can be sent to the baseband processor to instruct the baseband processor to purge data packets from the cache queue. If the current cache duration is not greater than the third preset duration threshold, the transmission bitrate of the data packets can be adjusted without sending a purge instruction to the baseband processor. Furthermore, during the transmission bitrate adjustment process, if the cache duration of data packets in the cache queue is greater than a second preset duration threshold, even if a keyframe request is not received, a purge instruction can be sent to the baseband processor to instruct the baseband processor to purge data packets from the cache queue. The second preset duration threshold is greater than the third preset duration threshold. This prevents bandwidth usage by invalid data during network congestion, improves data transmission quality, avoids video freezes, and enhances user experience.
[0228] In an embodiment of the present application, the network detection module can transmit the cleanup instruction to the baseband processor through the information sending API interface in the interactive service module. That is, in an embodiment of the present application, the information sending API interface can include a threshold information sending API interface, a query instruction sending API interface, and a cleanup instruction sending API interface. Among them, the threshold information sending API interface is used to send a first preset time threshold to the baseband processor, so that the baseband processor reports the cache time of the data message in the cache queue when the cache time of the data message in the cache queue is greater than the first preset time threshold. The query instruction sending API interface is used to send a query instruction to the baseband processor to instruct the baseband processor to report the cache time and bandwidth threshold of the data message in the current cache queue. The cleanup instruction sending API interface is used to send a cleanup instruction to the baseband processor to instruct the baseband processor to clean up the data message in the cache queue.
[0229] It can be understood that after receiving the clearing instruction, the baseband processor can execute the clearing instruction to clear the data messages in the cache queue.
[0230] In order to reduce the waste of resources, in an embodiment of the present application, some invalid data messages in the cache queue may also be cleared.
[0231] For example, the purge instruction sent by the network detection module to the baseband processor may include message tag information of the data packets to be purge. Upon receiving the purge instruction, the baseband processor may purge data packets in the cache queue that have the same message tag information based on the message tag information in the purge instruction. This enables precise purge of data packets in the cache queue, thereby avoiding waste of resources.
[0232] Optionally, in an embodiment of the present application, the message marking information can be the five-tuple information of the message, or it can be a message feature. The message feature can be, but is not limited to, an offset, a frame length, etc., which can be specifically set according to business requirements. The embodiment of the present application does not impose any specific restrictions.
[0233] It should be noted that in some other application scenarios, a cleanup instruction can also be sent to the baseband processor when a socket anomaly or service interruption is detected. For example, in the scenario of text and / or image upload, after the text and / or image are encapsulated into a data message and added to the cache queue for transmission, if the corresponding application's business logic detects a socket anomaly, a cleanup instruction can be sent to the baseband processor, instructing the baseband processor to clear the data messages in the cache queue.
[0234] For example, in a scanning and identification scenario, the object to be scanned is set as an identification code. When the terminal device scans the identification code, the data generated by the scan will be encapsulated into a data message and added to the cache queue for transmission. If the business logic of the corresponding application detects that the scan is interrupted, a clearing instruction can also be sent to the baseband processor to instruct the baseband processor to clear the data messages in the cache queue.
[0235] For example, in a file transfer scenario, the file to be transferred will be encapsulated into a data packet and added to the cache queue for transmission. During the transmission process, when the business logic of the corresponding application detects that the file transmission is abandoned, a cleanup instruction can be sent to the baseband processor to instruct the baseband processor to clean up the data packets in the cache queue.
[0236] It can be understood that the scenarios listed above are only examples of clearing data packets in the cache queue in the embodiments of the present application, and do not constitute specific limitations. The specific application scenarios can be set according to business needs, and the embodiments of the present application do not impose specific limitations.
[0237] When network congestion occurs, the embodiments of the present application clear invalid data from the cache queue by issuing a clearing instruction to the baseband processor. This can prevent invalid data from occupying bandwidth, improve the actual effective utilization rate of bandwidth, and reduce the transmission delay of valid data. The technical solution provided by the embodiments of the present application can be used in poor network environments, such as areas with poor cellular mobile network coverage, to reduce key frame requests by 40%, avoiding prolonged video freezes.
[0238] As shown in Table 2, which shows the call quality indicators of video call services tested in a poor network environment, it can be seen from Table 2 that the technical solution provided by the embodiment of the present application reduces the number of key frame requests, transmission delay, packet loss rate, etc. compared to the conventional technical solution, and improves the received frame rate. As shown in Figure 16, Figure 16 (a) is a received frame rate graph of the embodiment of the present application, and Figure 16 (b) is a received frame rate graph of the conventional technical solution.
[0239] Table 2
[0240] The embodiments of the present application, through information exchange between the application processor and the baseband processor, can timely and accurately perceive network status. In scenarios such as real-time audio and video calls, this can serve as a supplement to RTP / RTCP network detection to improve call quality. Through information exchange between the application processor and the baseband processor, data in the baseband processor's cache queue is cleared, thereby improving the actual effective utilization of bandwidth and reducing the transmission delay of valid data.
[0241] For ease of understanding, please refer to FIG17 for an explanation of the network status detection method provided in an embodiment of the present application. FIG17 is a flow chart of a network status detection method provided in an embodiment of the present application. As shown in FIG17 , the network status detection method provided in an embodiment of the present application may include the following steps:
[0242] S401: The baseband processor sends the cache duration of the data message in the cache queue to the application processor.
[0243] The baseband processor may monitor the cache duration of the data message in the cache queue to obtain the cache duration of the data message in the cache queue.
[0244] In order to reduce power consumption, in an embodiment of the present application, the baseband processor can transmit the cache duration of the data packet in the cache queue to the network detection module when the cache duration of the data packet in the cache queue is greater than a first preset duration threshold, or send the cache duration of the data packet in the cache queue to the application processor after receiving a query instruction sent by the application processor, thereby avoiding frequent transmission of the cache duration and effectively reducing power consumption.
[0245] S402: The application processor obtains the network status of the terminal device according to the cache duration.
[0246] Among them, after obtaining the cache time, the application processor can compare the cache time with a first preset time threshold. If the cache time is greater than the first preset time threshold, it can be determined that the current network state is a congested state. If the cache time is less than or greater than the first preset time threshold, it can be determined that the current network state is a normal state, that is, no congestion occurs.
[0247] In order to improve the quality of data transmission, in the embodiment of the present application, after obtaining the network status, the transmission bit rate of the data message can be adjusted according to the network status so that the data volume of the data message to be sent can meet the current network throughput, thereby improving the data transmission quality. Based on this, please refer to Figure 18. The network status detection method provided in the embodiment of the present application can also include step S4031:
[0248] S4031: When the network state is congested, reduce the sending code rate of the data message, or when the network state is normal, increase the sending code rate of the data message.
[0249] The congestion state is a network state in which the buffering time is longer than a first preset time threshold, and the normal state is a network state in which the buffering time is shorter than the first preset time threshold.
[0250] In order to promptly obtain changes in the network status after the transmission code rate is adjusted, in an embodiment of the present application, after obtaining that the network status is congested, the application processor can also start a polling thread and send a query instruction to the baseband processor at a set time interval to instruct the baseband processor to report the cache length of the data message in the cache queue.
[0251] During the polling process, for each query, after the application processor obtains the cache time length sent by the baseband processor, if the cache time length is still greater than the first preset time length threshold, that is, when the network status obtained by polling is still congested, the sending code rate of the data message can continue to be reduced. If the cache time length is less than the first preset time length threshold, that is, when the network congestion status is released through polling, the polling thread can be terminated and the sending code rate of the data message can be increased.
[0252] To facilitate the application processor's adjustment of the data packet transmission rate, timely adapting to the network environment and improving the user experience, in this embodiment of the application, after obtaining the data packet's buffering duration, the application processor can determine the adjustment range of the transmission rate based on the duration interval in which the buffering duration falls. Different duration intervals correspond to different adjustment ranges.
[0253] In order to avoid the adjusted sending code rate exceeding the bandwidth threshold when adjusting the sending code rate, in an embodiment of the present application, the baseband processor can also transmit the bandwidth threshold to the application processor when transmitting the cache duration to the application processor. In this way, the application processor can adjust the sending code rate of the data message with the broadband threshold as the upper limit to avoid the adjusted sending code rate of the data message exceeding the bandwidth threshold.
[0254] In order to further improve the data transmission quality in a network congestion state, please refer to FIG. 19 . After the application processor obtains the cache duration of the data message in the cache queue, the network status detection method may further include step S4032:
[0255] S4032: If the cache duration is greater than a second preset duration threshold, the application processor sends a clearing instruction to the baseband processor.
[0256] The second preset time threshold is greater than the first preset time threshold, and the clearing instruction is used to instruct the baseband processor to clear the data packets in the cache queue.
[0257] In this way, when the network is congested, by clearing the data packets in the cache queue, the bandwidth occupied by invalid data can be reduced and the transmission delay of valid data can be reduced.
[0258] In some embodiments, a clearing instruction may be sent to the baseband processor based on the key frame request. Therefore, after receiving the key frame request, the application processor may send a clearing instruction to the baseband processor to instruct the baseband processor to clear the data packets in the buffer queue.
[0259] It can be understood that the key frame request is sent by the data receiving device corresponding to the terminal device.
[0260] Considering that when the network state is jittery or congested, the data receiving device may frequently initiate key frame requests. If the data packets in the cache queue are cleared only based on the key frame requests, the re-encoded key frames may be deleted before they are sent from the cache queue, resulting in the data never being sent. Based on this, in some embodiments of the present application, the data packets in the cache queue can also be cleared in combination with the key frame requests and the cache duration of the data packets in the current cache queue. Please refer to Figure 20. After the application processor obtains the cache duration of the data packets in the cache queue, the network state detection method can also include step S4033:
[0261] S4033: When a key frame request is received and the cache duration is greater than a third preset duration threshold, the application processor sends a clearing instruction to the baseband processor.
[0262] Among them, when the application processor receives the key frame request reported by the data receiving device, if it detects that the cache time of the data message in the current cache queue is greater than the third preset time threshold, it indicates that the network is congested and the latest key frame may not be sent to the data receiving device in time. Therefore, the data message in the cache queue can be cleared to avoid invalid data messages occupying bandwidth and ensure that the latest key frame can be sent to the data receiving device in time.
[0263] If it is detected that the cache duration of the data message in the current cache queue is not greater than the third preset duration threshold, it means that the newly generated key frame can be sent to the data receiving device in a short time. Therefore, when the cache duration of the data message is not greater than the third preset duration threshold, there is no need to clean up the data message in the cache queue. The newly generated key frame is sent to the baseband processor and placed in the cache queue to be sent to the data receiving device.
[0264] To reduce resource waste, in an embodiment of the present application, the cleaning instructions sent by the application processor to the baseband processor may also include message marking information. Thus, upon receiving the cleaning instructions, the baseband processor can, based on the message marking information in the cleaning instructions, remove data messages from the cache queue that have the same message marking information. This allows for precise cleaning of data messages in the cache queue, thereby avoiding resource waste.
[0265] It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above steps S401, S402, S4031, S4032, and S4033 can refer to the corresponding processes in the aforementioned embodiments and will not be repeated here.
[0266] Based on the same inventive concept, an embodiment of the present application further provides a terminal device, the terminal device including a baseband processor and an application processor; the baseband processor includes a perception reporting module, and the application processor includes an interactive service module and a network detection module;
[0267] The interactive service module is used to exchange information between the perception reporting module and the network detection module;
[0268] The perception reporting module is used to send the cache duration of the data message in the cache queue to the network detection module through the interactive service module; wherein the cache queue is established by the baseband processor and is used to cache the data message to be sent;
[0269] The network detection module is used to obtain the network status of the terminal device based on the cache duration.
[0270] In an optional embodiment, the perception reporting module is configured to send the cache duration of the data packet in the cache queue to the network detection module through the interactive service module when the cache duration of the data packet in the cache queue is greater than a first preset duration threshold; or
[0271] After receiving the query instruction sent by the network detection module through the interactive service module, the buffering time length of the data message in the buffer queue is sent to the network detection module through the interactive service module.
[0272] In an optional implementation, the query instruction is an instruction sent when the network status is a congested state, and the application processor sends the query instruction to the baseband processor at a set time interval.
[0273] In an optional implementation manner, the network detection module is further configured to:
[0274] When the network is congested, the sending rate of the data message is reduced; or when the network is normal, the sending rate of the data message is increased;
[0275] The congestion state is a network state in which the buffering time is longer than a first preset time threshold, and the normal state is a network state in which the buffering time is shorter than the first preset time threshold.
[0276] In an optional implementation manner, the network detection module is specifically configured to:
[0277] According to the duration interval in which the buffer duration falls, an adjustment range for reducing or increasing the sending bit rate is obtained; different duration intervals correspond to different adjustment ranges.
[0278] In an optional implementation manner, the perception reporting module is further configured to:
[0279] Sending bandwidth thresholds to the network detection module through the interactive service module;
[0280] The sending code rate of the data message is less than the bandwidth threshold.
[0281] In an optional embodiment, when the cache duration is greater than a second preset duration threshold, the network detection module sends a cleanup instruction to the perception reporting module through the interactive service module; wherein the cleanup instruction is used to instruct the perception reporting module to clean up the data packets in the cache queue; the second preset duration threshold is greater than the first preset duration threshold.
[0282] In an optional embodiment, when a key frame request is received, the network detection module sends a cleanup instruction to the perception reporting module through the interactive service module; wherein the cleanup instruction is used to instruct the perception reporting module to clean up the data packets in the cache queue, and the key frame request is sent by the data receiving device corresponding to the terminal device.
[0283] In an optional embodiment, when a key frame request is received and the cache duration is greater than a third preset duration threshold, the network detection module sends a cleanup instruction to the perception reporting module through the interactive service module; wherein the cleanup instruction is used to instruct the perception reporting module to clean up the data packets in the cache queue, and the key frame request is sent by the data receiving device corresponding to the terminal device.
[0284] In an optional implementation, the cleaning instruction includes message marking information, and the cleaning instruction is used to instruct the perception reporting module to clean up data messages with the same message identification information in the cache queue.
[0285] In an optional implementation manner, the data message is an audio and video data message generated by instant messaging software.
[0286] An embodiment of the present application further provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processing circuit, the functions or steps in the above-mentioned materialized view updating method are implemented.
[0287] In addition, an embodiment of the present application can also provide a chip system, which includes a processing circuit and a storage medium, wherein the storage medium stores computer program instructions. When the computer program instructions are executed by the processing circuit, the functions or steps in the above-mentioned materialized view update method are implemented.
[0288] Through the description of the above embodiments, those skilled in the art will clearly understand that for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above 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. The specific working processes of the above-described systems, devices, and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0289] 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.
[0290] 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 computer-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, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk.
[0291] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A network status detection method, characterized in that: Applied to a terminal device, the terminal device includes a baseband processor and an application processor; the method includes: The baseband processor sends a cache duration of a data message in a cache queue to the application processor; the cache queue is established by the baseband processor and is used to cache data messages to be sent; The application processor obtains the network status of the terminal device according to the cache duration.
2. The method according to claim 1, characterized in that The baseband processor sends the cache duration of the data message in the cache queue to the application processor when the cache duration of the data message in the cache queue is greater than a first preset duration threshold; or, After receiving the query instruction sent by the application processor, the baseband processor sends the cache duration of the data message in the cache queue to the application processor.
3. The method according to claim 2, characterized in that The query instruction is an instruction sent when the network state is a congested state, and the application processor sends the query instruction to the baseband processor at a set time interval; the congested state is a network state in which the cache time length is greater than the first preset time length threshold.
4. The method according to claim 1, characterized in that: After the application processor obtains the network status of the terminal device according to the cache duration, the method further includes: When the network state is a congested state, reducing the sending code rate of the data message; or, When the network state is normal, increasing the sending code rate of the data message; The congestion state is a network state in which the cache time is greater than a first preset time threshold, and the normal state is a network state in which the cache time is less than the first preset time threshold.
5. The method according to claim 4, characterized in that The method further comprises: The application processor obtains an adjustment range for reducing or increasing the sending bit rate according to the duration interval in which the cache duration is located; wherein different duration intervals correspond to different adjustment ranges.
6. The method according to claim 4, characterized in that The method further comprises: The baseband processor sends a bandwidth threshold to the application processor; The sending code rate of the data message is less than the bandwidth threshold.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: When the cache duration is greater than a second preset duration threshold, the application processor sends a cleanup instruction to the baseband processor; The cleaning instruction is used to instruct the baseband processor to clean up the data messages in the cache queue; and the second preset time threshold is greater than the first preset time threshold.
8. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: When receiving a key frame request, the application processor sends a cleanup instruction to the baseband processor; The cleaning instruction is used to instruct the baseband processor to clean up the data messages in the cache queue, and the key frame request is sent by the data receiving device corresponding to the terminal device.
9. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: When a key frame request is received and the cache duration is greater than a third preset duration threshold, the application processor sends a cleanup instruction to the baseband processor; The cleaning instruction is used to instruct the baseband processor to clean up the data messages in the cache queue, and the key frame request is sent by the data receiving device corresponding to the terminal device.
10. The method according to any one of claims 7 to 9, characterized in that: The cleaning instruction includes message marking information, and the cleaning instruction is used to instruct the baseband processor to clean up data messages with the same message identification information in the cache queue.
11. The method according to any one of claims 1 to 10, characterized in that: The data message is an audio and video data message generated by instant messaging software.
12. A terminal device, characterized in that: The terminal device includes a baseband processor and an application processor; the baseband processor includes a perception reporting module, and the application processor includes an interactive service module and a network detection module; The interactive service module is used to perform information interaction between the perception reporting module and the network detection module; The perception reporting module is used to send the data message in the cache queue to the network detection module through the interactive service module. Cache duration, the cache queue is established by the baseband processor and is used to cache data messages to be sent; The network detection module is used to obtain the network status of the terminal device according to the cache duration.
13. The terminal device according to claim 12, characterized in that: The perception reporting module is used to send the cache time of the data message in the cache queue to the network detection module through the interactive service module when the cache time of the data message in the cache queue is greater than the first preset time threshold; or, After receiving the query instruction sent by the network detection module through the interactive service module, the cache duration of the data message in the cache queue is sent to the network detection module through the interactive service module.
14. The terminal device according to claim 13, characterized in that: The query instruction is an instruction sent when the network state is a congested state, and the application processor sends the query instruction to the baseband processor at a set time interval; the congested state is a network state in which the cache time length is greater than the first preset time length threshold.
15. The terminal device according to claim 12, characterized in that: The network detection module is also used for: When the network state is a congested state, reducing the sending code rate of the data message; or, When the network state is normal, increasing the sending code rate of the data message; The congestion state is a network state in which the cache time is greater than a first preset time threshold, and the normal state is a network state in which the cache time is less than the first preset time threshold.
16. The terminal device according to claim 15, characterized in that: The network detection module is specifically used for: According to the duration interval in which the cache duration is located, an adjustment range for reducing or increasing the sending code rate is obtained; wherein different duration intervals correspond to different adjustment ranges.
17. The terminal device according to claim 15, characterized in that: The perception reporting module is also used for: Sending a bandwidth threshold to the network detection module through the interactive service module; The sending code rate of the data message is less than the bandwidth threshold.
18. The terminal device according to any one of claims 12 to 17, characterized in that: When the cache duration is greater than a second preset duration threshold, the network detection module sends a cleanup instruction to the perception reporting module through the interactive service module; Among them, the cleaning instruction is used to instruct the perception reporting module to clean up the data packets in the cache queue; the second preset time threshold is greater than the first preset time threshold.
19. The terminal device according to any one of claims 12 to 17, characterized in that: When receiving a key frame request, the network detection module sends a cleanup instruction to the perception reporting module through the interactive service module; Among them, the cleaning instruction is used to instruct the perception reporting module to clean up the data packets in the cache queue, and the key frame request is sent by the data receiving device corresponding to the terminal device.
20. The terminal device according to any one of claims 12 to 17, characterized in that: When a key frame request is received and the cache duration is greater than a third preset duration threshold, the network detection module sends a cleanup instruction to the perception reporting module through the interactive service module; Among them, the cleaning instruction is used to instruct the perception reporting module to clean up the data packets in the cache queue, and the key frame request is sent by the data receiving device corresponding to the terminal device.
21. The terminal device according to any one of claims 17 to 19, characterized in that: The cleaning instruction includes message marking information, and the cleaning instruction is used to instruct the perception reporting module to clean up data messages with the same message identification information in the cache queue.
22. The terminal device according to any one of claims 12 to 19, characterized in that: The data message is an audio and video data message generated by instant messaging software.
23. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a computer program or instructions. When the computer program or instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 11.
24. A computer program product, characterized in that The computer program product comprises: a computer program or instructions, and when the computer program or instructions are run on a computer, the computer is caused to perform the method according to any one of claims 1 to 11.
25. A chip system, characterized in that: include: At least one processor and a communication interface, wherein the at least one processor is coupled to a memory via the communication interface, and when the at least one processor executes a computer program or instruction in the memory, the method according to any one of claims 1 to 11 is executed.
26. A terminal device, characterized in that: comprising a memory, one or more processors; The memory is coupled to the one or more processors, and the one or more processors are used to execute the computer program stored in the memory, so that the terminal device performs the method according to any one of claims 1 to 11; The one or more processors include a baseband processor and an application processor.
Citation Information
Patent Citations
A method and a device for controlling multimedia data transmission flow
CN104135444A
Communication terminal and method for handling upload traffic congestion
CN107637122A
Method for regulating congest window in communication network
CN1556629A
Video playing grade determination method, video playing method, and related apparatuses
WO2023051350A1
Cited By
UPF Buffer anti-congestion method based on service state awareness and dynamic quota adjustment
CN121586036A
Low-power-consumption equipment control instruction issuing method and system based on cache queue
CN121645431A