Network control method, electronic device, storage medium and program product
By implementing network enhancement strategies in preset scenarios on electronic devices, the impact of WLAN-assisted positioning on network latency is resolved, achieving low-latency and stable network connectivity and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-10-21
- Publication Date
- 2026-04-21
AI Technical Summary
In scenarios where network latency is critical, such as gaming, live streaming, or phone calls, the execution of WLAN-assisted positioning may affect network connection stability, leading to increased network latency and impacting user experience.
In preset scenarios, network enhancement strategies are implemented, such as disabling Wi-Fi channel scanning, disabling Wi-Fi hardware sleep mode, disabling unnecessary Wi-Fi roaming, limiting background application speed, accelerating foreground applications, and enabling Wi-Fi multi-path transmission to reduce network latency.
These strategies reduce network latency, improve the user experience in scenarios such as gaming, live streaming, or phone calls, and ensure network connection stability and data transmission efficiency.
Smart Images

Figure CN121908358A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a network control method, electronic device, storage medium, and program product. Background Technology
[0002] With the development of terminal technology, electronic devices such as mobile phones and tablets have become an indispensable part of people's daily lives. These devices not only perform traditional communication but are also widely used in various scenarios such as entertainment, learning, and work. For example, users can use electronic devices for entertainment activities such as gaming and live streaming, or to make calls with distant friends. However, high network latency during gaming, live streaming, or phone calls will severely impact the user experience. Summary of the Invention
[0003] This application provides a network control method, electronic device, storage medium, and program product, which can ensure relatively low network latency in a preset scenario to a certain extent. The technical solution is as follows:
[0004] Firstly, a network control method is provided. In this method, when an electronic device is connected to a Wi-Fi network, the foreground scenario of the electronic device is determined. If the foreground scenario is a preset scenario, the electronic device executes one or more policies in the network enhancement function, including policy one, which is to prohibit scanning Wi-Fi channels.
[0005] Preset scenarios are scenarios determined based on network latency requirements. Preset scenarios can be set in advance. Preset scenarios can be scenarios with high network latency requirements, that is, scenarios that require low network latency. For example, preset scenarios can include one or more of the following: gaming scenarios, live streaming scenarios, and call scenarios.
[0006] In this application, if the electronic device determines that the foreground scenario of the electronic device is a preset scenario in a Wi-Fi network environment, it can at least implement a policy of prohibiting the scanning of Wi-Fi channels. Thus, even if the electronic device has WLAN-assisted positioning enabled, it will not perform the operation of scanning Wi-Fi channels, thereby avoiding the impact of scanning Wi-Fi channels on the network latency of the preset scenario. This can, to a certain extent, ensure that the network latency of the preset scenario is relatively low, thereby improving the user experience.
[0007] Optionally, one or more strategies in the network enhancement features may also include one or more of strategies two, three, four, five, and six; strategy two is to prohibit Wi-Fi hardware from sleeping, strategy three is to prohibit unnecessary Wi-Fi roaming, strategy four is to limit the speed of background applications, strategy five is to accelerate foreground applications, and strategy six is to enable Wi-Fi multipathing.
[0008] In this application, by implementing strategy one, and one or more of strategies two, three, four, five, and six, the network latency of the preset scenario can be reduced as much as possible.
[0009] Optionally, the network enhancement function includes multiple modes, which are set according to the impact of various strategies in the network enhancement function on the power consumption of electronic devices. The strategies included in different modes are not entirely the same, but each mode includes strategy one. In this case, the operation of the electronic device executing one or more strategies in the network enhancement function can be: obtaining power management information of the electronic device; and executing one of the multiple modes based on the power management information of the electronic device.
[0010] For example, the power management information may include one or more of the following: the power supply status of the electronic device and the power level.
[0011] For example, the multiple modes may include a power-saving mode, a balanced mode, and a performance mode; the power-saving mode includes various strategies in the network enhancements that reduce the power consumption of electronic devices; the balanced mode includes some strategies in the network enhancements that reduce the power consumption of electronic devices, as well as some strategies that increase the power consumption of electronic devices; and the performance mode includes all strategies in the network enhancements.
[0012] In one possible implementation, the energy-saving mode may include one or more of the strategies described in Strategy 1 and Strategy 3 above. The balanced mode may include one or more of the strategies described in Strategy 1 and Strategy 3 above, and up to three of the strategies described in Strategy 2, Strategy 4, Strategy 5, and Strategy 6 above. The performance mode may include the strategies described in Strategy 1, Strategy 2, Strategy 3, Strategy 4, Strategy 5, and Strategy 6 above.
[0013] In this application, the power management information of the electronic device can be used to determine which of the multiple modes to execute, thereby minimizing network latency in the preset scenario while taking into account the power consumption of the electronic device, and thus ensuring the normal operation of the electronic device.
[0014] Optionally, the electronic device may include a Wi-Fi enhancement module and a Wi-Fi function module. In this case, the operation of the electronic device to execute one or more strategies in the network enhancement function can be as follows: if the Wi-Fi enhancement module determines that strategy one needs to be executed, it sends a first control message to the Wi-Fi function module. The first control message is used to indicate that scanning the Wi-Fi channel is prohibited. After receiving the first control message, if the Wi-Fi function module receives a device location query message sent by another module, it does not respond to the device location query message.
[0015] In this application, if the Wi-Fi function module does not receive the first control message, then the Wi-Fi function module is allowed to scan the Wi-Fi channel. In this case, if the Wi-Fi function module receives a device location query message sent by another module, it can obtain the signal strength of each nearby AP by scanning the Wi-Fi channel, and then determine the device location information accordingly, and return the device location information to the other module in a response message.
[0016] If the Wi-Fi module receives the first control message, it will disable Wi-Fi channel scanning. In this case, if the Wi-Fi module receives a device location query message from another module, it will not scan the Wi-Fi channel. Because the Wi-Fi module will not scan the Wi-Fi channel, it cannot determine the device's location information and therefore cannot respond to the device location query message. Thus, in the default scenario of the electronic device, even if the WLAN assisted positioning function is enabled, the operation of scanning the Wi-Fi channel will not be performed. This avoids the impact of scanning the Wi-Fi channel on the network latency of the default scenario, thereby ensuring a relatively low network latency in the default scenario and improving the user experience.
[0017] Optionally, the electronic device may include a Wi-Fi enhancement module and a Wi-Fi Hal. In this case, the operation of the electronic device to execute one or more strategies in the network enhancement function can be as follows: if the Wi-Fi enhancement module determines that strategy two needs to be executed, it sends a second control message to the Wi-Fi Hal. The second control message is used to indicate that the Wi-Fi hardware should not be put into sleep mode. After receiving the second control message, the Wi-Fi Hal does not execute the Wi-Fi hardware sleep triggering logic. The Wi-Fi hardware sleep triggering logic refers to the logic that controls the Wi-Fi hardware to go into sleep mode when the electronic device meets preset conditions.
[0018] If Wi-Fi Hal does not receive the second control message, then Wi-Fi Hal needs to execute the Wi-Fi hardware sleep trigger logic. Specifically, when Wi-Fi Hal determines that the electronic device meets preset conditions, such as when the electronic device has not transmitted data through the Wi-Fi network for an extended period, it can control the Wi-Fi hardware to enter sleep mode via the Wi-Fi driver. Subsequently, when Wi-Fi Hal determines that the electronic device does not meet the preset conditions, such as when the electronic device needs to transmit data through the Wi-Fi network, it can wake up the Wi-Fi hardware via the Wi-Fi driver so that data can be transmitted through the Wi-Fi hardware.
[0019] If Wi-Fi Hal receives the second control message, it will not execute the Wi-Fi hardware sleep trigger logic. In this case, even if Wi-Fi Hal finds that the electronic device meets the preset conditions, it will not control the Wi-Fi hardware to sleep, keeping the Wi-Fi hardware always active. This ensures, to some extent, that the Wi-Fi hardware can transmit data in the preset scenario in a timely manner, thus guaranteeing relatively low network latency and improving the user experience.
[0020] Optionally, the electronic device may include a Wi-Fi enhancement module. In this case, the operation of the electronic device to execute one or more strategies in the network enhancement function may be as follows: if the Wi-Fi enhancement module determines that strategy three needs to be executed, it modifies the Wi-Fi roaming threshold from a first threshold to a second threshold, where the second threshold is less than the first threshold; the Wi-Fi enhancement module performs Wi-Fi roaming when the signal strength of the Wi-Fi network currently connected to the electronic device is less than the second threshold.
[0021] In this application, the Wi-Fi enhancement module only performs Wi-Fi roaming when the currently connected Wi-Fi network is weaker than the default situation. This can, to some extent, avoid electronic devices frequently switching access points, improve the stability of the Wi-Fi network, and thus ensure that the network latency in the preset scenario is relatively low, thereby improving the user experience.
[0022] Optionally, the electronic device may include a Wi-Fi enhancement module and a network guardian module. In this case, the operation of the electronic device to execute one or more strategies in the network enhancement function can be as follows: if the Wi-Fi enhancement module determines that strategy four needs to be executed, it sends a third control message to the network guardian module. The third control message is used to instruct the speed limit of other applications besides the foreground application corresponding to the preset scenario. After receiving the third control message, the network guardian module limits the speed of other applications besides the foreground application.
[0023] The network protection module limits the bandwidth of applications other than the foreground application, which can reduce the bandwidth usage of those applications. By limiting the bandwidth of these other applications, the foreground application can run more smoothly, reducing lag and improving the user experience.
[0024] Optionally, the electronic device may include a Wi-Fi enhancement module and a network management module. In this case, the operation of the electronic device to execute one or more strategies in the network enhancement function can be as follows: if the Wi-Fi enhancement module determines that strategy five needs to be executed, it sends a fourth control message to the network management module. The fourth control message is used to instruct the data transmission priority of the foreground application corresponding to the preset scenario to be set to the preset priority. After receiving the fourth control message, if the network management module receives data from the foreground application, it adds the preset priority to the data and transmits the data to other modules.
[0025] Different applications can have different preset priorities. The preset priorities for each application can be set in advance. An application's preset priority can be higher than its original data transfer priority.
[0026] For example, the data transmission priorities, from highest to lowest, are: voice level, video level, best-effort transmission level, and background traffic level.
[0027] For example, the foreground application can be a game application, and the preset priority of the game application can be either the voice level or the video level.
[0028] In this application, since the data transmission priority of the foreground application is set to a high preset priority, the priority transmission of the data of the foreground application can be guaranteed to a certain extent, thereby reducing the data transmission latency of the foreground application.
[0029] Optionally, the electronic device may include a Wi-Fi enhancement module and a network management module. In this case, the operation of the electronic device to execute one or more strategies in the network enhancement function can be as follows: if the Wi-Fi enhancement module determines that strategy six needs to be executed, it sends a fifth control message to the network management module. The fifth control message is used to instruct the data of the foreground application corresponding to the preset scenario to be transmitted through multiple paths. After receiving the fifth control message, if the network management module receives data from the foreground application, it copies the data to obtain multiple data and transmits the multiple data to other modules. The multiple data use different network connection paths when transmitting the network.
[0030] For example, the fifth control message is used to instruct the data of the foreground application to be transmitted via dual-path Wi-Fi 2.4G and Wi-Fi 5G, or the fifth control message is used to instruct the data of the foreground application to be transmitted via dual-path Wi-Fi and mobile data, or the fifth control message is used to instruct the data of the foreground application to be transmitted via triple-path Wi-Fi 2.4G, Wi-Fi 5G and mobile data.
[0031] In this application, by using multiple network connection paths simultaneously to transmit data for the foreground application, the overall bandwidth of the foreground application can be enhanced, thereby improving network speed. Furthermore, when a problem occurs in one network connection path, other network connection paths can continue to ensure the normal transmission of data for the foreground application, reducing disconnections and connection instability, thereby improving network stability.
[0032] In one possible implementation, the fifth control message is used to instruct the data of the foreground application to be transmitted via both Wi-Fi and mobile data. In this case, before the network management module transmits the multiple data to other modules, it can add a new destination address to each of the multiple data, which is the address of the preset device.
[0033] The default device can be a pre-configured device. For example, the default device can be a VPN device.
[0034] In this scenario, after the electronic device sends multiple data packets to an external network, a pre-configured device can receive these packets. Upon receiving one of these packets, the pre-configured device can forward it to the corresponding device based on its original destination address. Subsequently, if the pre-configured device receives other packets, it can discard them without forwarding them.
[0035] In this application, by adding a preset device, the original business logic of the front-end application can be avoided when transmitting data via Wi-Fi and mobile data through multiple channels. That is, the processing logic of the front-end application and the processing logic of the device corresponding to the original target address in the data of the front-end application do not need to be changed, thus achieving better compatibility with existing business scenarios.
[0036] Secondly, a data transmission apparatus is provided, which has the function of implementing the network control method described in the first aspect. The data transmission apparatus includes at least one module for implementing the network control method provided in the first aspect.
[0037] Thirdly, an electronic device is provided, comprising: one or more processors, and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the network control method provided in the first aspect.
[0038] Fourthly, a chip system is provided for use in an electronic device, the chip system including one or more processors for invoking computer instructions to cause the electronic device to execute the network control method provided in the first aspect.
[0039] Fifthly, a computer-readable storage medium is provided, the computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the network control method provided in the first aspect.
[0040] In a sixth aspect, a computer program product is provided that, when the computer program product is run on an electronic device, causes the electronic device to execute the network control method provided in the first aspect.
[0041] The technical effects achieved by the second, third, fourth, fifth, and sixth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of a game interface provided in an embodiment of this application.
[0043] Figure 2 This is a schematic diagram of an interface for setting up an application and a control center, provided in an embodiment of this application.
[0044] Figure 3 This is a schematic diagram of an application settings interface provided in an embodiment of this application.
[0045] Figure 4 This is a schematic diagram of the interface of a control center provided in an embodiment of this application.
[0046] Figure 5 This is a schematic diagram of the interface of a game application and game manager provided in an embodiment of this application.
[0047] Figure 6 This is a schematic diagram of a voice call interface provided in an embodiment of this application.
[0048] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0049] Figure 8 This is a block diagram of a software system for an electronic device provided in an embodiment of this application.
[0050] Figure 9 This is a system architecture diagram related to a network enhancement function provided in an embodiment of this application.
[0051] Figure 10 This is a flowchart of a network control method provided in an embodiment of this application.
[0052] Figure 11 This is a flowchart of another network control method provided in the embodiments of this application.
[0053] Figure 12 This is a flowchart of another network control method provided in the embodiments of this application.
[0054] Figure 13 This is a flowchart of another network control method provided in the embodiments of this application.
[0055] Figure 14 This is a flowchart of another network control method provided in the embodiments of this application.
[0056] Figure 15 This is a flowchart of another network control method provided in the embodiments of this application.
[0057] Figure 16 This is a flowchart of another network control method provided in the embodiments of this application. Detailed Implementation
[0058] In the following description, specific details such as particular system architectures and technologies are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details.
[0059] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0060] It should be understood that "one or more" as mentioned in this application refers to one, two, or more, and "multiple" as mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.
[0061] To facilitate a clear description of the technical solutions of this application, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that the terms "first" and "second" do not necessarily imply that they are different.
[0062] The terms "one embodiment" or "some embodiments" used in this application mean that one or more embodiments of this application include the specific features, structures, or characteristics described in that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this application do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0063] The application scenarios involved in the embodiments of this application are described below.
[0064] With the development of terminal technology, electronic devices such as mobile phones and tablets have become an indispensable part of people's daily lives. These devices not only perform traditional communication but are also widely used in various scenarios such as entertainment, learning, and work. For example, users can use electronic devices for entertainment activities such as gaming and live streaming, or to make calls with distant friends. When playing games, live streaming, or making calls, electronic devices often have high requirements for network latency, generally requiring it to be within 100 milliseconds.
[0065] For example, when a user is playing a game on an electronic device, an unstable network connection may cause the connection to be interrupted. In this case, such as... Figure 1 As shown, electronic devices typically display a message like "Reconnecting and recovering" in the game interface. When this message appears, users will be unable to play the game normally, which will seriously affect their gaming experience.
[0066] In some scenarios, if wireless local area networks (WLAN) assisted positioning is enabled on an electronic device, the execution of WLAN assisted positioning may affect the stability of the network connection when the device is engaged in activities with high network latency requirements, such as gaming, live streaming, or making calls. This can significantly impact the user experience. The following is a detailed explanation:
[0067] Currently, electronic devices typically use the Global Navigation Satellite System (GNSS) for positioning. However, when these devices are indoors, the positioning accuracy of GNSS can be affected by building obstructions, potentially failing to meet positioning requirements. To improve indoor positioning accuracy, specialized indoor positioning technologies have emerged, such as WLAN-assisted positioning.
[0068] Users can enable or disable the WLAN-assisted positioning function in various ways. For example, ... Figure 2 As shown in Figure (a), the user can open interface 21 in the settings application and then turn the WLAN assisted positioning function on or off using the control 211 in interface 21. Alternatively, as... Figure 2 As shown in Figure (b), the user can swipe down from a preset position on the screen (such as the top) to open the control center interface 22, and then turn the WLAN assisted positioning function on or off using the controls 221 in the control center interface 22. Of course, this is not the only way; the user can also turn the WLAN assisted positioning function on or off in other ways, and this embodiment of the application does not limit this method.
[0069] WLAN-assisted positioning refers to a technology that combines GNSS and wireless fidelity (Wi-Fi) networks for positioning. For example, an electronic device can obtain first device location information via GNSS, obtain second device location information via a Wi-Fi network, and then determine the electronic device's location information based on the first and second device location information.
[0070] Optionally, when an electronic device obtains the location information of a second device via a Wi-Fi network, it can scan nearby access points (APs). By measuring the signal strength of each nearby AP, the electronic device estimates the distance between itself and each AP. Then, combining this with the location information of each AP, the electronic device can calculate its position relative to these APs, thereby determining the location information of the second device. During this process, scanning nearby APs involves scanning Wi-Fi channels, which can interfere with the data transmission of the Wi-Fi network currently connected to the electronic device.
[0071] With the increasing number of applications on electronic devices, many (such as food delivery, travel, map, and weather apps) periodically obtain device location information. Furthermore, some applications even continue to collect device location information in the background while the user is playing a game in the foreground. In this situation, if the electronic device has WLAN-assisted positioning enabled, these applications will obtain the device's location information via Wi-Fi. Obtaining device location information via Wi-Fi interferes with the data transmission of foreground applications (such as games), affecting the data throughput of the Wi-Fi network. This impact can lead to a decrease in Wi-Fi speed for foreground applications and cause network latency fluctuations. For example, it can increase data transmission latency within games, causing game lag and severely impacting the user's gaming experience.
[0072] To address this, this application provides a network enhancement function that can reduce the latency of business data transmission in scenarios with high network latency requirements, such as gaming, live streaming, and phone calls, by using preset strategies, thereby improving the user experience.
[0073] In some embodiments, enabling and disabling the network enhancement function in this application can be achieved through controls provided by the settings application. In other embodiments, enabling and disabling the network enhancement function in this application can be achieved through controls provided by the control center. In still other embodiments, enabling and disabling the network enhancement function in this application can be achieved through controls provided by the application or its management component. Of course, this is not limited to these methods; enabling and disabling the network enhancement function in this application can also be achieved in other ways, and this application does not limit this approach.
[0074] The following is combined Figure 3 The process of enabling and disabling network enhancement functions in this application embodiment based on controls provided by the settings application is illustrated by way of example.
[0075] For example, such as Figure 3 As shown in Figure (a), the user can open the network enhancement feature interface 31 in the settings application. Interface 31 can display the control 311 (also called a switch) corresponding to the network enhancement feature; here, it is assumed... Figure 3 Control 311 shown in Figure (a) is in the closed state.
[0076] In some instances, the user clicks Figure 3 In Figure (a), the control 311 in the closed state of the interface 31, in response to the click operation, such as Figure 3As shown in Figure (b), the electronic device can set control 311 to the on state and enable the network enhancement function. Understandably, if the user needs to disable the network enhancement function, they can click... Figure 3 The control 311 shown in Figure (b) is in the open state. In response to the click operation, the electronic device can set the control 311 to the closed state and disable the network enhancement function.
[0077] The following is combined Figure 4 The process of enabling and disabling the network enhancement function in this application embodiment based on the controls provided by the control center is illustrated by way of example.
[0078] For example, when the electronic device's interface is any interface after unlocking, the user swipes down from a preset position on the screen (such as the top), and in response to this swipe operation, such as... Figure 4 As shown in Figure (a), the electronic device can display the control center interface 41. Interface 41 can display multiple controls, such as the network enhancement function control 411, as well as WLAN controls, ringing controls, auto-rotate controls, wireless sharing controls, airplane mode controls, mobile data controls, location information controls, screenshot controls, eye protection mode controls, Bluetooth controls, screen recording controls, near field communication (NFC) controls, flashlight controls, dark mode controls, and do-not-disturb controls.
[0079] In some embodiments, the control 411 can be a switch, which is assumed here. Figure 4 Control 411 shown in Figure (a) is in the closed state.
[0080] For example, a user can click Figure 4 In Figure (a), the control 411 in the closed state of the interface 41, in response to the click operation, such as Figure 4 As shown in Figure (b), the electronic device can set control 411 to the on state and enable network enhancement.
[0081] Understandably, if a user needs to disable network enhancements, they can click [here]. Figure 4 As shown in Figure (b), the control 411 is in the open state. In response to the click operation, the electronic device can set the control 411 to the closed state and disable the network enhancement function.
[0082] In other embodiments, control 411 can be a function entry point.
[0083] For example, a user can click Figure 4 In Figure (a), control 411 in interface 41 responds to the click operation, allowing the electronic device to display an interface for network enhancement features, such as... Figure 3 The interface 31 shown is shown below. Afterwards, the user can turn the network enhancement function on or off using the controls in the network enhancement function interface, such as using control 311 in interface 31. Specific operations have been described in detail in the above embodiments and will not be repeated here.
[0084] The following is combined Figures 5 to 6 The process of enabling and disabling network enhancement functions in the embodiments of this application based on controls provided by the application or its management components is illustrated by way of example.
[0085] In some embodiments, such as Figure 5 As shown in Figure (a), after the user opens the game application, the electronic device can display the game application's interface 51. In this case, the user can swipe down from a preset position on the screen (such as the top), and in response to this swipe operation, as shown in Figure (a). Figure 5 As shown in Figure (b), the electronic device can display interface 52, and interface 52 can display a floating window 521. Optionally, the floating window 521 can be the interface of a game manager component. Optionally, the floating window 521 can be displayed on top of interface 51. The floating window 521 can display multiple controls, such as the control 522 corresponding to the network enhancement function, as well as controls for event mode, image quality enhancement, network acceleration, do-not-disturb, display enhancement, and accidental touch prevention.
[0086] For example, control 522 can be a switch, as assumed here. Figure 5 In Figure (b), control 522 is in a closed state. The user can click on the closed control 522 in the floating window 521. In response to this click, as shown... Figure 5 As shown in Figure (c), the electronic device can set control 522 to the on state and enable network enhancement.
[0087] Understandably, if a user needs to disable network enhancements, they can click [here]. Figure 5 The control 522 shown in Figure (c) is in the on state. In response to the click operation, the electronic device can set the control 522 to the off state and disable the network enhancement function.
[0088] In some embodiments, such as Figure 6As shown, during a voice call using an electronic device, the device can display a voice call interface 61. The voice call interface 61 can display multiple controls, such as a control 611 corresponding to the network enhancement function, as well as microphone, hang-up, and speaker controls. Users can turn the network enhancement function on or off by clicking the control 611. Optionally, the control 611 can float on the voice call interface 61, or it can be displayed as part of the voice call interface 61.
[0089] Similarly, during video calls using electronic devices, the video call interface can display controls for network enhancement features, which users can click to enable or disable. Optionally, these controls can float on the video call interface or be displayed as part of the video call interface.
[0090] Similarly, when a user is live-streaming video using an electronic device, the live-streaming interface displayed on the device can also show a control corresponding to the network enhancement function. The user can turn the network enhancement function on or off by clicking the control. Optionally, the control can be displayed floating on the live-streaming interface, or it can be displayed as part of the live-streaming interface.
[0091] Understandably, other applications that require network enhancement can provide controls for the network enhancement function in their own interface or in the interface of their management components. This allows users to easily and quickly enable or disable the network enhancement function while using these applications.
[0092] Understandably, the above text Figures 3 to 6 The descriptions of enabling and disabling network enhancement functions in the embodiments are merely illustrative for better understanding of the embodiments of this application and do not constitute a limitation on the embodiments of this application.
[0093] It should be noted that, in addition to the above methods, the network enhancement function can also be turned on or off in other ways, such as by using preset gestures or actions. This application embodiment does not limit this.
[0094] For example, users can double-tap the screen with two fingers to turn network enhancement on or off. Alternatively, users can long-press the screen with three fingers to turn network enhancement on and double-tap the screen with three fingers to turn it off.
[0095] It should be noted that when the network enhancement function is enabled, if an electronic device is connected to a Wi-Fi network and is currently in a scenario with high network latency requirements, such as gaming, live streaming, or making a call, then the network enhancement function can reduce the latency of data transmission in the current scenario through some strategies, thereby improving the user experience.
[0096] The network enhancement features in this application embodiment can be implemented through one or more strategies. These strategies can be pre-configured.
[0097] For example, the one or more strategies may include one or more of the following six strategies: Strategy 1, disabling Wi-Fi channel scanning; Strategy 2, disabling Wi-Fi hardware sleep mode; Strategy 3, disabling unnecessary Wi-Fi roaming; Strategy 4, limiting background application speed; Strategy 5, accelerating foreground applications; Strategy 6, enabling Wi-Fi multipathing. It is understood that this application embodiment only illustrates network enhancement functions through one or more of these six strategies. In practical applications, other strategies can also be used to achieve network enhancement functions, and this application embodiment does not limit this.
[0098] Strategy one, disabling Wi-Fi scanning, means that even if the electronic device has WLAN-assisted positioning enabled, it will not perform the operation of obtaining device location information through the Wi-Fi network, i.e., it will not scan for Wi-Fi channels. This avoids affecting data transmission on the Wi-Fi network currently connected to the electronic device due to Wi-Fi channel scanning.
[0099] Strategy two, which disables Wi-Fi hardware sleep mode, means that even if an electronic device has not transmitted data through the currently connected Wi-Fi network for an extended period, the Wi-Fi hardware will not enter sleep mode. This allows the electronic device to promptly send or receive data if it suddenly needs to transmit data after a long period of inactivity.
[0100] Strategy three, namely prohibiting unnecessary Wi-Fi roaming, refers to restricting the switching of electronic devices between different access points (APs). Wi-Fi roaming refers to the process of electronic devices switching between multiple APs, which usually occurs automatically when the Wi-Fi network signal strength is weak or when the electronic device moves. Wi-Fi roaming can improve the connectivity of electronic devices, but it can also lead to Wi-Fi network instability. Optionally, the Wi-Fi roaming threshold can be reduced to allow Wi-Fi roaming to occur only when the signal strength of the currently connected Wi-Fi network is weaker. In this way, frequent switching of APs by electronic devices can be avoided to some extent, thereby improving the stability of the Wi-Fi network.
[0101] Among them, strategy four, namely background application rate limiting, refers to limiting the bandwidth of background applications, such as limiting the bandwidth of background applications to 1MB / s (megabytes per second) in order to transmit as much data as possible from the foreground application.
[0102] Among them, strategy five, namely foreground application acceleration, refers to increasing the data transmission priority of foreground applications in order to prioritize the transmission of data from foreground applications.
[0103] Strategy six, namely enabling Wi-Fi multi-path transmission, refers to transmitting data simultaneously through multiple network connection paths to achieve higher bandwidth and better network performance. Optionally, data can be transmitted simultaneously via Wi-Fi 2.4G and Wi-Fi 5G, i.e., data can be transmitted simultaneously through Wi-Fi connections on the 2.4GHz and 5GHz bands; alternatively, data can be transmitted simultaneously via Wi-Fi networks and mobile data networks; or, data can be transmitted simultaneously via Wi-Fi 2.4G, Wi-Fi 5G, and mobile data networks. By using multiple network connection paths simultaneously, overall bandwidth can be enhanced, thereby improving network speed; furthermore, if one network connection path experiences a problem, other network connection paths can continue to ensure normal data transmission, reducing dropped connections and connection instability, thus improving network stability.
[0104] For example, a mobile data network may include one or more of the following: 2G networks, 3G networks, 4G networks, and 5G networks.
[0105] It should be noted that the various strategies in network enhancement features may reduce or increase the power consumption of electronic devices when implemented compared to when they are not implemented.
[0106] For example, strategy one reduces the power consumption of the electronic device compared to not implementing it. Strategy two increases the power consumption of the electronic device compared to not implementing it. Strategy three reduces the power consumption of the electronic device compared to not implementing it. Strategy four increases the power consumption of the electronic device compared to not implementing it. Strategy five increases the power consumption of the electronic device compared to not implementing it. Strategy six increases the power consumption of the electronic device compared to not implementing it.
[0107] In this scenario, the network enhancement features can be configured into different modes based on their impact on the power consumption of electronic devices. For example, the network enhancement features can be configured to include power-saving mode, balanced mode, and performance mode. Power-saving mode can include various strategies that reduce the power consumption of electronic devices. Balanced mode can include some strategies that reduce power consumption and some that increase it. Performance mode can include all strategies.
[0108] In one possible implementation, the energy-saving mode may include one or more of the strategies described in Strategy 1 and Strategy 3 above. The balanced mode may include one or more of the strategies described in Strategy 1 and Strategy 3 above, and up to three of the strategies described in Strategy 2, Strategy 4, Strategy 5, and Strategy 6 above. The performance mode may include the strategies described in Strategy 1, Strategy 2, Strategy 3, Strategy 4, Strategy 5, and Strategy 6 above.
[0109] In some embodiments, the electronic device can determine which mode of network enhancement needs to be performed based on the power management information of the electronic device.
[0110] For example, the power management information may include one or more of the following: the power supply status of the electronic device and its power level. The power supply status indicates whether the electronic device is connected to an external power source, which can be used to power the electronic device.
[0111] In one possible implementation, if the electronic device's battery level is less than a first battery threshold, the power-saving mode of the network enhancement function can be executed. If the electronic device's battery level is greater than or equal to the first battery threshold and less than a second battery threshold, the balanced mode of the network enhancement function can be executed. If the electronic device's battery level is greater than or equal to the second battery threshold, the performance mode of the network enhancement function can be executed.
[0112] The first and second battery thresholds can both be preset, with the first battery threshold being less than the second battery threshold. For example, the first battery threshold can be 15% or 20%, and the second battery threshold can be 40% or 45%, etc. This application does not limit this.
[0113] In another possible implementation, if the electronic device's battery level is below a third battery threshold and the device is not connected to an external power source, the power-saving mode of the network enhancement function can be executed. If the electronic device's battery level is below the third battery threshold and the device is connected to an external power source, the balanced mode of the network enhancement function can be executed. If the electronic device's battery level is greater than or equal to the third battery threshold and less than a fourth battery threshold, and the device is not connected to an external power source, the balanced mode of the network enhancement function can be executed. If the electronic device's battery level is greater than or equal to the third battery threshold and less than the fourth battery threshold, and the device is connected to an external power source, the performance mode of the network enhancement function can be executed. If the electronic device's battery level is greater than or equal to the fourth battery threshold, the performance mode of the network enhancement function can be executed.
[0114] Both the third and fourth battery thresholds can be preset, with the third battery threshold being lower than the fourth battery threshold. For example, the third battery threshold can be 15%, 20%, etc., and the fourth battery threshold can be 40%, 45%, etc., but this application embodiment does not limit this.
[0115] Of course, the implementation is not limited to the above-described method. Electronic devices can also determine which mode of network enhancement function needs to be executed through other implementation methods based on the power management information of the electronic device. This application embodiment does not limit this.
[0116] In this embodiment, the power management information of the electronic device can be used to determine which mode of network enhancement function to perform, thereby minimizing the latency of service data transmission in the current scenario while taking into account the power consumption of the electronic device, and thus ensuring the normal operation of the electronic device.
[0117] The network control method based on network enhancement provided in this application can be applied to electronic devices. For example, the electronic device may be a mobile phone, tablet computer, wearable device, digital camera, in-vehicle device, augmented reality (AR) device, virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), laptop, etc., and this application does not limit the scope of the application.
[0118] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. See also... Figure 7The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0119] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0120] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0121] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0122] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves system efficiency.
[0123] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions, such as saving music, video, and other files on the external memory card.
[0124] Internal memory 121 can be used to store computer-executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created by electronic device 100 during use (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0125] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (e.g., leakage current, impedance). In some other embodiments, the power management module 141 may be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0126] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0127] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0128] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including WLAN (such as Wireless Fidelity, Wi-Fi), Bluetooth, GNSS, frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module.
[0129] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. Wireless communication technologies may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies. GNSS may include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), BeiDou Navigation Satellite System (BDS), Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).
[0130] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D and application processor.
[0131] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0132] Electronic device 100 can implement display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The display screen 194 is used to display images, videos, etc.
[0133] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch display." Touch sensor 180K detects touch operations applied to or near it. Touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0134] It should be noted that the embodiments of this application do not specifically limit the specific structure of the executing entity of the network control method. As long as the code containing the network control method provided in the embodiments of this application is executed, the processing can be performed according to the network control method provided in the embodiments of this application. For example, the executing entity of the network control method provided in the embodiments of this application can be a functional module in the electronic device 100 that can call and execute a program, or it can be a processing device applied in the electronic device 100, such as a chip.
[0135] The software system of electronic device 100 will be described next.
[0136] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to illustrate the software system of electronic device 100.
[0137] Figure 8 This is a block diagram of a software system for an electronic device 100 provided in an embodiment of this application. See also... Figure 8 A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into the application layer, application framework layer, Android Runtime, system layer, hardware abstraction layer (HAL), and kernel layer.
[0138] The application layer can include a series of applications, including system applications and third-party applications, responsible for direct interaction with the user. System applications are those pre-installed on the electronic device before it leaves the factory. Third-party applications are those downloaded and installed by the user from application download platforms (including but not limited to app stores, app markets, and official app websites).
[0139] like Figure 8 As shown, the application layer can include applications such as camera, gallery, map, WLAN, Bluetooth, calendar, SMS, settings, social networking, games, and game manager.
[0140] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0141] like Figure 8 As shown, the application framework layer may include intelligent sensing modules (including but not limited to IAware), Wi-Fi enhancement modules (including but not limited to WifiEnhance), Wi-Fi function modules (including but not limited to WifiApex), network management modules (including but not limited to Boost), etc.
[0142] The intelligent sensing module can intelligently identify the foreground scene by monitoring the application's status, user behavior, and system resource usage.
[0143] The Wi-Fi enhancement module is primarily responsible for improving Wi-Fi performance and user experience, including optimizing connection speed, latency, and signal quality. It can also dynamically adjust Wi-Fi settings based on the network environment. In this embodiment, the Wi-Fi enhancement module can be used to implement network enhancement functions.
[0144] The Wi-Fi function module is primarily used for handling Wi-Fi configuration, status updates, and connection management. It is responsible for initializing the Wi-Fi function when the electronic device starts up. In this embodiment, the Wi-Fi function module can be used to obtain device location information via a Wi-Fi network during WLAN-assisted positioning.
[0145] The network management module is primarily used for network communication. In this embodiment, the network management module can perform data transmission between the application layer and the system layer.
[0146] like Figure 8 As shown, the application framework layer may also include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0147] The window manager manages windowed applications. It can determine the screen size, the presence of a status bar, screen lock, and screen capture. The content provider stores and retrieves data, making it accessible to applications. This data can include videos, images, audio, incoming and outgoing calls, browsing history and bookmarks, and phone books. The view system includes visual controls, such as controls for displaying text and images. The view system is used to build the application's display interface, which can consist of one or more views, such as a view displaying SMS notification icons, a view displaying text, and a view displaying images. The phone manager provides communication functionality for the electronic device 100, such as managing call status (including connection and disconnection). The resource manager provides various resources to the application, such as localized strings, icons, images, layout files, and video files. The notification manager allows applications to display notifications in the status bar. These notifications can be used to convey informational messages and can disappear automatically after a short pause without user interaction. For example, the notification manager can be used to notify of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the system's top status bar, such as notifications from background applications. The notification manager can also display notifications as dialog boxes on the screen, such as text messages in the status bar, sound alerts, vibrations of electronic devices, and flashing indicator lights.
[0148] The Android Runtime comprises the core libraries and the virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system. The core libraries consist of two parts: one part contains the functionalities that Java calls, and the other part is the core Android library itself. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0149] The system layer can include multiple functional modules, such as: network guardian module (including but not limited to Netd), surface manager, media libraries, 3D graphics processing library (including but not limited to OpenGL ES), 2D graphics engine (including but not limited to SGL), etc.
[0150] The network guardian module is primarily responsible for managing various network connections, such as Wi-Fi and mobile data connections, ensuring that electronic devices can communicate with external networks. The network guardian module can handle packet forwarding, sending packets from applications to the network and simultaneously transmitting packets from external devices back to the application.
[0151] The Surface Manager manages the display subsystem and provides fusion of two-dimensional (2D) and three-dimensional (3D) layers for multiple applications. The Media Library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video coding formats, such as: Moving Picture Experts Group (MPEG) 4, H.264 (also known as Advanced Video Coding, AVC), Moving Picture Experts Group Audio Layer III (MP3), Advanced Audio Coding (AAC), Adaptive Multi-rate (AMR), Joint Photographic Experts Group (JPG), and Portable Network Graphics (PNG). The 3D graphics processing library implements 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.
[0152] HAL is used to provide a call-driven generic interface to the application framework layer. HAL can include Wi-Fi HAL, etc.
[0153] Wi-Fi HAL provides a unified interface for different Wi-Fi drivers, allowing upper-layer applications and services to interact with Wi-Fi hardware in a standardized way.
[0154] The kernel layer is the layer between hardware and software. The kernel layer can include Wi-Fi drivers, display drivers, camera drivers, audio drivers, sensor drivers, etc.
[0155] The Wi-Fi driver is responsible for communicating directly with Wi-Fi hardware (such as wireless network cards), handling data transmission and hardware control.
[0156] Understandably, Figure 8 The layers in the software system shown, and the functional modules included in each layer, do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer layers than shown, and each layer may include more or fewer functional modules; this application does not limit this.
[0157] The implementation of the network enhancement function provided in the embodiments of this application will be illustrated below with reference to the above-described software system:
[0158] like Figure 9 As shown, some applications in the application layer (including but not limited to settings applications, social applications, live streaming applications, game applications, game manager applications, etc.) can enable or disable network enhancement features. The following explanation uses the game manager application to enable or disable network enhancement features as an example. The process for enabling or disabling network enhancement features in other applications is similar and will not be repeated.
[0159] As an example, the Game Manager app can automatically enable network enhancements when the game app launches. And / or, the Game Manager app can automatically disable network enhancements when the game app exits.
[0160] As another example, the game manager application can receive a user's command to enable network enhancements after the game application starts. For instance, the game manager application can... Figure 5 In the interface 52 shown in Figure (b), after receiving a click operation on the control 522 in the floating window 521, the network enhancement function is enabled. And / or, the game manager application may, for example, enable the network enhancement function if it receives an operation from the user to disable the network enhancement function after the game application starts. Figure 5 After receiving a click operation on the control 522 in the floating window 521 in the interface 52 shown in Figure (c), the network enhancement function is turned off.
[0161] For example, when the game manager application needs to enable network enhancement, it can send a network enhancement enable message to the Wi-Fi enhancement module. This message instructs the application to enable network enhancement. For instance, the game manager application can call the Wi-Fi enhancement module's enhancement management interface (including but not limited to EnhanceManager) to send the network enhancement enable message.
[0162] For example, when the game manager application needs to disable network enhancements, it can send a network enhancement disable message to the Wi-Fi enhancement module. This message instructs the network enhancement feature to be turned off. For instance, the game manager application can call the Wi-Fi enhancement module's enhancement management interface to send this message.
[0163] like Figure 9As shown, if the Wi-Fi enhancement module receives a network enhancement activation message from the upper-layer application, it can execute the network enhancement function triggering logic, which is explained below:
[0164] In some embodiments, after receiving a network enhancement enable message, the Wi-Fi enhancement module can register a callback function in the smart sensing module to listen for changes in the foreground scene. The smart sensing module can determine whether the foreground scene has changed while the electronic device is currently connected to a Wi-Fi network, and if so, call the callback function to notify the Wi-Fi enhancement module of this change.
[0165] The intelligent sensing module can determine whether the foreground scene has changed from other scenes to a preset scene. The preset scene can be pre-set, and can be configured by technicians according to requirements. The preset scene is a scene with high requirements for network latency; that is, a low network latency is required under the preset scene. For example, the preset scene may include one or more of the following: game scene, live streaming scene, voice call scene, video call scene, etc., but this application embodiment does not limit this.
[0166] When the intelligent sensing module determines that the foreground scene has changed from other scenes to the preset scene, it can send a first scene change message to the Wi-Fi enhancement module. The first scene change message is used to indicate that the foreground scene of the electronic device is the preset scene.
[0167] After receiving the first scene change message sent by the intelligent sensing module, the Wi-Fi enhancement module can execute one or more strategies in the network enhancement function to reduce network latency in the preset scene, thereby improving the user experience.
[0168] In some embodiments, network enhancement features may include multiple modes. For example, network enhancement features may be configured into different modes based on the impact of various strategies in the network enhancement features on the power consumption of electronic devices, and the strategies included in different modes are not exactly the same.
[0169] In this scenario, after receiving the first scene change message from the intelligent sensing module, the Wi-Fi enhancement module can obtain the power management information of the electronic device and determine which mode of network enhancement function needs to be executed based on the power management information.
[0170] Optionally, if the Wi-Fi enhancement module determines that it needs to implement Policy 1 of the network enhancement function (i.e., disable Wi-Fi scanning), it can send a first control message to the Wi-Fi function module. The first control message is used to instruct that scanning of Wi-Fi channels should be disabled.
[0171] In this scenario, after receiving the first control message, the Wi-Fi module will not scan the Wi-Fi channel even if it subsequently receives device location query messages from other modules. This avoids affecting network latency in the foreground scenario due to Wi-Fi channel scanning.
[0172] Optionally, if the Wi-Fi enhancement module determines that it needs to execute Strategy 2 in the network enhancement function (i.e., disable Wi-Fi hardware sleep), it can send a second control message to Wi-Fi Hal, which is used to instruct that Wi-Fi hardware sleep be disabled.
[0173] In this scenario, after receiving the second control message, Wi-Fi HAL will not control the Wi-Fi hardware to enter sleep mode even if it subsequently detects that the electronic device has not been transmitting data through the currently connected Wi-Fi network for an extended period. This allows for timely data transmission and reception in the foreground.
[0174] Optionally, if the Wi-Fi enhancement module determines that it needs to implement Strategy 3 in the network enhancement function (i.e., prohibiting unnecessary Wi-Fi roaming), it can change the set Wi-Fi roaming threshold from the default first threshold to the second threshold. Both the first and second thresholds can be preset, and the second threshold can be less than the first threshold.
[0175] In this case, the Wi-Fi enhancement module will only perform Wi-Fi roaming when the signal strength of the currently connected Wi-Fi network is less than the second threshold, that is, when the signal strength of the currently connected Wi-Fi network is weaker than the default situation. This can, to some extent, avoid electronic devices from frequently switching APs, thereby improving the stability of the Wi-Fi network.
[0176] Optionally, if the Wi-Fi enhancement module determines that it needs to implement strategy four (i.e. background application rate limiting) in the network enhancement function, it can send a third control message to the network guardian module. The third control message is used to instruct the rate limiting of other applications besides the foreground application corresponding to the preset scenario.
[0177] In this situation, after receiving a third control message, the network guardian module can reduce the bandwidth of the background application in order to transmit as much data as possible from the foreground application.
[0178] Optionally, if the Wi-Fi enhancement module determines that it needs to execute Strategy 5 (i.e., foreground application acceleration) in the network enhancement function, it can send a fourth control message to the network management module. The fourth control message is used to instruct the data transmission priority of the foreground application corresponding to the preset scenario to be set to the preset priority. The preset priority can be set in advance, and the preset priority is a higher transmission priority.
[0179] In this scenario, after receiving the fourth control message, the network management module can set the transmission priority of subsequent data received from the foreground application to a preset priority before transmitting the data to the network guardian module. This ensures that data from the foreground application is transmitted with the highest possible priority.
[0180] Optionally, if the Wi-Fi enhancement module determines that it needs to execute strategy six in the network enhancement function (i.e., enable Wi-Fi multipath), it can send a fifth control message to the network management module. The fifth control message is used to instruct the data of the foreground application corresponding to the preset scenario to be transmitted through multiple paths.
[0181] In this scenario, upon receiving the fifth control message, the network management module can copy the data received from the foreground application to obtain multiple data sets. These multiple data sets are then transmitted to the network guardian module, which is instructed to send them via multiple network connection paths (including but not limited to Wi-Fi 2.4G + Wi-Fi 5G, Wi-Fi + mobile data, and Wi-Fi 2.4G + Wi-Fi 5G + mobile data). By using multiple network connection paths simultaneously, overall bandwidth is enhanced, thereby improving network speed. Furthermore, if one network connection path experiences a problem, other network connection paths can continue to ensure normal data transmission, reducing dropped connections and connection instability, thus improving network stability.
[0182] It should be noted that the intelligent sensing module can not only determine whether the front-end scene has changed from other scenes to the preset scene, but also whether the front-end scene has changed from the preset scene to other scenes.
[0183] When the intelligent sensing module determines that the foreground scene has changed from the preset scene to another scene, it can send a second scene change message to the Wi-Fi enhancement module. The second scene change message is used to indicate that the foreground scene of the electronic device is not the preset scene.
[0184] After receiving the second scene change message from the intelligent sensing module, the Wi-Fi enhancement module can cancel one or more strategies in the previously executed network enhancement functions to restore the default processing logic.
[0185] Optionally, if the Wi-Fi enhancement module has previously executed Strategy 1, then after receiving the second scene change message sent by the intelligent sensing module, the Wi-Fi enhancement module can send a sixth control message to the Wi-Fi function module. The sixth control message is used to indicate that scanning of the Wi-Fi channel is allowed.
[0186] In this scenario, after receiving the sixth control message, if the Wi-Fi function module subsequently receives a device location query message from another module, it can scan the Wi-Fi channel, determine the device location information based on the scan results, and then return the determined device location information to the other module.
[0187] Optionally, if the Wi-Fi enhancement module has previously executed Strategy 2, after receiving the second scene change message sent by the intelligent sensing module, the Wi-Fi enhancement module can send a seventh control message to Wi-Fi Hal. The seventh control message is used to indicate that the Wi-Fi hardware is allowed to sleep.
[0188] In this scenario, after receiving the seventh control message, Wi-Fi Hal can control the Wi-Fi hardware to enter a sleep state if it detects that the electronic device has not been transmitting data through the currently connected Wi-Fi network for an extended period of time, thereby reducing the power consumption of the electronic device.
[0189] Optionally, if the Wi-Fi enhancement module has previously executed Strategy 3, then after receiving the second scene change message sent by the intelligent sensing module, the Wi-Fi enhancement module can change the set Wi-Fi roaming threshold from the second threshold to the first threshold.
[0190] In this situation, the Wi-Fi enhancement module can perform Wi-Fi roaming to improve network connection quality when the signal strength of the currently connected Wi-Fi network is less than a first threshold.
[0191] Optionally, if the Wi-Fi enhancement module has previously executed Strategy 4, after receiving the second scene change message sent by the intelligent sensing module, the Wi-Fi enhancement module can send an eighth control message to the network guardian module. The eighth control message is used to instruct the cancellation of the speed limit on background applications.
[0192] In this situation, after receiving the eighth control message, the network guardian module can restore the bandwidth of the background application.
[0193] Optionally, if the Wi-Fi enhancement module has previously executed Strategy 5, after receiving the second scene change message sent by the intelligent sensing module, the Wi-Fi enhancement module can send a ninth control message to the network management module. The ninth control message is used to indicate the cancellation of the data transmission priority setting for the foreground application corresponding to the preset scene.
[0194] In this case, after the network management module receives the ninth control message, if it subsequently receives data from the foreground application, it will not modify the transmission priority of the data and will transmit the data to the network guardian module normally.
[0195] Optionally, if the Wi-Fi enhancement module has previously executed Strategy Six, after receiving the second scene change message sent by the intelligent sensing module, the Wi-Fi enhancement module can send a tenth control message to the network management module. The tenth control message is used to instruct the cancellation of multi-path transmission of data to the foreground application corresponding to the preset scene.
[0196] In this case, after the network management module receives the tenth control message, if it subsequently receives data from the foreground application, it will not copy the data but will transmit it normally to the network guardian module.
[0197] In some embodiments, if the Wi-Fi enhancement module receives a network enhancement shutdown message sent by an upper-layer application, it will no longer execute the network enhancement function triggering logic.
[0198] For example, the operation by which the Wi-Fi enhancement module stops executing the triggering logic of the network enhancement function can be as follows: the Wi-Fi enhancement module unregisters the callback function previously registered in the smart sensing module to cancel the listening for changes in the foreground scene. Furthermore, if the Wi-Fi enhancement module is executing one or more strategies in the network enhancement function, the Wi-Fi enhancement module can cancel the execution of those strategies. Specific operations have been described in the above embodiments and will not be repeated here.
[0199] It should be noted that the above embodiments of the electronic device, when implementing network enhancement functions, are only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the electronic device can be divided into different functional modules to complete all or part of the functions described above. In addition, the specific names of each functional module are only for easy distinction and are not intended to limit the protection scope of the embodiments of this application.
[0200] After describing the technical architecture of the network enhancement function provided in the embodiments of this application, a timing diagram of the network control method based on the network enhancement function provided in the embodiments of this application is described, which is consistent with... Figure 9 The scene shown corresponds to this.
[0201] Figure 10 This is a flowchart of a network control method provided in an embodiment of this application. See also... Figure 10 The method may include the following steps:
[0202] Step 1001: The first application sends a network enhancement enable message to the Wi-Fi enhancement module.
[0203] This network enhancement enable message is used to indicate that network enhancement features are enabled.
[0204] The first application can be an application that can enable or disable network enhancement. For example, the first application may include system applications (including but not limited to settings applications, game manager applications, etc.) and third-party applications with network enhancement requirements (including but not limited to social applications, live streaming applications, game applications, etc.). This application embodiment does not limit this.
[0205] The first application can enable or disable network enhancement based on user actions, or it can automatically enable or disable network enhancement under certain circumstances. The process of enabling or disabling network enhancement has been exemplarily described in the above embodiments and will not be repeated here.
[0206] Step 1002: After receiving the network enhancement activation message, the Wi-Fi enhancement module uses the intelligent sensing module to monitor changes in the foreground scene of the electronic device.
[0207] The foreground scenario refers to the user's usage scenario, that is, what the user is doing while using an electronic device. This foreground scenario can reflect user needs.
[0208] For example, after receiving the network enhancement enable message, the Wi-Fi enhancement module can register a callback function in the smart sensing module to listen for specific changes in the foreground scene in the Wi-Fi network environment. These specific changes refer to the foreground scene changing from other scenes to a preset scene, or from a preset scene to other scenes.
[0209] In this scenario, when the electronic device is connected to a Wi-Fi network, if the intelligent sensing module detects a change in the foreground scene from another scene to a preset scene, it can call the callback function to send a first scene change message to the Wi-Fi enhancement module. This first scene change message indicates that the foreground scene of the electronic device is the preset scene. Upon receiving the first scene change message, the Wi-Fi enhancement module can then determine that the foreground scene of the electronic device has changed to the preset scene.
[0210] Optionally, the first scene change message may carry the identifier of the foreground application corresponding to the preset scene in which the electronic device is currently located.
[0211] For example, if the intelligent sensing module detects a change in the foreground scene to a game scene, it can include the identifier of the game application corresponding to that game scene in the first scene change message. Similarly, if the intelligent sensing module detects a change in the foreground scene to a live streaming scene, it can include the identifier of the live streaming application corresponding to that live streaming scene in the first scene change message. Furthermore, if the intelligent sensing module detects a change in the foreground scene to a call scene, it can include the identifier of the social application corresponding to that call scene in the first scene change message.
[0212] Optionally, the first scene change message may also carry the identifier of each of one or more background applications running on the electronic device.
[0213] In this context, a foreground application refers to an application that runs in the foreground, meaning it is visible to the user and can interact with the user on an electronic device. A background application refers to an application that runs in the background, meaning it is invisible to the user on an electronic device.
[0214] When an electronic device is connected to a Wi-Fi network, if the intelligent sensing module detects a change in the foreground scene from a preset scene to another scene, it can call this callback function to send a second scene change message to the Wi-Fi enhancement module. This second scene change message indicates that the foreground scene of the electronic device is no longer the preset scene. Upon receiving this message, the Wi-Fi enhancement module can then determine that the foreground scene of the electronic device has changed to a scene other than the preset scene.
[0215] Optionally, the intelligent sensing module can acquire application running information of the electronic device and determine the foreground scene of the electronic device based on the application running information. Of course, the intelligent sensing module can also determine the foreground scene of the electronic device in other ways, and this application embodiment does not limit this.
[0216] Since users often use various applications installed on electronic devices, the foreground scene can be determined based on the application running information in this embodiment, and the foreground scene determined accordingly is relatively accurate.
[0217] The application's runtime information can include application information such as foreground application information and background application information.
[0218] For example, the application information of an application may include the application name, application type, application running status, etc., but this application embodiment does not limit this.
[0219] Preset scenarios can be configured in advance. Preset scenarios are determined based on network latency requirements. Preset scenarios are those with high network latency requirements; that is, they require low network latency.
[0220] For example, the preset scenario may include one or more of the following: game scenario, live streaming scenario, call scenario, etc. Of course, the preset scenario may also include other scenarios, and this application embodiment does not limit this.
[0221] In some embodiments, the intelligent sensing module can determine that the foreground scene of the electronic device is a game scene if the current foreground application of the electronic device includes a game application. Alternatively, the intelligent sensing module can determine that the foreground scene of the electronic device is a game scene if the foreground application includes a game application and the game application is in battle mode.
[0222] In some embodiments, the intelligent sensing module can determine that the foreground scene of the electronic device is a live streaming scene if the current foreground application of the electronic device includes a live streaming application and the live streaming application is currently in live streaming mode.
[0223] In some embodiments, the intelligent sensing module can determine that the foreground scenario of the electronic device is a call scenario if the current foreground application of the electronic device includes a social application and the social application is currently in voice call mode or video call mode.
[0224] Of course, this is not the only way. The intelligent sensing module can also determine whether the foreground scene of the electronic device is a preset scene through other means. This application embodiment does not limit this.
[0225] Step 1003: When the foreground scene of the electronic device changes to a preset scene, the Wi-Fi enhancement module executes one or more strategies in the network enhancement function.
[0226] One or more strategies in the network enhancement features have been exemplarily described in the above embodiments and will not be repeated here.
[0227] In some embodiments, when the foreground scene of the electronic device changes to a preset scene, the Wi-Fi enhancement module can execute all the strategies in the network enhancement function. The network enhancement function may include at least strategy one.
[0228] In other embodiments, the network enhancement function may include multiple modes. For example, the network enhancement function may be configured with different modes based on the impact of various strategies within the network enhancement function on the power consumption of the electronic device; the different modes may include not entirely the same strategies. Each of these multiple modes may include at least one strategy. These multiple modes have been exemplarily described in the embodiments above and will not be repeated here.
[0229] In this case, when the foreground scene of the electronic device changes to a preset scene, the Wi-Fi enhancement module can obtain the power management information of the electronic device and execute all strategies in one of the multiple modes based on the power management information.
[0230] The operation of the Wi-Fi enhancement module in determining the mode to be executed based on the power management information has been exemplarily described in the above embodiments and will not be repeated here.
[0231] In some embodiments, the Wi-Fi enhancement module can cancel various previously executed strategies when the foreground scene of the electronic device changes to a scene other than the preset scene.
[0232] The following provides an exemplary description of the process by which the Wi-Fi enhancement module executes policies one through six:
[0233] Figure 11 This is a flowchart of a network control method provided in an embodiment of this application. See also... Figure 11 The method may include the following steps:
[0234] Step 1101: If the Wi-Fi enhancement module determines that strategy one needs to be executed, it sends a first control message to the Wi-Fi function module. The first control message is used to indicate that scanning for Wi-Fi channels should be prohibited.
[0235] Step 1102: After receiving the first control message, if the Wi-Fi function module receives a device location query message from another module, it will not respond to the device location query message.
[0236] Some modules may send device location query messages to the Wi-Fi function module, which are used to query the location information of electronic devices.
[0237] For example, the location-based services (LBS) module can send a device location query message to the Wi-Fi function module.
[0238] For example, an application might obtain the location information of an electronic device in the background. In this case, the application can send a device location query request to the LBS module. After receiving the device location query request, the LBS module can query the location information of the electronic device from the GNSS module (referred to as the first device location information) and return it to the application if the WLAN-assisted positioning function is turned off; if the WLAN-assisted positioning function is turned on, the LBS module can not only query the first device location information from the GNSS module, but also query the location information of the electronic device from the Wi-Fi function module (referred to as the second device location information). Then, by combining the first and second device location information, the LBS module determines the location information of the electronic device and returns it to the application.
[0239] If the Wi-Fi module does not receive the first control message, it allows scanning the Wi-Fi channel. In this case, if the Wi-Fi module receives a device location query message from another module, it can scan the Wi-Fi channel to obtain the signal strength of nearby access points (APs), and then determine the second device location information accordingly. This second device location information is then included in a response message and returned to the other module.
[0240] If the Wi-Fi module receives the first control message, it will disable Wi-Fi channel scanning. In this case, if the Wi-Fi module receives a device location query message from another module, it will not scan the Wi-Fi channel. Because the Wi-Fi module will not scan the Wi-Fi channel, it cannot determine the location information of the second device and therefore cannot respond to the device location query message. Thus, in the case of the preset scenario in the foreground scenario of the electronic device, even if the WLAN assisted positioning function is enabled, the operation of scanning the Wi-Fi channel will not be performed. Therefore, the impact of scanning the Wi-Fi channel on the network latency of the preset scenario can be avoided, thereby ensuring a relatively low network latency in the preset scenario to a certain extent, and thus improving the user experience.
[0241] In some embodiments, after receiving the first control message, if the Wi-Fi function module receives a device location query message sent by another module, although it will not scan the Wi-Fi channel, if the second device location information previously determined by the Wi-Fi function module is still valid, the Wi-Fi function module can carry the second device location information in a response message and return it to the other module.
[0242] Since the location changes of electronic devices are generally small within a short period, the second location information determined by the Wi-Fi module can remain valid for a certain time (e.g., a few seconds). Therefore, when the Wi-Fi module receives a device location query message from another module, although it cannot scan the Wi-Fi channel, it can still return the previously determined, still valid, second device location information to that other module. This not only avoids the impact on network latency in the preset scenario caused by scanning the Wi-Fi channel, but also ensures the normal operation of location query operations by other modules.
[0243] In some embodiments, if the Wi-Fi enhancement module determines that it needs to cancel the execution of strategy one, it can send a sixth control message to the Wi-Fi function module. The sixth control message is used to indicate that scanning for Wi-Fi channels is allowed.
[0244] After receiving the sixth control message, if the Wi-Fi function module also receives a device location query message from another module, it can respond to the device location query message normally. Specifically, the Wi-Fi function module can scan the Wi-Fi channel to obtain the signal strength of nearby APs, and then determine the location information of the second device based on this information. The second device location information is then carried in the response message and returned to the other module.
[0245] Figure 12 This is a flowchart of a network control method provided in an embodiment of this application. See also... Figure 12 The method may include the following steps:
[0246] Step 1201: If the Wi-Fi enhancement module determines that strategy two needs to be executed, it sends a second control message to Wi-Fi Hal. The second control message is used to indicate that Wi-Fi hardware sleep is prohibited.
[0247] Step 1202: After receiving the second control message, Wi-Fi Hal does not execute the Wi-Fi hardware sleep trigger logic.
[0248] Wi-Fi hardware sleep triggering logic refers to the logic that controls the Wi-Fi hardware to enter sleep mode when the electronic device meets preset conditions. These preset conditions can be set in advance. For example, preset conditions may include the electronic device not transmitting data via the Wi-Fi network for an extended period. Of course, preset conditions may also include other conditions, which are not limited in this embodiment.
[0249] If Wi-Fi Hal does not receive the second control message, then Wi-Fi Hal needs to execute the Wi-Fi hardware sleep trigger logic. Specifically, when Wi-Fi Hal determines that the electronic device meets preset conditions, such as when the electronic device has not transmitted data through the Wi-Fi network for an extended period, it can control the Wi-Fi hardware to enter sleep mode via the Wi-Fi driver. Subsequently, when Wi-Fi Hal determines that the electronic device does not meet the preset conditions, such as when the electronic device needs to transmit data through the Wi-Fi network, it can wake up the Wi-Fi hardware via the Wi-Fi driver so that data can be transmitted through the Wi-Fi hardware.
[0250] If Wi-Fi Hal receives the second control message, it will not execute the Wi-Fi hardware sleep trigger logic. In this case, even if Wi-Fi Hal finds that the electronic device meets the preset conditions, it will not control the Wi-Fi hardware to sleep, keeping the Wi-Fi hardware always active. This ensures, to some extent, that the Wi-Fi hardware can transmit data in the preset scenario in a timely manner, thus guaranteeing relatively low network latency and improving the user experience.
[0251] In some cases, if the Wi-Fi hardware is in a sleep state when the Wi-Fi Hal receives the second control message, the Wi-Fi Hal can wake up the Wi-Fi hardware without executing the Wi-Fi hardware sleep trigger logic.
[0252] In some embodiments, if the Wi-Fi enhancement module determines that it needs to cancel the execution of strategy two, it can send a seventh control message to the Wi-Fi function module. The seventh control message is used to indicate that the Wi-Fi hardware should be allowed to sleep. After receiving the seventh control message, the Wi-Fi function module can execute the Wi-Fi hardware sleep trigger logic. The specific operation has been exemplarily described in the above embodiments and will not be repeated here.
[0253] Figure 13 This is a flowchart of a network control method provided in an embodiment of this application. See also... Figure 13 The method may include the following steps:
[0254] Step 1301: If the Wi-Fi enhancement module determines that strategy three needs to be executed, it will change the Wi-Fi roaming threshold from the first threshold to the second threshold.
[0255] Both the first and second thresholds can be preset. The second threshold can be lower than the first threshold. The first threshold is the default Wi-Fi roaming threshold, which is the Wi-Fi roaming threshold executed in scenarios other than the preset scenario.
[0256] Step 1302: The Wi-Fi enhancement module performs Wi-Fi roaming when the signal strength of the currently connected Wi-Fi network is less than the second threshold.
[0257] In this embodiment, the Wi-Fi enhancement module will only perform Wi-Fi roaming when the currently connected Wi-Fi network is weaker than the default situation. This can avoid frequent switching of access points by electronic devices to a certain extent, improve the stability of the Wi-Fi network, and thus ensure that the network latency in the preset scenario is relatively low, thereby improving the user experience.
[0258] In some embodiments, if the Wi-Fi enhancement module determines that it needs to cancel the execution of strategy three, it can modify the Wi-Fi roaming threshold from the second threshold to the first threshold.
[0259] In this situation, the Wi-Fi enhancement module can perform Wi-Fi roaming when the signal strength of the currently connected Wi-Fi network is less than a first threshold, in order to improve network connection quality.
[0260] Figure 14 This is a flowchart of a network control method provided in an embodiment of this application. See also... Figure 14 The method may include the following steps:
[0261] Step 1401: If the Wi-Fi enhancement module determines that policy four needs to be executed, it sends a third control message to the network guardian module. The third control message is used to instruct the application to limit the speed of other applications besides the second application.
[0262] The second application is the foreground application corresponding to the preset scene in which the electronic device is currently located, that is, the application identified by the foreground application identifier carried in the first scene change information.
[0263] In some embodiments, the third control message may instruct that the bandwidth of all applications other than the second application be adjusted to the first bandwidth. In this case, the third control message may carry the identifier of the second application and the first bandwidth.
[0264] The first bandwidth can be preset. For example, the first bandwidth can be 1MB / s, 1.5MB / s, etc., but this application embodiment does not limit this.
[0265] In other embodiments, different preset scenarios can correspond to different second bandwidths. The Wi-Fi enhancement module can determine the corresponding second bandwidth based on the preset scenario currently in which the electronic device is located, and then instruct through a third control message to adjust the bandwidth of all applications except the second application to the second bandwidth. In this case, the third control message can carry the identifier of the second application and the second bandwidth.
[0266] The second bandwidth for each of the various preset scenarios can be pre-set. The second bandwidth for different preset scenarios can be the same or different. For example, the second bandwidth for a game scenario can be 1MB / s, the second bandwidth for a live streaming scenario can be 1.5MB / s, and the second bandwidth for a call scenario can be 1.5MB / s.
[0267] In some other embodiments, the Wi-Fi enhancement module can identify a third application from one or more background applications running on the electronic device, and then instruct the third application to adjust its bandwidth to a third bandwidth via a third control message. In this case, the third control message may carry an identifier of the third application and the third bandwidth corresponding to the third application. There may be one or more third applications, and each third application may have a corresponding third bandwidth.
[0268] In this way, by limiting the bandwidth of some background applications, the foreground applications can run more smoothly, reducing lag and improving the user experience. Furthermore, since only some background applications are limited in bandwidth, the impact on other background applications is minimized, ensuring that other background applications without bandwidth limitations can function normally.
[0269] Optionally, the operation of the Wi-Fi enhancement module in determining the third application from one or more background applications running on the electronic device can be as follows: the Wi-Fi enhancement module determines the target score of the second application, and determines the target score of each background application among the one or more background applications; if the target score of the second application is greater than a first score threshold, the background application whose target score is less than or equal to the second score threshold is determined as the third application, and the second score threshold is less than the first score threshold; if the target score of the second application is less than or equal to the first score threshold, the background application whose target score is less than or equal to the third score threshold is determined as the third application, and the third score threshold is less than the second score threshold.
[0270] The first, second, and third score thresholds can all be preset. For example, the first score threshold can be 80, the second score threshold can be 60, and the third score threshold can be 0.
[0271] An application's target score can be used to characterize the user's perception of the application's operation. That is, the higher the target score, the stronger the user's perception of the application's operation. For example, the target score of foreground applications is generally higher than that of background applications. Another example is that the target score of a foreground game application is higher than that of a foreground social application. Yet another example is that the target score of a background voice application is higher than that of a background download application.
[0272] The Wi-Fi enhancement module can determine whether to limit the bandwidth of a background application based on the target scores of each running application. Understandably, if the target scores of the second application running in the foreground are different, different background applications can be rate-limited to minimize the impact on the background applications while preventing lag in the foreground applications to some extent.
[0273] Optionally, the operation of the Wi-Fi enhancement module in determining the target score of the second application and the target score of each background application in one or more background applications can be as follows: the Wi-Fi enhancement module determines the target score of the second application based on at least one of the following: application type of the second application and whether it is lagging; for any one background application in one or more background applications, the target score of the background application is determined based on at least one of the following: whether the background application has voice stream input or output and service data throughput.
[0274] Optionally, the Wi-Fi enhancement module can determine the first score corresponding to the second application based on the application type of the second application. For example, the Wi-Fi enhancement module may pre-store the first scores corresponding to different application types. For instance, when the application type of the second application is a game or a voice application, the corresponding first score is 30 points; when the application type of the second application is a video caching application, the corresponding first score is 20 points; and when the application type of the second application is any other application type besides game, voice, and video caching applications, the corresponding first score is 10 points.
[0275] The Wi-Fi enhancement module can determine a second score for the second application based on whether it experiences lag during operation. For example, if the Wi-Fi enhancement module determines that the second application experiences lag, it determines the second score to be 15 points; if the Wi-Fi enhancement module determines that the second application does not experience lag, it determines the second score to be 0 points.
[0276] The Wi-Fi enhancement module can determine the target score of the second application based on the first and second scores corresponding to that application. For example, the Wi-Fi enhancement module can determine the target score of the second application as the sum of the first and second scores, or it can determine the target score of the second application as the sum of the base score, the first score, and the second score. The base score can be a pre-assigned score to each application; optionally, the base score can be greater than the second score threshold.
[0277] Optionally, the Wi-Fi enhancement module can determine the third score for a background application based on whether the background application has voice stream input or output. For example, when the Wi-Fi enhancement module determines that the background application has voice stream input or output, it determines the third score for the background application to be 40; when the Wi-Fi enhancement module determines that the background application does not have voice stream input or output, it determines the third score for the background application to be 0.
[0278] The Wi-Fi enhancement module pre-stores the correspondence between the ranking of the service data throughput of background applications and the fourth score. The Wi-Fi enhancement module can determine the fourth score corresponding to the background application based on the ranking of the service data throughput of the background application in the background service data throughput.
[0279] For example, the Wi-Fi enhancement module can assign different fourth scores to the top three background applications ranked by service data throughput. For instance, if the Wi-Fi enhancement module determines that a background application has the highest service data throughput, it assigns it a fourth score of -10; if it determines that a background application ranks second in service data throughput, it assigns it a fourth score of -30; and if it determines that a background application ranks third, it assigns it a fourth score of -50.
[0280] The Wi-Fi enhancement module can determine the target score of a background application based on its third and fourth scores. For example, the Wi-Fi enhancement module can determine the target score of a background application by summing its third and fourth scores, or it can determine the target score of a background application by summing its base score, third score, and fourth score.
[0281] Optionally, the Wi-Fi enhancement module can obtain the corresponding target bandwidth as the third bandwidth based on the target score of the third application and the correspondence between the target score and the target bandwidth.
[0282] Optionally, the Wi-Fi enhancement module can determine the total bandwidth of the electronic device based on the bandwidth parameters, multiply the bandwidth coefficient corresponding to each target score by the total bandwidth, and obtain the target bandwidth corresponding to each target score, that is, obtain the correspondence between the target score and the target bandwidth.
[0283] In this embodiment, the smaller the target score, the smaller the corresponding bandwidth coefficient. That is, the smaller the target score, the smaller the corresponding target bandwidth. In other words, the smaller the target score of the third application, the less the user can perceive the operation of the third application, and the more severe the bandwidth restriction on the third application, thereby minimizing the impact on other background applications.
[0284] For example, bandwidth parameters may include at least one of the following: air interface bandwidth, peak bandwidth at the network layer, and historical peak bandwidth of the currently connected Wi-Fi network. Air interface bandwidth refers to the maximum bandwidth that the firmware can actually support between the firmware and the access point (AP). Peak bandwidth at the network layer is estimated empirically and can be pre-stored in a configuration file. Historical peak bandwidth of the currently connected Wi-Fi network can be obtained by querying historical records. For instance, the historical peak bandwidth of the currently connected Wi-Fi network could be the maximum bandwidth of the Wi-Fi network currently connected to by the electronic device over the past 10 days.
[0285] For example, the Wi-Fi enhancement module can determine the total bandwidth of the electronic device from the minimum bandwidth among the air interface bandwidth, the peak bandwidth of the network layer, and the historical peak bandwidth of the currently connected Wi-Fi network included in the bandwidth parameters.
[0286] It should be noted that the above process of setting the correspondence between target scores and target bandwidth is only an example. In practical applications, the target score can also be divided into different score ranges, and different target bandwidths can be preset for different target score ranges. This application does not limit the number of target score ranges or the target bandwidth corresponding to each target score range.
[0287] Step 1402: After receiving the third control message, the network guardian module limits the speed of applications other than the second application.
[0288] For example, if the third control message carries the identifier of the second application and the first bandwidth, the network guardian module can adjust the bandwidth of other applications besides the second application to the first bandwidth.
[0289] For example, if the third control message carries the identifier of the second application and the second bandwidth, the network guardian module can adjust the bandwidth of other applications besides the second application to the second bandwidth.
[0290] For example, if the third control message carries the identifier of the third application and the third bandwidth corresponding to the third application, the network guardian module can adjust the bandwidth of the third application to the third bandwidth.
[0291] In some embodiments, if the Wi-Fi enhancement module determines that it needs to cancel the enforcement of policy four, it can send an eighth control message to the network guardian module. The eighth control message is used to instruct the cancellation of rate limiting for applications other than the second application.
[0292] After receiving the eighth control message, the network guardian module can cancel the rate limit on applications other than the second application, that is, cancel the bandwidth limit on applications other than the second application.
[0293] Figure 15 This is a flowchart of a network control method provided in an embodiment of this application. See also... Figure 15 The method may include the following steps:
[0294] Step 1501: If the Wi-Fi enhancement module determines that strategy five needs to be executed, it sends a fourth control message to the network management module. The fourth control message is used to instruct the data transmission priority of the second application to be set to the preset priority.
[0295] The second application is the foreground application corresponding to the preset scenario currently in which the electronic device is located. The fourth control message may carry the identifier and preset priority of the second application.
[0296] Currently, different transmission priorities can be set for different types of data to achieve higher transmission efficiency. For example, four different transmission priorities, also known as access categories, can be provided, ordered from highest to lowest: 1. Voice (AC_VO): Used for real-time audio streaming, such as Voice over Internet Protocol (VoIP) telephony. 2. Video (AC_VI): Used for real-time video streaming, such as video chat or streaming media. 3. Best-effort (AC_BE): Used for general data transmission, such as web browsing or file downloading. 4. Background (AC_BK): Used for low-priority data transmission, such as background downloads or file transfers.
[0297] Different applications may have different preset priorities. The preset priorities for each application can be set in advance. An application's preset priority can be higher than its original data transmission priority.
[0298] For example, if the original data transmission priority in a game application is AC_BE or AC_BK, then the default priority for the game application can be set to AC_VO or AC_VI.
[0299] As an example, if the current preset scenario of the electronic device is a game scenario, the Wi-Fi enhancement module can determine that the preset priority of the game application corresponding to the game scenario is AC_VO, so as to adjust the data transmission priority of the game application to the highest level, so as to prioritize the transmission of the game application's data and reduce the data transmission latency of the game application.
[0300] As another example, if the preset scenario currently in which the electronic device is playing a game, the Wi-Fi enhancement module can determine that the preset priority of the game application corresponding to this game scenario is AC_VO when the electronic device is not currently making a voice or video call, and AC_VI when the electronic device is currently making a voice or video call. In this way, while minimizing the impact on the call, priority transmission of data for the game application can be guaranteed to a certain extent, reducing the data transmission latency of the game application.
[0301] In some cases, if the transmission priority of certain data is already relatively high—for example, voice data already has the highest transmission priority—then there is no need to adjust its transmission priority further. In other words, the Wi-Fi enhancement module may not execute strategy five if the electronic device is currently in a pre-defined scenario such as a live streaming scenario, a voice call scenario, or a video call scenario.
[0302] Step 1502: After receiving the fourth control message, if the network management module receives data from the second application, it adds a preset priority to the data in the second application and transmits the data to the network guardian module.
[0303] For example, if the identifier of the second application carried in the fourth control message is the identifier of the game application, and the preset priority is AC_VO, then after receiving the fourth control message, the network management module will determine that the transmission priority of the game application's data needs to be set to AC_VO.
[0304] In this scenario, the game application generates data during runtime with a transmission priority of AC_BE. The game application then transmits this data to the network management module. Upon receiving the data from the game application, the network management module can add a new transmission priority (i.e., a preset priority AC_VO) to the data and then transmit the data to the network guardian module. In this case, the transmission priority in the data received by the network guardian module from the second application is the newly added transmission priority, AC_VO, from the network management module.
[0305] The network guardian module can transmit each data to the external network according to the transmission priority of each received data.
[0306] In this embodiment of the application, since the data transmission priority of the second application is set to a higher preset priority, the network protection module can guarantee the priority transmission of the data of the second application to a certain extent, thereby reducing the data transmission latency of the second application.
[0307] In some embodiments, if the Wi-Fi enhancement module determines that it needs to cancel the execution of policy five, it can send a ninth control message to the network management module. The ninth control message is used to instruct the cancellation of the setting of data transmission priority for applications other than the second application.
[0308] After the network management module receives the ninth control message, if it subsequently receives data from the second application, it will not add a new transmission priority to that data and can transmit the data normally to the network guardian module. In this case, the transmission priority of the data received by the network guardian module from the second application will be its original transmission priority.
[0309] Figure 16 This is a flowchart of a network control method provided in an embodiment of this application. See also... Figure 16 The method may include the following steps:
[0310] Step 1601: If the Wi-Fi enhancement module determines that policy six needs to be executed, it sends a fifth control message to the network management module. The fifth control message is used to instruct the data of the second application to be transmitted via multiple paths.
[0311] The second application is the foreground application corresponding to the preset scene currently in which the electronic device is located. The fifth control message may carry the identifier of the second application.
[0312] In some embodiments, the electronic device may pre-establish both a Wi-Fi 2.4G connection and a Wi-Fi 5G connection. In this case, the fifth control message may instruct dual-path transmission of data for the second application via both Wi-Fi 2.4G and Wi-Fi 5G.
[0313] In some embodiments, the electronic device may pre-establish a Wi-Fi connection and a mobile data connection. In this case, the fifth control message may instruct dual-path transmission of data for the second application via both Wi-Fi and mobile data.
[0314] In some embodiments, the electronic device may pre-establish a Wi-Fi 2.4G connection, a Wi-Fi 5G connection, and a mobile data connection. In this case, the fifth control message may instruct the second application to perform tri-path transmission of data via Wi-Fi 2.4G, Wi-Fi 5G, and mobile data.
[0315] It should be noted that whether to perform the aforementioned dual-path transmission or the aforementioned triple-path transmission can be selected by the user in some cases, while in other cases, the Wi-Fi enhancement module can automatically select based on the current network connection status of the electronic device.
[0316] For example, users can choose to enable or disable dual-path transmission or tri-path transmission in settings applications or control centers. In this case, the Wi-Fi enhancement module can transmit data from the second application through the fifth control message according to the dual-path or tri-path function selected by the user.
[0317] For example, the Wi-Fi enhancement module can instruct the second application to perform corresponding multi-path transmission of data based on whether the electronic device has established a Wi-Fi 2.4G connection, a Wi-Fi 5G connection, and / or a mobile data connection.
[0318] In some embodiments, if the electronic device establishes only one network connection path (such as a Wi-Fi 2.4G connection or a Wi-Fi 5G connection), then the Wi-Fi enhancement module may not execute Strategy Six.
[0319] Step 1602: After receiving the fifth control message, if the network management module receives data from the second application, it copies the data to obtain multiple data sets and transmits these multiple data sets to the network guardian module. These multiple data sets are used for transmission through multiple network connection paths.
[0320] It should be noted that the second application can generate data during operation, which may include network information and destination address. The network information is used to indicate which network connection path is used to transmit the data. Optionally, the network information may include Wi-Fi 2.4G, Wi-Fi 5G, mobile data, etc.
[0321] In some embodiments, if the fifth control message indicates dual-path transmission of data from the second application via Wi-Fi 2.4G and Wi-Fi 5G, the network management module, upon receiving data from the second application (referred to as first data), can copy the first data to obtain second data, where the data identifier in the first data is the same as the data identifier in the second data. If the network information in the first data is Wi-Fi 2.4G, the network management module can modify the network information in the second data to Wi-Fi 5G; conversely, if the network information in the first data is Wi-Fi 5G, the network management module can modify the network information in the second data to Wi-Fi 2.4G. The network management module can then transmit the first data and the second data to the network guardian module. Upon receiving the first data and the second data, the network guardian module can send the first data to an external network via a corresponding network connection path based on the network information in the first data, and send the second data to an external network via a corresponding network connection path based on the network information in the second data.
[0322] In this scenario, after the access point (AP) establishing a Wi-Fi connection with the electronic device receives one of the first and second data sets, it can forward that data. Subsequently, if the AP receives the other data set from the first and second sets, it will find that this other data set has the same identifier as the previously received data. In this case, the AP can discard the other data set and not forward it.
[0323] In some embodiments, if the fifth control message indicates dual-path transmission of data from the second application using both Wi-Fi and mobile data, the network management module, upon receiving the first data from the second application, can copy the first data to obtain the second data, where the data identifier in the first data is the same as the data identifier in the second data. If the network information in the first data is Wi-Fi, the network management module can modify the network information in the second data to mobile data; if the network information in the first data is mobile data, the network management module can modify the network information in the second data to Wi-Fi. Then, the network management module can transmit the first and second data to the network guardian module. After receiving the first and second data, the network guardian module can send the first data to an external network via a corresponding network connection path based on the network information in the first data, and also send the second data to an external network via a corresponding network connection path based on the network information in the second data.
[0324] In this scenario, the device (referred to as the first device) to which the destination address in the first data belongs can process one of the first and second data after receiving it. Subsequently, if the first device receives the other data from the first and second data, it will find that this other data has the same identifier as the data in the previously received data. In this case, the first device can discard this other data without processing it.
[0325] In some embodiments, if the fifth control message indicates dual-path transmission of data from the second application using both Wi-Fi and mobile data, the network management module, upon receiving the first data from the second application, can copy the first data to obtain the second data, where the data identifier in the first data is the same as the data identifier in the second data. If the network information in the first data is Wi-Fi, the network management module can modify the network information in the second data to mobile data; if the network information in the first data is mobile data, the network management module can modify the network information in the second data to Wi-Fi. The network management module can add a new destination address to the existing destination addresses in the first and second data, where the new destination address is the address of the second device. Then, the network management module can transmit the first and second data to the network guardian module. After receiving the first and second data, the network guardian module can send the first data to an external network through a corresponding network connection path based on the network information in the first data, and also send the second data to an external network through a corresponding network connection path based on the network information in the second data.
[0326] The second device can be a pre-configured device. For example, the second device can be a virtual private network (VPN) device. Of course, the second device can also be other devices, and this application embodiment does not limit this.
[0327] In this scenario, after receiving one of the first and second data sets, the second device can forward this data to the corresponding device, i.e., the first device, based on its original destination address. Subsequently, if the second device receives the other data set, it will find that this other data has the same identifier as data from previously received data. In this case, the second device can discard this other data and not forward it.
[0328] In this embodiment of the application, by adding a second device, the original business logic of the second application can be avoided when transmitting data via Wi-Fi and mobile data through multiple channels. That is, the processing logic of the second application and the processing logic of the first device do not need to be changed, thereby better compatibility with existing business scenarios.
[0329] In some embodiments, if the fifth control message instructs for three-channel transmission of data from the second application via Wi-Fi 2.4G, Wi-Fi 5G, and mobile data, the network management module, upon receiving the first data from the second application, can copy the first data to obtain two sets of second data. The data identifier in the first data is identical to the data identifier in each of the two sets of second data. Then, if the network information in the first data is Wi-Fi 2.4G, the network management module can modify the network information in one set of second data to Wi-Fi 5G and the network information in the other set of second data to mobile data; if the network information in the first data is Wi-Fi 5G, the network management module can modify the network information in one set of second data to Wi-Fi 2.4G and the network information in the other set of second data to mobile data; if the network information in the first data is mobile data, the network management module can modify the network information in one set of second data to Wi-Fi 2.4G and the network information in the other set of second data to Wi-Fi 5G. The network management module can then transmit the first data and the two sets of second data to the network guardian module. After receiving the first data and the two second data, the network protection module can send the first data to the external network through the corresponding network connection path according to the network information in the first data, and send each second data to the external network through the corresponding network connection path according to the network information in each second data.
[0330] In this scenario, after the access point (AP) establishing a Wi-Fi connection with the electronic device receives the first data and one of the two second data sets, it can forward that data. Subsequently, if the AP receives other data with the same identifier as the first data set, it can discard that other data and not forward it.
[0331] Furthermore, after receiving the first data and one of the two second data, the first device can process this data. Subsequently, if the first device receives other data with the same data identifier as this data, it can discard the other data without processing it.
[0332] In some embodiments, if the fifth control message indicates that the data of the second application should be transmitted via three channels: Wi-Fi 2.4G, Wi-Fi 5G, and mobile data, then after receiving the first data from the second application, the network management module can copy the first data to obtain two sets of second data. The data identifier in the first data is the same as the data identifier in each of the two sets of second data. Then, if the network information in the first data is Wi-Fi 2.4G, the network management module can modify the network information in one set of second data to Wi-Fi 5G and the network information in the other set of second data to mobile data; if the network information in the first data is Wi-Fi 5G, the network management module can modify the network information in one set of second data to Wi-Fi 2.4G and the network information in the other set of second data to mobile data; if the network information in the first data is mobile data, the network management module can modify the network information in one set of second data to Wi-Fi 2.4G and the network information in the other set of second data to Wi-Fi 5G. The network management module can add a new destination address to the existing destination addresses in the first data and the two second data sets. This new destination address is the address of the second device. The network management module then transmits the first data and the two second data sets to the network guardian module. Upon receiving the first data and the two second data sets, the network guardian module can send the first data to the external network via the corresponding network connection path based on the network information in the first data, and also send each of the second data sets to the external network via the corresponding network connection path based on the network information in each of the second data sets.
[0333] In this scenario, after the access point (AP) establishing a Wi-Fi connection with the electronic device receives the first data and one of the two second data sets, it can forward that data. Subsequently, if the AP receives other data with the same identifier as the first data set, it can discard that other data and not forward it.
[0334] Furthermore, after receiving the first data and one of the two second data sets, the second device can forward the data to the corresponding device, i.e., the first device, based on the original destination address of the first data set. Subsequently, if the second device receives other data with the same identifier as the first data set, it can discard that other data without forwarding it.
[0335] In this embodiment of the application, by using multiple network connection paths to transmit data of the second application simultaneously, the overall bandwidth of the second application can be enhanced, thereby improving network speed; and when a problem occurs in one network connection path, other network connection paths can continue to ensure the normal transmission of data of the second application, reducing disconnection and connection instability, thereby improving network stability.
[0336] In some embodiments, if the Wi-Fi enhancement module determines that it needs to cancel the execution of policy six, it can send a tenth control message to the network management module. The tenth control message is used to instruct the cancellation of multipath transmission of data other than the second application.
[0337] After receiving the tenth control message, if the network management module subsequently receives data from the second application, it will not copy the data but will instead transmit it normally to the network guardian module. In this case, upon receiving the data, the network guardian module can send the data to the external network through the appropriate network connection path based on the network information contained in the data.
[0338] The preceding text provided an illustrative description of the process by which the Wi-Fi enhancement module executes the triggering logic for network enhancement after receiving a network enhancement enable message from the first application. In some embodiments, the first application may also disable the network enhancement function. In this case, the first application may send a network enhancement disable message to the Wi-Fi enhancement module, which instructs the network enhancement function to be disabled. Upon receiving the network enhancement disable message, the Wi-Fi enhancement module can stop listening to changes in the foreground scene of the electronic device and cancel various previously executed policies.
[0339] Optionally, the operation for the Wi-Fi enhancement module to cancel listening to changes in the foreground scene of the electronic device can be as follows: the Wi-Fi enhancement module unregisters the callback function previously registered in the smart sensing module to cancel listening to changes in the foreground scene.
[0340] The process by which the Wi-Fi enhancement module cancels various previously executed policies has been exemplarily described in the above embodiments and will not be repeated here.
[0341] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0342] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0343] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the various method embodiments described above.
[0344] This application also provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.
[0345] This application also provides a chip system including a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the steps of any method embodiment of this application. The chip system can be a single chip or a chip module composed of multiple chips.
[0346] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic cable, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave) means. The computer-readable storage medium can be any available medium accessible to a computer, or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (such as floppy disks, hard disks, magnetic tapes, etc.), optical media (such as Digital Versatile Discs (DVDs), etc.) or semiconductor media (such as Solid State Disks (SSDs), etc.).
[0347] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0348] The above-described embodiments are optional embodiments provided by this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the technical scope disclosed in this application should be included within the protection scope of this application.
Claims
1. A network control method, characterized in that, Applied to electronic devices, the method includes: When the electronic device is connected to a Wi-Fi network, determine the foreground scenario of the electronic device; When the foreground scenario is a preset scenario, one or more strategies in the network enhancement function are executed. The one or more strategies include strategy one, which is to prohibit scanning Wi-Fi channels. The preset scenario is a scenario determined based on network latency requirements.
2. The method as described in claim 1, characterized in that, The one or more strategies also include one or more of strategies two, three, four, five, and six; strategy two is to prohibit Wi-Fi hardware from sleeping, strategy three is to prohibit unnecessary Wi-Fi roaming, strategy four is to limit the speed of background applications, strategy five is to accelerate foreground applications, and strategy six is to enable Wi-Fi multi-path.
3. The method as described in claim 1, characterized in that, The network enhancement function includes multiple modes, which are set according to the impact of various strategies in the network enhancement function on the power consumption of the electronic device. The strategies included in different modes are not completely the same, and each mode includes strategy one. The implementation of one or more strategies for network enhancement includes: Obtain the power management information of the electronic device; Based on the power management information of the electronic device, one of the multiple modes is executed.
4. The method as described in claim 3, characterized in that, The power management information includes one or more of the following: the power supply status of the electronic device and the power level.
5. The method as described in claim 3 or 4, characterized in that, The multiple modes include a power-saving mode, a balanced mode, and a performance mode; the power-saving mode includes various strategies in the network enhancement function that reduce the power consumption of the electronic device; the balanced mode includes some strategies in the network enhancement function that reduce the power consumption of the electronic device, and also includes some strategies that increase the power consumption of the electronic device; the performance mode includes all strategies in the network enhancement function.
6. The method according to any one of claims 1 to 5, characterized in that, The electronic device includes a Wi-Fi enhancement module and a Wi-Fi function module, wherein executing one or more strategies of network enhancement functions includes: If the Wi-Fi enhancement module determines that the first strategy needs to be executed, it sends a first control message to the Wi-Fi function module. The first control message is used to indicate that scanning for Wi-Fi channels should be prohibited. After receiving the first control message, if the Wi-Fi function module receives a device location query message from another module, it will not respond to the device location query message.
7. The method as described in claim 2, characterized in that, The electronic device includes a Wi-Fi enhancement module and a Wi-Fi hardware abstraction layer (HAL), and the execution of one or more strategies in the network enhancement functions includes: If the Wi-Fi enhancement module determines that the second strategy needs to be executed, it sends a second control message to the Wi-Fi Hal. The second control message is used to indicate that Wi-Fi hardware sleep is prohibited. After receiving the second control message, the Wi-Fi Hal does not execute the Wi-Fi hardware sleep trigger logic, which refers to the logic of controlling the Wi-Fi hardware to go into sleep mode when the electronic device meets preset conditions.
8. The method as described in claim 2 or 7, characterized in that, The electronic device includes a Wi-Fi enhancement module, and the execution of one or more strategies in the network enhancement function includes: If the Wi-Fi enhancement module determines that strategy three needs to be executed, it modifies the Wi-Fi roaming threshold from the first threshold to the second threshold, where the second threshold is less than the first threshold. The Wi-Fi enhancement module enables Wi-Fi roaming when the signal strength of the Wi-Fi network currently connected to the electronic device is less than the second threshold.
9. The method according to any one of claims 2, 7, and 8, characterized in that, The electronic device includes a Wi-Fi enhancement module and a network protection module, wherein executing one or more strategies of the network enhancement function includes: If the Wi-Fi enhancement module determines that the fourth strategy needs to be executed, it sends a third control message to the network guardian module. The third control message is used to instruct the speed limit to be applied to applications other than the foreground application corresponding to the preset scenario. After receiving the third control message, the network protection module limits the speed of applications other than the foreground application.
10. The method according to any one of claims 2, 7 to 9, characterized in that, The electronic device includes a Wi-Fi enhancement module and a network management module, wherein executing one or more strategies of the network enhancement function includes: If the Wi-Fi enhancement module determines that strategy five needs to be executed, it sends a fourth control message to the network management module. The fourth control message is used to instruct the data transmission priority of the foreground application corresponding to the preset scenario to be set to the preset priority. After receiving the fourth control message, if the network management module receives data from the foreground application, it adds the preset priority to the data and transmits the data to other modules.
11. The method as described in claim 10, characterized in that, The data transmission priorities, from highest to lowest, include: voice level, video level, best-effort transmission level, and background traffic level; the foreground application is a game application, and the preset priority corresponding to the game application is either voice level or video level.
12. The method according to any one of claims 2, 7 to 11, characterized in that, The electronic device includes a Wi-Fi enhancement module and a network management module, wherein executing one or more strategies of the network enhancement function includes: If the Wi-Fi enhancement module determines that strategy six needs to be executed, it sends a fifth control message to the network management module. The fifth control message is used to instruct the data of the foreground application corresponding to the preset scenario to be transmitted through multiple channels. After receiving the fifth control message, if the network management module receives data from the foreground application, it copies the data to obtain multiple data sets and transmits these multiple data sets to other modules. The multiple data sets use different network connection paths during network transmission.
13. The method as described in claim 12, characterized in that, The fifth control message is used to instruct the data of the foreground application to be transmitted via dual-path Wi-Fi 2.4G and Wi-Fi 5G, or the fifth control message is used to instruct the data of the foreground application to be transmitted via dual-path Wi-Fi and mobile data, or the fifth control message is used to instruct the data of the foreground application to be transmitted via triple-path Wi-Fi 2.4G, Wi-Fi 5G and mobile data.
14. The method as described in claim 12, characterized in that, The fifth control message is used to instruct the foreground application's data to be transmitted via both Wi-Fi and mobile data. Before the network management module transmits the multiple data to other modules, it further includes: A new destination address is added to each of the multiple data sets, and the new destination address is the address of a preset device.
15. An electronic device, characterized in that, The electronic device includes: one or more processors, and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 14.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 14.
17. A computer program product, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1 to 14.