Multicast lock management method, terminal, storage medium, program product and chip
Managing multicast locks by detecting inactive applications and releasing them in video applications reduces power consumption by avoiding unnecessary wake-ups, ensuring efficient power usage and quick lock recovery.
Patent Information
- Application Number
- CN202410031322.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-08
- Publication Date
- 2025-07-15
AI Technical Summary
The video application holds a Wi-Fi multicast lock during screen projection, causing abnormal increase in the power consumption of the mobile phone, although the application still wakes up frequently when running in the background or when the terminal locks the screen, affecting the terminal's battery life.
When the application is detected to be inactive, the information of the multicast lock is stored and the multicast lock is released. The multicast packet filtering function is activated when no application holds the multicast lock, discarding the multicast packet from surrounding devices to avoid the processor waking up.
Effectively reduce terminal power consumption, avoid frequent wake-up of multicast data packets, improve battery usage time, and significantly reduce night standby power consumption in complex network environments.
Smart Images

Figure CN120321740A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of intelligent terminals, and particularly to a method for managing a multicast lock, a terminal, a storage medium, a program product, and a chip. Background Art
[0002] Currently, video applications generally have a screen mirroring function that allows users to project videos from devices such as mobile phones onto large-screen devices. When performing screen mirroring, the video application requests a Wi-Fi multicast lock (hereinafter simply referred to as "multicast lock") from the operating system (OS) of the mobile phone. However, during screen mirroring, even if the video application runs in the background, the video application will continue to hold the multicast lock, resulting in the closure of the multicast packet filtering function of the mobile phone. Packets received from the local area network will frequently wake up the mobile phone, causing the power consumption level of the mobile phone to rise to an abnormal range.
[0003] Based on this, how to manage the multicast lock of applications (APPs) on terminals such as mobile phones to reduce the power consumption of the terminals is an urgent problem to be solved. Summary of the Invention
[0004] This application provides a method for managing a multicast lock, a terminal, a storage medium, a program product, and a chip to save the power consumption of the terminal and prevent the terminal from being frequently awakened by multicast packets from surrounding devices.
[0005] In a first aspect, a method for managing a Wi-Fi multicast lock is provided. The method includes: detecting that an application on the terminal is in an inactive state and the application holds a Wi-Fi multicast lock; storing information of the Wi-Fi multicast lock and releasing the Wi-Fi multicast lock; and when no application in the terminal holds a Wi-Fi multicast lock, starting a multicast packet filtering function of the terminal to discard multicast packets from surrounding devices.
[0006] In this aspect, when detecting that an application on the terminal is in an inactive state, storing information of the multicast lock of the application and releasing the multicast lock, and when no application in the terminal holds a multicast lock, starting a multicast packet filtering function of the terminal to discard multicast packets from surrounding devices can save the power consumption of the terminal and prevent the terminal from being frequently awakened by multicast packets.
[0007] The essence of this method is to proxy the multicast lock of the application, temporarily store the information of the multicast lock, and temporarily release the multicast lock. When the application re-enters the active state, it can directly obtain the temporarily stored multicast lock information without re-requesting a multicast lock from the operating system.
[0008] In combination with the first aspect, in a possible implementation, detecting that an application on the terminal is in an inactive state includes at least one of the following operations: detecting that the application is running in the background; detecting that the application is running in the foreground and the terminal is in a locked screen state.
[0009] In combination with the first aspect, in another possible implementation, the method further includes: obtaining the user identifier (UID) of the Wi-Fi multicast lock; the storing the information of the Wi-Fi multicast lock includes: correspondingly storing the UID and the information of the Wi-Fi multicast lock.
[0010] In this implementation, there may be multiple applications in the terminal, and multiple applications may hold multicast locks. When releasing the multicast locks held by these multiple applications, the information of each multicast lock may be different. The UID of the multicast lock can be obtained, and according to the UID of each multicast lock, the information of the corresponding multicast lock is stored, so as to facilitate the subsequent restoration of the multicast lock and accurately obtain the information of the multicast lock.
[0011] In combination with the first aspect, in another possible implementation, the method further includes: when receiving a multicast data packet from a surrounding device, not waking up the processor of the terminal.
[0012] In this implementation, since the multicast data packet filtering function of the terminal is enabled, when the terminal receives a multicast data packet from a surrounding device, the processor of the terminal can not be woken up, thereby saving the power consumption of the terminal.
[0013] In combination with the first aspect, in another possible implementation, the method further includes: detecting that the application re-enters the active state; obtaining the information of the Wi-Fi multicast lock corresponding to the UID according to the UID of the Wi-Fi multicast lock; and restoring the Wi-Fi multicast lock according to the obtained information of the Wi-Fi multicast lock.
[0014] In this implementation, since this solution is to proxy the multicast lock of the application, the information of the multicast lock is temporarily stored and the multicast lock is temporarily released. When the application re-enters the active state, there is no need to re-apply for the multicast lock from the operating system, but the temporarily stored multicast lock information can be directly obtained, so that the multicast lock can be quickly restored.
[0015] In combination with the first aspect, in another possible implementation, the method further includes: turning off the multicast data packet filtering function of the terminal; and receiving multicast data packets from surrounding devices.
[0016] In a second aspect, a terminal is provided for implementing the Wi-Fi multicast lock management method in the first aspect or any implementation of the first aspect above. The device can be a terminal, or a module applied to the terminal (such as a processor, a chip, or a chip system, etc.), or a logical node, a logical module, or software that can implement all or part of the terminal functions.
[0017] In a possible implementation, the above terminal includes a unit for executing the method in the first aspect or any implementation of the first aspect above.
[0018] Among them, the terminal includes: a first detection unit for detecting that an application on the terminal is in an inactive state and the application holds a Wi-Fi multicast lock; a storage unit for storing information about the Wi-Fi multicast lock; a release unit for releasing the Wi-Fi multicast lock; and a start unit for starting the multicast packet filtering function of the terminal to discard multicast packets from surrounding devices when no application in the terminal holds a Wi-Fi multicast lock.
[0019] Optionally, the first detection unit is used to perform at least one of the following operations: detecting that the application is running in the background; detecting that the application is running in the foreground and the terminal is in a locked screen state.
[0020] Optionally, the terminal further includes: a first acquisition unit for acquiring the UID of the Wi-Fi multicast lock; and the storage unit is used to correspondingly store the UID and the information of the Wi-Fi multicast lock.
[0021] Optionally, the terminal further includes: a wake-up unit for not waking up the processor of the terminal when receiving a multicast packet from a surrounding device.
[0022] Optionally, the terminal further includes: a second detection unit for detecting that the application re-enters the active state; a second acquisition unit for acquiring the information of the Wi-Fi multicast lock corresponding to the UID according to the UID of the Wi-Fi multicast lock; and a recovery unit for recovering the Wi-Fi multicast lock according to the acquired information of the Wi-Fi multicast lock.
[0023] Optionally, the terminal further includes: a closing unit for closing the multicast packet filtering function of the terminal; and a receiving unit for receiving multicast packets from surrounding devices.
[0024] In another possible implementation, the terminal in the above first aspect or any implementation of the first aspect includes a processor coupled to a memory; the processor is configured to implement the corresponding functions of the device in executing the above Wi-Fi multicast lock management method. The memory is used to be coupled to the processor and stores the necessary programs (instructions) and / or data of the device. Optionally, the terminal may further include an interface circuit for implementing communication between the device and other devices. Optionally, the memory may be located inside the terminal or outside the terminal.
[0025] In a third aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the method described in the above first aspect or any implementation of the first aspect is implemented.
[0026] In a fourth aspect, a computer program product containing instructions is provided. When the instructions run on a terminal, the terminal is caused to execute the method described in the above first aspect or any implementation of the first aspect.
[0027] In a fifth aspect, a chip is provided. The chip is coupled to a memory and is used to execute the method described in the above first aspect or any implementation of the first aspect. Description of the Drawings
[0028] Figure 1 It is a schematic flow chart of a Wi-Fi multicast lock management method provided by an embodiment of the present application;
[0029] Figure 2 It is a schematic flow chart of the process of holding a multicast lock exemplified by an embodiment of the present application;
[0030] Figure 3 It is a schematic flow chart of another Wi-Fi multicast lock management method provided by an embodiment of the present application;
[0031] Figure 4 It is a schematic flow chart of the process of proxy multicast lock exemplified by an embodiment of the present application;
[0032] Figure 5 It is a schematic flow chart of the process of restoring a multicast lock exemplified by an embodiment of the present application;
[0033] Figure 6 It is a schematic structural diagram of a terminal provided by an embodiment of the present application;
[0034] Figure 7 It is a schematic structural diagram of another terminal provided by an embodiment of the present application. Detailed Embodiments
[0035] The embodiments of the present application will be described below with reference to the accompanying drawings.
[0036] Currently, video applications generally have a screen mirroring function that allows users to project videos from devices such as mobile phones onto large-screen devices. When performing screen mirroring, the video application requests a multicast lock from the operating system of the mobile phone. However, during screen mirroring, even if the video application is running in the background, the video application will continue to hold the multicast lock, resulting in the closure of the multicast packet filtering function of the mobile phone. Packets received from the local area network will frequently wake up the mobile phone, causing the power consumption level of the mobile phone to rise to an abnormal range.
[0037] Since the application is running in the background, or the application is running in the foreground but the terminal is locked, etc., the user is unaware that the application still holds the multicast lock, resulting in relatively high power consumption of the terminal. Through nighttime power consumption testing of the terminal (nighttime power consumption testing excludes the possibility of additional power consumption caused by the user frequently operating the terminal), if the application holds the multicast lock, the average standby current at night is 90+ mA, which is 2-3 times higher than the normal standby at night (i.e., when the application does not hold the multicast lock, the average standby current at night is 30 mA).
[0038] In addition, according to a large data search of the terminal, it shows that there have been more than 400 reports of cases where only the screen-off lock timeout (i.e., the terminal is locked but the application still holds the multicast lock) was detected and killed within a month. Among them, online video applications accounted for more than 80%. It can be seen that the situation where online video applications apply for and timeout the multicast lock is relatively common and is the main factor leading to increased power consumption of the terminal.
[0039] In view of this, the present application provides a Wi-Fi multicast lock management solution. When it is detected that an application on the terminal is in an inactive state, the information of the multicast lock of the application is stored and the multicast lock is released. And when no application in the terminal holds the multicast lock, the multicast packet filtering function of the terminal is started to discard multicast packets from surrounding devices, which can save the power consumption of the terminal and prevent the terminal from being frequently woken up by multicast packets.
[0040] As Figure 1 shown, it is a schematic flowchart of a Wi-Fi multicast lock management method provided by an embodiment of the present application. Exemplarily, the method may include the following steps:
[0041] S101. Detect that an application on the terminal is in an inactive state.
[0042] In this embodiment, one or more applications are installed on the terminal. When these applications need to multicast or broadcast data, or receive multicast or broadcast data from other surrounding devices, they request a Wi-Fi multicast lock from the operating system. During the operation of the application, the application holds the Wi-Fi multicast lock. Holding the multicast lock means that the application has applied for the multicast lock and has not released the multicast lock.
[0043] Some applications may run in the background after running for a period of time, or although these applications are running in the foreground, the terminal can enter the locked screen state. For example, when a video application performs screen mirroring, the video application can run in the background. At this time, these applications are in an inactive state. When an application is in an inactive state, the application is not visible, or the user cannot perceive the application.
[0044] In this embodiment, in order to save the power consumption of the terminal, it is necessary to detect whether one or more applications on the terminal are in an inactive state irregularly (for example, triggered based on a certain event) or periodically.
[0045] Exemplarily, detecting that an application on the terminal is in an inactive state includes at least one of the following operations:
[0046] Detecting that the application is running in the background;
[0047] Detecting that the application is running in the foreground and the terminal is in the locked screen state.
[0048] As Figure 2 shown, it is a schematic flowchart of holding a multicast lock according to an embodiment of the present application. The application is a video application. When the digital living network alliance (DLNA) screen mirroring of the video application is started, the terminal discovers the devices around that can perform screen mirroring, and then applies for a multicast lock from the operating system, and the multicast starts. When the data to be screen mirrored arrives, the CPU of the terminal processes the received data, sends the data to the screen mirroring device (that is, other AP devices connected to the AP) through the wireless access point (AP) for playback, and pushes the resource address to the screen mirroring device. Then, the application can enter an invisible state, and the operation freezes the application to save the power consumption of the terminal.
[0049] S102. Store the information of the Wi-Fi multicast lock and release the Wi-Fi multicast lock.
[0050] When it is detected that any application on the terminal is in an inactive state, temporarily store the information of the multicast lock held by the application, and release the multicast lock.
[0051] Exemplarily, the terminal can store the information of the multicast lock held by the application in the cache.
[0052] For the specific content of the information of the multicast lock, reference can be made to the prior art, and details are not described herein.
[0053] S103. When no application in the terminal holds the Wi-Fi multicast lock, start the multicast packet filtering function of the terminal to discard the multicast packets from surrounding devices.
[0054] One or more applications may be installed in the terminal. When the terminal detects that all multicast locks held by inactive applications are released, it can start the multicast packet filtering function of the terminal. Starting the multicast packet filtering function of the terminal means that when receiving a multicast packet from a surrounding device, the multicast packet from the surrounding device is filtered or discarded without waking up the processor of the terminal to process the packet. Thereby, the power consumption of the terminal can be saved.
[0055] According to a Wi-Fi multicast lock management method provided by an embodiment of the present application, when detecting that an application on the terminal is in an inactive state, the information of the multicast lock of the application is stored and the multicast lock is released. And when there is no application in the terminal holding a multicast lock, the multicast packet filtering function of the terminal is started to discard the multicast packets from surrounding devices, which can save the power consumption of the terminal and prevent the terminal from being frequently woken up by multicast packets.
[0056] Compared with the whole machine entering the low-power mode and turning off the multicast function of the whole machine, its trigger condition is relatively strict. And in this solution, the multicast packet filtering function of the terminal can be started when the application enters the inactive state, so that power consumption benefits can be created in a wider range of scenarios. And this solution releases the multicast lock held by the inactive application, and the execution granularity of the solution is finer, avoiding the problem that the existing solution may cause the multicast shutdown of the whole machine to affect the application service.
[0057] The essence of this method is to proxy the multicast lock of the application, temporarily store the information of the multicast lock and temporarily release the multicast lock. When the application re-enters the active state, it does not need to re-apply for a multicast lock from the operating system, but can directly obtain the temporarily stored multicast lock information.
[0058] The proxy and recovery of the multicast lock are further described below through embodiments:
[0059] As Figure 3 shown, it is a flowchart of another Wi-Fi multicast lock management method provided by an embodiment of the present application. Exemplarily, the method may include the following steps:
[0060] S301. Detect that an application on the terminal is in an inactive state.
[0061] Wherein, the application holds a Wi-Fi multicast lock.
[0062] For the specific implementation of this step, reference may be made to Figure 1 step S101 of the embodiment shown, which will not be elaborated here.
[0063] S302. Obtain the UID of the Wi-Fi multicast lock.
[0064] Each application has a unique user identifier (UID) that is used to identify the identity and permissions of the application in the system. The UID is an identity identifier independent of the user account, and the system uses the UID to manage and restrict the access permissions of application programs to system resources.
[0065] When any application on the terminal is detected to be in an inactive state, the information of the multicast lock held by the application is temporarily stored. Since the terminal may need to temporarily cache the information of the multicast locks of one or more applications, before caching, the UID of the multicast lock is first obtained to identify the information of the multicast locks held by each application.
[0066] When an application applies to the operating system for a multicast lock, the UID of the multicast lock is obtained at the same time. Therefore, the application information for the multicast lock application can be searched to obtain the UID of the multicast lock.
[0067] S303. Store the information of the UID and the Wi-Fi multicast lock correspondingly.
[0068] After the terminal obtains the UID of the multicast lock, it stores the information of the UID and the multicast lock correspondingly. That is, the UID is used as the index of the information of the multicast lock to uniquely identify the information of the multicast lock.
[0069] Among them, the information of the multicast lock includes at least one of the following information: tag, UID, binder (a communication interface through which an application connects to the system service to apply for a multicast lock), and other information.
[0070] S304. Release the Wi-Fi multicast lock.
[0071] After the terminal stores the information of the multicast lock held by the application, it can release the multicast lock held by the application. After releasing the multicast lock, the application does not hold the multicast lock temporarily.
[0072] S305. When no application in the terminal holds a Wi-Fi multicast lock, start the multicast packet filtering function of the terminal to discard multicast packets from surrounding devices.
[0073] One or more applications may be installed in the terminal. When the terminal detects that all the multicast locks held by inactive applications have been released, it can start the multicast packet filtering function of the terminal.
[0074] S306. When receiving a multicast packet from a surrounding device, do not wake up the processor of the terminal.
[0075] Enable the multicast packet filtering function of the terminal, that is, when receiving multicast packets from surrounding devices, filter or discard the multicast packets from surrounding devices without waking up the processor of the terminal to process the packets. Thus, the power consumption of the terminal can be saved.
[0076] It can be understood that the terminal temporarily stores the information of the multicast lock held by the application and releases the multicast lock held by the application. The terminal essentially acts as an agent for the multicast lock of the application, and the multicast lock can still be restored without having to re-apply for a multicast lock from the operating system. This is different from the existing direct release of the multicast lock.
[0077] Such as Figure 4 As shown, it is a schematic flowchart of the proxy multicast lock in the embodiment of the present application. When the application is invisible to the user, the terminal detects whether the application enters the inactive state. The above process can be implemented by the application status detection module or function of the terminal.
[0078] If so, the proxy action of the terminal starts; otherwise, the action ends. If the proxy action of the terminal starts, the terminal determines whether it enters the proxy state (that is, the multicast lock of the application can be uniformly managed by the terminal, temporarily store the information of the multicast lock and temporarily release the multicast lock) or whether the application is a non-system application (if it is a system application, the solution of this embodiment may not be applicable and the multicast lock it holds is not released). If so, the terminal obtains the UID of the multicast lock; otherwise, the action ends. After the terminal obtains the UID of the multicast lock, it detects whether the UID is empty. The above process can be implemented by the multicast lock proxy module or function of the terminal.
[0079] The above power consumption management module and multicast lock proxy module of the terminal can be collectively referred to as the power consumption management module or function of the terminal.
[0080] If the UID is not empty, the terminal stores the information of the multicast lock corresponding to the UID; otherwise, the action ends. After the terminal stores the information of the multicast lock, it successfully acts as an agent for the multicast lock and can release the multicast lock. Since there may be one or more applications in the terminal holding the multicast lock, the terminal detects whether there is still an active multicast lock, that is, whether there is still an application holding the multicast lock and not released. If so, the action ends; otherwise, the terminal can start the multicast lock packet filtering function. When receiving multicast packets from surrounding devices, filter or discard the multicast packets from surrounding devices without waking up the processor of the terminal to process the packets. The above process can be implemented at the framework layer of the terminal.
[0081] The framework layer notifies the hardware abstraction layer (HAL) of the terminal to process.
[0082] The kernel layer of the terminal senses the end process of the above actions.
[0083] It can be understood that if the above application exits after the multicast lock proxy, that is, the application stops running, the binderDied method can delete the information of the multicast lock of the application temporarily stored in the terminal, avoiding the problem of inconsistent information inside and outside the system.
[0084] After the application enters the inactive state, the process of the application is frozen by the operating system and cannot execute code. The solution of this embodiment will not cause any impact on the business of the application itself. And since the application obtains and releases the lock through the upper-layer WifiManager, this solution modifies the code of the lower-layer WifiMulticastLockManager called by the WifiManager. The entire logic of proxy-restoring the multicast lock is completely imperceptible to the application, thus avoiding the problem of inconsistent information inside and outside the application.
[0085] S307. It is detected that the application re-enters the active state.
[0086] When the application enters the perceivable state, or the application may be pulled alive in the background and starts to be active again, the application enters the active state.
[0087] The terminal can detect whether the application re-enters the active state irregularly (for example, when the application is pulled alive in the background, triggering the terminal to know that it enters the active state) or periodically.
[0088] S308. According to the UID of the Wi-Fi multicast lock, obtain the information of the Wi-Fi multicast lock corresponding to the UID.
[0089] If the multicast lock of the application is proxied, that is, the terminal temporarily stores the information of the multicast lock according to the UID of the multicast lock, the terminal can obtain the information of the multicast lock corresponding to the UID according to the UID of the multicast lock.
[0090] S309. Restore the Wi-Fi multicast lock according to the obtained information of the Wi-Fi multicast lock.
[0091] After the terminal obtains the information of the multicast lock corresponding to the application, it can restore the multicast lock of the application according to the information of the multicast lock, so that the application can hold the multicast lock again.
[0092] After the multicast lock corresponding to the application is restored, all services of the application can proceed normally.
[0093] When the application re-enters the active state, there is no need to re-apply for the multicast lock from the operating system, but it can directly obtain the temporarily stored multicast lock information, so that the multicast lock can be quickly restored.
[0094] S310. Turn off the multicast packet filtering function of the terminal.
[0095] When any application on the terminal holds a multicast lock, turn off the multicast packet filtering function of the terminal.
[0096] S311. Receive multicast packets from surrounding devices.
[0097] If the terminal turns off the multicast packet filtering function, it can receive multicast packets from surrounding devices.
[0098] As Figure 5 shown, it is a schematic flowchart of restoring a multicast lock according to an embodiment of the present application. The terminal detects that the application enters a perceivable state or the application is pulled up in the background. The above process can be implemented by an application state detection module or function of the terminal.
[0099] When the terminal detects that the application enters a perceivable state or the application is pulled up in the background, the restoration action of the multicast lock starts. The terminal detects whether the application is in a non-proxy state (that is, detects whether the terminal temporarily stores the information of the multicast lock corresponding to the application). If so, the action ends; otherwise, the terminal obtains the UID of the multicast lock corresponding to the application. The above process can be implemented by a multicast lock restoration module or function of the terminal.
[0100] The above application state detection module and multicast lock restoration module of the terminal can be collectively referred to as the power consumption management module of the terminal.
[0101] The terminal obtains the information of the multicast lock stored corresponding to the UID according to the obtained UID of the multicast lock, and restores the multicast lock according to the information of the multicast lock. The terminal determines whether the number of the multicast locks starts to increase from 0. If so, that is, there starts to be an application holding a multicast lock in the terminal, turn off the multicast packet filtering function; otherwise, the action ends. The above process can be implemented by the framework layer of the terminal.
[0102] The framework layer notifies the hardware abstraction layer of the terminal to process.
[0103] The kernel layer of the terminal senses the end process of the above action.
[0104] According to a Wi-Fi multicast lock management method provided by an embodiment of the present application, when it is detected that an application on the terminal is in an inactive state, store the information of the multicast lock of the application and release the multicast lock, and when there is no application holding a multicast lock in the terminal, start the multicast packet filtering function of the terminal to discard multicast packets from surrounding devices, which can save the power consumption of the terminal and prevent the terminal from being frequently awakened by multicast packets; when the application re-enters the active state, it does not need to re-apply for a multicast lock from the operating system, but can directly obtain the temporarily stored multicast lock information, so that the multicast lock can be quickly restored.
[0105] By conducting tests in an office network environment, with the screen mirroring application placed in the foreground and then the screen turned off, it was observed that in the test group without using this solution, the standby current sometimes increased, and the average current was 38.2% higher than that of the test group using this solution.
[0106] Compared with the office network, the home network has a more complex network environment. There are more and different types of devices connected under the same AP, and there is no phenomenon of AP isolation in the office network. In the home network environment, the optimization of power consumption by this solution was tested. The screen mirroring application was placed in the foreground and then the screen was turned off. It can be found that through this solution, the power consumption during night standby can be significantly and effectively reduced, and the night standby current is controlled within the normal range (30 mA).
[0107] It can be understood that in each of the above embodiments, the methods and / or steps implemented by the terminal can also be implemented by components (such as chips or circuits) for the terminal. The terminal can be a smart phone, a tablet, a personal computer, etc., or can be applied to any maximum that can connect to a Wi-Fi network.
[0108] Based on the same concept of the above Wi-Fi multicast lock management method, an embodiment of the present application also provides a terminal for implementing the above various methods. The terminal can be the terminal in the above method embodiments, or a component applicable to the terminal. It can be understood that in order to implement the above functions, the terminal includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0109] Embodiments of the present application can divide the functional modules of the terminal according to the above method embodiments. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing unit. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiments of the present application is illustrative, only a logical function division, and there can be other division methods in actual implementation.
[0110] As Figure 6 shown, it is a schematic structural diagram of a terminal provided by an embodiment of the present application. The terminal 600 includes:
[0111] The first detection unit 601 is configured to detect that an application on the terminal is in an inactive state, and the application holds a Wi-Fi multicast lock; the storage unit 602 is configured to store information about the Wi-Fi multicast lock; the release unit 603 is configured to release the Wi-Fi multicast lock; and the startup unit 604 is configured to, when no application in the terminal holds a Wi-Fi multicast lock, start the multicast packet filtering function of the terminal to discard multicast packets from surrounding devices.
[0112] Optionally, the first detection unit 601 is configured to perform at least one of the following operations: detect that the application is running in the background; detect that the application is running in the foreground and the terminal is in a locked screen state.
[0113] Optionally, the terminal 600 may further include the following units, Figure 6 which are represented and connected by dotted lines:
[0114] Optionally, the terminal 600 further includes: a first acquisition unit 605 configured to acquire the user identification UID of the Wi-Fi multicast lock; and the storage unit 602 is configured to correspondingly store the UID and the information about the Wi-Fi multicast lock.
[0115] Optionally, the terminal 600 further includes: a wake-up unit 606 configured to not wake up the processor of the terminal when receiving a multicast packet from a surrounding device.
[0116] Optionally, the terminal 600 further includes: a second detection unit 607 configured to detect that the application re-enters the active state; a second acquisition unit 608 configured to acquire the information about the Wi-Fi multicast lock corresponding to the UID according to the UID of the Wi-Fi multicast lock; and a recovery unit 609 configured to recover the Wi-Fi multicast lock according to the acquired information about the Wi-Fi multicast lock.
[0117] Optionally, the terminal 600 further includes: a closing unit 610 configured to close the multicast packet filtering function of the terminal; and a receiving unit 611 configured to receive multicast packets from surrounding devices.
[0118] For the specific implementation and beneficial effects of this embodiment, reference may be made to the foregoing method embodiment, which will not be elaborated herein.
[0119] The division of units in this application is illustrative and is only a logical function division. In actual implementation, there may be other division methods. Additionally, in each example of this application, each functional unit can be integrated in a processor, can exist independently physically, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0120] It should be noted that the above unit or one or more of the units can be implemented by software, hardware, or a combination of both. When any of the above units is implemented by software, the software exists in the form of computer program instructions and is stored in the memory. The processor can be used to execute the program instructions and implement the above method flow.
[0121] According to a terminal provided by an embodiment of the present application, when it is detected that an application on the terminal is in an inactive state, the information of the multicast lock of the application is stored and the multicast lock is released. And when there is no application in the terminal holding the multicast lock, the multicast packet filtering function of the terminal is started to discard multicast packets from surrounding devices, which can save the power consumption of the terminal and prevent the terminal from being frequently awakened by multicast packets; when the application re-enters the active state, it does not need to re-apply for the multicast lock from the operating system, but can directly obtain the temporarily stored multicast lock information, so that the multicast lock can be quickly restored.
[0122] As Figure 7 shown, it is a schematic structural diagram of another terminal provided by an embodiment of the present application. The terminal 700 includes one or more processors 701 ( Figure 7 one processor is exemplified). Optionally, the terminal 700 may further include an interface circuit 702 ( Figure 7 shown by a dotted line), and the processor 701 and the interface circuit 702 are coupled to each other. It can be understood that the interface circuit 702 can be a transceiver or an input / output interface. Optionally, the terminal 700 may further include a memory 703 ( Figure 7 shown by a dotted line). The memory 703 is used to store instructions executed by the processor 701, or input data required for the processor 701 to run the instructions, or data generated after the processor 701 runs the instructions.
[0123] Wherein, the processor 701 is used to perform the following operations:
[0124] Detect that an application on the terminal is in an inactive state and the application holds a Wi-Fi multicast lock;
[0125] Store the information of the Wi-Fi multicast lock and release the Wi-Fi multicast lock;
[0126] When there is no application in the terminal holding a Wi-Fi multicast lock, the multicast packet filtering function of the terminal is started to discard multicast packets from surrounding devices.
[0127] In a possible implementation, the processor 701 performs the operation of detecting that an application on the terminal is in an inactive state, including at least one of the following operations:
[0128] Detecting that the application is running in the background;
[0129] Detecting that the application is running in the foreground and the terminal is in the locked screen state.
[0130] In another possible implementation, the processor 701 further performs the following operations:
[0131] Obtaining the user identification UID of the Wi-Fi multicast lock;
[0132] The operation that the processor 701 performs to store the information of the Wi-Fi multicast lock includes:
[0133] Correspondingly storing the UID and the information of the Wi-Fi multicast lock.
[0134] In another possible implementation, the interface circuit 702 is used to perform the following operations:
[0135] When receiving a multicast packet from a surrounding device, not waking up the processor of the terminal.
[0136] In another possible implementation, the processor 701 is further used to perform the following operations:
[0137] Detecting that the application re-enters the active state;
[0138] According to the UID of the Wi-Fi multicast lock, obtaining the information of the Wi-Fi multicast lock corresponding to the UID;
[0139] Restoring the Wi-Fi multicast lock according to the obtained information of the Wi-Fi multicast lock.
[0140] In another possible implementation, the processor 701 is further used to perform the following operations:
[0141] Closing the multicast packet filtering function of the terminal;
[0142] And the interface circuit 702 is further used to perform the following operations:
[0143] Receiving multicast packets from surrounding devices.
[0144] For the specific implementation and beneficial effects of this embodiment, reference may be made to the foregoing method embodiments, which will not be elaborated herein.
[0145] When the above terminal is a chip applied to a terminal, the chip implements the functions of the terminal in the above method embodiments.
[0146] It can be understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0147] According to a terminal provided by an embodiment of the present application, when it is detected that an application on the terminal is in an inactive state, the information of the multicast lock of the application is stored and the multicast lock is released. And when there is no application in the terminal holding the multicast lock, the multicast packet filtering function of the terminal is started to discard multicast packets from surrounding devices, which can save the power consumption of the terminal and prevent the terminal from being frequently awakened by multicast packets. When the application re-enters the active state, it can directly obtain the temporarily stored multicast lock information without re-applying for the multicast lock to the operating system, thereby quickly restoring the multicast lock.
[0148] An embodiment of the present application also provides a computer-readable storage medium, in which computer programs or instructions are stored. When the computer programs or instructions are executed, the methods in the above embodiments are implemented.
[0149] An embodiment of the present application also provides a computer program product containing instructions. When the instructions run on a computer, the computer is caused to execute the methods in the above embodiments.
[0150] An embodiment of the present application also provides a circuit, which is coupled to a memory and is used to execute the method shown in the above embodiments. The circuit may include a chip circuit.
[0151] Optionally, an embodiment of the present application further provides a chip system, including: at least one processor and an interface. The at least one processor is coupled to a memory through the interface. When the at least one processor runs a computer program or instruction in the memory, the chip system is caused to execute the method in any of the above method embodiments. Optionally, the chip system may be composed of chips, or may include chips and other discrete devices. The embodiments of the present application do not make specific limitations thereto.
[0152] The memory in the present application may also be a circuit or any other device capable of implementing a storage function, for storing program instructions and / or data. The memory is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. For example, the memory may be a non-volatile memory, such as a digital versatile disc (DVD), a hard disk drive (HDD), or a solid-state drive (SSD), etc., or may also be a volatile memory, such as a random-access memory (RAM).
[0153] As used in the present application, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes other unlisted steps or units, or optionally further includes other steps or units inherent to these processes, methods, products, or devices. It should be noted that in the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any method or design solution described as "exemplary" or "for example" in the present application should not be construed as being more preferred or more advantageous than other methods or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.
[0154] It should be understood that in the description of this application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship. For example, A / B can represent A or B; where A and B can be singular or plural. Also, in the description of this application, unless otherwise specified, "a plurality of" means two or more than two. "At least one (item)" or similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c can be single or multiple. Additionally, to facilitate a clear description of the technical solutions of the embodiments of this application, in the embodiments of this application, terms such as "first" and "second" are used to distinguish between identical or similar items with basically the same functions and roles. Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order, and "first", "second", etc. do not necessarily mean different. At the same time, in the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner for easy understanding.
[0155] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of this application are generated in whole or in part. The computer can be a general - purpose computer, a special - purpose computer, a computer network, or other programmable devices. 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, network device, or data center to another website, computer, network device, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.).
[0156] Although the present application has been described in connection with various embodiments, those skilled in the art can understand and implement other variations of the disclosed embodiments by viewing the accompanying drawings, the disclosure, and the appended claims. In the claims, a single processor or other unit may implement several functions recited in the claims. Certain measures are recited in mutually different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0157] It can be understood that the various numerical numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. The magnitude of the sequence numbers of the above processes does not mean the order of execution, and the order of execution of each process should be determined by its function and internal logic.
[0158] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0159] The components in the device embodiments of the present application can be combined, divided, and deleted according to actual needs. Those skilled in the art can combine or combine the different embodiments and the features of different embodiments described in this specification.
[0160] In the present application, on the premise of no logical contradiction, the examples can be cited from each other. For example, the methods and / or terms between method embodiments can be cited from each other. For example, the functions and / or terms between device embodiments can be cited from each other. For example, the functions and / or terms between device examples and method examples can be cited from each other.
Claims
1. A Wi-Fi multicast lock management method, characterized in that The method includes: Detecting that an application on the terminal is in an inactive state, and the application holds a Wi-Fi multicast lock; Storing information about the Wi-Fi multicast lock and releasing the Wi-Fi multicast lock; When no application in the terminal holds a Wi-Fi multicast lock, starting the multicast packet filtering function of the terminal to discard multicast packets from surrounding devices.
2. The method according to claim 1, characterized in that, The detecting that an application on the terminal is in an inactive state includes at least one of the following operations: Detecting that the application is running in the background; Detecting that the application is running in the foreground and the terminal is in a locked screen state.
3. The method according to claim 1 or 2, characterized in that, The method further includes: Obtaining the user identification UID of the Wi-Fi multicast lock; The storing the information about the Wi-Fi multicast lock includes: Correspondingly storing the UID and the information about the Wi-Fi multicast lock.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: When receiving a multicast packet from a surrounding device, not waking up the processor of the terminal.
5. The method according to claim 3 or 4, characterized in that, The method further includes: Detecting that the application re-enters the active state; According to the UID of the Wi-Fi multicast lock, obtaining the information about the Wi-Fi multicast lock corresponding to the UID; Restoring the Wi-Fi multicast lock according to the obtained information about the Wi-Fi multicast lock.
6. The method according to claim 5, wherein The method further includes: Closing the multicast packet filtering function of the terminal; Receiving multicast packets from surrounding devices.
7. A terminal, characterized in that, The terminal includes: A first detection unit, configured to detect that an application on the terminal is in an inactive state, and the application holds a Wi-Fi multicast lock; A storage unit, configured to store the information about the Wi-Fi multicast lock; A release unit, configured to release the Wi-Fi multicast lock; A start unit, configured to start the multicast packet filtering function of the terminal to discard multicast packets from surrounding devices when no application in the terminal holds a Wi-Fi multicast lock.
8. The terminal according to claim 7, wherein The first detection unit is configured to perform at least one of the following operations: Detecting that the application is running in the background; Detecting that the application is running in the foreground and the terminal is in a locked screen state.
9. The terminal according to claim 7 or 8, characterized in that, The terminal further includes: A first obtaining unit, configured to obtain the user identification UID of the Wi-Fi multicast lock; The storage unit is configured to correspondingly store the UID and the information about the Wi-Fi multicast lock.
10. The terminal according to any one of claims 7-9, characterized in that, The terminal further includes: A wake-up unit, configured to not wake up the processor of the terminal when receiving a multicast packet from a surrounding device.
11. The terminal according to claim 9 or 10, characterized in that, The terminal further includes: A second detection unit, configured to detect that the application re-enters the active state; A second obtaining unit, configured to obtain the information about the Wi-Fi multicast lock corresponding to the UID according to the UID of the Wi-Fi multicast lock; A restoration unit, configured to restore the Wi-Fi multicast lock according to the obtained information about the Wi-Fi multicast lock.
12. The terminal according to claim 11, wherein The terminal further includes: A closing unit, configured to close the multicast packet filtering function of the terminal; A receiving unit, configured to receive multicast packets from surrounding devices.
13. A terminal, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor. It is characterized in that when the processor executes the computer program, the method described in any one of claims 1-6 is implemented.
14. A computer-readable storage medium, characterized in that, A computer program or instruction is stored in the computer-readable storage medium. When the computer program or instruction is executed, the method described in any one of claims 1-6 is executed.
15. A computer program product containing instructions, characterized in that, When the instruction runs on the terminal, the terminal is caused to execute the method described in any one of claims 1-6.
16. A chip, characterized in that, The chip is coupled to the memory, and the chip is used to execute the method described in any one of claims 1-6.