Network channel control method and electronic equipment
Patent Information
- Application Number
- CN202380087251.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-01-18
- Filing Date
- 2023-11-14
- Publication Date
- 2025-08-19
AI Technical Summary
When electronic devices use multiple network channels for data transmission, power consumption increases and is difficult to effectively reduce.
By obtaining the temperature and battery output current of the electronic device, when the temperature and current exceed the threshold, some available network channels are used for data transmission, and the network channels are dynamically adjusted to reduce power consumption.
It effectively reduces the power consumption of electronic equipment and improves network performance, especially under high temperature and high power consumption conditions.
Smart Images

Figure CN120513670A_ABST
Abstract
Description
Network channel control method and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on January 18, 2023, with application number 202310097496.8 and application name “Network Channel Control Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communication technology, and in particular to a network channel control method and electronic equipment. Background Art
[0003] With the continuous development of electronic technology, electronic devices such as mobile phones and tablet computers have become common tools in people's lives and work. In order to ensure that some services in electronic devices can be carried out normally, electronic devices can use network channels to transmit data.
[0004] When electronic devices use network channels to transmit data, how to reduce power consumption is a problem that needs to be solved.
[0005] Summary of the Invention
[0006] Embodiments of the present application provide a network channel control method and an electronic device, which can transmit data streams through some of M available network channels, thereby reducing the power consumption of the electronic device.
[0007] In a first aspect, an embodiment of the present application proposes a network channel control method, which is applied to an electronic device, the electronic device having multiple network channels, and a target application running on the electronic device; the method includes: the electronic device obtains the temperature of the electronic device and the output current of a battery in the electronic device; during the operation of the target application, when the temperature is greater than a first temperature threshold and / or the output current is greater than a first current threshold, and there are M available network channels among the multiple network channels, the electronic device uses a target network channel among the M available network channels to transmit the data stream of the target application; wherein the available network channel is a network channel that is performing data transmission and is in an available state for the target application, and the target network channel is N available network channels among the M available network channels, M is an integer greater than 1, N is an integer greater than or equal to 1, and N is less than M.
[0008] In this way, when the temperature of the electronic device is greater than the first temperature threshold and / or the output current of the battery is greater than the first current threshold, and there are M available network channels among the multiple network channels, the decision of whether to turn the network channel on or off can be triggered, and N available network channels are extracted from the M available network channels as target network channels to transmit the data stream of the target application, while other available network channels except the target network channels among the M available network channels no longer transmit the data stream of the target application, thereby reducing the power consumption of the electronic device.
[0009] In one possible implementation, before an electronic device uses a target network channel among M available network channels to transmit a data stream of a target application, the electronic device further includes: obtaining network quality information corresponding to the M available network channels, where the network quality information is used to characterize the network quality of the available network channels. When the difference between the network quality of at least two of the M available network channels is greater than a network quality threshold, the network quality of the target network channel is higher than the network quality of the other available network channels among the M available network channels excluding the target network channel. When the difference between the network quality of any two of the M available network channels is less than or equal to the network quality threshold, the priority of the target network channel is higher than the priorities of the other available network channels among the M available network channels excluding the target network channel. In this way, the available network channel with better network quality or higher priority can be used for data transmission, thereby reducing the power consumption of the electronic device while minimizing the degradation of network performance during the operation of the target application.
[0010] In one possible implementation, the method further includes: the electronic device obtaining a target network delay and a composite frame rate of an image; and the electronic device selecting a corresponding first temperature threshold and a first current threshold based on the target network delay and the composite frame rate. When the target network delay is less than the delay threshold and the composite frame rate is greater than the frame rate threshold, the first temperature threshold is a first temperature value and the first current threshold is a first current value. When the target network delay is greater than or equal to the delay threshold and / or the composite frame rate is less than or equal to the frame rate threshold, the first temperature threshold is a second temperature value and the first current threshold is a second current value. Furthermore, the first temperature value is less than the second temperature value and the first current value is less than the second current value. Thus, when the target network delay is less than the delay threshold and the composite frame rate is greater than the frame rate threshold, it indicates that the current network performance is relatively good. Therefore, the problem of high power consumption and heat generation of the electronic device can be addressed in advance, further reducing the power consumption of the electronic device. When the target network delay is greater than or equal to the delay threshold and / or the composite frame rate is less than or equal to the frame rate threshold, it indicates that the current network performance is relatively poor. Therefore, the network performance issue can be prioritized to further improve the network performance during the operation of the target application.
[0011] In one possible implementation, after the electronic device uses a target network channel among M available network channels to transmit the data stream of the target application, it also includes: the electronic device again obtains the temperature of the electronic device and the output current of the battery in the electronic device; when the re-obtained temperature and the re-obtained output current meet a first preset condition, the electronic device re-determines the target network channel for transmitting the data stream.
[0012] In one possible implementation, the first preset condition includes: the temperature acquired again is less than the second temperature threshold, and / or the output current acquired again is less than the second current threshold; the second temperature threshold is less than the first temperature threshold, and the second current threshold is less than the first current threshold. The electronic device re-determines the target network channel for transmitting the data stream, including: the electronic device adopts the target network channel, and some or all of the available network channels of M available network channels except the target network channel, to transmit the data stream. In this way, after adopting the target network channel to transmit the data stream, if the temperature of the electronic device drops to less than the second temperature threshold and / or the output current of the battery drops to less than the second current threshold, the electronic device can restore some or all of the closed available network channels among the M available network channels to transmit the data stream through the target network channel and the restored available network channels, thereby improving the network performance during the operation of the target application.
[0013] In one possible implementation, N is an integer greater than 1, and the first preset condition includes: the reacquired temperature is greater than a third temperature threshold, and / or the reacquired output current is greater than a third current threshold; the third temperature threshold is greater than the first temperature threshold, and the third current threshold is greater than the first current threshold. The electronic device re-determines a target network channel for transmitting the data stream, including: the electronic device transmits the data stream via a portion of the target network channels; wherein the network quality of the target network channels used for transmitting the data stream is higher than the network quality of the target network channels not used for transmitting the data stream; or, the priority of the target network channels used for transmitting the data stream is higher than the priority of the target network channels not used for transmitting the data stream. Thus, after using the target network channels for transmitting the data stream, if the temperature of the electronic device continues to rise above the third temperature threshold, and / or the output current of the battery continues to rise above the third current threshold, the electronic device may continue to transmit the target application's data stream via a portion of the target network channels, while other portions of the target network channels no longer transmit the target application's data stream, thereby further reducing the power consumption of the electronic device.
[0014] In one possible implementation, after the electronic device adopts the target network channel among M available network channels to transmit the data stream of the target application, it also includes: the electronic device again obtains the target network delay and the composite frame rate of the image; when the re-acquired target network delay satisfies the second preset condition relative to the target network delay obtained before the target network channel decision is made, and / or the re-acquired composite frame rate satisfies the third preset condition relative to the composite frame rate obtained before the target network channel decision is made, the electronic device adopts the target network channel, and some or all of the available network channels of the M available network channels except the target network channel, to transmit the data stream.
[0015] In one possible implementation, the second preset condition includes: the difference between the reacquired target network delay and the target network delay acquired before the target network channel decision is made is greater than the product of the first preset ratio and the target network delay acquired before the target network channel decision is made; the first preset ratio is greater than 0 and less than 1. The third preset condition includes: the difference between the composite frame rate acquired before the target network channel decision is made and the reacquired composite frame rate is greater than the product of the second preset ratio and the composite frame rate acquired before the target network channel decision is made; the second preset ratio is greater than 0 and less than 1. Thus, after using the target network channel to transmit the data stream, if the target network delay increases and the increased target network delay meets the second preset condition, and / or if the reduced composite frame rate decreases and the decreased composite frame rate meets the third preset condition, the electronic device can restore some or all of the M available network channels that were closed, so as to transmit the target application's data stream via the target network channel and the restored available network channels, thereby improving network performance during the operation of the target application.
[0016] In one possible implementation, the electronic device includes a temperature sensor, a temperature sensor driver, a fuel meter, a fuel meter driver, and a network channel decision module. The electronic device obtains the temperature of the electronic device and the output current of the battery in the electronic device, including: the temperature sensor driver obtains the actual temperature of the target device collected by the temperature sensor; the temperature sensor driver determines the temperature of the electronic device based on the actual temperature; the temperature sensor driver sends the temperature of the electronic device to the network channel decision module; the fuel meter driver obtains the output current of the battery collected by the fuel meter; the fuel meter driver sends the output current to the network channel decision module. In this way, the network channel decision module can obtain the temperature of the electronic device through the temperature sensor and the temperature sensor driver, and the network channel decision module can obtain the output current of the battery through the fuel meter and the fuel meter driver.
[0017] In one possible implementation, an electronic device includes a connection service, a network channel control module, and a network channel decision module. The electronic device obtains network quality information corresponding to M available network channels, including: the connection service sends the network status information of each network channel and the identification information of the network channel currently transmitting data to the network channel control module; the network status information includes the activation status of the network channel and the network quality information when the activation status is available, where the activation status includes available or unavailable; the network channel control module sends the network status information of each network channel and the identification information of the network channel currently transmitting data to the network channel decision module; the network channel decision module determines, from multiple network channels, an available network channel that is currently transmitting data and has an activation status of available, based on the activation status of each network channel and the identification information of the network channel currently transmitting data; and the network channel decision module extracts the network quality information corresponding to the available network channel from the network status information of each network channel.
[0018] In one possible implementation, the multiple network channels include a cellular channel and a wireless fidelity (WiFi) channel, and the electronic device further includes a phone manager, a WiFi manager, a cellular network driver, a WiFi network driver, a mobile communication module, and a wireless communication module. Before the connection service sends network status information of each network channel to the network channel control module, the following steps are further performed: the cellular network driver obtains the network status information of the cellular channel from the mobile communication module; the cellular network driver sends the network status information of the cellular channel to the connection service via the phone manager; the WiFi network driver obtains the network status information of the WiFi channel from the wireless communication module; and the WiFi network driver sends the network status information of the WiFi channel to the connection service via the WiFi manager.
[0019] In one possible implementation, an electronic device uses a target network channel from among M available network channels to transmit a data stream for a target application, including: a network channel decision module selects N available network channels from among the M available network channels as target network channels based on network quality information corresponding to the M available network channels; the network channel decision module sends a network on / off decision result to a network channel control module; the network on / off decision result is used to indicate that the data stream is to be transmitted through the target network channel, rather than through other available network channels among the M available network channels except the target network channel; the network channel control module sends the network on / off decision result to a connection service; and the connection service controls the target network channel from among the M available network channels to transmit the data stream based on the network on / off decision result. In this way, the network channel decision module can make a network channel on / off decision, so that the connection service can control the target network channel to transmit the data stream, while other available network channels among the M available network channels except the target network channel do not transmit the data stream, thereby reducing the power consumption of the electronic device.
[0020] In one possible implementation, the electronic device further includes a phone manager, a WiFi manager, a cellular network driver, a WiFi network driver, a mobile communication module, and a wireless communication module. The connection service controls a target network channel among M available network channels to transmit a data stream based on a network on / off decision result, including: when the other available network channels among the M available network channels, except the target network channel, include a cellular channel, the connection service sends a first control instruction to the cellular network driver via the phone manager; the cellular network driver controls the mobile communication module not to transmit the data stream based on the first control instruction; and / or, when the other available network channels among the M available network channels, except the target network channel, include a WiFi channel, the connection service sends a second control instruction to the WiFi network driver via the WiFi manager; the WiFi network driver controls the wireless communication module not to transmit the data stream based on the second control instruction.
[0021] In one possible implementation, the electronic device includes an application information receiving module, a graphics library, a graphics interface hook module, an image synthesizer, a frame rate detection module, and a network channel decision module. The electronic device obtains the target network delay and the synthesized frame rate of the image, including: the target application sends a first network delay to the application information receiving module; the application information receiving module sends the first network delay to the network channel decision module; when the target application calls the graphics library to draw and render the image, the graphics interface hook module obtains a drawing and rendering instruction from the graphics library; the graphics interface hook module determines a second network delay based on the drawing and rendering instruction; the graphics interface hook module sends the second network delay to the network channel decision module; the network channel decision module determines the target network delay based on the first network delay and / or the second network delay; when the image synthesizer synthesizes the drawn and rendered image, the frame rate detection module obtains the synthesis time when each frame of the image is synthesized; the frame rate detection module calculates the synthesized frame rate based on the synthesis time when each frame of the image is synthesized; and the frame rate detection module sends the synthesized frame rate to the network channel decision module. In this way, the first network delay can be obtained through the application information receiving module, the second network delay can be obtained through the graphics library and the graphics interface hook module, and the composite frame rate can be obtained through the image synthesizer and the frame rate detection module. In this way, in the on-off decision stage of the network channel, the appropriate first temperature threshold and first current threshold are selected according to the first network delay, the second network delay and the composite frame rate. In the feedback stage after the network channel is on and off, the target network channel for transmitting the data stream is adjusted again according to the first network delay, the second network delay and the composite frame rate.
[0022] In one possible implementation, the electronic device selects a corresponding first temperature threshold and a first current threshold based on a target network delay and a synthetic frame rate, including: a network channel decision module selects a corresponding first temperature threshold and a first current threshold based on the target network delay and the synthetic frame rate.
[0023] In one possible implementation, the drawing rendering instruction includes characteristic parameters corresponding to multiple user interface (UI) controls, and the characteristic parameters include the size and position of the UI controls. The graphics interface hook module determines the second network delay based on the drawing rendering instruction, including: the graphics interface hook module determines the target UI control for characterizing the network delay from multiple UI controls based on the characteristic parameters corresponding to the multiple UI controls; the graphics interface hook module calculates the pixel ratio of various colors included in the target UI control; the graphics interface hook module determines the second network delay based on the color with the largest pixel ratio. In this way, when the target application is a game application, the second network delay can be calculated using the characteristic parameters corresponding to the UI control, so that the first network delay and the second network delay can be applied to the decision-making process of whether the network channel is on or off and the feedback process after the network channel is on or off.
[0024] In one possible implementation, the frame rate detection module calculates the synthesis frame rate based on the synthesis time when each frame of the image is synthesized, including: the frame rate detection module counts the number of synthesis times obtained within a preset period; the frame rate detection module determines the ratio of the number to the preset period as the synthesis frame rate.
[0025] In one possible implementation, the frame rate detection module calculates the synthesis frame rate based on the synthesis time of each frame image, including: the frame rate detection module counts the average time interval between the synthesis times of the most recent multiple frame images; the frame rate detection module determines the reciprocal of the average time interval as the synthesis frame rate.
[0026] In a possible implementation, the M available network channels include a first network channel and a second network channel, the first network channel is a cellular channel, and the second network channel is a WiFi channel.
[0027] In one possible implementation, the target application is a gaming application. Therefore, before the electronic device uses the target network channel among the M available network channels to transmit the data stream of the target application, the electronic device may further determine whether the currently running target application is a gaming application. If the currently running target application is a gaming application, and the temperature of the electronic device is greater than a first temperature threshold and / or the output current of the battery is greater than a first current threshold, and there are M available network channels among the multiple network channels, the electronic device will use the target network channel among the M available network channels to transmit the data stream of the target application.
[0028] In a second aspect, an embodiment of the present application proposes an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call the computer program to execute the above-mentioned network channel control method.
[0029] In a third aspect, an embodiment of the present application proposes a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed, the above-mentioned network channel control method is implemented.
[0030] In a fourth aspect, an embodiment of the present application proposes a computer program product, including a computer program, which enables a computer to execute the above-mentioned network channel control method when the computer program is run.
[0031] The possible implementation methods of the second to fourth aspects have effects similar to those of the first aspect and the possible designs of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] FIG1 is a software system interaction diagram provided by the related art when cellular channels and WiFi channels are used simultaneously for data transmission;
[0033] FIG2 is a schematic diagram of the hardware system structure of an electronic device provided in an embodiment of the present application;
[0034] FIG3 is a schematic diagram of the software system structure of an electronic device provided in an embodiment of the present application;
[0035] FIG4 is a software system interaction diagram of a network channel control method provided in an embodiment of the present application;
[0036] FIG5 is a flow chart of the network channel decision process provided by an embodiment of the present application;
[0037] FIG6 is a UI interface diagram of a game scenario provided by an embodiment of the present application;
[0038] FIG7 is a flow chart of a feedback process after a network channel decision according to an embodiment of the present application;
[0039] FIG8 is a flow chart of another feedback process after network channel decision according to an embodiment of the present application;
[0040] FIG9 is a flow chart of another feedback process after network channel decision-making according to an embodiment of the present application;
[0041] FIG10 is a schematic structural diagram of a network channel control device provided in an embodiment of the present application;
[0042] FIG11 is a schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] To facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first chip and the second chip are merely used to distinguish different chips and do not limit their order. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or execution order, and the words "first" and "second" do not necessarily mean that they are different.
[0044] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0045] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0046] With the continuous development of electronic technology, electronic devices such as mobile phones and tablets have become common tools in people's lives and work. To meet their various usage needs, users can download and install third-party applications on their electronic devices, such as game applications, video chat applications, live streaming applications, and video conferencing applications.
[0047] During the use of electronic devices, in order to ensure that some services in the electronic devices can be carried out normally, the electronic devices can use network channels such as cellular channels and WiFi channels to transmit data.
[0048] During the operation of certain applications installed on electronic devices, especially in operating scenarios with relatively high network quality requirements, in order to cope with network fluctuations, multiple available network channels are usually used and data transmission is carried out in a redundant packet manner. This will lead to increased power consumption of electronic devices.
[0049] For example, when a game application is in a game battle scenario, a video chat application is in an audio / video chat scenario, a live broadcast application is in a live broadcast scenario, and a video conferencing application is in a video conferencing scenario, the electronic device may use multiple available network channels and transmit data in a redundant packet manner.
[0050] For example, for gaming apps (such as Honor of Kings), after enabling network optimization within the app, when the game enters a competitive scenario, it will use both cellular and WiFi channels to send data packets for data transmission. During a specific game, the game app used both cellular and WiFi channels to send data packets. After the game, the total power consumption of the device was 309.22mAh, of which the cellular channel's business power consumption was 39.45mAh. This indicates that the cellular channel's business power consumption accounts for approximately 13% of the total power consumption.
[0051] For example, Figure 1 is a software system interaction diagram provided by the related art when using cellular channels and WiFi channels for data transmission at the same time. It can be applied to electronic devices. Taking the operating system of the electronic device as the Android system as an example, the electronic device may include an application layer, an application framework layer, a system library, and a kernel layer. The application layer includes the running target application, which can be a game application or a video chat application, etc. The application framework layer includes a connectivity service (CS), a phone manager, and a WiFi manager. The kernel layer includes a cellular network driver and a WiFi network driver. Referring to Figure 1, it may include the following steps:
[0052] S101: The target application sends a request to a connection service for obtaining an available network channel.
[0053] After the target application on the electronic device is started, the target application can send a request for obtaining an available network channel to the connection service in the application framework layer by calling the requestNetwork interface.
[0054] The request to obtain available network channels can obtain the activation status of each network channel and network quality information when the activation status is available. The activation status of a network channel includes an available state and a disabled state. The available state indicates that the network channel can be activated, and the disabled state indicates that the network channel cannot be activated.
[0055] S102: The connection service sends a query instruction for the network status information of the cellular channel to the phone manager in response to the request for obtaining the available network channel.
[0056] After receiving the request for obtaining an available network channel sent by the target application, the connection service can respond to the request by sending a query instruction for the network status information of the cellular channel to the telephony network factory to inquire whether the current cellular channel is available and the network quality information when the cellular channel is in an available state.
[0057] S103 : The phone manager obtains the network status information of the cellular channel through the cellular network driver in response to the query instruction of the network status information of the cellular channel.
[0058] After receiving a query request for the cellular channel's network status from the connection service, the phone manager responds to the query request by invoking the cellular network driver (i.e., the modem driver) to obtain the cellular channel's network status information. This cellular channel's network status information includes whether the cellular channel is available and, if so, the network quality information.
[0059] Specifically, the electronic device further includes a mobile communication module located at the hardware layer. The telephony manager can send a query instruction for cellular channel network status information to the cellular network driver, causing the cellular network driver to obtain the cellular channel network status information from the mobile communication module based on the query request. The cellular network driver then transmits the obtained cellular channel network status information to the telephony manager.
[0060] In some embodiments, the network quality information includes at least one of signal strength, bandwidth, and signal-to-interference plus noise ratio (SINR). The signal strength may be a received signal strength indication (RSSI). Of course, it is understood that the signal strength may also be other specific parameters representing the signal strength, which may be set according to specific circumstances and are not limited in this embodiment of the present application.
[0061] S104: The phone manager sends the network status information of the cellular channel to the connection service.
[0062] S105 , the connection service sends a query instruction for the network status information of the WiFi channel to the WiFi manager in response to the request for obtaining the available network channel.
[0063] After receiving the available network channel acquisition request sent by the target application, the connection service can respond to the available network channel acquisition request by sending a query instruction for the network status information of the WiFi channel to the WiFi manager (WiFi network factory) to query whether the current WiFi channel is available and the network quality information when the WiFi channel is in the available state.
[0064] It is understandable that there is no fixed execution order for S102 and S105. After receiving the request for obtaining available network channels sent by the target application, the connection service can simultaneously send query instructions to the phone manager and the WiFi manager, that is, S102 and S105 can be performed synchronously.
[0065] S106 , the WiFi manager obtains the network status information of the WiFi channel through the WiFi network driver in response to the query instruction of the network status information of the WiFi channel.
[0066] After receiving a query request for the WiFi channel's network status from the connection service, the WiFi manager responds to the query request by calling the WiFi network driver to obtain the WiFi channel's network status information. The WiFi channel's network status information includes whether the WiFi channel is available and, if so, the network quality information.
[0067] Specifically, the electronic device further includes a wireless communication module located at the hardware layer. The WiFi manager can send a query instruction for the network status information of the WiFi channel to the WiFi network driver, so that the WiFi network driver obtains the network status information of the WiFi channel from the wireless communication module according to the query request; the WiFi network driver then sends the obtained network status information of the WiFi channel to the WiFi manager.
[0068] S107: The WiFi manager sends the network status information of the WiFi channel to the connection service.
[0069] S108 , the connection service notifies the target application of the available network channel.
[0070] After receiving the network status information of the cellular channel sent by the phone manager and the network status information of the WiFi channel sent by the WiFi manager, the connection service notifies the target application of the available network channel by calling the onAvailable(network) method.
[0071] S109 , the target application binds to a WiFi channel and sends the data packet allocated on the WiFi channel to the WiFi network driver.
[0072] S110 , the target application binds to the cellular channel and sends the data packet allocated on the cellular channel to the cellular network driver.
[0073] When the target application detects an available network channel, it calls the network.bindSocket function to bind the socket to the available network channel. The target application also replicates all or part of the data packets that need to be sent redundantly and allocates the data packets to be transmitted on each available network channel.
[0074] For example, when both the cellular channel and the WiFi channel are available, the target application allocates data packets to be transmitted on the cellular channel and the WiFi channel. The target application then sends the allocated data packets to the cellular network driver and the WiFi network driver. The cellular network driver sends the data packets to the mobile communication module, which then transmits the data packets to the target application's corresponding server under the control of the corresponding network protocol. Correspondingly, the WiFi network driver sends the data packets to the wireless communication module, which then transmits the data packets to the target application's corresponding server under the control of the corresponding network protocol.
[0075] For example, if the available network channels include a cellular channel and a WiFi channel, and the target application includes a data stream containing five data packets, namely, the first, second, third, fourth, and fifth data packets. The target application can then copy the first, third, and fifth data packets of these five data packets and allocate the cellular channel to transmit the first, third, and fifth data packets, while allocating the WiFi channel to transmit the first, second, third, fourth, and fifth data packets. This means that the cellular channel redundantly transmits three data packets, and the data packets redundantly transmitted by the cellular channel are the same as some of the data packets transmitted by the WiFi channel. Therefore, the target application can send the first, third, and fifth data packets to the cellular network driver, which then transmits them to the server corresponding to the target application via the cellular network driver and the mobile communication module. The target application can also send the first, second, third, fourth, and fifth data packets to the WiFi network driver, which then transmits them to the server corresponding to the target application via the WiFi network driver and the wireless communication module.
[0076] It is understood that the server corresponding to the target application can respond to the earliest received data packet to return a response data packet to the electronic device. For example, if the server corresponding to the target application first receives the first data packet transmitted via the WiFi channel and then receives the first data packet transmitted via the cellular channel, the server corresponding to the target application can respond to the first data packet transmitted via the WiFi channel to return a response data packet to the electronic device.
[0077] In some embodiments, the format of the data packets sent by the target application may be User Datagram Protocol (UDP), Transmission Control Protocol (TCP), Real-time Transport Protocol (RTP), etc. For example, when the target application is a gaming application, the format of the data packets sent by the target application may be UDP; when the target application is a video chat application in a video chat scenario, the format of the data packets sent by the target application may be RTP.
[0078] In this way, the target application uses multiple available network channels and transmits data in a redundant packet manner, which will lead to increased power consumption of electronic devices.
[0079] Based on this, an embodiment of the present application provides a network channel control method, which obtains the temperature of an electronic device and the output current of a battery in the electronic device. During the operation of a target application, when the temperature is greater than a first temperature threshold and / or the output current is greater than a first current threshold, and there are M available network channels among multiple network channels, a target network channel among the M available network channels is used to transmit the data stream of the target application. Wherein, an available network channel is a network channel that is currently transmitting data and is in an available state for the target application, and the target network channel is N available network channels among the M available network channels, where M is an integer greater than 1, N is an integer greater than or equal to 1, and N is less than M.
[0080] In this way, when the temperature of the electronic device is greater than the first temperature threshold and / or the output current of the battery is greater than the first current threshold, and there are M available network channels among the multiple network channels, the decision of network channel on and off is triggered, and N available network channels are extracted from the M available network channels as target network channels to transmit the data stream of the target application, while other available network channels except the target network channels among the M available network channels no longer transmit the data stream of the target application, thereby reducing the power consumption of the electronic device.
[0081] The network channel control method provided in the embodiment of the present application can be applied to electronic devices. The electronic device can also be called a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The electronic device can be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiments of the present application do not limit the specific technology and specific device form adopted by the electronic device.
[0082] In order to better understand the embodiments of the present application, the structure of the electronic device according to the embodiments of the present application is introduced below.
[0083] 2 shows a schematic structural diagram of an electronic device 200. The electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display 294, and a subscriber identification module (SIM) card interface 295.
[0084] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 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.
[0085] The processor 210 may include one or more processing units. For example, the processor 210 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). Different processing units may be independent devices or integrated into one or more processors.
[0086] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0087] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the instruction or data again, it can retrieve it from the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.
[0088] The charging management module 240 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. The power management module 241 is configured to connect the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240 to power the processor 210, the internal memory 221, the display 294, the camera 293, and the wireless communication module 260.
[0089] The wireless communication function of the electronic device 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor and the baseband processor.
[0090] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The antennas in electronic device 200 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.
[0091] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 200. The mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the same device as at least some of the modules of the processor 210.
[0092] 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 a sound signal through an audio device (not limited to the speaker 270A, the receiver 270B, etc.) or displays an image or video through the display screen 294. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be set in the same device as the mobile communication module 250 or other functional modules.
[0093] The wireless communication module 260 can provide wireless communication solutions including wireless local area networks (WLAN) (such as WiFi networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. applied to the electronic device 200. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0094] In some embodiments, antenna 1 of electronic device 200 is coupled to mobile communication module 250, and antenna 2 is coupled to wireless communication module 260, so that electronic device 200 can communicate with a network and other devices via wireless communication technology. 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 technology, etc. 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 the satellite based augmentation system (SBAS).
[0095] Electronic device 200 implements display functionality through a GPU, display screen 294, and an application processor. A GPU is a microprocessor for image processing that connects display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or modify display information.
[0096] The electronic device 200 can implement a shooting function through an ISP, a camera 293, a video codec, a GPU, a display screen 294, and an application processor.
[0097] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200. The external memory card communicates with the processor 210 via the external memory interface 220 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0098] The internal memory 221 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area may 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 may store data created during the use of the electronic device 200 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 221 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 210 executes various functional applications and data processing of the electronic device 200 by running instructions stored in the internal memory 221 and / or instructions stored in a memory provided in the processor.
[0099] The electronic device 200 can implement audio functions such as music playback and recording through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone jack 270D, and the application processor.
[0100] The buttons 290 include a power button, a volume button, and the like. The buttons 290 may be mechanical buttons or touch buttons. The electronic device 200 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 200.
[0101] Motor 291 can generate vibration alerts. Motor 291 can be used for incoming call vibration alerts or touch vibration feedback. Indicator 292 can be an indicator light that can be used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. SIM card interface 295 is used to connect a SIM card. The SIM card can be connected to and disconnected from electronic device 200 by inserting or removing it from SIM card interface 295.
[0102] The software system of the electronic device 200 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture, etc. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 200.
[0103] Figure 3 is a block diagram of the software structure of an electronic device according to an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0104] The application layer may include a series of application packages. As shown in Figure 3, the application package may include applications such as phone, email, games, and video chat.
[0105] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0106] As shown in FIG3 , the application framework layer may include a connection service, a phone manager, a WiFi manager, an application information receiving module, an activity manager, a resource manager, and a view system.
[0107] In response to a request from a target application for available network channels, the connection service sends a query instruction for the network status of the cellular channel to the telephony manager, and sends a query instruction for the network status of the WiFi channel to the WiFi manager. Furthermore, the connection service receives network status information for the cellular channel from the telephony manager and WiFi channel from the WiFi manager, and notifies the target application of the available network channels. Cellular channel network status information includes the cellular channel's activation status and network quality information when the activation status is available; WiFi channel network status information includes the WiFi channel's activation status and network quality information when the activation status is available.
[0108] Moreover, when the network channel for data transmission includes a cellular channel, the connection service may also receive first data monitoring information sent by the phone manager, and the first data monitoring information may include identification information of the cellular channel for data transmission, etc.; when the network channel for data transmission includes a WiFi channel, the connection service may also receive second data monitoring information sent by the WiFi manager, and the second data monitoring information may include identification information of the WiFi channel for data transmission, etc.
[0109] In addition, the connection service can also send the network status information of each network channel and the identification information of the network channel in which data is being transmitted to the network channel control module, and receive the network on / off decision result sent by the network channel control module, and send a first control instruction to the phone manager and / or send a second control instruction to the WiFi manager based on the network on / off decision result. The first control instruction is used to control the mobile communication module not to transmit the data stream of the target application, and the second control instruction is used to control the wireless communication module not to transmit the data stream of the target application.
[0110] The phone manager is used to manage cellular services on electronic devices. For example, the phone manager manages call status (including connected and disconnected) and cellular data connection status (including connected to the cellular network, disconnected from the cellular network, connecting to the cellular network, and disconnecting from the cellular network).
[0111] It can be understood that the cellular network may include 2G network, 3G network, 4G network and 5G network (such as SA network), etc.
[0112] In some embodiments, the phone manager is configured to, in response to a query instruction for network status information of a cellular channel sent by a connection service, call a cellular network driver to obtain network status information of the cellular channel, and send the obtained network status information of the cellular channel to the connection service. Furthermore, the phone manager is configured to transmit a first control instruction sent by the connection service to the cellular network driver. Furthermore, the phone manager may monitor, via the cellular network driver, whether the cellular channel is currently transmitting data. When the network channel currently transmitting data includes a cellular channel, the phone manager sends first data monitoring information to the connection service. The first data monitoring information may include, for example, identification information of the cellular channel currently transmitting data.
[0113] The WiFi manager is used to provide management functions for WiFi-related services of electronic devices. In some embodiments, the WiFi manager is used to respond to a query instruction for the network status information of the WiFi channel sent by the connection service, call the WiFi network driver to obtain the network status information of the WiFi channel, and send the obtained network status information of the WiFi channel to the connection service. In addition, the WiFi manager is also used to transmit the second control instruction sent by the connection service to the WiFi network driver. In addition, the WiFi manager can also monitor whether the WiFi channel is currently transmitting data through the WiFi network driver. When the network channel currently transmitting data includes a WiFi channel, the WiFi manager sends second data monitoring information to the connection service. The second data monitoring information may include identification information of the WiFi channel currently transmitting data, etc.
[0114] The application information receiving module is used to receive the first network delay sent by the target application, and send the first network delay to the network channel decision module.
[0115] The Activity Manager is used to manage the lifecycle of each application and the navigation back function. It is responsible for creating the Android main thread and maintaining the lifecycle of each application.
[0116] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0117] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0118] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.
[0119] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0120] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0121] The system library may include multiple functional modules, such as a graphics library, a surface flinger (SF), a graphics interface hook module, a frame rate detection module, a network channel control module, and a network channel decision module.
[0122] A graphics library, also known as a drawing library, is used to define a cross-programming language and cross-platform API that contains many functions for processing graphics. For example, the graphics library may include the libEGL graphics library, which the target application can call to render images.
[0123] In a possible implementation, the target application renders the image by calling the graphics library. The target application then sends the rendered image to the image compositor's cache queue. Whenever the vertical synchronization (Vsync) signal arrives, the image compositor sequentially retrieves a frame of image to be synthesized from the cache queue and then synthesizes the image.
[0124] The graphics interface hook (interception) module obtains drawing rendering instructions from the graphics library by replacing the graphics library interface (an existing function of OpenGL). Based on the characteristic parameters corresponding to multiple UI controls in the rendering instructions, it determines the target UI control used to characterize the network latency from among the multiple UI controls. It then calculates the pixel ratio of each color included in the target UI control, determines the second network latency based on the color with the largest pixel ratio, and sends the second network latency to the network channel decision module.
[0125] The frame rate detection module is used to obtain the synthesis time of each frame of the image when the image synthesizer synthesizes the rendered image, calculate the synthesis frame rate according to the synthesis time of each frame of the image, and send the calculated synthesis frame rate to the network channel decision module.
[0126] The network channel control module is used to receive the network status information of each network channel sent by the connection service, as well as the identification information of the network channel in which data transmission is in progress, and then send the network status information of each network channel and the identification information of the network channel in which data transmission is in progress to the network channel decision module; the network channel control module is also used to receive the network on / off decision result sent by the network channel decision module, and send the network on / off decision result to the connection service.
[0127] The network channel decision module is used to receive the temperature of the electronic device driven by the temperature sensor and the output current of the battery driven by the fuel gauge, and when it is determined that the temperature of the electronic device is greater than a first temperature threshold and / or the output current of the battery is greater than a first current threshold, and there are M available network channels among the multiple network channels that are currently transmitting data and are available for the target application, select N available network channels from the M available network channels as target network channels, and send the network on / off decision result to the network channel control module. Wherein, M is an integer greater than 1, N is an integer greater than or equal to 1, and N is less than M.
[0128] In addition, the network channel decision module can also select an appropriate first temperature threshold and first current threshold based on the first network delay sent by the application information receiving module, the second network delay sent by the graphics interface hook module, and the synthetic frame rate sent by the frame rate detection module.
[0129] In addition, after controlling the target network channel among the M available network channels according to the network on-off decision result to transmit the data stream of the target application, and not transmitting the data stream of the target application through other available network channels except the target network channel among the M available network channels, the network channel decision module can also re-determine the target network channel for transmitting the data stream of the target application based on the re-acquired temperature of the electronic device, the re-acquired output current of the battery, the re-acquired first network delay, the re-acquired second network delay, and the re-acquired synthetic frame rate of the image.
[0130] The kernel layer is the layer between hardware and software. The kernel layer includes at least cellular network drivers, Wi-Fi network drivers, temperature sensor drivers, and fuel gauge drivers.
[0131] The hardware can be a mobile communication module, a wireless communication module, a temperature sensor, a power meter, etc.
[0132] In some embodiments, the cellular network driver can obtain the network status information of the cellular channel from the mobile communication module and send the network status information of the cellular channel to the phone manager; and the cellular network driver can also control the mobile communication module not to transmit the data stream of the target application according to the first control instruction.
[0133] The WiFi network driver can obtain the network status information of the WiFi channel from the wireless communication module and send the network status information of the WiFi channel to the WiFi manager; and the WiFi network driver can also control the wireless communication module not to transmit the data stream of the target application according to the second control instruction.
[0134] The temperature sensor driver is used to obtain the actual temperature of the target device collected by the temperature sensor, determine the temperature of the electronic device based on the actual temperature, and send the temperature of the electronic device to the network channel decision module.
[0135] The fuel gauge driver is used to obtain the battery output current collected by the fuel gauge and send the battery output current to the network channel decision module.
[0136] It should be noted that although the embodiments of the present application are described using the Android system, the principles of the network channel control method are also applicable to electronic devices with operating systems such as iOS or Windows.
[0137] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be implemented independently or in combination with each other. For the same or similar concepts or processes, some embodiments may not be described in detail.
[0138] In an embodiment of the present application, after the network optimization function is enabled in a game application (such as the Honor of Kings application), it will use multiple available network channels to carry the data stream corresponding to the game application; and in a video chat scenario of a video chat application (such as WeChat), it will also use multiple available network channels to carry the data stream corresponding to the video chat application. Of course, the application scenarios of the embodiment of the present application are not limited to the above two scenarios. As long as multiple available network channels are used to carry data streams during the operation of the application, the scenario is applicable, and the embodiment of the present application does not limit this.
[0139] Furthermore, the number of available network channels that can be used to transmit the data stream included in the target application is M, where M is an integer greater than 1. The available network channels can be cellular channels, WiFi channels, or other network channels.
[0140] Exemplarily, the number of available network channels in the embodiment of the present application may be 2, that is, M is equal to 2, and the two available network channels are respectively the first network channel and the second network channel, and the number of the first network channel and the second network channel are both 1. The first network channel may be a cellular channel, and the second network channel may be a WiFi channel. Alternatively, the first network channel and the second network channel may both be cellular channels, and the two cellular channels are different. For example, two SIM cards are installed in the electronic device, one of which supports the first cellular channel, and the other supports the second cellular channel. Alternatively, the first network channel and the second network channel may both be WiFi channels, and the two WiFi channels are different. For example, the electronic device may support dual WiFi connections, where one WiFi channel may be a 2.4 GHz band network, and the other WiFi channel may be a 5 GHz band network.
[0141] Of course, the number of available network channels in the embodiments of the present application may also be greater than 2, that is, M is an integer greater than 2. For example, the M available network channels may include one cellular channel and at least two WiFi channels; or, the M available network channels may include one WiFi channel and at least two cellular channels; or, the M available network channels may include at least two cellular channels and at least two WiFi channels.
[0142] The following takes an example in which M available network channels include a first network channel and a second network channel, the first network channel is a cellular channel, the second network channel is a WiFi channel, and the number of the first network channel and the second network channel is 1 to illustrate the implementation of the network channel control method provided in an embodiment of the present application.
[0143] Exemplarily, FIG4 is a software system interaction diagram of a network channel control method provided in an embodiment of the present application. Referring to FIG4 , the network channel control method can be applied to an electronic device. Taking the operating system of the electronic device as the Android system as an example, the electronic device may include an application layer, an application framework layer, a system library and a kernel layer. The application layer includes a running target application, which may be a game application or a video chat application, etc.; the application framework layer includes a connection service, a phone manager, a WiFi manager and an application information receiving module; the system library includes a graphics library, an image synthesizer, a graphics interface hook module, a frame rate detection module, a network channel control module and a network channel decision module; the kernel layer includes a cellular network driver, a WiFi network driver, a temperature sensor driver and a power meter driver. In addition, the electronic device may also include a hardware layer (not shown in FIG4 ), and the hardware layer includes a mobile communication module, a wireless communication module, a temperature sensor and a power meter.
[0144] As shown in FIG4 , the network channel control method may specifically include the following steps:
[0145] S401: The target application sends a request to the connection service for obtaining an available network channel.
[0146] S402: The connection service sends a query instruction for the network status information of the cellular channel to the phone manager in response to the request for obtaining the available network channel.
[0147] S403: The phone manager obtains the network status information of the cellular channel through the cellular network driver in response to the query instruction of the network status information of the cellular channel.
[0148] S404: The phone manager sends the network status information of the cellular channel to the connection service.
[0149] That is, the cellular network driver can obtain the network status information of the cellular channel from the mobile communication module, and send the network status information of the cellular channel to the connection service through the phone manager.
[0150] S405 : The connection service sends a query instruction for the network status information of the WiFi channel to the WiFi manager in response to the request for obtaining the available network channel.
[0151] S406 : The WiFi manager obtains the network status information of the WiFi channel through the WiFi network driver in response to the query instruction of the network status information of the WiFi channel.
[0152] S407: The WiFi manager sends the network status information of the WiFi channel to the connection service.
[0153] That is, the WiFi network driver can obtain the network status information of the WiFi channel from the wireless communication module, and send the network status information of the WiFi channel to the connection service through the WiFi manager.
[0154] S408: The connection service notifies the target application of the available network channel.
[0155] It should be noted that the specific implementation process of S401 to S408 is similar to the specific implementation process of S101 to S108 described above, and will not be described again here to avoid repetition.
[0156] S409: The target application binds to a WiFi channel and sends the data packet allocated on the WiFi channel to the WiFi network driver.
[0157] S410: The target application binds to a cellular channel and sends data packets allocated on the cellular channel to a cellular network driver.
[0158] When the target application detects an available network channel, it binds to the available network channel and copies all or part of the data packets that need to be sent redundantly. It then allocates the data packets to be transmitted on each available network channel. Finally, the target application sends the allocated data packets to the cellular network driver and the WiFi network driver. The cellular network driver sends the corresponding data packets to the mobile communication module, and the WiFi network driver sends the corresponding data packets to the wireless communication module.
[0159] S411 , the temperature sensor driver sends the temperature of the electronic device to the network channel decision module.
[0160] During the use of electronic devices, the network channel decision module needs to continuously obtain device status information. This device status information can be divided into two parts: thermal data and power consumption data. Thermal data can be represented by the temperature at certain specified locations in the electronic device, and power consumption data can be represented by the output current of the battery in the electronic device (the corresponding hardware node is VPH_PWR). In other words, the device status information can include the temperature of the electronic device and the output current of the battery in the electronic device.
[0161] Specifically, the temperature sensor driver obtains the actual temperature of the target device collected by the temperature sensor; the temperature sensor driver determines the temperature of the electronic device according to the actual temperature; and the temperature sensor driver sends the temperature of the electronic device to the network channel decision module.
[0162] In some embodiments, a temperature sensor is provided near a target device in an electronic device. The temperature sensor can detect the actual temperature of the target device in real time, and the temperature sensor can report the detected actual temperature of the target device to a temperature sensor driver. For example, the target device can be a battery, and the temperature sensor can detect the temperature of the battery in real time.
[0163] In one possible implementation, the temperature sensor driver may use a preset temperature conversion algorithm to convert the actual temperature of the target device to the temperature of the electronic device. For example, the target device may be a battery, and the temperature of the electronic device may be the fitted temperature of the backplane of the electronic device, which may also be called the fitted case temperature. The temperature sensor driver may use the preset temperature conversion algorithm to convert the actual battery temperature to the fitted case temperature.
[0164] In another possible implementation, the temperature sensor driver may also directly determine the actual temperature of the target device as the temperature of the electronic device. For example, if the target device is a battery, the temperature of the electronic device is the actual temperature of the battery.
[0165] It should be noted that the embodiments of the present application do not limit the type of temperature sensor. The temperature sensor may be a negative temperature coefficient (NTC) temperature sensor or other type of temperature sensor. Furthermore, the temperature sensor driver may obtain the actual temperature collected by the temperature sensor according to a preset sampling period. That is, the temperature sensor driver obtains the actual temperature of the target device once every sampling period. For example, the preset sampling period may be 5 seconds.
[0166] S412 , the fuel meter driver sends the output current of the battery to the network channel decision module.
[0167] Specifically, the fuel meter driver obtains the output current of the battery collected by the fuel meter; the fuel meter driver sends the output current to the network channel decision module.
[0168] In some embodiments, a fuel meter may be provided on the battery protection board of the electronic device, which can collect parameters such as the output current and output voltage of the battery. The fuel meter can report the collected output current of the battery to the fuel meter driver, and the fuel meter driver then sends the output current of the battery to the network channel decision module.
[0169] S413 , the connection service sends the network status information of the cellular channel, the network status information of the WiFi channel, and the identification information of the network channel in which data transmission is in progress to the network channel control module.
[0170] S414 , the network channel control module sends the network status information of the cellular channel, the network status information of the WiFi channel, and the identification information of the network channel in which data transmission is in progress to the network channel decision module.
[0171] During the execution of the above S404, the phone manager sends the network status information of the cellular channel to the connection service, and the connection service can save the network status information of the cellular channel; during the execution of the above S407, the WiFi manager sends the network status information of the WiFi channel to the connection service, and the connection service can save the network status information of the WiFi channel.
[0172] In addition, during use of the electronic device, the phone manager may also monitor whether data is being transmitted on a cellular channel through a cellular network driver. When the network channel currently transmitting data includes a cellular channel, the phone manager sends first data monitoring information to the connection service. The first data monitoring information may include identification information of the cellular channel currently transmitting data. The WiFi manager may also monitor whether data is being transmitted on a WiFi channel through a WiFi network driver. When the network channel currently transmitting data includes a WiFi channel, the WiFi manager sends second data monitoring information to the connection service. The second data monitoring information may include identification information of the WiFi channel currently transmitting data.
[0173] The connection service can send the saved network status information of the cellular channel, the network status information of the WiFi channel, and the identification information of the network channel in which data transmission is in progress to the network channel control module. The network channel control module then sends the network status information of the cellular channel, the network status information of the WiFi channel, and the identification information of the network channel in which data transmission is in progress to the network channel decision module.
[0174] The network status information includes the enabled state of the network channel and the network quality information when the enabled state is the available state; the enabled state includes the available state or the unavailable state, and the network quality information includes at least one of the signal strength, bandwidth and signal-to-noise ratio.
[0175] For example, when the enabled state in the network status information of the cellular channel is the available state, the enabled state in the network status information of the WiFi channel is also the available state, and the identification information of the network channel in which data transmission is in progress also includes the identification information of the cellular channel and the identification information of the WiFi channel, the cellular channel and the WiFi channel are both available network channels.
[0176] S415 , the target application sends the first network delay to the application information receiving module.
[0177] S416: The application information receiving module sends the first network delay to the network channel decision module.
[0178] In some embodiments, when the network channel decision module decides whether to disconnect one or more network channels from transmitting the data stream of the target application, in addition to the device status information obtained in S411 and S412 above, it may also be based on the first network delay, the second network delay and the composite frame rate of the image.
[0179] The first network delay is the network delay sent by the target application, which can be called the server network delay. In one possible implementation, when the target application sends a data packet to the corresponding server, the data packet can include a first timestamp when it was sent. When the server returns a response data packet to the target application, the response data packet can also include a second timestamp when it was sent. After receiving the response data packet, the target application determines the time difference between the second timestamp and the first timestamp as the first network delay.
[0180] The target application may send the first network delay to the application information receiving module. In one possible implementation, the target application may be integrated with a corresponding data interface, and the electronic device may have a service adapted to transmit information from the target application. The target application may send the first network delay to the application information receiving module through the data interface and service.
[0181] After receiving the first network delay sent by the target application, the application information receiving module sends the first network delay to the network channel decision module.
[0182] S417: When the target application calls the graphics library to perform image drawing and rendering, the graphics interface hook module obtains a drawing and rendering instruction from the graphics library.
[0183] S418: The graphics interface hook module determines a second network delay according to the drawing rendering instruction, and sends the second network delay to the network channel decision module.
[0184] To enable the electronic device's display to display the user interface corresponding to the target application, the target application calls a graphics library to render the image. During this process, the graphics interface hook module retrieves rendering instructions from the graphics library. These rendering instructions may include characteristic parameters corresponding to multiple UI controls, each of which includes the size and position of the UI control.
[0185] After obtaining the drawing and rendering instruction, the graphics interface hook module determines the second network delay according to information such as characteristic parameters corresponding to the UI control in the drawing and rendering instruction, and sends the second network delay to the network channel decision module.
[0186] The second network delay may also be referred to as UI network delay, which is determined according to a UI control in a user interface.
[0187] S419 , when the image synthesizer synthesizes the rendered image, the frame rate detection module obtains the synthesis time of each frame of the image.
[0188] S420: The frame rate detection module calculates the synthesis frame rate according to the synthesis time of each frame image synthesis, and sends the synthesis frame rate to the network channel decision module.
[0189] After the target application draws and renders an image by calling the graphics library, it sends the rendered image to the image synthesizer's cache queue. Whenever the Vsync signal arrives, the image synthesizer sequentially retrieves a frame of image to be synthesized from the cache queue and then synthesizes the image.
[0190] When the image synthesizer synthesizes the rendered image, the frame rate detection module can obtain the synthesis time of each frame of the image from the image synthesizer; then, the frame rate detection module calculates the synthesis frame rate of the image based on the synthesis time of each frame of the image, and sends the synthesis frame rate of the image to the network channel decision module.
[0191] It should be noted that the above S411 is an execution process of sending the temperature of the electronic device to the network channel decision module, the above S412 is an execution process of sending the output current of the battery to the network channel decision module, the above S414 is an execution process of sending the network status information of the cellular channel, the network status information of the WiFi channel and the identification information of the network channel in which data transmission is in progress to the network channel decision module, the above S416 is an execution process of sending the first network delay to the network channel decision module, the above S418 is an execution process of sending the second network delay to the network channel decision module, and the above S420 is an execution process of sending the synthetic frame rate to the network channel decision module. There is no fixed order of sequence, and the corresponding operations can be performed according to actual conditions, such as parallel execution.
[0192] S421, the network channel decision module generates a network on / off decision result based on the temperature of the electronic device, the output current of the battery, the first network delay, the second network delay, the synthetic frame rate, the network status information of the cellular channel, the network status information of the WiFi channel, and the identification information of the network channel in which data transmission is in progress, and sends the network on / off decision result to the network channel control module.
[0193] In some embodiments, when the network channel decision module determines that the temperature of the electronic device is greater than a first temperature threshold and / or the output current is greater than a first current threshold, and the cellular channel and the WiFi channel are available network channels, the network channel decision module selects one of the available network channels from the cellular channel and the WiFi channel as the target network channel based on the network quality information of the cellular channel and the network quality information of the WiFi channel. After determining the target network channel, the network channel decision module sends the network on / off decision result to the network channel control module. The network on / off decision result is used to indicate that the data stream of the target application is transmitted through the target network channel, rather than through other available network channels other than the target network channel among the M available network channels.
[0194] For example, when the network channel decision module selects the WiFi channel as the target network channel from the cellular channel and the WiFi channel, the network on / off decision result is used to indicate that the data stream of the target application is transmitted through the WiFi channel instead of the cellular channel.
[0195] The first network delay, second network delay, and composite frame rate are primarily used to select the appropriate first temperature threshold and first current threshold when determining whether to trigger a network channel on / off decision. Specifically, the network channel decision module determines a target network delay based on the first network delay and / or the second network delay; and the network channel decision module selects the corresponding first temperature threshold and first current threshold based on the target network delay and composite frame rate.
[0196] When the target network delay and the synthetic frame rate change, the selected first temperature threshold is different, and the selected first current threshold is also different.
[0197] S422 , the network channel control module sends the network on / off decision result to the connection service, so that the connection service controls the cellular channel or WiFi channel to transmit the data stream of the target application according to the network on / off decision result.
[0198] In some embodiments, the network channel control module can send the network on / off decision result to the connection service, and the connection service can control the cellular channel or WiFi channel to transmit the data stream of the target application based on the network on / off decision result.
[0199] For example, when the network connection / disconnection decision indicates that the target application's data stream should be transmitted via the WiFi channel rather than the cellular channel, the connection service can send a first control instruction to the cellular network driver via the phone manager. The cellular network driver, based on the first control instruction, controls the mobile communication module to not transmit the target application's data stream. The target application then sends the allocated data packets to the cellular network driver, which then sends the data packets to the mobile communication module. The mobile communication module can then discard these data packets.
[0200] When the network connection / disconnection decision indicates that the target application's data stream should be transmitted via the cellular channel rather than the WiFi channel, the connection service can send a second control instruction to the WiFi network driver via the WiFi manager. Based on the second control instruction, the WiFi network driver controls the wireless communication module to not transmit the target application's data stream. The target application then sends the allocated data packets to the WiFi network driver, which then sends the data packets to the wireless communication module. The wireless communication module can then discard these data packets.
[0201] It's important to note that the data stream corresponding to the target application refers to the data stream that needs to be sent to the server during the target application's operation. A data stream is an ordered sequence of bytes with a starting point and an end point. In the field of communications, the transmission of multimedia resources such as text, images, audio, and video can be understood as the transmission of a data stream. For example, the data stream sent in a video chat scenario in a video chat application includes a video stream and an audio stream.
[0202] It can be understood that the implementation method corresponding to Figure 4 gives the entire process of network channel control of the cellular network and the WiFi network. In order to more clearly understand the embodiment of the present application, the interaction process between the various modules involved in the network channel decision-making process provided by the embodiment of the present application is described in detail below in combination with Figure 5.
[0203] For example, Figure 5 is a flow chart of the network channel decision process provided in an embodiment of the present application. In the implementation corresponding to Figure 5, the electronic device may include: a temperature sensor driver, a power meter driver, a target application, an application information receiving module, a graphics interface hook module, a frame rate detection module, a network channel decision module, a network channel control module, and a connection service; in addition, the electronic device may also include a phone manager, a WiFi manager, a graphics library, an image synthesizer, a cellular network driver, a WiFi network driver, a mobile communication module, a wireless communication module, a temperature sensor, and a power meter, etc. (not shown).
[0204] As shown in FIG5 , the network channel control method in the network channel decision process may specifically include the following steps:
[0205] S501: The temperature sensor driver obtains the actual temperature of the target device collected by the temperature sensor.
[0206] A temperature sensor is located near a target device in an electronic device. During use, the temperature sensor continuously collects the actual temperature of the target device and reports the collected actual temperature to a temperature sensor driver. For example, the target device may be a battery, and the actual temperature of the target device refers to the actual temperature of the battery.
[0207] S502: The temperature sensor driver determines the temperature of the electronic device according to the actual temperature.
[0208] In one possible implementation, after obtaining the actual temperature of the target device, the temperature sensor driver may use a preset temperature conversion algorithm to convert the actual temperature of the target device into the temperature of the electronic device. For example, the target device may be a battery, and the temperature of the electronic device may be the fitted temperature of the backplane of the electronic device, which may also be referred to as the fitted case temperature.
[0209] In another possible implementation, after obtaining the actual temperature of the target device, the temperature sensor driver may directly determine the actual temperature of the target device as the temperature of the electronic device. For example, if the target device is a battery, the temperature of the electronic device is the actual temperature of the battery.
[0210] S503: The temperature sensor driver sends the temperature of the electronic device to the network channel decision module.
[0211] S504: The fuel meter driver obtains the output current of the battery collected by the fuel meter.
[0212] S505 , the fuel meter driver sends the output current of the battery to the network channel decision module.
[0213] In some embodiments, a fuel meter may be provided on the battery protection board of the electronic device. The fuel meter can collect the output current of the battery and report the collected output current of the battery to the fuel meter driver, which then sends the output current of the battery to the network channel decision module.
[0214] S506: The target application sends the first network delay to the application information receiving module.
[0215] S507: The application information receiving module sends the first network delay to the network channel decision module.
[0216] It should be noted that the specific implementation process of S506 and S507 can refer to the specific implementation process of S415 and S416 mentioned above, and will not be repeated here to avoid repetition.
[0217] S508 , when the target application calls the graphics library to perform image drawing and rendering, the graphics interface hook module obtains a drawing and rendering instruction from the graphics library.
[0218] S509: The graphics interface hook module determines a second network delay according to the drawing rendering instruction.
[0219] In order to enable the display screen of the electronic device to display the user interface corresponding to the target application, the target application will call the graphics library to render the image. During the process of the target application calling the graphics library to render the image, the graphics interface hook module can obtain the rendering instruction from the graphics library.
[0220] The drawing and rendering instruction is an instruction for drawing and rendering the user interface of the target application, which may include characteristic parameters corresponding to multiple UI controls, and each characteristic parameter includes the size and position of the UI control.
[0221] The graphics interface hook module can determine the second network delay in the following manner: the graphics interface hook module determines a target UI control for characterizing the network delay from multiple UI controls based on characteristic parameters corresponding to the multiple UI controls; the graphics interface hook module calculates the pixel ratios of various colors included in the target UI control; and the graphics interface hook module determines the second network delay based on the color with the largest pixel ratio.
[0222] Typically, the target UI control used to characterize network latency is drawn and rendered only after the main scene screen is rendered. During the drawing and rendering process of the target application's user interface, the electronic device will first draw and render the main scene screen, and perform a depth test during the drawing process of the main scene screen, which is used to control the front and back occlusion relationship of each layer in the main scene screen; since the UI control is drawn and rendered on the outermost layer of the entire user interface, the depth detection function is turned off after the main scene screen is drawn and rendered, and since the UI control is usually in a translucent state, it is also necessary to turn on a blend test when drawing and rendering the UI control to mix the color of the UI control itself with the color of each pixel in the layer below the UI control.
[0223] In this way, when the graphics interface hook module detects that the conditions for turning off depth detection and turning on hybrid detection are met at the same time, the remaining drawing and rendering instructions are the drawing and rendering instructions of the UI control. Since the characteristic parameters of different UI controls are different, the graphics interface hook module can determine the target UI control used to characterize the network delay from multiple UI controls based on the characteristic parameters in the drawing and rendering instructions of the UI control. Then, the graphics interface hook module counts the color of each pixel in the target UI control and calculates the pixel ratio of each color included in the target UI control. Finally, the graphics interface hook module determines the second network delay based on the color with the largest pixel ratio.
[0224] In one possible implementation, different colors correspond to different second network delays, and each color and its corresponding delay range are pre-set. When the color with the largest pixel ratio in the target UI control is green, it indicates that the network performance is relatively good, and its corresponding delay range is less than or equal to the range formed by the first delay threshold, that is, the second network delay can be less than or equal to the first delay threshold; when the color with the largest pixel ratio in the target UI control is yellow, it indicates that the network performance is average, and its corresponding delay range is greater than the first delay threshold and less than the second delay threshold, that is, the second network delay can be greater than the first delay threshold and less than the second delay threshold; when the color with the largest pixel ratio in the target UI control is red, it indicates that the network performance is poor, and its corresponding delay range is greater than the second delay threshold, that is, the second network delay is greater than the second delay threshold.
[0225] The first delay threshold is smaller than the second delay threshold. That is, when the color with the largest proportion of pixels in the target UI control is green, it indicates that the second network delay is relatively low, and when the color with the largest proportion of pixels in the target UI control is red, it indicates that the second network delay is relatively high.
[0226] As shown in Figure 6, in the battle interface of the game application running on the electronic device, the target UI control 601 for representing the network delay is located in the upper middle position of the battle interface, and the size of the target UI control 601 for representing the network delay can be 20×20 pixels.
[0227] For example, taking the upper left corner as the coordinate origin, the horizontal direction as the X-axis, and the vertical direction as the Y-axis, if the graphics interface hook module determines from multiple UI controls that a certain UI control has a size of 20×20 pixels, its X-axis coordinate is close to the center of the screen, and its Y-axis coordinate is relatively small, then this UI control is selected as the target UI control for network latency characterization.
[0228] For example, the target UI control 601 for representing network latency may include four antenna grids arranged from low to high, and further, the target UI control 601 may include other areas outside the four antenna grids. It can be seen that the four antenna grids occupy most of the area of the target UI control 601.
[0229] In the game application's battle interface, the second network latency can be represented by filling the four antenna grids of the target UI control 601 with different colors. Furthermore, since the four antenna grids in the target UI control 601 occupy most of the area of the target UI control 601, the second network latency can be determined by the color with the largest pixel percentage.
[0230] Of course, it is understandable that the above only provides a method for determining the second network delay based on the pixel ratio of each color included in the target UI control. The embodiment of the present application can also use other methods to determine the second network delay.
[0231] S510: The graphic interface hook module sends the second network delay to the network channel decision module.
[0232] S511: The network channel decision module determines a target network delay according to the first network delay and / or the second network delay.
[0233] In some embodiments, after the network channel decision module obtains the first network delay sent by the application information receiving module and the second network delay sent by the graphics interface hook module, the network channel decision module can determine the target network delay based on the first network delay and / or the second network delay.
[0234] Specifically, the network channel decision module can perform a weighted sum of the first network delay and the second network delay to calculate the target network delay. In the embodiment of the present application, the target network delay can be calculated based on the first network delay as the primary factor and the second network delay as the secondary factor. Therefore, when the target network delay is calculated using the weighted summation method, the weight of the first network delay is greater than the weight of the second network delay.
[0235] Alternatively, when the network channel decision module receives the first network delay sent by the application information receiving module, the network channel decision module can directly determine the first network delay as the target network delay. Alternatively, when the network channel decision module does not receive the first network delay sent by the application information receiving module, but receives the second network delay sent by the graphics interface hook module, the network channel decision module can directly determine the second network delay as the target network delay.
[0236] S512 , when the image synthesizer synthesizes the rendered image, the frame rate detection module obtains the synthesis time of each frame of the image.
[0237] S513: The frame rate detection module calculates the synthesis frame rate according to the synthesis time of each frame image.
[0238] When the image compositor composites the rendered image, it calls onPostComposition. Therefore, each time the image compositor calls onPostComposition, the frame rate detection module obtains the composition time of each frame from the image compositor.
[0239] In one possible implementation, the frame rate detection module may calculate the synthetic frame rate in the following manner: the frame rate detection module counts the number of synthetic times obtained within a preset period; and the frame rate detection module determines the ratio of the number to the preset period as the synthetic frame rate.
[0240] For example, the preset period may be 1 second, and the frame rate detection module counts the number of times the synthesis time is obtained within 1 second. When the number of times the synthesis time is obtained within 1 second is 60 times, the synthesis frame rate of the image is determined to be 60fps.
[0241] In another possible implementation, the frame rate detection module may calculate the synthetic frame rate in the following manner: the frame rate detection module counts the average time interval between the synthesis times of the most recent multiple frames of images; and the frame rate detection module determines the reciprocal of the average time interval as the synthetic frame rate.
[0242] For example, the frame rate detection module calculates the time interval between the composite times of each adjacent frame in the most recent 20 frames, averages these calculated time intervals to obtain the average time interval, and finally determines the composite frame rate of the image by dividing the ratio of 1 to the average time interval. If the average time interval is 16.6ms, the composite frame rate of the image is 60fps.
[0243] In an embodiment of the present application, the synthetic frame rate may be an average synthetic frame rate within a preset time period (eg, 10 seconds) before the current moment.
[0244] S514: The frame rate detection module sends the synthesized frame rate to the network channel decision module.
[0245] S515 , the network channel decision module selects a corresponding first temperature threshold and a first current threshold according to the target network delay and the synthetic frame rate.
[0246] In some embodiments, the target network delay and the synthesized frame rate can represent the network performance during the operation of the target application, such as whether the network is stuck during the operation of the target application. When the target network delay is large, it indicates that the network is stuck during the operation of the target application. When the target network delay is small, it indicates that the network is smooth during the operation of the target application. When the synthesized frame rate of the image is large, it indicates that the picture displayed during the operation of the target application is smooth. When the synthesized frame rate of the image is small, it indicates that the picture displayed during the operation of the target application is stuck. The smoothness of the displayed picture further reflects the smoothness of the network.
[0247] Therefore, when the target network latency and composite frame rate change, the network channel decision module can select different first temperature thresholds and different first current thresholds, resulting in different decision conditions for triggering the network channel on / off. In other words, when the target network latency and composite frame rate change, the first temperature threshold and first current threshold used as reference when triggering the network channel on / off decision are different.
[0248] Among them, when the target network delay is less than the delay threshold and the synthetic frame rate is greater than the frame rate threshold, the first temperature threshold is the first temperature value, and the first current threshold is the first current value; when the target network delay is greater than or equal to the delay threshold, and / or the synthetic frame rate is less than or equal to the frame rate threshold, the first temperature threshold is the second temperature value, and the first current threshold is the second current value; and, the first temperature value is less than the second temperature value, and the first current value is less than the second current value.
[0249] For example, the latency threshold may be 80ms; the frame rate threshold may be 90% of the maximum frame rate of the target application. For example, if the maximum frame rate of the target application is 60fps, the frame rate threshold may be 54fps.
[0250] When the target network delay is less than the delay threshold and the composite frame rate is greater than the frame rate threshold, it indicates that the current network performance is relatively good. Therefore, the problems of high power consumption and heat generation of electronic devices can be addressed in advance. In this case, the decision conditions for triggering the network channel to be turned on and off are relatively low, resulting in the selection of the first temperature threshold and the first current threshold being relatively low. When the target network delay is greater than or equal to the delay threshold, and / or the composite frame rate is less than or equal to the frame rate threshold, it indicates that the current network performance is relatively poor. Therefore, the network performance issue can be given priority. In this case, the decision conditions for triggering the network channel to be turned on and off are relatively high, resulting in the selection of the first temperature threshold and the first current threshold being relatively high.
[0251] For example, the latency threshold may be 80ms, and the frame rate threshold may be 54fps. When the target network latency is less than 80ms and the composite frame rate is greater than 54fps, the selected first temperature threshold may be 39°C, and the selected first current threshold may be 800mA. When the target network latency is greater than or equal to 80ms, and / or the composite frame rate is less than or equal to 54fps, the selected first temperature threshold may be 43°C, and the selected first current threshold may be 1000mA.
[0252] It is understandable that the above method of selecting the corresponding first temperature threshold and first current threshold by comparing the target network delay with the delay threshold and comparing the synthesized frame rate with the frame rate threshold is only one possible implementation method. Of course, the embodiments of the present application can also adopt other judgment methods to determine the corresponding first temperature threshold and first current threshold based on the target network delay and the synthesized frame rate.
[0253] In another possible implementation, the network channel decision module does not need to select the corresponding first temperature threshold and first current threshold based on the target network delay and the synthesized frame rate. In this case, the first temperature threshold can be a fixed temperature value pre-set in the electronic device, and the first current threshold can also be a fixed current value pre-set in the electronic device. When the target network delay and the synthesized frame rate change, the first temperature threshold remains the same, and the first current threshold also remains the same.
[0254] It is understandable that the first temperature thresholds corresponding to different target applications may be different, and the first current thresholds corresponding to different target applications may also be different.
[0255] S516 , the connection service sends the network status information of each network channel and the identification information of the network channel in which data transmission is in progress to the network channel control module.
[0256] In some embodiments, when multiple network channels in the electronic device include a cellular channel, the cellular network driver obtains network status information of the cellular channel from the mobile communication module; the cellular network driver sends the network status information of the cellular channel to the connection service through the phone manager.
[0257] When the multiple network channels in the electronic device include a WiFi channel, the WiFi network driver obtains network status information of the WiFi channel from the wireless communication module; the WiFi network driver sends the network status information of the WiFi channel to the connection service through the WiFi manager.
[0258] It should be noted that the specific implementation process of the connection service obtaining the network status information of the cellular channel and the network status information of the WiFi channel can refer to the specific implementation process of S402 to S407 above, and will not be repeated here to avoid repetition.
[0259] In addition, during use of the electronic device, the phone manager may also monitor whether data is being transmitted on a cellular channel through a cellular network driver. When the network channel currently transmitting data includes a cellular channel, the phone manager sends first data monitoring information to the connection service. The first data monitoring information may include identification information of the cellular channel currently transmitting data. The WiFi manager may also monitor whether data is being transmitted on a WiFi channel through a WiFi network driver. When the network channel currently transmitting data includes a WiFi channel, the WiFi manager sends second data monitoring information to the connection service. The second data monitoring information may include identification information of the WiFi channel currently transmitting data.
[0260] After obtaining the network status information for each of the multiple network channels and the identification information of the network channel currently transmitting data, the connection service sends the network status information for each network channel and the identification information of the network channel currently transmitting data to the network channel control module. The network status information includes the activation status of the network channel and network quality information when the activation status is in the available state. The activation status can be either available or unavailable. A network channel in the available state is considered an available network channel.
[0261] S517 , the network channel control module sends the network status information of each network channel and the identification information of the network channel in which data transmission is in progress to the network channel decision module.
[0262] It should be noted that the above S501 to S503 send the temperature of the electronic device to the network channel decision module, the above S504 and S505 send the output current of the battery to the network channel decision module, the above S506 and S507 send the first network delay to the network channel decision module, the above S508 to S510 send the second network delay to the network channel decision module, the above S512 to S514 send the synthetic frame rate to the network channel decision module, and the above S516 and S517 send the network status information of each network channel and the identification information of the network channel undergoing data transmission to the network channel decision module. There is no fixed order, and the corresponding operations can be performed according to actual conditions, such as parallel execution.
[0263] S518, when the temperature of the electronic device is greater than the first temperature threshold and / or the output current of the battery is greater than the first current threshold, and there are M available network channels among the multiple network channels, the network channel decision module selects N available network channels from the M available network channels as target network channels based on network quality information corresponding to the M available network channels.
[0264] After the network channel decision module receives the temperature of the electronic device, the output current of the battery, the network status information of each network channel, and the identification information of the network channel in which data transmission is in progress, the network channel decision module compares the temperature of the electronic device with a first temperature threshold, and compares the output current of the battery with a first current threshold.
[0265] It should be understood that the temperature of the electronic device compared with the first temperature threshold can be the average temperature of the electronic device within a first preset time period (such as 10s) before the current moment; the output current compared with the first current threshold can be the average output current within a second preset time period (such as 10s) before the current moment.
[0266] After the network channel decision module receives the temperature of the electronic device, the output current of the battery, the network status information of each network channel, and the identification information of the network channel that is currently transmitting data, the network channel decision module determines, from multiple network channels, an available network channel that is currently transmitting data and has an enabled state of available. The network channel decision module extracts network quality information corresponding to the available network channel from the network status information of each network channel.
[0267] Specifically, the network channel decision module takes the intersection of the network channels whose enabled state is available and the network channels that are currently transmitting data, that is, the network channels that are currently transmitting data and whose enabled state is available are regarded as available network channels.
[0268] Network channels that are enabled and available indicate that the target application may use these channels to transmit data. In practice, the target application may use some or all of these enabled and available network channels to transmit data. However, it is impossible to determine exactly which network channels are used to transmit the data.
[0269] The network channel currently transmitting data indicates the network channel currently used by the electronic device for data transmission. In actual use, the network channel currently transmitting data can be the data stream of the target application or other data streams outside the target application.
[0270] Therefore, among the multiple network channels of the electronic device, the available network channel that is currently transmitting data and whose activation state is available may be the network channel used to transmit the data stream of the target application.
[0271] When the temperature of the electronic device is greater than a first temperature threshold and / or the output current of the battery is greater than a first current threshold, and there are M available network channels among the multiple network channels, a decision on whether to turn the network channel on or off is triggered. At this time, the network channel decision module can extract network quality information corresponding to the M available network channels from the network status information of each network channel, and then,
[0272] According to the network quality information corresponding to the M available network channels, N available network channels are selected from the M available network channels as target network channels, where M is an integer greater than 1, N is an integer greater than or equal to 1, and N is less than M.
[0273] In one possible implementation, the network channel decision module may select N available network channels as target network channels from M available network channels in the following manner: the network channel decision module evaluates the network quality of the M available network channels based on the network quality information corresponding to the M available network channels; when the difference between the network quality of at least two available network channels among the M available network channels is greater than a network quality threshold, the network channel decision module selects the top N available network channels as target network channels in descending order of the network quality of the M available network channels; when the difference between the network quality of any two available network channels among the M available network channels is less than or equal to the network quality threshold, the network channel decision module selects the top N available network channels as target network channels in descending order of the usage priority of the M available network channels.
[0274] In some embodiments, the network quality information includes at least one of signal strength, bandwidth, and signal-to-noise ratio. If the network quality information includes signal strength, the greater the signal strength of the available network channel, the higher the network quality of the available network channel; and the smaller the signal strength of the available network channel, the lower the network quality of the available network channel. If the network quality information includes bandwidth, the greater the bandwidth of the available network channel, the higher the network quality of the available network channel; and the smaller the bandwidth of the available network channel, the lower the network quality of the available network channel. If the network quality information includes signal-to-noise ratio, the greater the signal-to-noise ratio of the available network channel, the higher the network quality of the available network channel; and the smaller the signal-to-noise ratio of the available network channel, the lower the network quality of the available network channel.
[0275] The network quality of the available network channel can be evaluated using a specific value. For example, when the network quality information includes signal strength, bandwidth, and signal-to-noise ratio, the network quality of the available network channel can be a weighted sum of the signal strength, bandwidth, and signal-to-noise ratio of the available network channel.
[0276] The weights of signal strength, bandwidth, and signal-to-noise ratio can be set according to actual conditions. The weights of signal strength, bandwidth, and signal-to-noise ratio can be equal or unequal.
[0277] Of course, network quality information can also include any one of signal strength, bandwidth, and signal-to-noise ratio. In this case, the network channel decision module can directly use the network quality information of the available network channels to measure the network quality of the available network channels. Network quality information can also include any two of signal strength, bandwidth, and signal-to-noise ratio. In this case, the network quality of the available network channels can be the weighted sum of any two of the aforementioned network quality information. For example, if the network quality information includes signal strength and bandwidth, the network quality of the available network channels can be the weighted sum of the signal strength and bandwidth of the available network channels.
[0278] After obtaining the network quality of each available network channel by measuring in the above manner, the network channel decision module may compare the network quality of any two available network channels among the M available network channels.
[0279] When the difference in network quality between at least two of the M available network channels is greater than a network quality threshold, that is, when the network channel decision module determines that there is a significant difference in network quality between at least some of the available network channels, the network channel decision module selects the top N available network channels in descending order of network quality among the M available network channels as target network channels. In this case, the network quality of the target network channel is higher than the network quality of the other available network channels among the M available network channels except the target network channel.
[0280] When the difference in network quality between any two of the M available network channels is less than or equal to the network quality threshold, that is, when the network channel decision module determines that there is no significant difference in network quality between the available network channels, the network channel decision module selects the top N available network channels as target network channels in descending order of usage priority among the M available network channels. At this time, the usage priority of the target network channel is higher than the usage priority of all other available network channels in the M available network channels except the target network channel. The usage priority indicates the order in which the available network channels are used.
[0281] For example, taking M equal to 2, and the two available network channels are the first network channel and the second network channel, the first network channel is a cellular channel, and the second network channel is a WiFi channel, the network channel decision module can select the target network channel according to the decision strategy shown in Table 1 below.
[0282] Table 1
[0283] In Table 1, when the temperature of the electronic device is "high," it indicates that the temperature of the electronic device is greater than a first temperature threshold, and when the temperature of the electronic device is "low," it indicates that the temperature of the electronic device is less than or equal to the first temperature threshold. When the output current of the battery is "high," it indicates that the output current of the battery is greater than a first current threshold, and when the output current of the battery is "low," it indicates that the output current of the battery is less than or equal to the first current threshold.
[0284] When the network quality of the cellular channel and the network quality of the WiFi channel are both "Excellent", it indicates that the network quality of the cellular channel and the network quality of the WiFi channel are both relatively good, and there is no significant difference between the network quality of the cellular channel and the network quality of the WiFi channel. That is, the difference between the network quality of the cellular channel and the network quality of the WiFi channel is less than or equal to the network quality threshold. When the network quality of the cellular channel and the network quality of the WiFi channel are both "Poor", it indicates that the network quality of the cellular channel and the network quality of the WiFi channel are both relatively poor, and there is no significant difference between the network quality of the cellular channel and the network quality of the WiFi channel. That is, the difference between the network quality of the cellular channel and the network quality of the WiFi channel is less than or equal to the network quality threshold. When the network quality of the cellular channel is "Excellent" and the network quality of the WiFi channel is "Poor", it indicates that the network quality of the cellular channel is higher than that of the WiFi channel, and there is a significant difference between the network quality of the cellular channel and the network quality of the WiFi channel. That is, the difference between the network quality of the cellular channel and the network quality of the WiFi channel is greater than the network quality threshold.
[0285] The “unchanged” in Table 1 means that the current enabled states of the cellular channel and the WiFi channel are maintained unchanged.
[0286] Therefore, in combination with Table 1, it can be seen that: taking M available network channels including one cellular channel and one WiFi channel as an example, when the temperature of the electronic device is greater than a first temperature threshold and / or the output current of the battery is greater than a first current threshold, when there is a large difference between the network quality of the cellular channel and the network quality of the WiFi channel, the available network channel with poorer network quality is preferentially closed, and the target network channel in this case is the available network channel with better network quality; and when there is no obvious difference between the network quality of the cellular channel and the network quality of the WiFi channel, the cellular channel with lower priority is preferentially closed, and the target network channel in this case is the WiFi channel with higher priority.
[0287] Of course, the number M of available network channels in the embodiment of the present application may also be an integer greater than 2. In this case, the number N of selected target network channels may be an integer greater than 0 and less than M.
[0288] Exemplarily, N may be equal to M-1, that is, the available network channel with the worst network quality among the M available network channels is closed, or the available network channel with the lowest usage priority among the M available network channels is closed.
[0289] It can be understood that closing the available network channel mentioned in the embodiment of the present application means not using the available network channel to transmit the data stream of the target application.
[0290] S519, the network channel decision module sends the network on-off decision result to the network channel control module; the network on-off decision result is used to indicate that the data stream is transmitted through the target network channel, and not through other available network channels except the target network channel among the M available network channels.
[0291] S520: The network channel control module sends the network on / off decision result to the connection service.
[0292] S521 , the connection service controls a target network channel among the M available network channels to transmit data streams according to the network connection / disconnection decision result.
[0293] In some embodiments, when the other available network channels among the M available network channels except the target network channel include a cellular channel, the connection service sends a first control instruction to the cellular network driver through the phone manager; the cellular network driver controls the mobile communication module not to transmit the data stream of the target application according to the first control instruction.
[0294] When the network connection / disconnection decision indicates that the target application's data stream should not be transmitted via the cellular channel, the connection service may send a first control instruction to the telephony manager. The telephony manager then sends the first control instruction to the cellular network driver. The cellular network driver, based on the first control instruction, controls the mobile communication module to not transmit the target application's data stream. The target application then sends the allocated data packets to the cellular network driver, which then sends the data packets to the mobile communication module. The mobile communication module may then discard these data packets.
[0295] In other embodiments, when the other available network channels among the M available network channels except the target network channel include a WiFi channel, the connection service sends a second control instruction to the WiFi network driver through the WiFi manager; the WiFi network driver controls the wireless communication module not to transmit the data stream of the target application according to the second control instruction.
[0296] If the network connection / disconnection decision indicates that the target application's data stream should not be transmitted over the WiFi channel, the connection service can send a second control instruction to the WiFi manager. The WiFi manager then sends the second control instruction to the WiFi network driver. Based on the second control instruction, the WiFi network driver controls the wireless communication module to not transmit the target application's data stream. The target application then sends the allocated data packets to the WiFi network driver, which then sends the data packets to the wireless communication module. The wireless communication module can then discard these data packets.
[0297] Therefore, when the temperature of the electronic device is greater than the first temperature threshold and / or the output current is greater than the first current threshold, and there are M available network channels among the multiple network channels, the decision of whether to turn the network channel on or off is triggered, and based on the network quality information corresponding to the M available network channels, N available network channels are screened out as target network channels to transmit the data stream of the target application, instead of transmitting the data stream of the target application through other available network channels except the target network channel among the M available network channels, thereby reducing the power consumption of the electronic device.
[0298] In an embodiment of the present application, after the connection service controls the other available network channels except the target network channel among the M available network channels not to transmit the data stream of the target application based on the network on-off decision result, in order to determine the network performance of transmitting the data stream of the target application only through the target network channel, the electronic device can also obtain the latest temperature of the electronic device, the latest battery output current, the latest target network delay and the latest synthetic frame rate again to re-determine the target network channel for transmitting the data stream of the target application.
[0299] For example, Figure 7 is a flow chart of the feedback process after a network channel decision is provided in an embodiment of the present application. In the embodiment corresponding to Figure 7, the electronic device may include a network channel decision module, a network channel control module, and a connection service; in addition, the electronic device may also include a temperature sensor driver, a power meter driver, a phone manager, a WiFi manager, a cellular network driver, a WiFi network driver, a mobile communication module, a wireless communication module, a temperature sensor, and a power meter, etc. (not shown).
[0300] As shown in FIG7 , after the network channel control method corresponding to FIG5 is executed, that is, after the above-mentioned S521 , the network channel control method in the feedback process may specifically include the following steps:
[0301] S701: The network channel decision module obtains the temperature of the electronic device again.
[0302] It should be noted that the network channel decision module can obtain the temperature of the electronic device again through the specific implementation process of S501 to S503 above, which will not be repeated here.
[0303] S702: The network channel decision module obtains the output current of the battery again.
[0304] It should be noted that the network channel decision module can obtain the output current of the battery again through the specific implementation process of S504 to S505 above, which will not be described in detail here.
[0305] Therefore, through the above-mentioned S701 and S702 , the network channel decision module can obtain the temperature of the electronic device and the output current of the battery in the electronic device again.
[0306] S703, when the temperature of the electronic device obtained again is less than the second temperature threshold, and / or the output current obtained again is less than the second current threshold, the network channel decision module sends a first feedback result to the network channel control module; the first feedback result is used to indicate the use of the target network channel, and some or all of the M available network channels except the target network channel, to transmit the data stream of the target application.
[0307] After the network channel decision module obtains the temperature of the electronic device again (i.e., the temperature obtained after only the target network channel is used to transmit the data stream), and obtains the output current again (i.e., the output current obtained after only the target network channel is used to transmit the data stream), when it is determined that the temperature of the electronic device obtained again is less than the second temperature threshold, and / or the output current obtained again is less than the second current threshold, it indicates that the temperature of the electronic device has decreased and / or the power consumption of the electronic device has decreased. In this case, the network channel decision module sends a first feedback result to the network channel control module to restore some or all of the closed available network channels among the M available network channels, so as to transmit the data stream of the target application through the target network channel and the restored available network channel.
[0308] The second temperature threshold is lower than the first temperature threshold, and the second current threshold is lower than the first current threshold. For example, the first temperature threshold may be 43° C., the first current threshold may be 1000 mA, and the second temperature threshold may be 39° C., the second current threshold may be 800 mA.
[0309] It is understandable that different target applications may correspond to different second temperature thresholds, and different target applications may correspond to different second current thresholds.
[0310] S704: The network channel control module sends the first feedback result to the connection service.
[0311] S705 : The connection service controls the target network channel and some or all of the M available network channels except the target network channel according to the first feedback result to transmit the data stream of the target application.
[0312] Specifically, the first feedback result may be restoration of the cellular channel. The restoration method of the cellular channel may be described in detail below.
[0313] In some embodiments, when the available network channel to be restored among the M available network channels includes a cellular channel, that is, when the first feedback result indicates that the cellular channel should be restored, the connection service can send a third control instruction to the telephony manager. The telephony manager then sends the third control instruction to the cellular network driver. The cellular network driver, based on the third control instruction, controls the mobile communication module to continue transmitting the target application's data stream. Therefore, in the subsequent process, after the target application sends the allocated data packet to the cellular network driver, and the cellular network driver sends the data packet to the mobile communication module, the mobile communication module can then send the data packet to the corresponding server.
[0314] Specifically, the first feedback result may be restoring the WiFi channel. The method for restoring the WiFi channel may be described in detail below.
[0315] In other embodiments, when the available network channel to be restored among the M available network channels includes a WiFi channel, that is, when the first feedback result indicates that the WiFi channel should be restored, the connection service may send a fourth control instruction to the WiFi manager, which in turn sends the fourth control instruction to the WiFi network driver. The WiFi network driver, based on the fourth control instruction, controls the wireless communication module to continue transmitting the target application's data stream. Therefore, in subsequent processes, after the target application sends the allocated data packet to the WiFi network driver, which in turn sends the data packet to the wireless communication module, the wireless communication module may then send the data packet to the corresponding server.
[0316] In this way, when the temperature of the electronic device obtained after only using the target network channel to transmit the data stream is less than the second temperature threshold, and / or the output current obtained after only using the target network channel to transmit the data stream is less than the second current threshold, the electronic device can restore some or all of the closed available network channels among the M available network channels to transmit the data stream through the target network channel and the restored available network channels, thereby improving the network performance during the operation of the target application.
[0317] The implementation method corresponding to Figure 7 is aimed at the feedback method when the temperature of the electronic device and the output current of the battery decrease after only the target network channel is used to transmit the data stream of the target application; of course, in other scenarios, after only the target network channel is used to transmit the data stream of the target application, the temperature of the electronic device and the output current of the battery may continue to increase. In this case, the feedback method can refer to the description corresponding to Figure 8 below.
[0318] For example, FIG8 is a flow chart of another feedback process after network channel decision-making provided in an embodiment of the present application. In the implementation corresponding to FIG8 , the electronic device may include a network channel decision module, a network channel control module, and a connection service; in addition, the electronic device may also include a temperature sensor driver, a power meter driver, a phone manager, a WiFi manager, a cellular network driver, a WiFi network driver, a mobile communication module, a wireless communication module, a temperature sensor, and a power meter, etc. In the implementation corresponding to FIG8 , N is an integer greater than 1, that is, when making a network channel decision, the number of target network channels selected is greater than 1.
[0319] As shown in FIG8 , after the network channel control method corresponding to FIG5 is executed, that is, after the above-mentioned S521 , the network channel control method in the feedback process may specifically include the following steps:
[0320] S801: The network channel decision module obtains the temperature of the electronic device again.
[0321] S802: The network channel decision module obtains the output current of the battery again.
[0322] Therefore, through the above-mentioned S801 and S802, the network channel decision module can obtain the temperature of the electronic device and the output current of the battery in the electronic device again.
[0323] S803, when the temperature of the electronic device obtained again is greater than the third temperature threshold, and / or the output current obtained again is greater than the third current threshold, the network channel decision module sends a second feedback result to the network channel control module; the second feedback result is used to indicate that the data stream of the target application is transmitted through part of the target network channels.
[0324] After the network channel decision module obtains the temperature of the electronic device again and obtains the output current again, when it is determined that the temperature of the electronic device obtained again is greater than the third temperature threshold and / or the output current obtained again is greater than the third current threshold, it means that after transmitting the data stream of the target application only through the target network channel, the temperature of the electronic device continues to rise and / or the power consumption of the electronic device continues to rise. In this case, the network channel decision module sends a second feedback result to the network channel control module to continue to transmit the data stream of the target application through part of the target network channel, while the other part of the target network channel no longer continues to transmit the data stream of the target application.
[0325] The third temperature threshold is greater than the first temperature threshold, and the third current threshold is greater than the first current threshold. For example, the first temperature threshold may be 43° C., the first current threshold may be 1000 mA, and the third temperature threshold may be 46° C., the third current threshold may be 1200 mA.
[0326] It is understandable that different target applications may correspond to different third temperature thresholds, and different target applications may correspond to different third current thresholds.
[0327] In the embodiment of the present application, the network quality of the target network channel used to transmit the data stream is higher than the network quality of the target network channel not used to transmit the data stream. In other words, when there is a significant difference in the network quality of the target network channels, the target network channel with the better network quality continues to be used to transmit the data stream of the target application, and the target network channel with the worse network quality among the target network channels is not used to continue transmitting the data stream of the target application.
[0328] For example, the M available network channels include a WiFi channel, a first cellular channel, and a second cellular channel, and the signal quality of the WiFi channel is higher than that of the first cellular channel, and the signal quality of the first cellular channel is higher than that of the second cellular channel. Therefore, during the execution of S521, the second cellular channel is controlled not to transmit the data stream of the target application. In this case, the target network channel includes the WiFi channel and the first cellular channel, that is, the data stream of the target application is transmitted through the WiFi channel and the first cellular channel. When the temperature of the electronic device obtained after transmitting the data stream only through the target network channel is greater than the third temperature threshold, and / or the output current obtained after transmitting the data stream only through the target network channel is greater than the third current threshold, the first cellular channel can continue to be controlled to no longer transmit the data stream of the target application, and the data stream of the target application can be transmitted only through the WiFi channel.
[0329] Alternatively, the priority of the target network channel used to transmit the data stream is higher than the priority of the target network channel not used to transmit the data stream. In other words, when there is no significant difference in network quality between the target network channels, the target network channel with the higher priority continues to be used to transmit the data stream of the target application, and the target network channel with the lower priority is not used to continue transmitting the data stream of the target application.
[0330] S804: The network channel control module sends the second feedback result to the connection service.
[0331] S805: The connection service controls part of the target network channels to transmit the data stream of the target application according to the second feedback result.
[0332] In this way, when the temperature of the electronic device obtained after only using the target network channel to transmit the data stream is greater than the third temperature threshold, and / or the output current obtained after only using the target network channel to transmit the data stream is greater than the third current threshold, the electronic device can continue to transmit the data stream of the target application through part of the target network channels, while the other part of the target network channels no longer transmit the data stream of the target application, thereby further reducing the power consumption of the electronic device.
[0333] 7 and 8 , it can be seen that when the reacquired temperature of the electronic device and the reacquired output current meet the first preset condition, the electronic device re-determines the target network channel for transmitting the data stream.
[0334] In the embodiment corresponding to Figure 7, the first preset condition may include: the temperature of the electronic device obtained again is less than the second temperature threshold, and / or the output current obtained again is less than the second current threshold; the electronic device re-determines the target network channel for transmitting the data stream, which is actually: the electronic device uses the target network channel and M available network channels except the target network channel. Other or all available network channels to transmit the data stream.
[0335] In the implementation corresponding to Figure 8, the first preset condition may include: the temperature of the electronic device obtained again is greater than the third temperature threshold, and / or the output current obtained again is greater than the third current threshold; the electronic device re-determines the target network channel for transmitting the data stream, which is actually: the electronic device transmits the data stream through part of the target network channel.
[0336] For example, Figure 9 is a flow chart of another feedback process after network channel decision-making provided by an embodiment of the present application. In the implementation corresponding to Figure 9, the electronic device may include a network channel decision module, a network channel control module, and a connection service; in addition, the electronic device may also include a target application (not shown), an application information receiving module, a graphical interface hook module, a frame rate detection module, a phone manager, a WiFi manager, a cellular network driver, a WiFi network driver, a mobile communication module, a wireless communication module, etc.
[0337] As shown in FIG9 , after the network channel control method corresponding to FIG5 is executed, that is, after the above-mentioned S521 , the network channel control method in the feedback process may specifically include the following steps:
[0338] S901: The network channel decision module obtains the first network delay again.
[0339] It should be noted that, through the specific implementation process of S506 and S507 above, the network channel decision module can obtain the first network delay again, which will not be described in detail here.
[0340] S902: The network channel decision module obtains the second network delay again.
[0341] It should be noted that, through the specific implementation process of S508 to S510 above, the network channel decision module can obtain the second network delay again, which will not be described in detail here.
[0342] S903: The network channel decision module determines a re-acquired target network delay according to the re-acquired first network delay and / or the re-acquired second network delay.
[0343] It should be noted that the target network delay to be obtained again may be determined by referring to the specific implementation of S511 above, and will not be described again here to avoid repetition.
[0344] S904: The network channel decision module obtains the synthetic frame rate of the image again.
[0345] It should be noted that, through the specific implementation process of S512 to S514 above, the network channel decision module can obtain the synthetic frame rate of the image again.
[0346] Therefore, through the above-mentioned S901 to S904, the network channel decision module can obtain the target network delay and the synthetic frame rate of the image again.
[0347] S905. When the target network delay obtained again satisfies the second preset condition relative to the target network delay obtained before the target network channel decision is made, and / or the synthesized frame rate obtained again satisfies the third preset condition relative to the synthesized frame rate obtained before the target network channel decision is made, the network channel decision module sends a third feedback result to the network channel control module; the third feedback result is used to indicate the use of the target network channel and some or all of the available network channels of the M available network channels except the target network channel to transmit the data stream of the target application.
[0348] The second preset condition includes: the difference between the target network delay obtained again and the target network delay obtained before the target network channel decision is made is greater than the product of the first preset ratio and the target network delay obtained before the target network channel decision is made; the first preset ratio is greater than 0 and less than 1. The third preset condition includes: the difference between the composite frame rate obtained before the target network channel decision is made and the composite frame rate obtained again is greater than the product of the second preset ratio and the composite frame rate obtained before the target network channel decision is made; the second preset ratio is greater than 0 and less than 1.
[0349] For example, the first preset ratio may be 10%, and the second preset ratio may also be 10%. The first preset ratio and the second preset ratio may be set according to actual conditions, and are not limited in this embodiment of the present application.
[0350] That is, when the target network delay obtained after using only the target network channel to transmit the data stream increases relative to the target network delay obtained before the target network channel decision was made (i.e., before using only the target network channel to transmit the data stream), and / or the composite frame rate obtained after using only the target network channel to transmit the data stream decreases relative to the composite frame rate obtained before the target network channel decision was made, it indicates that the closure of some available network channels will affect network performance. Therefore, in order to improve network performance, some or all of the closed available network channels can be restored to transmit the data stream of the target application through the target network channel and the restored available network channels.
[0351] S906: The network channel control module sends the third feedback result to the connection service.
[0352] S907 , the connection service controls the target network channel and some or all of the M available network channels except the target network channel according to the third feedback result to transmit the data stream of the target application.
[0353] In this way, when the target network delay obtained after only using the target network channel to transmit the data stream meets the second preset condition relative to the target network delay obtained before the target network channel decision is made, and / or the synthetic frame rate obtained after only using the target network channel to transmit the data stream meets the third preset condition relative to the synthetic frame rate obtained before the target network channel decision is made, the electronic device can restore some or all of the closed available network channels among the M available network channels to transmit the data stream of the target application through the target network channel and the restored available network channel, thereby improving the network performance during the operation of the target application.
[0354] The network channel control method provided in the embodiments of the present application is described above in conjunction with Figures 4 to 9. The device for executing the above method provided in the embodiments of the present application is described below. As shown in Figure 10, Figure 10 is a schematic diagram of the structure of a network channel control device provided in the embodiments of the present application. The network channel control device can be an electronic device in the embodiments of the present application, or a chip or chip system within an electronic device.
[0355] As shown in Figure 10, the network channel control device 1000 includes a processing unit 1001 and a communication unit 1002. The processing unit 1001 is used to support the network channel control device 1000 in executing the aforementioned processing steps; the communication unit 1002 is used to support the network channel control device 1000 in executing the aforementioned data sending and receiving steps. The communication unit 1002 can be an input or output interface, pin, or circuit.
[0356] Processing unit 1001 is used to obtain the temperature of the electronic device and the output current of the battery in the electronic device; during the operation of the target application, when the temperature is greater than a first temperature threshold and / or the output current is greater than a first current threshold, and there are M available network channels among the multiple network channels, processing unit 1001 is used to use a target network channel among the M available network channels to transmit the data stream of the target application. Wherein, the available network channel is a network channel that is currently transmitting data and is in an available state for the target application, and the target network channel is N available network channels among the M available network channels, where M is an integer greater than 1, N is an integer greater than or equal to 1, and N is less than M.
[0357] In one possible implementation, the network channel control device 1000 further includes a storage unit 1003. The storage unit 1003 is connected to the processing unit 1001 via a circuit. The storage unit 1003 may include one or more memories, which may be devices in one or more devices or circuits for storing programs or data. The storage unit 1003 may exist independently and be connected to the processing unit 1001 via a communication bus. Alternatively, the storage unit 1003 may be integrated with the processing unit 1001.
[0358] The storage unit 1003 can store computer-executable instructions for the method in the electronic device, so that the processing unit 1001 executes the method in the above embodiment. The storage unit 1003 can be a register, a cache, or a random access memory (RAM), etc. The storage unit 1003 can be integrated with the processing unit 1001. The storage unit 1003 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions. The storage unit 1003 can be independent of the processing unit 1001.
[0359] FIG11 is a schematic diagram of the structure of a chip provided in an embodiment of the present application. As shown in FIG11 , the chip 1100 includes one or more (including two) processors 1101 , a communication circuit 1102 , and a communication interface 1103 . Optionally, the chip 1100 also includes a memory 1104 .
[0360] In some embodiments, the memory 1104 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
[0361] The method described in the above embodiment of the present application can be applied to the processor 1101, or implemented by the processor 1101. The processor 1101 may be an integrated circuit chip with signal processing capabilities. During the implementation process, the steps of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1101. The above-mentioned processor 1101 can be a general-purpose processor (for example, a microprocessor or a conventional processor), a digital signal processor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 1101 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0362] The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a mature storage medium in the field such as random access memory, read-only memory, programmable read-only memory, or electrically erasable programmable read only memory (EEPROM). The storage medium is located in the memory 1104, and the processor 1101 reads the information in the memory 1104 and completes the steps of the above method in combination with its hardware.
[0363] The processor 1101 , the memory 1104 , and the communication interface 1103 can communicate with each other via the communication line 1102 .
[0364] In the above embodiment, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory or downloaded and installed in the memory in the form of software.
[0365] The present application also provides a computer program product comprising one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated therein. For example, available media may include magnetic media (e.g., floppy disk, hard disk or tape), optical media (e.g., digital versatile disc (DVD)), or semiconductor media (e.g., solid state disk (SSD)).
[0366] An embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above-mentioned network channel control method.
[0367] The present application also provides a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part via software, hardware, firmware, or any combination thereof. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one location to another. The storage medium can be any target medium that can be accessed by a computer.
[0368] As one possible design, computer-readable media may include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; computer-readable media may include magnetic disk storage or other magnetic disk storage devices. Moreover, any connecting line may also be appropriately referred to as a computer-readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, DVD, floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while discs reproduce data optically using lasers.
[0369] The present application embodiment is described with reference to the flow chart and / or block diagram according to the method, device (system) and computer program product of the embodiment of the present application.It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processing unit of general-purpose computer, special-purpose computer, embedded processing machine or other programmable data processing equipment to produce a machine, so that the instruction executed by the processing unit of computer or other programmable data processing equipment produces the device for realizing the function specified in one flow chart flow chart or multiple flow charts and / or one block or multiple blocks of block diagram.
[0370] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of this application in detail. It should be understood that the above are only specific implementation methods of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of this application should be included in the scope of protection of this application.
Claims
1. A network channel control method, characterized in that: Applied to an electronic device, the electronic device has multiple network channels, and a target application is running on the electronic device; the method includes: The electronic device acquires the temperature of the electronic device and the output current of a battery in the electronic device; During the operation of the target application, when the temperature is greater than a first temperature threshold and / or the output current is greater than a first current threshold, and there are M available network channels among the multiple network channels, the electronic device uses a target network channel among the M available network channels to transmit a data stream of the target application; Among them, the available network channel is a network channel that is performing data transmission and is in an available state for the target application, the target network channel is N available network channels among the M available network channels, M is an integer greater than 1, N is an integer greater than or equal to 1, and N is less than M.
2. The method according to claim 1, characterized in that Before the electronic device uses the target network channel among the M available network channels to transmit the data stream of the target application, the method further includes: The electronic device obtains network quality information corresponding to the M available network channels; the network quality information is used to characterize the network quality of the available network channels; Among them, when the difference between the network qualities of at least two of the M available network channels is greater than a network quality threshold, the network quality of the target network channel is higher than the network qualities of other available network channels among the M available network channels except the target network channel; when the difference between the network qualities of any two of the M available network channels is less than or equal to the network quality threshold, the priority of the target network channel is higher than the priority of other available network channels among the M available network channels except the target network channel.
3. The method according to claim 1, characterized in that The method further comprises: The electronic device obtains a target network delay and a synthetic frame rate of an image; The electronic device selects the corresponding first temperature threshold and the first current threshold according to the target network delay and the synthetic frame rate; Among them, when the target network delay is less than the delay threshold and the synthetic frame rate is greater than the frame rate threshold, the first temperature threshold is a first temperature value, and the first current threshold is a first current value; when the target network delay is greater than or equal to the delay threshold, and / or the synthetic frame rate is less than or equal to the frame rate threshold, the first temperature threshold is a second temperature value, and the first current threshold is a second current value; and, the first temperature value is less than the second temperature value, and the first current value is less than the second current value.
4. The method according to claim 1, characterized in that After the electronic device uses the target network channel among the M available network channels to transmit the data stream of the target application, the method further includes: The electronic device again acquires the temperature of the electronic device and the output current of the battery in the electronic device; When the re-acquired temperature and the re-acquired output current meet a first preset condition, the electronic device re-determines a target network channel for transmitting the data stream.
5. The method according to claim 4, characterized in that The first preset condition includes: the temperature acquired again is less than a second temperature threshold, and / or the output current acquired again is less than a second current threshold; the second temperature threshold is less than the first temperature threshold, and the second current threshold is less than the first current threshold; The electronic device re-determines a target network channel for transmitting the data stream, including: The electronic device uses the target network channel, and the M available network channels except the target network channel Other part or all of the available network channels outside the channel are used to transmit the data stream.
6. The method according to claim 4, characterized in that The N is an integer greater than 1, and the first preset condition includes: the temperature obtained again is greater than a third temperature threshold, and / or the output current obtained again is greater than a third current threshold; the third temperature threshold is greater than the first temperature threshold, and the third current threshold is greater than the first current threshold; The electronic device re-determines a target network channel for transmitting the data stream, including: The electronic device transmits the data stream through a portion of the target network channels; The network quality of the target network channel used to transmit the data stream is higher than the network quality of the target network channel not used to transmit the data stream; or the priority of the target network channel used to transmit the data stream is higher than the priority of the target network channel not used to transmit the data stream.
7. The method according to claim 3, characterized in that After the electronic device uses the target network channel among the M available network channels to transmit the data stream of the target application, the method further includes: The electronic device again obtains the target network delay and the synthetic frame rate of the image; When the target network delay obtained again satisfies the second preset condition relative to the target network delay obtained before the target network channel decision is made, and / or the synthesized frame rate obtained again satisfies the third preset condition relative to the synthesized frame rate obtained before the target network channel decision is made, the electronic device adopts the target network channel, and some or all of the M available network channels except the target network channel, to transmit the data stream.
8. The method according to claim 7, characterized in that The second preset condition includes: the difference between the target network delay obtained again and the target network delay obtained before the target network channel decision is greater than the product of the first preset ratio and the target network delay obtained before the target network channel decision is made; the first preset ratio is greater than 0 and less than 1; The third preset condition includes: the difference between the synthetic frame rate obtained before the target network channel decision is made and the synthetic frame rate obtained again is greater than the product of the second preset ratio and the synthetic frame rate obtained before the target network channel decision is made; the second preset ratio is greater than 0 and less than 1.
9. The method according to claim 1, characterized in that: The electronic device includes a temperature sensor, a temperature sensor driver, an electric meter, an electric meter driver and a network channel decision module; The electronic device acquires the temperature of the electronic device and the output current of a battery in the electronic device, including: The temperature sensor driver obtains the actual temperature of the target device collected by the temperature sensor; The temperature sensor driver determines the temperature of the electronic device according to the actual temperature; The temperature sensor driver sends the temperature of the electronic device to the network channel decision module; The fuel gauge drives the battery to obtain the output current of the battery collected by the fuel gauge; The power meter driver sends the output current to the network channel decision module.
10. The method according to claim 2, characterized in that The electronic device includes a connection service, a network channel control module and a network channel decision module; The electronic device obtains network quality information corresponding to the M available network channels, including: The connection service sends the network status information of each network channel and the identification information of the network channel in which data transmission is in progress to the network channel control module; The network status information includes the activation status of the network channel and network quality information when the activation status is an available status, wherein the activation status includes the available status or the unavailable status; The network channel control module sends the network status information of each network channel and the identification information of the network channel in which data transmission is in progress to the network channel decision module; The network channel decision module determines, according to the activation state of each of the network channels and the identification information of the network channel that is performing data transmission, an available network channel that is performing data transmission and whose activation state is an available state from the multiple network channels; The network channel decision module extracts network quality information corresponding to the available network channel from the network status information of each of the network channels.
11. The method according to claim 10, characterized in that The multiple network channels include a cellular channel and a WiFi channel, and the electronic device also includes a phone manager, a WiFi manager, a cellular network driver, a WiFi network driver, a mobile communication module, and a wireless communication module; Before the connection service sends the network status information of each network channel to the network channel control module, it also includes: The cellular network driver obtains the network status information of the cellular channel from the mobile communication module; The cellular network driver sends the network status information of the cellular channel to the connection service through the phone manager; The WiFi network driver obtains the network status information of the WiFi channel from the wireless communication module; The WiFi network driver sends the network status information of the WiFi channel to the connection service through the WiFi manager.
12. The method according to claim 10, characterized in that The electronic device uses a target network channel among the M available network channels to transmit a data stream of the target application, including: The network channel decision module selects N available network channels from the M available network channels as the target network channels according to the network quality information corresponding to the M available network channels; The network channel decision module sends a network on / off decision result to the network channel control module; the network on / off decision result is used to indicate that the data stream is transmitted through the target network channel, and the data stream is not transmitted through other available network channels among the M available network channels except the target network channel; The network channel control module sends the network on / off decision result to the connection service; The connection service controls a target network channel among the M available network channels to transmit the data stream according to the network on / off decision result.
13. The method according to claim 12, characterized in that The electronic device further includes a phone manager, a WiFi manager, a cellular network driver, a WiFi network driver, a mobile communication module, and a wireless communication module; the connection service controls a target network channel among the M available network channels to transmit the data stream according to the network on / off decision result, including: When the other available network channels among the M available network channels except the target network channel include a cellular channel, the connection service sends a first control instruction to the cellular network driver through the phone manager; The cellular network driver controls the mobile communication module not to transmit the data stream according to the first control instruction; and / or, when other available network channels among the M available network channels except the target network channel include a WiFi channel, the connection service sends a second control instruction to the WiFi network driver through the WiFi manager; The WiFi network driver controls the wireless communication module not to transmit the data stream according to the second control instruction.
14. The method according to claim 3, characterized in that The electronic device includes an application information receiving module, a graphics library, a graphics interface hook module, an image synthesizer, a frame rate detection module and a network channel decision module; The electronic device obtains a target network delay and a synthetic frame rate of an image, including: The target application sends a first network delay to the application information receiving module; The application information receiving module sends the first network delay to the network channel decision module; When the target application calls the graphics library to perform image drawing and rendering, the graphics interface hook module obtains a drawing and rendering instruction from the graphics library; The graphics interface hook module determines the second network delay according to the drawing rendering instruction; The graphic interface hook module sends the second network delay to the network channel decision module; The network channel decision module determines the target network delay according to the first network delay and / or the second network delay; When the image synthesizer synthesizes the rendered image, the frame rate detection module obtains the synthesis time of each frame of the image; The frame rate detection module calculates the synthesis frame rate according to the synthesis time of each frame of the image; The frame rate detection module sends the synthesized frame rate to the network channel decision module.
15. The method according to claim 14, characterized in that The electronic device selects the corresponding first temperature threshold and the first current threshold according to the target network delay and the synthetic frame rate, including: The network channel decision module selects the corresponding first temperature threshold and the first current threshold according to the target network delay and the synthetic frame rate.
16. The method according to claim 14, characterized in that The drawing and rendering instruction includes characteristic parameters corresponding to a plurality of UI controls, and the characteristic parameters include the size and position of the UI controls; the graphics interface hook module determines the second network delay according to the drawing and rendering instruction, including: The graphic interface hook module determines a target UI control for characterizing network delay from the multiple UI controls according to the characteristic parameters corresponding to the multiple UI controls; The graphic interface hook module calculates the pixel proportions of various colors included in the target UI control; The graphic interface hook module determines the second network delay according to the color with the largest pixel proportion.
17. The method according to claim 14, characterized in that The frame rate detection module calculates the synthesis frame rate according to the synthesis time of each frame of the image synthesis, including: The frame rate detection module counts the number of times the synthesis time is obtained within a preset period; The frame rate detection module determines the ratio of the number of times to the preset period as the synthetic frame rate.
18. The method according to claim 14, characterized in that The frame rate detection module calculates the synthesis frame rate according to the synthesis time of each frame of the image synthesis, including: The frame rate detection module counts the average time interval between the synthesis times of the most recent multiple frame images; The frame rate detection module determines the reciprocal of the average time interval as the synthetic frame rate.
19. The method according to any one of claims 1 to 18, characterized in that The M available network channels include a first network channel and a second network channel, the first network channel is a cellular channel, and the second network channel is a WiFi channel.
20. The method according to any one of claims 1 to 18, characterized in that The target application is a game application.
21. An electronic device, characterized in that: The invention comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call the computer program to execute the network channel control method according to any one of claims 1 to 20.
22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed, the network channel control method according to any one of claims 1 to 20 is implemented.