A method, system and device for quality of service detection
Patent Information
- Application Number
- CN202111671830.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2041-12-31
AI Technical Summary
通过RTN连接传输数据具有时延稳定和带宽稳定的优点,但成本较高
Smart Images

Figure CN116418790B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a service quality testing method, system and device. Background Technology
[0002] In communication scenarios such as video calls, two electronic devices need to compress and encode video data before sending it to each other. A common data transmission method is a real-time network (RTN) connection that uses a cloud-side server as an intermediary. The sending device can send the encoded video data to the cloud-side server via the RTN connection, and the cloud-side server then sends the encoded video data to the receiving device via the RTN connection. Data transmission via RTN has the advantages of stable latency and bandwidth, but it is more expensive.
[0003] Therefore, peer-to-peer (P2P) connection transmission, which can effectively save costs, has become a new option for transmitting video encoded data. The sending device can directly send video encoded data to the receiving device through a P2P connection established using Network Address Translation (NAT) traversal technology, thereby saving server bandwidth.
[0004] In some scenarios, when a sending device transmits video encoded data to a receiving device via an RTN connection, if a P2P connection has already been established between the sending and receiving devices, the sending device can switch to using the P2P connection to transmit video encoded data. To ensure stable transmission of video encoded data after the switch, the sending device needs to perform a quality of service (QoS) test on the P2P connection before switching communication connections to determine QoS parameters such as latency and packet loss rate when the sending device transmits data via the P2P connection. Summary of the Invention
[0005] This application provides a service quality testing method, system, and device to improve the accuracy of service quality testing for communication connections.
[0006] Firstly, this application provides a service quality detection method, which can be applied to a first electronic device. The method includes: the first electronic device determining a first probe message based on a first data packet, wherein the first data packet is a data packet sent by the first electronic device to a second electronic device through a first communication connection, and the first probe message is used to detect the service quality of a second communication connection between the first electronic device and the second electronic device; the first electronic device sends the first probe message to the second electronic device through the second communication connection and receives a first response message returned by the second electronic device; and the first electronic device determines service quality parameters of the second communication connection based on the first probe message and the first response message.
[0007] In the above method, when the first electronic device performs service quality detection on the second communication connection, it can obtain the first data packet transmitted in the first communication connection and determine the first probe packet based on the first data packet. Thus, the first probe packet can simulate the communication characteristics of the packet data in the actual data transmission process, thereby accurately detecting the service quality parameters of the second communication connection when actually transmitting data, and improving the accuracy of service quality detection of the communication connection.
[0008] In one possible design, determining the first probe message based on the first data message includes: acquiring the first data message sent by the first electronic device through the first communication connection within a preset time period, determining the data volume of the first data message; and determining the data volume of the first probe message based on a preset first resolution and the data volume of the first data message.
[0009] With this design, when the first electronic device generates the first probe message, it can determine the data volume of the first probe message based on the data volume of the first data message. This makes the data volume of the first probe message determined by the first electronic device similar to the data volume of the message data in the actual data transmission, and the result of using the first probe message to perform service quality detection on the second communication connection is more accurate.
[0010] In one possible design, after acquiring the first data packet sent by the first electronic device through the first communication connection within a preset time period, and before determining the data volume of the first probe packet based on the preset first resolution and the data volume of the first data packet, the method further includes: determining, based on the data volume of the first data packet, that the service state of the first electronic device is not a resolution transition state.
[0011] This design avoids switching communication connections when the first electronic device is in a resolution transition state. This allows the first electronic device to switch connections when the data rate is relatively stable, ensuring successful switching to the second communication connection for data transmission. Furthermore, when the first electronic device is not in a resolution transition state, the data volume of the first data packet it receives more closely reflects the actual data transmission situation, thus enabling the determined first probe packet to more accurately detect the service quality of the second communication connection.
[0012] In one possible design, after determining the quality of service parameters of the second communication connection based on the first probe message and the first response message, the method further includes: determining that the quality of service parameters of the second communication connection do not meet preset conditions; acquiring a second data packet sent by the first electronic device through the first communication connection within a preset time period; determining the data volume of the second data packet; determining the data volume of the second probe message based on a preset second resolution and the data volume of the second data packet; wherein the second resolution is less than the first resolution; sending the second probe message through the second communication connection; receiving a second response message returned by the second electronic device; and determining the quality of service parameters of the second communication connection based on the second probe message and the second response message.
[0013] This design allows the first electronic device to reduce the resolution of the probe message when the service quality parameters obtained from the first probe message for the second communication connection do not meet preset conditions. The first electronic device then generates a second probe message based on the second resolution and the re-acquired second data message. This second probe message, at a lower resolution, is used to re-detect the service quality of the second communication connection, thus determining the service quality parameters of the second communication connection when transmitting the second probe message. Repeating this process iterates through preset resolution levels to detect the service quality of the second communication connection, thereby determining the service quality parameters of the second communication connection when transmitting probe messages at different resolutions and ensuring the accuracy of the service quality detection for the second communication connection.
[0014] In one possible design, the duration of the second probe message is shorter than the duration of the first probe message.
[0015] With this design, since the second resolution corresponding to the second probe message is smaller than the first resolution corresponding to the first probe message, the first electronic device can reduce the duration of the second probe message when performing service quality detection on the second communication connection based on the second probe message, thereby improving the efficiency of service quality detection.
[0016] In one possible design, after determining the quality of service parameters of the second communication connection based on the first probe message and the first response message, the method further includes: determining that the quality of service parameters of the second communication connection meet preset conditions, and switching to use the second communication connection to send service data to the second electronic device; wherein the resolution corresponding to the service data is the first resolution.
[0017] With this design, after the first electronic device performs a service quality detection on the second communication connection based on the first probe message to obtain the service quality parameters, if the service quality parameters meet preset conditions, it indicates that it can switch to the second communication connection to transmit service data. Furthermore, the first electronic device can set the resolution corresponding to the service data to a first resolution to ensure normal data transmission after switching to the second communication connection and prevent problems such as video stuttering.
[0018] In one possible design, determining that the service state of the first electronic device is not a resolution transition state based on the data volume of the first data packet includes: determining the standard deviation and the maximum value of the data volume of the first data packet; when the ratio of the standard deviation to the maximum value is less than or equal to a preset threshold, determining that the service state of the first electronic device is not a resolution transition state.
[0019] With this design, when determining whether the first electronic device is in a resolution transition state, the first electronic device can calculate the standard deviation and maximum value of the data volume of the first data packet. When the ratio of the standard deviation and maximum value of the data volume of the first data packet is greater than a preset threshold, it indicates that the data volume of the current first data packet fluctuates greatly. At this time, the first electronic device may be in a resolution transition state, and it is not advisable to switch communication connections.
[0020] In one possible design, the first communication connection is a Real-Time Audio / Video Transmission Network (RTN) connection, and the second communication connection is a peer-to-peer (P2P) connection.
[0021] With this design, the first communication connection is an RTN connection and the second communication connection is a P2P connection. Since the cost of the P2P connection is lower, when the first electronic device performs service quality detection on the P2P connection and determines that the service quality parameters of the second communication connection meet the preset conditions, the first electronic device switches to use the P2P connection to transmit service data, thereby reducing the transmission cost of service data.
[0022] In one possible design, the quality of service parameters of the second communication connection include latency and / or packet loss rate.
[0023] With this design, the first electronic device can perform service quality detection on the second communication connection based on the probe message, determine the latency and / or packet loss rate of the second communication connection, and then determine whether to switch to the second communication connection to transmit service data, thereby further improving the accuracy of service quality detection.
[0024] In one possible design, the first electronic device is any one of a smart terminal device, a wearable device, an Internet of Things (IoT) device, or a smart vehicle device; the second electronic device is any one of a smart terminal device, a wearable device, an IoT device, or a smart vehicle device.
[0025] Secondly, this application provides an electronic device comprising multiple functional modules; the multiple functional modules interact to implement the methods described in the first aspect and its various embodiments. The multiple functional modules can be implemented based on software, hardware, or a combination of both, and can be arbitrarily combined or divided based on specific implementations.
[0026] Thirdly, this application provides an electronic device including at least one processor and at least one memory, wherein the at least one memory stores computer program instructions, and when the electronic device is running, the at least one processor executes the methods described in the first aspect and its various embodiments.
[0027] Fourthly, this application also provides a computer program that, when run on a computer, causes the computer to perform the methods shown in any of the above aspects and their respective embodiments.
[0028] Fifthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a computer, causes the computer to perform the methods shown in any of the above aspects and their embodiments.
[0029] Sixthly, this application also provides a chip for reading a computer program stored in a memory and executing the methods shown in any of the above aspects and their embodiments.
[0030] Seventhly, this application also provides a chip system including a processor for supporting a computer device in implementing the methods shown in any of the above aspects and their embodiments. In one possible design, the chip system further includes a memory for storing programs and data necessary for the computer device. The chip system may be composed of chips or may include chips and other discrete devices. Attached Figure Description
[0031] Figure 1 This is a schematic diagram of a probe message;
[0032] Figure 2 This is a schematic diagram illustrating a communication scenario to which an embodiment of this application applies;
[0033] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0034] Figure 4 A software structure block diagram of an electronic device provided in an embodiment of this application;
[0035] Figure 5 A flowchart illustrating a service quality detection method provided in this application embodiment;
[0036] Figure 6 A schematic diagram of a data packet and a probe packet provided for an embodiment of this application;
[0037] Figure 7 A schematic diagram illustrating the calculation of the latency of a second communication connection, provided as an embodiment of this application;
[0038] Figure 8 This is a flowchart illustrating a quality of service (QoS) detection method before switching to a second communication connection, as provided in an embodiment of this application. Detailed Implementation
[0039] In scenarios such as video calls and real-time multiplayer games, two electronic devices need to compress and encode video data before sending it to each other. A common data transmission method is a real-time network (RTN) connection that uses a cloud-side server as an intermediary. The sending device can send the encoded video data to the cloud-side server via the RTN connection, and the cloud-side server then sends the encoded video data to the receiving device via the RTN connection. Data transmission via RTN has the advantages of stable latency and bandwidth, but it is more expensive.
[0040] Therefore, peer-to-peer (P2P) connection transmission, which can effectively save costs, has become a new option for transmitting video encoded data. The sending device can directly send video encoded data to the receiving device through a P2P connection established using Network Address Translation (NAT) traversal technology, thereby saving data transmission costs.
[0041] In some scenarios, when a sending device transmits video encoded data to a receiving device via an RTN connection, if a P2P connection has already been established between the sending and receiving devices, the sending device can switch to using the P2P connection to transmit video encoded data. To ensure stable transmission of video encoded data after the switch, the sending device needs to perform a quality of service (QoS) test on the P2P connection before switching communication connections to determine QoS parameters such as latency and packet loss rate when the sending device transmits data via the P2P connection.
[0042] Currently, the method for quality of service (QoS) testing of P2P connections between electronic devices involves the sending device sending multiple probe packets over the P2P connection, with each probe packet containing the same amount of data. For example, Figure 1 This is a schematic diagram of a probe message. (Reference) Figure 1 The sending device evenly sends multiple probe packets, each with a fixed data size and corresponding fixed bitrate. Upon receiving the probe packets, the receiving device sends a response message back to the sending device. The sending device then determines the Quality of Service (QoS) parameters of the P2P connection based on the probe packets and the response message. However, in actual data transmission, the data size of different data packets varies. Therefore, the QoS parameters obtained through this method cannot accurately represent the QoS of the P2P connection during actual data transmission, leading to inaccurate QoS detection results and issues such as video stuttering after switching communication connections.
[0043] To address the aforementioned issues, this application provides a service quality detection method to improve the accuracy of service quality detection for communication connections.
[0044] Figure 2 This is a schematic diagram illustrating a communication scenario applicable to an embodiment of this application. (Reference) Figure 2 The scenario includes a first electronic device and a second electronic device. The first electronic device sends a first data packet, such as video encoded data, to the second electronic device via a first communication connection. The first electronic device determines a first probe packet based on the first data packet, wherein the first probe packet is used to detect the quality of service (QoS) of the second communication connection between the first and second electronic devices. The first electronic device sends the first probe packet to the second electronic device via the second communication connection and receives a first response message returned by the second electronic device. The first electronic device determines the QoS parameters of the second communication connection based on the first probe packet and the first response message. Through this scheme, the first electronic device can determine the probe packet used to detect the QoS of the second communication connection based on the actual data packets transmitted in the first communication connection, making the probe packet more similar to the actual transmitted data packets, thereby accurately detecting the QoS of the second communication connection when transmitting data.
[0045] The following describes an electronic device and embodiments for using such an electronic device. The electronic device in this application embodiment may be, for example, a tablet computer, a mobile phone, an in-vehicle device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a wearable device, an internet of things (IoT) device, an in-vehicle system, etc. This application embodiment does not impose any limitations on the specific type of electronic device.
[0046] Figure 3 This is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of this application. Figure 3 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0047] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the central nervous system and command center of the electronic device 100. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. Processor 110 may also include 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 processor 110 has recently used or is repeatedly used. If processor 110 needs to reuse an instruction or data, it can directly retrieve it from the memory. This avoids repeated access, reduces the waiting time of processor 110, and thus improves system efficiency.
[0048] USB interface 130 is a USB standard compliant interface, specifically a Mini USB interface, Micro USB interface, USB Type-C interface, etc. USB interface 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. Charging management module 140 receives charging input from the charger. Power management module 141 connects battery 142, charging management module 140, and processor 110. Power management module 141 receives input from battery 142 and / or charging management module 140, providing power to processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.
[0049] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0050] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0051] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0052] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0053] The display screen 194 is used to display the display interface of an application, such as the display page of an application installed on the electronic device 100. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0054] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0055] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system and software code for at least one application program. The data storage area may store data generated during the use of electronic device 100 (e.g., captured images, recorded videos, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0056] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, images, videos, and other files can be saved on the external memory card.
[0057] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0058] The sensor module 180 may include a pressure sensor 180A, an acceleration sensor 180B, a touch sensor 180C, etc.
[0059] The pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194.
[0060] Touch sensor 180C, also known as a "touch panel," can be located on display screen 194. The touch sensor 180C and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180C detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180C may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0061] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. Electronic device 100 can receive button inputs and generate key signal inputs related to user settings and function control. Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, touch operations applied to different applications (such as taking photos, audio playback, etc.) can correspond to different vibration feedback effects. Touch vibration feedback effects can also be customized. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, or to indicate messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with electronic device 100.
[0062] Understandable, Figure 3The components shown do not constitute a specific limitation on the electronic device 100. The electronic device may also include more or fewer components than shown, or combine some components, or separate some components, or have different component arrangements. Furthermore, Figure 3 The combination / connection relationships between the components can also be adjusted and modified.
[0063] Figure 4 This is a software structure block diagram of an electronic device provided in an embodiment of this application. For example... Figure 4 As shown, the software architecture of an electronic device can be a layered architecture. For example, the software can be divided into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the operating system is divided into four layers, from top to bottom: the application layer, the application framework layer (framework, FWK), the runtime and system libraries, and the kernel layer.
[0064] The application layer can include a series of application packages. For example... Figure 4 As shown, the application layer can include camera, settings, skin modules, user interface (UI), third-party applications, etc. Third-party applications can include gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, etc.
[0065] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer can include some predefined functions. For example... Figure 4 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, and notification manager.
[0066] The window manager is used to manage windowed applications. It can obtain the screen size, determine if a status bar is present, lock the screen, and capture screenshots. The content provider stores and retrieves data, making this data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0067] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0068] A phone manager is used to provide communication functions for electronic devices. For example, it manages call status (including connection and disconnection).
[0069] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0070] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0071] The runtime includes the core libraries and the virtual machine. The runtime is responsible for the scheduling and management of the operating system.
[0072] The core library consists of two parts: one part contains the functionalities that the Java language needs to call, and the other part contains the core libraries of the operating system. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0073] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0074] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0075] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0076] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0077] A 2D graphics engine is a graphics engine for 2D drawing.
[0078] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0079] The hardware layer can include various types of sensors, such as accelerometers, gyroscopes, and touch sensors.
[0080] It should be noted that, Figure 3 and Figure 4 The structure shown is merely an example of an electronic device provided in this application embodiment and is not intended to limit the electronic device provided in this application embodiment in any way. In specific implementations, the electronic device may have more than Figure 3 or Figure 4 The structure shown may contain more or fewer devices or modules.
[0081] The service quality testing method provided in the embodiments of this application is described below.
[0082] Figure 5 A flowchart of a service quality detection method provided in this application embodiment, wherein the first electronic device and the second electronic device may have Figure 3 and / or Figure 4 The structure shown. (Reference) Figure 5 The service quality detection method provided in this application includes the following steps:
[0083] S501: The first electronic device determines the first probe message based on the first data message.
[0084] The first data message is a data message sent by the first electronic device to the second electronic device through the first communication connection, and the first probe message is used to detect the service quality of the second communication connection between the first electronic device and the second electronic device.
[0085] Optionally, the first electronic device and the second electronic device can interact with each other via a first communication connection. For example, the first electronic device can send a first data message to the second electronic device via the first communication connection. The first data message can be business data, such as video encoding data.
[0086] When a first electronic device sends service data to a second electronic device through a first communication connection, if a second communication connection has already been established between the two devices, the first electronic device can switch to using the second communication connection to send service data to the second electronic device. For example, the first communication connection may be an RTN connection, and the second communication connection may be a P2P connection. As mentioned earlier, P2P connections are less expensive than RTN connections; therefore, when a P2P connection has been established between the first and second electronic devices, the P2P connection can be switched to for service data transmission. Before switching to the second communication connection, the first electronic device needs to perform a quality of service (QoS) check on the second communication connection, such as determining QoS parameters like latency and packet loss rate. In practice, the first electronic device sends probe messages to the second electronic device through the second communication connection to perform the QoS check.
[0087] The following describes the method for determining probe messages provided in the embodiments of this application:
[0088] In one optional implementation, the first electronic device can acquire first data packets sent by the first electronic device through the first communication connection within a preset duration, and determine the data volume of the first data packets. For example, the first electronic device can acquire first data packets sent within M seconds in the first communication connection. In practice, data packets can be collected once per second. The first electronic device can determine the data volume of the first data packets within M seconds, for example, the data volume of the first data packets within M seconds can be: average_speed[M]. Wherein, M seconds is the preset duration, and this value can be an empirical value, for example, M can take any value between 5 and 10.
[0089] The first electronic device can determine the data volume of the first probe message based on the data volume of the first data message and the first resolution, and thus determine the first probe message.
[0090] In this embodiment, multiple resolution levels can be preset, such as 540×960, 320×480, and 240×320. Each resolution corresponds to a bitrate range, and the first electronic device can sequentially generate the first probe message using different resolutions. For example, when the preset resolution levels are 540×960, 320×480, and 240×320, the first electronic device can select a first resolution of 540×960.
[0091] Optionally, the data size of the first probe message, the data size of the first data message, and the first resolution can satisfy the following formula 1:
[0092]
[0093] wherein detect_speed[i] is the data volume of the i-th first probe packet, average_speed[i] is the data volume of the first data packet collected in the i-th second, N is the duration of the first probe packet, generally N<M, for example, N can be selected as 3, and the value of N can be adjusted at any time during the process of performing quality of service detection on the second communication connection. detect_resolution is the first resolution, real_resolution is the resolution corresponding to the first data packet, and redundant_rate is the dynamic redundancy rate in the encoding algorithm, generally ranging from 20% to 50%, and the maximum dynamic redundancy rate can be selected in the embodiments of the present application.
[0094] It can be seen from the above formula that after collecting the first data packets for M seconds, the first electronic device can determine M first probe packets sent within N seconds, and the first probe packets retain the data volume characteristic of the first data packets, which can simulate the fluctuation of the packet data volume in the actual data transmission process, so as to accurately detect the quality of service parameters of the second communication connection when actually transmitting data.
[0095] For example, Figure 6 is a schematic diagram of a data packet and a probe packet provided by an embodiment of the present application. The first data packet sent by the first electronic device to the second electronic device through the first communication connection is as shown in Figure 6 in (a), and the data volume of the first data packet is not a fixed value. The first probe packet generated by the first electronic device according to the collected first data packets within 9s is as shown in Figure 6 in (b), the duration of the first probe packet may be 1s, and the 9 first probe packets sent within 1s retain the data volume characteristics of the first data packets within 9s.
[0096] In an optional implementation manner, after acquiring the first data packet, the first electronic device may determine whether the service state of the first electronic device is a resolution transition state according to the data volume of the first data packet, and when it is determined that the service state of the first electronic device is not the resolution transition state, then determine the data volume of the first probe packet according to the preset first resolution and the data volume of the first data packet. The resolution transition state refers to that the resolution corresponding to the service data is being switched, for example, from 540P to 720P, the bit rate fluctuation of the service data will be relatively large, which is not suitable for determining the data volume of the first probe packet.
[0097] In implementation, the first electronic device can calculate the standard deviation and maximum value of the data volume of the first data packet, and calculate the ratio of the standard deviation to the maximum value. When the ratio is less than or equal to a preset threshold, it is determined that the service state of the first electronic device is not a resolution transition state; when the ratio is greater than the preset threshold, it is determined that the service state of the first electronic device is a resolution transition state. For example, the preset threshold can be 30%. If the service state of the first electronic device is a resolution transition state, the bit rate of the service data transmitted in the first communication connection fluctuates greatly, making it inconvenient to switch communication connections. This method avoids switching communication connections when the service state of the first electronic device is a resolution transition state, allowing the first electronic device to switch communication connections when the bit rate of the service data is relatively stable, ensuring that the first electronic device can successfully switch to the second communication connection to send service data. Furthermore, when the service state is not a resolution transition state, the data volume of the first data packet obtained by the first electronic device is more consistent with the actual data transmission situation, thus making the determined first probe packet more accurate in detecting the service quality of the second communication connection.
[0098] In some embodiments of this application, different resolution levels can be preset according to the network card operation status of the first electronic device. The following describes the methods for presetting different resolution levels in different scenarios:
[0099] In some scenarios, the first electronic device supports dual network cards, such as simultaneously supporting a wireless fidelity (Wi-Fi) network card and a cellular network card. Dual network cards can be used to achieve dual-path communication. For example, the first electronic device can enable dual-path communication through dual-path acceleration technology.
[0100] When the first electronic device uses a Wi-Fi or cellular network card for single-channel communication, if it simultaneously establishes a first communication connection and a second communication connection, these two connections will compete for network bandwidth. Therefore, when the first electronic device sends a first probe message to detect the service quality of the second communication connection, it needs to select a lower resolution to generate the first probe message. This is to avoid the service quality detection process of the second communication connection affecting the transmission of service data in the first communication connection. For example, the resolution can be set to 540×960, 320×480, or 240×320.
[0101] When the first electronic device enables both its Wi-Fi and cellular network cards for dual-path communication, the quality of service (QoS) check process for the second communication connection will not affect the transmission of service data in the first communication connection. Therefore, when generating the first probe message, the first electronic device can select a higher resolution. For example, the resolution can be set to 1080×1920, 720×1280, or 540×960.
[0102] It should be noted that if the first resolution is the same as the resolution corresponding to the first data packet, the first electronic device can directly use the first data packet as the first detection packet without recalculating the data volume of the first detection packet. For example, when the first electronic device enables dual-channel communication using both Wi-Fi and cellular network cards, it can select a first resolution of 1080×1920. If the resolution of the data packet sent by the first electronic device through the first communication connection is also 1080×1920, the first electronic device can simultaneously send the first data packet output by the encoder to the second electronic device through both the first and second communication connections, further reducing the computational load on the first electronic device and improving detection efficiency.
[0103] By using the above method, the service quality detection of the second communication connection can be avoided from affecting the service data transmission of the first communication connection. At the same time, the first probe message is generated with the highest possible resolution, which improves the accuracy of service quality detection.
[0104] S502: The first electronic device sends a first probe message to the second electronic device through the second communication connection.
[0105] S503: The first electronic device receives the first response message sent by the second electronic device.
[0106] The first response message can be generated by the second electronic device after receiving the first probe message. The first response message can carry information for calculating the quality of service parameters of the second communication connection, such as information for calculating latency or packet loss rate.
[0107] S504: The first electronic device determines the quality of service parameters of the second communication connection based on the first probe message and the first response message.
[0108] In one optional implementation, the first electronic device can determine the quality of service parameters of the second communication connection, such as latency, packet loss rate, and equivalent bandwidth, based on the first probe message and the first response message.
[0109] For example, Figure 7 This is a schematic diagram illustrating the calculation of the latency of a second communication connection, provided as an embodiment of this application. (Reference) Figure 7A first electronic device sends a first probe message to a second electronic device. Upon receiving the first probe message, the second electronic device sends a first response message to the first electronic device. The first response message includes the Network Time Protocol (NTP) time value (LSR) of the first probe message and the time from receiving the first probe message to sending the first response message (DLSR). After receiving the first response message, the first electronic device determines the relative time value at which it received the first response message. The first electronic device can determine the delay of the second communication connection based on the relative time value of the received first response message and the LSR and DLSR. For example, the delay of the second communication connection and the relative time value, LSR, and DLSR at which the first electronic device received the first response message satisfy the following formula:
[0110] Delay = T1 - LSR - DLSR
[0111] Where Delay is the delay of the second communication connection, and T1 is the relative time value at which the first electronic device receives the first response message.
[0112] For example, when the first electronic device calculates the packet loss rate of the second communication connection, the first response message sent by the second electronic device may include the number of data packets actually received within a preset time interval. The first electronic device determines the packet loss rate based on the expected number of data packets to be received within the preset time interval and the actual number of data packets received. For example, the packet loss rate and the expected number of data packets to be received within the preset time interval and the actual number of data packets received satisfy the following formula:
[0113] LostInterval=(ExpectedInterval-ReceivedInterval) / ExpectedInterval
[0114] Where LostInterval is the packet loss rate, ExpectedInterval is the number of data packets expected to be received within the preset time interval, and ReceivedInterval is the number of data packets actually received within the preset time interval.
[0115] In some embodiments, after determining the quality of service (QoS) parameters of the second communication connection, the first electronic device can determine whether the QoS parameters of the second communication connection meet preset conditions. For example, the preset conditions may be that the latency is less than the service requirement latency, and / or that the packet loss rate is less than a preset threshold. If the QoS parameters of the second communication connection meet the preset conditions, the second communication connection is switched to send service data to the second electronic device. Since the resolution corresponding to the first probe message is the first resolution, the resolution corresponding to the service data is also the first resolution after switching to the second communication connection, thereby preventing stuttering of the video frame loaded based on the service data after switching the communication connection. If the QoS parameters of the second communication connection do not meet the preset conditions, the first electronic device needs to reduce the resolution corresponding to the probe message and regenerate the probe message to perform QoS detection on the second communication connection again.
[0116] In one optional implementation, when the quality of service (QoS) parameters of the second communication connection do not meet preset conditions, the first electronic device acquires a second data packet sent through the first communication connection within a preset time period and determines the data volume of the second data packet. The first electronic device determines the data volume of the second probe packet based on a preset second resolution and the data volume of the second data packet; wherein the second resolution is smaller than the first resolution. For example, when the resolution options are 540×960, 320×480, and 240×320, the second electronic device can select a second resolution of 320×480. The first electronic device sends the second probe packet through the second communication connection and receives a second response message returned by the second electronic device. The first electronic device determines the QoS parameters of the second communication connection based on the second probe packet and the second response message.
[0117] In practice, the specific methods by which the first electronic device determines the second probe message and determines the quality of service parameters of the second communication connection based on the second probe message can be found in S601-S604, and the repeated parts will not be described again.
[0118] Understandably, if the service quality parameters of the second communication connection detected based on the second probe message meet the preset conditions, the first electronic device switches to using the second communication connection to send service data to the second electronic device. The resolution of the sent service data is the second resolution. If the service quality parameters of the second communication connection detected based on the second probe message still do not meet the preset conditions, the first electronic device continues to reduce the resolution corresponding to the probe message and regenerates the probe message to re-detect the service quality of the second communication connection. When the service quality parameters of the second communication connection detected by the first electronic device across preset resolution levels all fail to meet the preset conditions, the detection is paused, and the service quality detection is re-performed after a preset time.
[0119] The method for detecting quality of service provided by the embodiments of the present application is further introduced below with an example:
[0120] Figure 8 is a flowchart of a method for detecting quality of service provided by an embodiment of the present application. At this time, when a second communication connection has been established, before the first electronic device switches to use the second communication connection, it may according to Figure 8 the method shown to detect the quality of service of the second communication connection. This method may be performed by Figure 2 the first electronic device in the scenario shown, and the first electronic device may have Figure 3 and / or Figure 4 the structure shown. With reference to Figure 8 , this method includes the following steps:
[0121] S801: The first electronic device acquires data packets sent by the first electronic device through the first communication connection within M seconds before the current time, and calculates the data volume average_speed[M] of the data packets.
[0122] S802: The first electronic device judges whether the ratio of the standard deviation to the maximum value of the data volume of the data packets transmitted by the first electronic device within M seconds is less than or equal to a preset threshold; if yes, proceed to S803; otherwise, return to S801.
[0123] Wherein, the preset threshold may be 30%.
[0124] S803: The first electronic device determines the data volume of the probe packet according to the preset resolution and the data volume of the data packet.
[0125] For example, the data volume of the probe packet, the preset resolution and the data volume of the data packet satisfy the following formula:
[0126]
[0127] Wherein, detect_speed[i] is the data volume of the i-th probe packet, average_speed[i] is the data volume of the data packet collected at the i-th second, N is the duration of the probe packet, generally N<M, for example, N may be selected as 3. detect_resolution[j] is the j-th resolution gear, for example, in the embodiment of the present application, detect_resolution[3] = [540×960, 320×480, 240×320] may be set, real_resolution is the resolution corresponding to the data packet, and redundant_rate is the dynamic redundancy rate in the encoding algorithm.
[0128] S804: The first electronic device sends a probe message to the second electronic device through the second communication connection and receives a response message sent by the second electronic device.
[0129] S805: The first electronic device determines the latency and packet loss rate of the second communication connection based on the probe message and response message.
[0130] S806: The first electronic device determines whether the delay is less than the service requirement delay and whether the packet loss rate is less than or equal to the preset packet loss rate; if yes, proceed to S807; otherwise, proceed to S808.
[0131] S807: The first electronic device switches to using the second communication connection to send service data to the second electronic device.
[0132] S808: The first electronic device reduces the resolution value corresponding to the probe message and reduces the duration of the probe message.
[0133] For example, if j=1 is selected in S803 and the resolution is 540×960, then j=2 can be set in S809 and the resolution is 320×480.
[0134] It should be noted that when the first electronic device reduces the resolution corresponding to the probe message, the time required to perform quality of service detection on the second communication connection is reduced, thus allowing for an adaptive reduction in the duration of the probe message. For example, if N=3 is selected in S803, then N=2 can be selected in S808.
[0135] S809: The first electronic device determines whether the resolution after the value is reduced is greater than or equal to the minimum resolution in the preset resolution level; if so, it returns to S801; otherwise, it proceeds to S810.
[0136] S810: The first electronic device determines that the service quality test based on all resolution levels has ended, does not switch communication connections for the time being, and returns to S801 after a preset time.
[0137] It should be noted that, Figure 8 In the illustrated embodiment, S801-S803 can be... Figure 5 In the illustrated embodiment, S501 is implemented in one way, and S804-S805 can be... Figure 5 The illustrated embodiment represents one implementation of steps S502-S504; for specific implementation details, please refer to [link to relevant documentation]. Figure 5 The embodiments shown are repeated hereafter.
[0138] Based on the above embodiments, this application also provides an electronic device, which includes multiple functional modules; the multiple functional modules interact to implement the methods described in the embodiments of this application. Figure 5The function performed by the first electronic device in the service quality detection method of the illustrated embodiment, or the function of performing... Figure 8 The service quality detection method in the illustrated embodiment. The multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on the specific implementation.
[0139] Based on the above embodiments, this application also provides an electronic device, which includes at least one processor and at least one memory, wherein the at least one memory stores computer program instructions, and when the electronic device is run, the at least one processor executes the methods described in the embodiments of this application. (Implementation follows) Figure 5 The function performed by the first electronic device in the service quality detection method of the illustrated embodiment, or the function of performing... Figure 8 The service quality detection method in the illustrated embodiment.
[0140] Based on the above embodiments, this application also provides a computer program that, when run on a computer, causes the computer to execute the methods described in the embodiments of this application.
[0141] Based on the above embodiments, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a computer, causes the computer to perform the methods described in the embodiments of this application.
[0142] Based on the above embodiments, this application also provides a chip for reading computer programs stored in a memory to implement the methods described in the embodiments of this application.
[0143] Based on the above embodiments, this application provides a chip system including a processor for supporting a computer device in implementing the methods described in the embodiments of this application. In one possible design, the chip system further includes a memory for storing necessary programs and data of the computer device. This chip system may be composed of chips or may include chips and other discrete devices.
[0144] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0145] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0146] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0147] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0148] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of protection of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A service quality testing method, applied to a first electronic device, characterized in that, The method includes: The first probe message is determined based on the first data message. The first data message is a data message sent by the first electronic device to the second electronic device through the first communication connection. The first probe message is used to detect the service quality of the second communication connection between the first electronic device and the second electronic device. The first probe message is sent to the second electronic device through the second communication connection, and the first response message is received from the second electronic device. The quality of service parameters of the second communication connection are determined based on the first probe message and the first response message.
2. The method as described in claim 1, characterized in that, Determining the first probe message based on the first data message includes: Acquire the first data packet sent by the first electronic device through the first communication connection within a preset time period, and determine the data volume of the first data packet; The data volume of the first probe message is determined based on the preset first resolution and the data volume of the first data message.
3. The method as described in claim 2, characterized in that, After acquiring the first data packet sent by the first electronic device within a preset time period through the first communication connection, and before determining the data volume of the first detection packet based on a preset first resolution and the data volume of the first data packet, the method further includes: Based on the data volume of the first data packet, it is determined that the service state of the first electronic device is not a resolution transition state.
4. The method as described in claim 2, characterized in that, After determining the quality of service parameters of the second communication connection based on the first probe message and the first response message, the method further includes: If it is determined that the quality of service parameters of the second communication connection do not meet the preset conditions, the second data packet sent by the first electronic device through the first communication connection within a preset time period is obtained, and the data volume of the second data packet is determined. The data size of the second probe message is determined based on a preset second resolution and the data size of the second data message; the second resolution is smaller than the first resolution. Send the second probe message through the second communication connection and receive the second response message returned by the second electronic device; The quality of service parameters of the second communication connection are determined based on the second probe message and the second response message.
5. The method as described in claim 4, characterized in that, The duration of the second probe message is less than the duration of the first probe message.
6. The method as described in claim 2 or 3, characterized in that, After determining the quality of service parameters of the second communication connection based on the first probe message and the first response message, the method further includes: Once the service quality parameters of the second communication connection are determined to meet the preset conditions, the second communication connection is switched to be used to send service data to the second electronic device. The resolution corresponding to the business data is the first resolution.
7. The method as described in claim 3, characterized in that, The step of determining that the service state of the first electronic device is not a resolution transition state based on the data volume of the first data packet includes: Determine the standard deviation and maximum value of the data size of the first data packet; When the ratio of the standard deviation to the maximum value is less than or equal to a preset threshold, it is determined that the service state of the first electronic device is not a resolution transition state.
8. The method according to any one of claims 1-5 and 7, characterized in that, The first communication connection is a Real-Time Audio and Video Transmission Network (RTN) connection, and the second communication connection is a peer-to-peer (P2P) connection.
9. The method according to any one of claims 1-5 and 7, characterized in that, The quality of service parameters for the second communication connection include latency and / or packet loss rate.
10. The method according to any one of claims 1-5, 7, characterized in that, The first electronic device is any one of a smart terminal device, a wearable device, an Internet of Things device, or a smart vehicle device; the second electronic device is any one of a smart terminal device, a wearable device, an Internet of Things device, or a smart vehicle device.
11. An electronic device, characterized in that, The method includes at least one processor coupled to at least one memory, the at least one processor being configured to read a computer program stored in the at least one memory to perform the method as described in any one of claims 1-10.
12. An electronic device, characterized in that, It includes multiple functional modules; the multiple functional modules interact with each other to implement the method as described in any one of claims 1-10.
13. A service quality detection system, characterized in that, The service quality detection system includes a first electronic device and a second electronic device; The first electronic device is configured to determine a first probe message based on a first data message, wherein the first data message is a data message sent by the first electronic device to the second electronic device through a first communication connection, and the first probe message is used to detect the service quality of the second communication connection between the first electronic device and the second electronic device; send the first probe message to the second electronic device through the second communication connection; and receive a first response message returned by the second electronic device. The quality of service parameters of the second communication connection are determined based on the first probe message and the first response message. The second electronic device is configured to receive the first probe message sent by the first electronic device; generate the first response message based on the first probe message; and send the first response message to the first electronic device.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-10.
15. A computer program, characterized in that, When the computer program is run on a computer, it causes the computer to perform the method as described in any one of claims 1-10.
Citation Information
Patent Citations
Cell switching method, base station and user equipment
CN107820282A
Method providing for adaptive streaming service, and device therefor
IN201817047756A