Method for reducing power consumption of equipment, electronic equipment and medium thereof

CN119768758APending Publication Date: 2025-04-04HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380055346.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-08-11
Filing Date
2023-04-12
Publication Date
2025-04-04

Smart Images

  • Figure CN119768758A_ABST
    Figure CN119768758A_ABST
Patent Text Reader

Abstract

The invention relates to the field of terminal equipment, in particular to a method for reducing equipment power consumption, electronic equipment and a medium thereof. According to the method, different video playing scenes are identified, whether the user still watches the video in the current video playing scene or not is judged according to the condition that the user does not use the mobile phone in different video playing scenes, and the power consumption of the terminal equipment is reduced under the condition that the user is determined not to watch the video any more. Through the mode, whether the user still watches the video can be determined in a targeted manner according to the current video playing scene, and under the condition of determining that the user does not watch the video, the power consumption of the equipment is reduced, the maintenance of a battery of the terminal equipment is facilitated, and the phenomenon that the mobile phone cannot be cooled when the mobile phone is placed at a place without heat dissipation is avoided. The mobile phone battery swells, catches fire and the like due to too fast temperature rise, so that the personal safety of a user is facilitated, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Method for reducing device power consumption, electronic device and medium thereof

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on August 11, 2022, with application number 202210965621.8 and invention name “Method for reducing device power consumption, electronic device and medium thereof”. The entire contents of the above patent are incorporated into this application by reference. Technical Field

[0002] The present application relates to the field of terminal equipment, and in particular to a method for reducing equipment power consumption, an electronic device and a medium thereof. Background Art

[0003] The survey found that many users are accustomed to watching videos such as In this case, if the user does not actively turn off the screen, the video in the video application will continue to play in a loop until the live broadcast stops or the next video is automatically played (such as a TV series automatically switching to the next episode). During this period, the mobile phone and other terminal devices will continue to consume power until they are shut down due to insufficient power.

[0004] In addition, when mobile phones and other terminal devices are placed in places with poor heat dissipation, the above situation will cause the battery temperature of mobile phones and other terminal devices to rise too quickly, which in turn will cause abnormal conditions such as battery swelling and fire, affecting the service life of the mobile phone battery. More seriously, it will endanger the personal safety of users.

[0005] Summary of the Invention

[0006] In order to solve the above problems, the present application provides a method for reducing device power consumption, an electronic device and a medium thereof. The method of the present application identifies different video playback scenarios, and then determines whether the user is still watching the video in the current video playback scenario based on the situation that the user is not using the mobile phone in different video playback scenarios, and reduces the power consumption of the terminal device when it is determined that the user is no longer watching the video. In this way, it is possible to specifically determine whether the user is still watching the video based on the current video playback scenario, and reduce the power consumption of the device when it is determined that the user is not watching the video, which is beneficial to the maintenance of the battery of the terminal device and avoids the situation where the mobile phone is placed in a place with poor heat dissipation or no heat dissipation, and the mobile phone battery is prevented from bulging or catching fire due to excessive temperature rise when the mobile phone is placed in a place with poor heat dissipation or no heat dissipation. It is beneficial to the personal safety of the user and improves the user experience.

[0007] In a first aspect, an embodiment of the present application provides a method for reducing device power consumption, which is applied to an electronic device, the method comprising: the electronic device is in a first video playback scenario; determining that the user is not using the electronic device and the video status of the electronic device meets the first status condition under the first video playback scenario; and performing at least one operation to reduce the power consumption of the electronic device.

[0008] In some implementations, the first video playback scenario includes a video loop playback scenario, a video automatic switching scenario, and a video live broadcast scenario.

[0009] That is, the above method determines that the user is no longer watching the video by determining that the user is not using the electronic device and the state of the video currently played by the electronic device meets the first state condition in the first video playback scenario, that is, performing at least one operation to reduce the power consumption of the electronic device. Among them, in some implementations, the user not using the electronic device means that the user has not interacted with the electronic device for a long time or the electronic device has been in a bright screen state for a long time, or the electronic device is in a stationary state, or the user is in a sleeping state. Among them, the electronic device being in a stationary state means that it is determined based on the sensor data of the electronic device that the electronic device has been in an unmoved state for a long time. In this case, it can also be determined that the user is not using the electronic device. Among them, in the implementation of the present application, the electronic device can also be called a terminal device.

[0010] It is understandable that in different video playback scenarios, when the user is no longer watching or has not operated the electronic device for a long time, the video status is different. Therefore, it is necessary to determine whether the user is no longer watching the video or has not operated the electronic device for a long time based on whether the first state condition corresponding to the video playback scenario corresponding to the electronic device is met, and then determine whether to perform the operation of reducing the electronic device. Through this method, it is possible to determine that the user is not watching the video in different video playback scenarios, and then reduce the power consumption of the device, which is beneficial to the maintenance of the battery of the electronic device, so that the battery will not swell or catch fire due to excessive temperature rise, which is more beneficial to the personal safety of the user and improves the user experience.

[0011] In conjunction with the first aspect, in one possible implementation, determining that the user is not using the electronic device includes at least one of the following: determining that the duration of time the electronic device is in the screen-on state is greater than a first preset duration; determining that the electronic device has not detected the user's first operation on the electronic device for more than a second preset duration; determining that the electronic device is in a stationary state; determining that the user is in a sleep state. The first preset duration and the second preset duration are empirical values ​​or experimental values, and this application does not impose any restrictions on this. The first operation can be an operation such as single-clicking, double-clicking, or pressing performed by the user on the electronic device, or it can be a voice command made by the user to invoke a response function in the electronic device.

[0012] In combination with the first aspect and the above-mentioned possible implementation methods, in one possible implementation method, the first video playback scenario includes a video loop playback scenario, and the video state of the electronic device satisfies the first state condition under the first video playback scenario, including: the number of times the electronic device loops the same video is greater than a first threshold, and / or the duration of the electronic device looping the same video is greater than a third preset duration. That is, if the duration of the same video loop playback is greater than a certain value, or the number of loop playbacks is greater than a certain value, then it can be determined that the user is not watching the video. Among them, the first threshold is an empirical value or an experimental value, and this application does not impose any restrictions on this.

[0013] In combination with the first aspect and the above-mentioned possible implementation methods, in one possible implementation method, the first video playback scenario includes a video automatic switching scenario, and the video state of the electronic device satisfies the first state condition under the first video playback scenario, including: the number of different videos played by the electronic device is greater than the second threshold, and / or the time taken by the electronic device to play different videos is greater than a fourth preset time. That is, if the number of automatically switched videos exceeds a certain value or the duration of automatically switched video playback exceeds a certain value, it can also be determined that the user is not watching the video. The second threshold and the fourth preset time are empirical values ​​or experimental values, and this application does not impose any restrictions on this.

[0014] In conjunction with the first aspect and the above-described possible implementations, in one possible implementation, the first video playback scenario includes a live video broadcast scenario, and the video state of the electronic device satisfies a first state condition in the first video playback scenario, including: the electronic device does not detect a second user operation on the electronic device within a fifth preset time period after the end of the current video playback. In other words, if the second user operation is still not detected after the live video broadcast ends, it can be determined that the user is not watching the video.

[0015] In conjunction with the first aspect and the above possible implementations, in one possible implementation, the method further includes: upon detecting that the user has performed a third operation on the electronic device, not executing or ceasing to execute the operation of reducing the power consumption of the electronic device. That is, even if it is determined that the user is not using the electronic device and the video state of the electronic device meets the first state condition in the first video playback scenario, if the user subsequently performs the third operation, it indicates that the user is still watching the video, and therefore, the operation of reducing the power consumption of the electronic device is not executed or ceasing to execute.

[0016] In combination with the first aspect and the above possible implementation manners, in one possible implementation manner, the third operation includes at least one of single-click, double-click, and pressing by the user on the electronic device.

[0017] In combination with the first aspect and the above-mentioned possible implementations, in one possible implementation, the method further includes: displaying a first user interface, the first user interface being used to prompt the user to control the electronic device to turn off the screen within a sixth preset duration; if the user is not detected to perform a fourth operation within the sixth preset duration, the electronic device is controlled to enter a screen-off state and reduce the power consumption of the electronic device, wherein the fourth operation is used to control the electronic device not to perform or stop performing an operation to reduce the power consumption of the electronic device. That is, when it is determined that the user is not using the electronic device, and the video state of the electronic device meets the first state condition under the first video playback scenario, the electronic device displays the first user interface, prompting the user to perform the fourth operation to control the electronic device not to perform or stop performing an operation to reduce the power consumption of the device, so as to more accurately determine that the user is not watching the video. And, at the same time, the first user interface displays a countdown for the electronic device to enter the screen-off state (i.e., the above-mentioned sixth preset duration), and detects whether the user performs the fourth operation during this period. When the user is not detected to perform the fourth operation within the sixth preset duration, the electronic device is controlled to enter the screen-off state.

[0018] In conjunction with the first aspect and the above-described possible implementations, in one possible implementation, the first user interface includes a first control, and the fourth operation includes a user clicking on the first control. That is, in some implementations, the first user interface may include a first control, such as 1011 shown in FIG11c below, and then upon detecting that the user has clicked on the first control, determine that the user has performed the fourth operation. It will be appreciated that this approach can determine that the fourth operation was performed intentionally by the user, rather than unconsciously, thereby more accurately determining whether the user is watching a video.

[0019] In combination with the first aspect and the above-mentioned possible implementation methods, in one possible implementation method, the operation of reducing the power consumption of an electronic device includes at least one of the following: controlling the electronic device to enter a screen-off state; reducing the screen brightness of the electronic device; reducing the resolution and frame rate of the video currently played by the electronic device; turning off the background application update function of the electronic device; switching the network positioning method of the electronic device.

[0020] In combination with the first aspect and the above-mentioned possible implementation, in a possible implementation, determining that the first video playback scene in which the electronic device is located is a video loop playback scene, including: obtaining a first image of the first video currently played by the electronic device; at an interval of a seventh preset time length, obtaining a second image of the second video played by the electronic device; determining the image similarity between the first image and the second image, and when the similarity between the first image and the second image is greater than a first similarity threshold, determining that the first video playback scene in which the electronic device is located is a video loop playback scene. It can be understood that for the video loop playback scene, since the same video is played, two images with the same or very similar content can be obtained. Therefore, the first image of the currently playing first video can be obtained in the above manner, and then after an interval of a seventh preset time length (generally the duration of the video), the second image of the second video played at this time is obtained, and then the image similarity of the two images is compared. When the similarity between the first image and the second image is greater than the first similarity threshold, it indicates that the first image and the second image are the same, then it can be determined that the current video playback scene is a video loop playback scene.

[0021] In combination with the first aspect and the above-mentioned possible implementations, in one possible implementation, determining that the first video playback scene in which the electronic device is located is a live video scene includes: obtaining a third image of the currently playing video at the same time as the video currently playing on the electronic device ends; using an image recognition method to identify the text content of the third image, and when the text content of the third image includes preset keywords, determining that the first video playback scene in which the electronic device is located is a live video scene, wherein the preset keywords include keywords indicating that the type of video currently playing on the electronic device is a live video. Preset keywords include, but are not limited to, "live," "live," etc., and this application does not impose any restrictions on this.

[0022] In combination with the first aspect and the above-mentioned possible implementation manner, in a possible implementation manner, the seventh preset duration includes the video duration of the first video.

[0023] In combination with the first aspect and the above-mentioned possible implementation methods, in one possible implementation method, the electronic device is deployed with an Android operating system, and the Android system of the electronic device includes a video application located at the application layer, and a layer display control module located at the application framework layer, wherein the video application is used to receive an instruction for playing a third video, and when receiving the video playback instruction, sends an instruction to create a first layer to the layer display control module, wherein the instruction is at least used to instruct the layer display module to create a first layer corresponding to the video type of the third video; the layer display control module creates a first layer in response to the instruction, the first layer is used to play the third video, the first layer includes a layer identifier, and the layer identifier includes at least information representing the video type of the third video; and the method also includes: determining the type of the first video playback scene in which the electronic device is located according to the identifier corresponding to the first layer.

[0024] In combination with the first aspect and the above-mentioned possible implementation methods, in one possible implementation method, the application framework layer also includes a video decoder and a video player, wherein the video decoder calls a first function to decode the video stream data of the third video, and after completing the decoding of the video stream data for the third video, calls a second function to end the decoding of the video stream data of the third video; the video player is used to receive the video stream data of the third video decoded by the video decoder, and send the decoded video stream data of the third video to the layer display control module, and the layer display module displays the decoded video stream data of the third video on the first layer; and the method also includes: determining the type of the first video playback scene in which the electronic device is located according to the function called by the video decoder after calling the first function.

[0025] In combination with the first aspect and the above-mentioned possible implementation methods, in a possible implementation method, the type of the first video playback scene in which the electronic device is located is determined according to the function called by the video decoder after calling the first function, including: corresponding to the video decoder calling the third function after calling the first function, determining that the first video playback scene in which the electronic device is located is a first type of video playback scene; corresponding to the video decoder continuing to call the first function after calling the second function, determining that the first video playback scene in which the electronic device is located is a second type of video playback scene; corresponding to the video decoder not calling the first function after calling the second function, determining that the first video playback scene in which the electronic device is located is a third type of video playback scene.

[0026] In a second aspect, an embodiment of the present application further provides an electronic device comprising a memory storing computer program instructions; a processor, wherein the processor and the memory are coupled, and when the computer program instructions stored in the memory are executed by the processor, the electronic device implements the above-mentioned first aspect and any possible implementation method of the first aspect.

[0027] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and is characterized in that when the computer program is executed by a processor, it implements the above-mentioned first aspect and any method of any possible implementation of the first aspect.

[0028] In a fourth aspect, an embodiment of the present application provides a computer program product, which, when running on an electronic device, enables the electronic device to execute the method of the above-mentioned first aspect and any possible implementation of the first aspect.

[0029] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] FIG1a shows a schematic diagram of an interface for starting to play a video in a video loop playback scenario according to an implementation example of the present application;

[0031] FIG1b shows a schematic diagram of an interface for ending video playback in a video loop playback scenario according to an implementation example of the present application;

[0032] FIG1c is a schematic diagram of an interface for restarting a video in a video loop playback scenario according to an implementation example of the present application;

[0033] FIG2a shows a schematic diagram of an interface for ending playback of a video in an automatic video switching scenario according to an implementation example of the present application;

[0034] FIG2b shows a schematic diagram of an interface in a video automatic switching scenario according to an implementation example of the present application;

[0035] FIG2c is a schematic diagram of an interface for playing a video in a video loop playback scenario according to an implementation example of the present application;

[0036] FIG3a shows a schematic diagram of an interface for playing a video in a live video broadcast scenario according to an implementation example of the present application;

[0037] FIG3b shows a schematic diagram of an interface after a video ends in a live video broadcast scenario according to an implementation example of the present application;

[0038] FIG4 shows a schematic flow chart of the method of the present application according to an embodiment of the present application;

[0039] FIG5 is a schematic diagram showing several situations of monitoring the interaction status of a mobile phone according to an embodiment of the present application;

[0040] FIG6 is a schematic diagram showing several situations of monitoring the motion status of a mobile phone according to an embodiment of the present application;

[0041] FIG7 is a schematic diagram showing several situations of monitoring video playback status according to an embodiment of the present application;

[0042] FIG8 is a schematic diagram showing several situations of monitoring the battery power of a mobile phone according to an embodiment of the present application;

[0043] FIG9 shows several schematic diagrams of operations for reducing device power consumption according to an embodiment of the present application;

[0044] FIG10 is a schematic flow chart showing a method for reducing device power consumption according to an embodiment of the present application;

[0045] FIG11a shows a schematic diagram of an interface for playing a video in a live video broadcasting scenario according to an embodiment of the present application;

[0046] FIG11b shows a schematic diagram of an interface after a video is played in a live video broadcast scenario according to an embodiment of the present application;

[0047] FIG11c is a schematic diagram showing an interface for prompting a user to countdown to the screen turning off in a live video broadcast scenario according to an embodiment of the present application;

[0048] FIG11d is a schematic diagram showing a mobile phone screen being turned off in a live video broadcasting scenario according to an embodiment of the present application;

[0049] FIG11e is a schematic diagram showing the mobile phone interface after the user cancels the screen-off function in a live video broadcasting scenario according to an embodiment of the present application;

[0050] FIG12 shows a software layer structure of a mobile phone according to an embodiment of the present application;

[0051] FIG13a shows a schematic diagram of background data corresponding to an identifier of a layer (or interface) corresponding to a live video according to an embodiment of the present application;

[0052] FIG13b shows a schematic diagram of background data corresponding to an identifier of a layer (or interface) corresponding to a non-live video according to an embodiment of the present application;

[0053] FIG14 shows a schematic diagram of the interaction process of various software modules of the mobile phone in FIG12 involved in the present application according to an embodiment of the present application;

[0054] FIG15 a shows a schematic diagram of a mobile phone interface during video playback (the video playback progress bar is T4 ) according to an embodiment of the present application;

[0055] FIG15 b shows a schematic diagram of a mobile phone interface during video playback (the video playback progress bar is T5 ) according to an embodiment of the present application;

[0056] FIG15c is a schematic diagram showing a comparison of the video playback progress bars in FIG15a and FIG15b;

[0057] FIG16 shows a schematic diagram of a mobile phone interface when a video playback progress bar is blocked during video playback according to an embodiment of the present application;

[0058] FIG17 is a schematic diagram showing background data in a video loop playback scenario according to an embodiment of the present application;

[0059] FIG18 is a schematic diagram showing background data in an automatic video switching scenario according to an embodiment of the present application;

[0060] Figure 19a shows a schematic diagram of an interface of a mobile phone according to an embodiment of the present application;

[0061] FIG19 b shows a schematic diagram of the interface of a mobile phone settings application according to an embodiment of the present application;

[0062] FIG20 shows a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application;

[0063] FIG21 shows a schematic diagram of a software layered structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0064] Various aspects of the illustrative embodiments will be described below using terms commonly employed by those skilled in the art.

[0065] The present application provides a method for reducing device power consumption, an electronic device, and a medium thereof. The following will use terms commonly used by those skilled in the art to describe various aspects of the illustrative embodiments. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A or B exists at the same time, and B exists alone. In addition, in the description of the implementation of the present application, "multiple" refers to two or more than two.

[0066] In the following, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the technical features indicated. Therefore, a feature designated "first," "second," or "third" may explicitly or implicitly include one or more of such features.

[0067] The methods for reducing device disclosure provided in the various embodiments of this application can be applied to terminal devices such as mobile phones, tablet computers, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). The embodiments of this application do not impose any restrictions on the specific types of terminal devices. For ease of explanation, the following uses a mobile phone as an example.

[0068] As mentioned above, many users are accustomed to watching TV programs such as In this case, if the user does not actively turn off the screen, the video in the video application will continue to play in a loop or until the live broadcast stops. During this period, terminal devices such as mobile phones will continue to consume power until they are shut down due to insufficient power.

[0069] Moreover, when mobile phones and other terminal devices are placed in places with poor heat dissipation such as electric blankets, the above situation will cause the battery temperature of mobile phones and other terminal devices to rise too quickly, which in turn may cause abnormal conditions such as battery swelling and fire, affecting the service life of the mobile phone battery. In more serious cases, it may endanger the personal safety of users.

[0070] In order to solve the above problems, the present application provides a method for reducing device power consumption.

[0071] Considering that video playback scenarios are generally divided into video loop playback scenarios, video automatic switching scenarios and video live broadcast scenarios, in each video playback scenario, the situation that occurs after the user stops watching mobile videos (or the user has not used the mobile phone for a long time) is different.

[0072] For example, in some implementations, in a video loop playback scenario, if the user has not used mobile phone 01 for a long time, mobile phone 01 will automatically loop the current video. For example, as shown in Figure 1a, the interface 10 of mobile phone 01 is playing video 11, and the progress bar of video 11 starts at time T1. As shown in Figure 1b, video 11 is played (its progress bar reaches time T2), and mobile phone 01 repeats playing video 11. That is, as shown in Figure 1c, video 11 enters the next playback (its progress bar starts playing again at time T1).

[0073] In some implementations, for automatic video switching, if the user has not used mobile phone 01 for a long time, the automatic video switching scenario will automatically play the next video after the current video is played. For example, as shown in Figure 2a, after video 11 on mobile phone 01 interface 10 ends, the playback progress bar of video 11 reaches time T1. After a preset interval (such as 3 seconds as shown in Figure 2b), as shown in Figure 2c, mobile phone 01 automatically plays the next video 12, and the playback progress bar of video 12 now starts at time T3.

[0074] In some implementations, for a live video broadcast scenario, if the user has not used the mobile phone 01 for a long time, then after the current live broadcast ends, the user will enter and remain in the live broadcast end state. For example, as shown in FIG3a, after the video 11 on the mobile phone 01 interface 10 ends, the progress bar of the video 11 reaches time T1. Subsequently, as shown in FIG3b, the interface 10 is displayed as the live broadcast end interface, and specifically displays the cumulative number of views of the live video (e.g., "Cumulative number of views 60,000+") and the live broadcast status (e.g., "This live broadcast has ended").

[0075] Based on this, the method of the present application identifies the above-mentioned different video playback scenarios, and in different video playback scenarios, determines whether the user is still watching the video in the current video playback scenario, and executes a method to reduce device power consumption when it is determined that the user is no longer watching the video.

[0076] For example, when the mobile phone 01 determines that the user is in a sleeping state, the mobile phone 01 automatically turns off the screen or automatically switches to a power saving mode, etc. The method of the mobile phone 01 identifying different video playback scenarios and the specific method of reducing device power consumption will be described below.

[0077] Specifically, in the screen-on state, if mobile phone 01 determines that the current video playback scene is a video loop playback scene, mobile phone 01 continues to determine whether the number of video loop playbacks exceeds a first threshold value and / or whether the duration of the current video loop playback exceeds a first preset duration. If it is determined that the number of video loop playbacks exceeds the first threshold value and / or the duration of the current video loop playback exceeds the first preset duration, mobile phone 01 executes the method for reducing device power consumption. The first threshold value and the first preset duration are empirical values ​​or experimental values, and this application does not impose any restrictions on them.

[0078] If mobile phone 01 determines that the current video playback scenario is an automatic video switching scenario, mobile phone 01 continues to determine whether the number of automatic video switching exceeds a second threshold and / or whether the duration of mobile phone 01 playing the video exceeds a second preset duration. If it is determined that the number of automatic video switching exceeds the second threshold and / or the duration of mobile phone 01 playing the video exceeds the second preset duration, mobile phone 01 executes the method for reducing device power consumption. The second threshold and the second preset duration are empirical or experimental values ​​and are not limited in this application.

[0079] If mobile phone 01 determines that the video playback scenario is a live video broadcast scenario, mobile phone 01 further determines whether, after the live video broadcast ends, no user has performed the first preset operation for a period exceeding a third preset time. If it is determined that the period of time during which no user has performed the first preset operation exceeds the third preset time, a method for reducing device power consumption is executed. The third preset time is an empirical or experimental value and is not limited in this application.

[0080] In this way, it is possible to determine whether the user is still watching the video on mobile phone 01 based on the current video playback scenario, and if it is determined that the user is not watching the video on mobile phone 01, execute the method of reducing device power consumption to achieve the purpose of reducing the power consumption of mobile phone 01.

[0081] It is also understandable that when the user is not watching videos on Mobile Phone 01, timely controlling Mobile Phone 01 to reduce power consumption is also beneficial to the maintenance of Mobile Phone 01's battery, so that Mobile Phone 01's battery will not swell or catch fire due to rapid temperature rise, which is more beneficial to the user's personal safety.

[0082] To better understand the implementation process of this application, the following describes the process of mobile phone 01 implementing the solution of this application in conjunction with Figure 1. As shown in Figure 4, the method includes:

[0083] 401 , when the screen of the mobile phone 01 is on, determine whether the usage status of the mobile phone 01 meets a first preset condition.

[0084] It can be understood that the premise for identifying the video playback status in the above-mentioned various video playback scenarios is that the mobile phone 01 is in a bright screen state.

[0085] On this basis, in some implementations, mobile phone 01 can determine whether the user has not interacted with mobile phone 01 for a long time by judging whether the interaction status between mobile phone 01 and the user meets the corresponding conditions, so as to further determine whether to execute the method of reducing power consumption.

[0086] More specifically, it can be understood that, under normal circumstances, when a user is using the mobile phone 01, the mobile phone 01 will inevitably enter the screen-off state due to circumstances such as the user temporarily going out and locking the screen, so the mobile phone 01 will not be in the screen-on state for a long time. If the mobile phone 01 is in the screen-on state for a long time, it can be indicated that the user has not used the mobile phone 01 for a long time. Therefore, as shown in Figure 5, in some implementations, it can be determined whether the user has not interacted with the mobile phone 01 for a long time by judging whether the mobile phone 01 is in the screen-on state for a long time. More specifically, in some implementations, it can be determined whether the mobile phone 01 is in the screen-on state for a long time by judging whether the duration of the mobile phone 01 being in the screen-on state is greater than a fourth preset duration. If the duration of the mobile phone 01 being in the screen-on state is greater than the fourth preset duration, it is determined that the mobile phone 01 is in the screen-on state for a long time. Among them, the fourth preset duration is an empirical value or an experimental value, for example, it can be 10 minutes. This application does not impose any restrictions on this.

[0087] Similarly, it is understood that, generally, during the process of the user interacting with the mobile phone 01, the mobile phone 01 can frequently detect user operations. Therefore, if the mobile phone 01 does not detect any user operations for a long period of time, it can also be determined that the user has not used the mobile phone 01 for a long period of time. Therefore, as shown in FIG5 , in some implementations, the mobile phone 01 can also determine whether the user has not interacted with the mobile phone 01 for a long period of time by determining whether the duration during which the mobile phone 01 has not detected any user operations is greater than a fifth preset duration. If it is determined that the duration during which the mobile phone 01 has not detected any user operations is greater than the fifth preset duration, it is determined that the user has not interacted with the mobile phone 01 for a long period of time. The fifth preset duration is an empirical value or an experimental value, for example, it can be 15 minutes, and this application does not impose any limitation thereto.

[0088] It can be understood that in some implementations, the interaction between the user and the mobile phone 01 includes but is not limited to interactive behaviors such as the user touching the screen of the mobile phone 01 and the user inputting voice commands to the mobile phone 01. Among them, in some implementations, the mobile phone 01 can detect whether the user has interacted with the mobile phone 01 through the terminal interaction detection method. Specifically, the mobile phone 01 can determine whether a touch event such as touch, click, and long press is detected through the event input module InputEvent of the application framework layer of the mobile phone 01 to determine whether the user has interacted with the mobile phone 01. In some implementations, the mobile phone 01 can detect the voice interaction between the user and the terminal through the mobile phone 01 voice recognition engine. It should be understood that the method of detecting the interactive behavior between the user and the mobile phone 01 is a technical means well known to those skilled in the art, and this application does not limit this.

[0089] It is understood that as long as the usage status of mobile phone 01 meets one of the above conditions, it can be determined that the user has not used mobile phone 01 for a long time. It is also understood that in some implementations, the above two conditions can be combined to determine whether the user has not used mobile phone 01 for a long time. That is, if it is detected that the screen of mobile phone 01 is in the on state for a long time and the user has not interacted with mobile phone 01 for a long time, it is determined that the user has not used mobile phone 01 for a long time.

[0090] It is understandable that there is a scenario where the user watches a video on the mobile phone 01 but does not interact with the mobile phone 01. In this case, since the mobile phone 01 is generally not in an absolutely static state, in other implementations, as shown in FIG6 , the mobile phone 01 can also determine whether the user is using the mobile phone 01 by judging whether the motion state of the mobile phone 01 meets the corresponding conditions.

[0091] For example, various sensors in mobile phone 01, such as a gyroscope and an accelerometer, can be used to collect motion data from mobile phone 01 to determine whether mobile phone 01 is in an absolutely stationary state. If the duration of time that mobile phone 01 remains in an absolutely stationary state exceeds a sixth preset time duration, it indicates that the user is not using mobile phone 01. The sixth preset time duration is an empirical or experimental value and is not limited in this application. Furthermore, determining whether mobile phone 01 is in an absolutely stationary state based on sensor data from mobile phone 01 is a technical means known to those skilled in the art and is not limited in this application.

[0092] In other implementations, mobile phone 01 can determine whether the user is using mobile phone 01 by determining whether the user is in a sleeping state. It is understandable that users generally enter a sleeping state for a long time in fixed places, such as homes or hotels. Therefore, in some implementations, mobile phone 01 can further determine whether mobile phone 01 is within a preset geographic fence based on the positioning function of mobile phone 01. When it is determined that mobile phone 01 is within the preset geographic fence, it continues to determine whether the user is in a sleeping state. If it is determined that the user is in a sleeping state, it indicates that the user is not using mobile phone 01. Among them, in some implementations, the positioning function of mobile phone 01 can be that mobile phone 01 uses its own LinkTurbo service to achieve the positioning function, or mobile phone 01 uses a third-party platform (such as a global positioning system, etc.) to achieve the positioning function. This application does not impose any restrictions on this.

[0093] In some implementations, the mobile phone 01 can also use smart wearable devices such as smart bracelets, smart watches, smart rings, etc. worn by the user to obtain the user's heart rate data, blood pressure data, pulse data and other physiological data, and then determine whether the user is in a sleep state based on these physiological data, so as to improve the accuracy of the detection of the usage status of the mobile phone 01 in the method of this application.

[0094] Taking the detection data of a smart watch as an example, when the smart watch detects that the user is in motion, for example, the number of steps of the user is increasing, it can be determined that the user is not in an absolutely static state, and then it can be determined that the user is not sleeping. It can be understood that the communication connection between smart wearable devices such as smart bracelets and mobile phone 01 can be carried out through wireless transmission methods such as Bluetooth and wireless network, and in the specific judgment process, the smart wearable device can send the user's physiological data to mobile phone 01, and mobile phone 01 can judge whether the user is in a sleeping state based on the user's physiological data. The smart wearable device can also judge whether the user is in a sleeping state based on the user's physiological data, and then send the judgment result to mobile phone 01. This application does not impose any restrictions on this.

[0095] In some implementations, before using a smart wearable device such as a smart watch to detect whether the user is in a sleep state, the mobile phone 01 may first perform a wearing detection on the smart wearable device such as a smart watch. If it is determined that the user is wearing a smart wearable device, the data of the smart wearable device such as the smart watch is used to determine whether the user is in a sleep state. In some implementations, if the detection data about the user by the smart wearable device such as the smart watch is empty, for example, the blood pressure and heart rate values ​​of the user measured by the smart watch are both 0, then it can also be determined that the user is not wearing the smart watch, and the smart watch is no longer used to determine whether the user is in a sleep state. Among them, the method of using a smart bracelet, smart watch, smart ring, etc. to determine whether the user is in a sleep state is a well-known means for those skilled in the art and is not introduced in this application.

[0096] 402. When it is determined that the usage status of the mobile phone 01 meets the first preset condition, the playback status of the current video is determined.

[0097] In some implementations, when it is determined that the user has not interacted with the mobile phone 01 for a long time, the playback status of the video currently played by the mobile phone 01 is further determined, and then based on the current playback status of the video on the mobile phone 01, it is determined whether to execute the method of reducing power consumption.

[0098] In addition, as mentioned above, video playback scenarios can be divided into three types: video loop playback scenario, video automatic switching scenario, and video live broadcast scenario. The corresponding playback status of each video is different when the user no longer watches the video.

[0099] Based on this, as mentioned above, in some implementations, the current video playback scene of mobile phone 01 can be determined. After determining the current video playback scene of mobile phone 01, the video playback status in the current video playback scene is determined to meet the second preset condition, thereby determining whether to execute the method for reducing power consumption. The method for determining the current video playback scene of mobile phone 01 will be described below.

[0100] Specifically, as shown in FIG7 , in some implementations, mobile phone 01 determines that the current video playback scene is a loop playback scene, and upon detecting that the number of times the current video has been played exceeds a first threshold, determines that the current video playback state satisfies a second preset condition. The first threshold is an empirical or experimental value, and its value may be, for example, 10 times, which is not limited in this application.

[0101] In other implementations, mobile phone 01 determines that the current video playback scenario is a looped video playback scenario, and detects that the current video playback duration exceeds a first preset duration, and determines that the current video playback state meets a second preset condition. The first preset duration is an empirical or experimental value, and its value can be, for example, 10 minutes, which is not limited in this application.

[0102] In yet other implementations, the mobile phone 01 may also determine that the current video playback state satisfies the second preset condition when determining that the current video playback scenario is a video loop playback scenario and detecting that the current video playback duration exceeds a first preset duration and the number of loops of the current video exceeds a first threshold. This application is not limited to this. The method for determining the number of loop playbacks and the playback time of a video loop playback scenario will be described below.

[0103] Continuing with FIG. 7 , in some implementations, mobile phone 01 determines that the current video playback scene is an automatic video switching scene, and upon detecting that the number of video playback switching events exceeds a second threshold, determines that the current video playback state meets a second preset condition. The second threshold is an empirical or experimental value, and may be, for example, 5 times.

[0104] In some implementations, the mobile phone 01 determines that the current video playback scene is an automatic video switching scene, and detects that the video playback time exceeds a second preset duration, and determines that the current video playback state meets the second preset condition.

[0105] In some implementations, mobile phone 01 may also determine that the current video playback state meets the second preset condition if it determines that the current video playback scene is an automatic video switching scene, and detects that the current video playback duration exceeds a second preset duration and the number of switching times exceeds a second threshold. This application is not limited to this. The method for determining the number of switching times and playback time in the automatic video switching scene will be described below.

[0106] Continuing with FIG. 7 , in yet other implementations, if mobile phone 01 determines that the current video playback scene is a live video scene, detects that the live video scene has ended, and detects no user operation for a duration exceeding a third preset duration after the live video scene has ended, then it is determined that the current video playback state of mobile phone 01 meets the second preset condition. The third preset duration is an empirical or experimental value, such as 5 minutes, and this application does not impose any limitation thereto. The method for determining the end of a live video scene will be described below.

[0107] In some implementations, it is also possible to determine whether the video playback status of mobile phone 01 meets the second preset condition based on the current battery usage of mobile phone 01. Specifically, as shown in Figure 8, if it is detected that the current battery level of mobile phone 01 is lower than the first power threshold, then it is determined that the video playback status of mobile phone 01 meets the second preset condition. For another example, if it is detected that the battery temperature of mobile phone 01 is higher than the first temperature threshold for a period exceeding a seventh preset time, indicating that the battery temperature of mobile phone 01 is in a state of continuous increase, then it can also be determined that the video playback status of mobile phone 01 meets the second preset condition. This application does not impose any restrictions on this.

[0108] In some implementations, the usage status of the battery of mobile phone 01 can be obtained by mobile phone 01 based on the power monitoring function and temperature monitoring function of its battery management module. It can be understood that the method for mobile phone 01 to obtain the usage status of the battery of mobile phone 01 is a means well known to technical personnel in this field, and this application does not impose any restrictions on this.

[0109] It should be understood that the above-mentioned methods of determining whether the current video playback status of the mobile phone 01 meets the second preset condition can be implemented independently or in combination, and this application does not impose any restrictions on this.

[0110] It is also understood that in some implementations, priorities can be set for each judgment method. If the judgment method with the highest priority is met, the current video playback status of mobile phone 01 is determined to meet the second preset condition. If the judgment method with the highest priority is not met, the judgment conditions corresponding to the other priority levels are sequentially determined. This application does not impose any restrictions on the priority of each judgment condition. For example, if the battery of mobile phone 01 is low or the battery temperature of mobile phone 01 continues to rise, it will affect the usage time of mobile phone 01 and even, as mentioned above, the service life of mobile phone 01's battery. Therefore, the priority of determining whether the video playback status of mobile phone 01 meets the second preset condition based on the current battery usage of mobile phone 01 can be set to the highest priority. If it is detected that the battery level of mobile phone 01 is lower than the first power threshold or the battery temperature of mobile phone 01 is higher than the first temperature threshold for more than the seventh preset time, it can be determined that mobile phone 01 meets the second preset condition. Otherwise, the current video playback status of mobile phone 01 is determined to meet the second preset condition based on the other judgment conditions. The first power threshold is an empirical or experimental value, for example, it can be 5%. The first temperature threshold is also an empirical or experimental value, for example, it can be 35°C. The seventh preset time length is also an empirical value or an experimental value, for example, the value may be 30 minutes.

[0111] In some implementations, the values ​​of the various thresholds involved in the aforementioned methods for determining whether the current video playback status of mobile phone 01 meets the second preset condition can also be set based on the current battery usage of mobile phone 01. For example, if the battery level of mobile phone 01 is higher than the first power threshold but lower than the second power threshold, then the values ​​of the aforementioned thresholds can be reduced, for example, the first threshold can be reduced from 10 to 5. The second power threshold is an empirical or experimental value, for example, it can be 15%. For another example, if the battery temperature of mobile phone 01 is lower than the first temperature threshold but higher than the second temperature threshold, then the values ​​of the aforementioned thresholds can also be reduced, for example, the second threshold can be reduced from 7 to 3. The second temperature threshold is also an empirical or experimental value, for example, it can be 30°C. This application does not impose any restrictions on this. It is understood that the reduction in the aforementioned first and second thresholds is exemplary and does not constitute any limitation to this application. In other implementations, other thresholds can also be reduced by other amounts, and this application does not impose any restrictions on this.

[0112] 403 , when the current video playback state meets the second preset condition, the mobile phone 01 executes a method for reducing power consumption.

[0113] That is, mobile phone 01 determines that in the above-mentioned different video playback scenarios, the playback status of the video played by mobile phone 01 meets the second preset condition, and mobile phone 01 executes the method of reducing power consumption to reduce the power consumption of mobile phone 01. Furthermore, to avoid the phenomenon of bulging, heating, etc. of mobile phone 01 battery when mobile phone 01 is placed in unsafe places such as electric blanket, thereby increasing the service life of the battery of mobile phone 01, improving user experience, and ensuring user personal safety.

[0114] In some implementations, as shown in FIG9 , the method for reducing power consumption includes keeping the screen of the mobile phone 01 on, but taking power consumption limiting measures in the background of the mobile phone 01 to reduce power consumption of the mobile phone 01 and battery heating.

[0115] Specifically, in some implementations, mobile phone 01 can limit the working performance of the central unit processor (CPU) of mobile phone 01. For example, the operating frequency of the CPU can be limited (for example, the CPU operating frequency can be limited from 3.4 GHz to 2 GHz), or several cores such as large cores / super large cores can be forcibly shut down to reduce the power consumption of mobile phone 01. For example, assuming that the mobile phone 01 CPU has 8 cores (including 4 large cores and 4 small cores), then when reducing the power consumption of mobile phone 01 device, 4 of the large cores can be shut down to reduce the power consumption of mobile phone 01. In other implementations, mobile phone 01 can reduce the frame rate and resolution of the video currently playing on mobile phone 01 (such as the above-mentioned video loop playback scene or video automatic switching scene) or reduce the current brightness of the mobile phone 01 screen, etc., to reduce the power consumption of mobile phone 01.

[0116] For example, the frame rate of the video currently being played on the mobile phone 01 (such as the aforementioned video loop playback scenario or video automatic switching scenario) is reduced from 240 frames per second (FPS) to 60FPS. Alternatively, the resolution of the currently playing video is reduced from 1080p (progressive scanning) to 720p (progressive scanning).

[0117] In some implementations, the mobile phone 01 may also suspend some or all of the currently running background applications, for example, suspending the updating of all or some of the background applications.

[0118] In some implementations, the mobile phone 01 can turn off the sound effect algorithm for the video currently being played by the mobile phone 01. For example, the mobile phone 01 can turn off the sound effect algorithm used during video playback. Sound effects, three-dimensional surround sound and other sound effect algorithms.

[0119] In some implementations, the mobile phone 01 may disable a display effect algorithm for the video currently being played by the mobile phone 01. For example, the definition algorithm used during video playback may be disabled.

[0120] In some implementations, when detecting that the mobile phone 01 is in a charging state, the mobile phone 01 may further limit the maximum charging current of the mobile phone 01 to reduce heating of the battery of the mobile phone 01. For example, the mobile phone 01 may reduce the charging current of the mobile phone 01 from 400 mA to 200 mA.

[0121] In some implementations, the mobile phone 01 may also turn off the 5G signal. In some implementations, the mobile phone 01 switches the positioning mode to a mode that consumes less power. For example, the mobile phone 01 switches from the global positioning system (GPS) mode to the network positioning mode.

[0122] In other implementations, as shown in FIG10 , the method for reducing power consumption includes: 1001, mobile phone 01 prompts the user that mobile phone 01 enters the screen-off countdown; 1002, detecting with mobile phone 01 whether the user performs a preset operation during the screen-off countdown. If the user is detected to have performed a preset operation during the above-mentioned screen-off countdown, 1003 is executed, that is, mobile phone 01 controls mobile phone 01 to turn off the screen. If the user is not detected to have performed a preset operation during the above-mentioned screen-off countdown, mobile phone 01 maintains the screen on. Among them, detecting that the user has performed a preset operation includes detecting that the user has clicked the screen, long pressed the screen, and other gesture operations, or the user has made a preset voice command. This application does not impose any restrictions on this.

[0123] For example, as shown in FIG11a , mobile phone 01 is currently in a live video broadcast scene, and as shown in FIG11b , mobile phone 01 detects that video 11 has been in a live broadcast end state for more than a third preset time length. Then, as shown in FIG11c , interface 10 of mobile phone 01 displays a screen-off countdown prompt box 101 , and prompts the user that “your operation has not been detected for a long time, and this device will automatically turn off the screen in 1 minute”, and displays a countdown time prompt 1012.

[0124] If the user clicks the cancel button 1011 within 1 minute, the mobile phone 01 enters the screen-off state as shown in Figure 11d. If the user clicks the cancel button 1011 within 1 minute, the mobile phone 01 maintains the screen-on state as shown in Figure 11e.

[0125] It is understandable that in some implementations, when it is determined that the user has not used the mobile phone 01 for a long time, the method of reducing power consumption may also be executed, that is, the above 402 may not be executed.

[0126] It can be understood that the present application aims to reduce the power consumption of mobile phone 01 when it is determined that the user has not operated the mobile phone 01 for a long time, to avoid phenomena such as heating and swelling of the battery when the mobile phone 01 is placed in an unsafe place, and to avoid phenomena that endanger the user's personal safety. Moreover, since the user's operations on the mobile phone 01 are intermittent rather than continuous, in some implementations, even if it is determined that the usage status of the mobile phone 01 meets the above-mentioned first preset condition for a certain period of time, and the current video playback status of the mobile phone 01 meets the above-mentioned second preset condition for a certain period of time, as long as the user performs the second preset operation on the mobile phone 01 before the mobile phone 01 executes the method for reducing power consumption, or while the mobile phone 01 is already executing the method for reducing power consumption, it can be determined that the user is still using the mobile phone 01, and the method for reducing the power consumption of the mobile phone 01 will not be executed. Among them, the second preset operation includes but is not limited to the user pressing the volume button on the side of the mobile phone 01 to adjust the volume, the user clicking, double-clicking, triple-clicking or long pressing the screen, etc.

[0127] For example, when it is determined that the duration of mobile phone 01 being in the screen-on state exceeds 10 minutes, and no user operation is detected for more than 15 minutes since the determination that mobile phone 01 is in the screen-on state, it is determined that the usage status of mobile phone 01 meets the above-mentioned first preset condition. In addition, when it is determined that mobile phone 01 meets the above-mentioned first preset condition, it is detected that the video playback scene of mobile phone 01 is a video loop playback scene, and it is detected that the number of loops of the current video exceeds 10 times, it is determined that the current video playback state of mobile phone 01 meets the second preset condition, but then it is detected that the user double-clicks the screen of mobile phone 01. In this case, mobile phone 01 does not execute the power reduction method, or if mobile phone 01 is already executing the power reduction method, then mobile phone 01 stops executing the power reduction method. In some implementations, if the user's second preset operation meets the corresponding trigger condition, then mobile phone 01 executes the function corresponding to the trigger condition. For example, if the second preset operation performed by the user is to adjust the volume of mobile phone 01, then mobile phone 01 adjusts its own volume. This application does not impose any restrictions on this.

[0128] The following describes the method for determining the various video playback scenarios of the present application, with reference to the accompanying drawings. Generally, mobile phone 01 can obtain information about the currently playing video through the video decoder in its application framework layer, and then determine the video type of the current video to determine the current video playback scenario of mobile phone 01. Because this process involves the interaction between various software modules within mobile phone 01, before introducing the method for determining the various video playback scenarios of the present application, we first introduce the software structure framework of mobile phone 01 involved in the present application.

[0129] Specifically, Figure 12 shows a software layered architecture diagram of a mobile phone 01. As shown in Figure 12, the layered architecture divides the software structure of the terminal device 01 into an application layer 010 and an application framework layer 020 from top to bottom.

[0130] The application layer 010 may include a series of application packages. In some implementations of the present application, the application layer 010 mainly includes application 011, which refers to various applications installed on the desktop of the mobile phone 01. For example, various video applications for playing videos are included, which are not limited in the present application.

[0131] In some implementations, the application layer 010 may also include system programs. The system program refers to a system program for managing various applications on the mobile phone 01, which controls and coordinates the mobile phone 01 and its external devices (such as input and output devices) and supports the development and operation of applications on the mobile phone 01. In some implementations, the system program may be an operating system installed on the mobile phone 01, such as operating system, Operating system, etc. This application does not impose any restrictions on this.

[0132] The application framework layer 020 of mobile phone 01 provides an application programming interface (API) and programming framework for applications in application layer 010. Application framework layer 020 includes some predefined methods. Application framework layer 020 may include a multimedia framework layer 021. Furthermore, multimedia framework layer 021 includes an activity management service (AMS) 0211, a layer display control module (e.g., Surface Flinger) 0212, a video decoder 0213, and a video player 0214.

[0133] In some implementations of the present application, the AMS 0211 is configured to, upon detecting that an application has been launched, create a process corresponding to the application. For example, upon detecting that a video application has been launched, the AMS 0211 creates a process corresponding to the video application. More specifically, the AMS 0211 creates a video playback process corresponding to the video application.

[0134] In some implementations of this application, when creating the video playback process corresponding to the video application, AMS 0211 will also create a video identifier to indicate whether the video belongs to a live video scene or a looped video scene. The video identifier can be in the form of letters, numbers, etc., and this application does not impose any restrictions on this.

[0135] In some implementations of the present application, after AMS 0211 completes creation of an application process, it sends a message to application 011 indicating successful process creation. For example, taking a video application as an example, after AMS 0211 completes creation of the video application process, it sends a message to the video application indicating successful creation of the video playback process. In some implementations, the successful creation message includes at least information indicating the video type corresponding to the process and the application to which the video belongs (e.g., an application identifier).

[0136] In some implementations, SurfaceFlinger 0212 is used to create layers, merge layers, and display layers. In the implementation of the present application, after AMS 0211 completes process creation, application 011 sends a layer creation instruction to SurfaceFlinger 0212. SurfaceFlinger 0212 creates a layer corresponding to the application based on the instruction, and displays the corresponding graphical interface of the application, such as a video playback interface.

[0137] In some implementations of the present application, the application 011 sends a layer creation instruction to SurfaceFlinger 0212, which at least instructs SurfaceFlinger 0212 to create a layer corresponding to the video identifier. For example, as shown in FIG13a, for live video, the name of the live video layer created by SurfaceFlinger 0212 is: "com.ss.android.ugc.aweme / com.ss.android.ugc.aweme.live.LivePlayerActivity#0" contains the live keyword "live". For another example, as shown in FIG13b, for non-live video, the name of the live video layer created by SurfaceFlinger 0212 is: "com.ss.android.ugc.aweme / com.ss.android.ugc.aweme.splash.SplashActivity#0" contains the "splash" keyword.

[0138] Therefore, it can be understood that in some implementations, the identification of live video scenes can also be achieved by utilizing image recognition methods (such as artificial intelligence recognition methods) to detect whether the name of the layer corresponding to the current video contains the keyword identifying the live video (for example, "live"). If it is determined that the name of the layer corresponding to the current video contains the keyword identifying the live video "live", it can be determined that the current video is a live video.

[0139] Similarly, after SurfaceFlinger 0212 completes the creation of the layer, it will also send information that the layer was created successfully to the application 011.

[0140] In some implementations of the present application, the video application will also send the video stream data corresponding to the video to be played to the video decoder (MediaCodec) 0213. After MediaCodec 0213 decodes the video according to the video stream data, it sends the decoded video stream data to the video player (MediaPlayer) 0214. MediaPlayer 0214 then sends an instruction to refresh the layer corresponding to the video application to SurfaceFlinger 0212 to play the video.

[0141] More specifically, after MediaCodec 0213 receives the video sent by the video application, it generates an identifier (ID) of the MediaCodec object for the video and calls the start() method under MediaCodec to decode the video.

[0142] Moreover, in some implementations, for the video loop playback scenario, since no new video is played, MediaCodec 0213 calls the flush() method each time it plays the video loop playback scenario to refresh the corresponding video playback interface.

[0143] In other implementations, for the automatic video switching scenario, since it involves the playback of new videos, it can be understood that MediaCodec 0213 generates a corresponding MediaCodec ID for each new video received, and calls start() under MediaCodec to decode the video. After the video is played, the end() method under MediaCodec is called to end the decoding and playback of the current video.

[0144] Among them, it should be noted that for the live video scenario, MediaCodec 0213 will also generate a MediaCodec ID for the live video scenario, and call start() under MediaCodec to decode the video. After the video is played, the end() method under MediaCodec is called to end the decoding and playback of the current video.

[0145] However, since the video live broadcast scenario in this application refers to a video live broadcast scenario that does not support loop playback and automatic switching, the video live broadcast scenario that supports loop playback or automatic switching should be classified as a video loop playback scenario or automatic switching live broadcast in this application, and will not be repeated below.

[0146] It is understood that the above-mentioned schematic diagram of the layered architecture of the software structure of mobile phone 01 is merely exemplary. In other implementations, the layered architecture of the software structure of mobile phone 01 may further include more or fewer layers, or a layered structure formed in other ways. For example, in some implementations, mobile phone 01 may further include a kernel layer, a physical layer (PHY), etc. It is understood that this application does not limit this.

[0147] The following describes the interaction process between the various software modules of the mobile phone 01 in conjunction with Figure 14. For the same content as in Figure 12 above, please refer to the relevant description above and will not be repeated here. As shown in Figure 14, the process includes:

[0148] 1401. The video application, in response to a video application launch instruction, sends video application launch information to the task management module 0211. In some implementations, the video application launch instruction may be generated when the mobile phone 01 detects that the user has performed a preset launch operation for the video application. The preset launch operation includes, but is not limited to, a preset gesture such as a click or long press by the user, or a user invoking the video application via a voice command.

[0149] 1402, the task management module 0211 creates a process corresponding to the video application. It can be understood that, as mentioned above, for each application that is started, the task management module 0211 will create a corresponding process.

[0150] 1403. The task management module 0211 sends a process creation completion message to the video application.

[0151] 1404. The video application sends an instruction to the layer display control module 0212 to create a layer corresponding to the video application.

[0152] 1405. The layer display control module 0212 creates an interface corresponding to the video application and displays it.

[0153] 1406. The layer display control module 0212 sends information to the video application indicating that the interface corresponding to the video application has been successfully displayed.

[0154] It is understandable that for video applications, generally, after starting the video application, the video will not be played directly. Instead, it is necessary to determine whether to play the video or implement other functions other than playing the video (such as membership recharge, etc.) based on further instructions from the user. Therefore, the above 1401 to 1406 are to establish the corresponding interface after starting the video application and prepare for subsequent video playback. The following describes the interaction process between the various software modules of mobile phone 01 during video playback. Among them, the same content as the above 1401 to 1406 can be referred to the relevant description above and will not be repeated here.

[0155] 1407 , the video application sends an instruction to create a layer corresponding to the video playback interface to the layer display control module 0212 in response to the video playback instruction to play the video.

[0156] In some implementations, the video playback instruction may be generated when the mobile phone 01 detects that the user has performed a preset playback operation for a particular video. Preset playback operations include, but are not limited to, a user performing a preset click or long press gesture, or the user controlling video playback via voice commands. This application does not impose any restrictions on this.

[0157] In some implementations, the instruction sent to the layer display control module 0212 to create a layer corresponding to the video playback interface includes at least information for indicating the video type, so that when the layer display control module 0212 establishes a layer corresponding to the video playback interface for the video, it can establish an identifier corresponding to the video type for the layer.

[0158] 1408. The layer display control module 0212 creates a layer corresponding to the video playback interface and displays it.

[0159] In some implementations, the layer display control module 0212 creates a corresponding layer for the video according to the layer creation instruction, and simultaneously adds an identifier corresponding to the video type to the layer. In some implementations, the identifier corresponding to the video type can be a letter, number, etc. indicating the video type, and this application does not impose any limitation on this.

[0160] 1409. The layer display control module 0212 sends a message to the video application indicating that the video playback interface is successfully displayed.

[0161] 1410. The video application sends the video stream data corresponding to the current video to MediaCodec 0213.

[0162] It is understandable that in order to reduce the data flow resources occupied by video stream data during network transmission, the video stream data during network transmission is generally compressed video stream data after encoding and compression processing. Therefore, when the mobile phone 01 plays the video, the compressed video stream data needs to be decoded and decompressed. In the implementation of this application, the mobile phone 01 decodes the compressed video stream data corresponding to the current video through MediaCodec 0212. Among them, decoding the video stream data is a technical means known to those skilled in the art, and this application does not impose any restrictions on this.

[0163] 1411, MediaCodec 0213 decodes the video stream data.

[0164] As mentioned above, in some implementations, after receiving the video stream data corresponding to the current video, MediaCodec 0213 establishes a MediaCodec ID for the current video and calls the start() method to decode the video.

[0165] 1412 , MediaCodec 0213 sends the decoded video stream data to MediaPlayer 0214 .

[0166] 1413, MediaPlayer 0214 receives the decoded video stream data and sends an instruction to refresh the video playback interface to the layer display control module 0212.

[0167] It can be understood that during video playback, video decoding is ongoing. Therefore, MediaPlayer 0214 needs to send the decoded video data to the layer display control module 0212 in real time for display, so as to update the layer corresponding to the above-mentioned video playback interface and realize video playback.

[0168] The above 1407 to 1413 is the interaction process between the various software modules of the mobile phone 01 during the video playback process. It can be understood that, as mentioned above, when MediaCodec 0213 calls the stop() method to end the decoding of the current video stream data, it indicates that the current video playback is over. In addition, for the video loop playback scenario, MediaCodec 0213 can call the flush() method to reuse the first decoding result, and the loop playback does not require re-decoding, and then send the decoded video data to MediaPlayer 0214. MediaPlayer 0214 sends the received decoded video stream data to the layer display control module 0212, and the display control module 0212 refreshes the video playback interface according to the received decoded video stream data.

[0169] The method for determining the number of loop playback times and the duration of the loop playback scene of a video will be described below with reference to the accompanying drawings.

[0170] It can be understood that for the video loop playback scenario, since the video played each time is the same video, it is possible to determine whether the current video playback scenario is a video loop playback scenario by judging whether the video content is the same within a certain period of time.

[0171] Specifically, in some implementations, when the mobile phone 01 starts playing a video (that is, when MediaCodec 0213 calls the start() method to start decoding), the mobile phone 01 is screenshotted to obtain a first image including the content of the currently playing video. Then, the mobile phone 01 determines the first duration of the currently playing video, and after an interval of the first duration, the mobile phone 01 is screenshotted again to obtain a second image including the content of the currently playing video. The similarity between the first image and the second image is then compared. If the similarity between the two is greater than the first similarity threshold, it indicates that the first image is the same as the second image, that is, the mobile phone 01 is in a video loop playback scenario. Among them, the similarity between images can be the vector Euclidean distance, Hamming distance, etc. between image vectors representing image features. And the method of comparing the similarity between images is a means well known to those skilled in the art, and this application does not limit this. The first similarity threshold is an empirical value or an experimental value, for example, it can be 95%, and this application does not limit this.

[0172] Mobile phone 01 may determine the first duration of the currently playing video by taking screenshots of the currently playing video at intervals of a second duration, and then determining the duration of the current video based on the length of the video playback progress bar in the images obtained from the two screenshots. The second duration is an empirical or experimental value, for example, 5 seconds, and this application does not impose any limitation thereto.

[0173] For example, assuming that the image obtained by the mobile phone 01 for the first screenshot of the currently playing video is Figure 15a, and after an interval of 5 seconds, the image obtained by the screenshot of the currently playing video is Figure 15b, then the comparison of the video playback progress bar in the two images can be shown in Figure 15c, that is, after 5 seconds, the video playback progress bar moves from T4 to T5 (the moving distance is X = 2 cm). As can be seen from Figure 15c, the total length of the progress bar of the current video playback is S = 5 cm. Therefore, it can be known that the total duration of the current video is T = (S / X)*5 = (5 / 2)*5 = 12.5 seconds. Among them, in some implementations, the mobile phone 01 can determine the distance the video playback progress bar moves by the distance moved by the small dot P on the video playback progress bar (for example, as shown in Figure 15c). This application is not limited to this.

[0174] In other implementations, the currently playing video may not have a video playback progress bar or the video playback progress bar may be blocked. In this case, the current video playback duration can be defaulted to the third duration, and then based on the third duration, two screenshot operations are performed on the current video to obtain images representing the current video content. The similarity of these images is compared using the above method to determine whether the mobile phone 01 is in a video loop playback state. Wherein, the third duration is an empirical value or an experimental value, for example, its value can be 30 seconds or 10 minutes, and this application does not limit this. In some implementations, the current video content at least includes subtitles, portraits, etc. of the current video, and this application does not limit this.

[0175] Alternatively, in the case where the video playback progress bar is blocked, for example, as shown in Figure 16, the video playback progress bar is blocked by the comment area interface 102 evoked by the user, then at this time, the mobile phone 01 can take a screenshot of the current interface 10 to obtain a third image, and then take a screenshot of the current interface 10 every fourth time interval, and compare the similarity between the image obtained after each screenshot and the third image. If the similarity between a certain image and the third image is greater than the second similarity threshold, it indicates that the mobile phone 01 is in a video loop playback scenario.

[0176] It is understood that in the above-mentioned image recognition method, the similarity between images can also be determined by using the intelligent recognition function integrated in the mobile phone 01 or by calling the intelligent recognition service (such as Accessibility Service) provided by a third-party platform. Specifically, the mobile phone 01 can use the intelligent recognition in the intelligent recognition function to extract the text content in the acquired image, and then determine whether the two images are similar by comparing the similarity of the text content in the two images, and then determine whether the current video is a looped video, that is, whether the mobile phone 01 is in a video loop playback scenario. This application does not impose any restrictions on this.

[0177] In addition, in other implementations, as mentioned above, for the video loop playback scenario, since no new video is involved, MediaCodec 0213 will only call the flush() method to refresh the video playback interface and repeatedly play the video.

[0178] Therefore, mobile phone 01 can judge the number of times and time of playback of the video loop playback scene by the number of times and time interval of the flush() method called by MediaCodec 0213. Specifically, as shown in Figure 17, mobile phone 01 can obtain the information of flush() called by MediaCodec 0213, which includes the time information of calling flush() (such as timestamp t1 in Figure 15) and the number of times. It can be understood that the number of times the video loop playback scene is played is the number of times flush() is called, and the playback duration of the video loop playback scene is the difference between the time when flush() is called for the first time and the time when the flush() method is currently called. For example, as shown in Figure 17, the time for calling the flush() method for the first time is: 11:41:27:714, and the time for calling the flush() method for the third time is: 11:43:10:145, then the time used for the video loop playback three times should be (11:43:10:145-11:41:27:714).

[0179] The following describes the method for determining the number and time of playback of the automatic video switching scene with reference to the accompanying drawings.

[0180] Similar to the above determination of the number of plays in the video loop playback scenario, when mobile phone 01 plays the current video, MediaCodec0213 will call the start() method to decode the current video stream data and play the current video. However, unlike the video loop playback scenario, since the video automatic switching scenario involves the playback of a new video, MediaCodec 0213 will call the stop() method to stop decoding the current video when the current video ends. Then, when the next video (new video) sent by the video application is received, the start() method is called again to decode the current video stream data and play the current video. When the video ends, the stop() method is called to stop decoding the current video.

[0181] Therefore, the mobile phone 01 can determine the number of times and time the video is automatically switched by the number of times MediaCodec 0213 calls a group of start() and stop() methods and the time interval between each group. Specifically, as shown in Figure 18, the mobile phone 01 can obtain the information of the start() method called by MediaCodec 0213 when playing the current video, as well as the information of the stop() method corresponding to the start() method, which includes the time information of calling start() (such as timestamp t2 in Figure 18) and the time information of calling stop() method (such as timestamp t3 in Figure 18). It can be understood that the number of times the video loop playback scene is played is the number of times the start() method (or stop()) is called, and the video playback duration is the difference between the time when the first start() method is called and the time when the start() method is currently called. For example, as shown in Figure 18, the time when the start() method is called for the first time is: 15:03:09:768, and the time when the start() method is called for the second time is: 15:03:24:206, then the video playback duration should be (15:03:24:206-15:03:09:768).

[0182] The method for determining the end of a live video broadcast scenario is described below with reference to the accompanying drawings.

[0183] It can be understood that for any video, the MediaCodec 0213 of the mobile phone 01 will call the start() method to decode the video stream data and play the video. And when the video playback ends, the stop() method is called to stop decoding the current video. Different from the video loop playback scene and the video automatic switching scene, the end of the video live scene does not involve video loop playback or automatic switching. Therefore, in some implementations, when it is determined that the current video is a video live scene, the current video live scene can be determined to end the live broadcast when MediaCodec 0213 calls the stop() method.

[0184] It is understood that in some cases, after the live video broadcast ends, mobile phone 01 will automatically play the advertisement video in a loop or automatically play different advertisement videos continuously. In this case, since the principles of video playback are the same, mobile phone 01 can still use the above-mentioned methods for determining video loop playback scenarios and video automatic switching scenarios to determine whether mobile phone 01 is playing the advertisement video in a loop or playing different advertisement videos continuously. This application does not impose any restrictions on this.

[0185] It can be understood that due to the live video scene, a message prompting the end of the live broadcast will generally be displayed after the live broadcast ends. For example, as shown in Figure 3b, after the live broadcast of the video live scene 11 ends, the interface 10 of the mobile phone 01 displays a message prompting the user that "this live broadcast has ended, and the cumulative number of viewers is 60,000+". Therefore, in some implementations, the mobile phone 01 can also take screenshots at preset time intervals, obtain the image of the current interface of the mobile phone 01, and then identify the text of the current interface image of the mobile phone 01, determine whether the text of the current interface image includes preset keywords, and determine that the video live scene ends the live broadcast when it is determined that the text of the interface image includes preset keywords. Among them, the preset keywords include but are not limited to keywords indicating the end of the live broadcast (such as "this live broadcast ends"). This application does not impose any restrictions on this.

[0186] It is understood that, for a live video broadcast scenario, the magnitude of the uplink and downlink data traffic of mobile phone 01 will be different before and after the live broadcast ends. Generally, during the live broadcast, the downlink data traffic of mobile phone 01 will be greater than the downlink data traffic of mobile phone 01 after the live broadcast ends. For example, during the live broadcast, the downlink data traffic of mobile phone 01 is generally 300kb / s, while after the live broadcast ends, the downlink data traffic of mobile phone 01 will drop to 100kb / s. Therefore, in some implementations, whether the live broadcast scenario has ended can be determined based on the magnitude of the downlink data traffic of mobile phone 01. Specifically, mobile phone 01 can obtain the downlink data traffic of mobile phone 01 in real time or at intervals of preset time periods. If the data traffic is less than a data traffic threshold, the live broadcast scenario is determined to have ended. The data traffic threshold may be an empirical or experimental value, for example, 100kb / s, and this application does not impose any restrictions on this. In some implementations, mobile phone 01 can obtain the downlink data traffic of mobile phone 01 through services such as TrafficsStats, NetWorkStatsManager, laware, etc. It should be understood that the method of obtaining the uplink and downlink data traffic of mobile phone 01 is a technical means well known to technical personnel in this field, and this application does not impose any restrictions on this.

[0187] It is understandable that in some cases, when a user watches a video for a long time or plays a video in a loop for a long time, if the method of reducing device power consumption of the present application is continued, the power consumption of the mobile phone 01 will be reduced or even the screen of the mobile phone 01 will be turned off, which will undoubtedly affect the user experience. Therefore, in some implementations, the mobile phone 01 may not reduce the power consumption of the mobile phone 01 even if it is detected that the usage status of the mobile phone 01 and the video playback status meet the above conditions if the user turns off the function of reducing device power consumption of the mobile phone 01.

[0188] Specifically, for example, as shown in Figure 19a, the user can enter the display and brightness setting interface 103 shown in Figure 19b by clicking the setting application g displayed on the desktop of mobile phone 01, and then turn off the smart screen off function (that is, the function of automatically reducing device power consumption in this application) through control 1031.

[0189] In this way, the user is provided with room for choice, so that the mobile phone 01 can decide whether to reduce power consumption according to user needs, thereby improving user experience.

[0190] For example, FIG20 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0191] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0192] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated into one or more processors. Among them, the controller can be the nerve center and command center of the electronic device 100. The controller can generate an operation control signal based on the instruction opcode and the timing signal to complete the control of instruction fetching and execution.

[0193] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0194] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0195] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0196] The charging management module 140 is used to receive charging input from a charger. The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. In some implementations of this application, the mobile phone 01 can obtain the battery level and temperature information of the mobile phone 01 through the battery management module 141. In other implementations of this application, when the mobile phone 01 executes the method for reducing device power consumption, the charging management module 140 can control the maximum current of the mobile phone 01 battery. This application does not limit this.

[0197] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor and the baseband processor. The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied on the electronic device 100. The wireless communication module 160 can provide solutions for wireless communications including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc. applied on the electronic device 100. In some implementations, the mobile phone 01 can achieve a communication connection with the smart wearable device described above through the wireless communication module 160.

[0198] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0199] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLed, a MicroLed, a Micro-OLED, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0200] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0201] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0202] The camera 193 is used to capture still images or videos. The object is projected through the lens to generate an optical image onto the photosensitive element. The photosensitive element can be In some embodiments, the electronic device 100 can include 1 or N cameras 193, where N is a positive integer greater than 1.

[0203] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0204] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0205] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0206] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0207] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0208] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0209] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0210] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0211] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0212] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0213] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0214] The pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some implementations of the present application, the mobile phone 01 can use the gyroscope sensor to determine whether the mobile phone 01 is in an absolutely stationary state. The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 uses the air pressure value measured by the air pressure sensor 180C to calculate the altitude to assist in positioning and navigation. The magnetic sensor 180D includes a Hall effect sensor. The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). In an implementation of the present application, the mobile phone 01 can use an accelerometer to determine whether the mobile phone 01 is in an absolutely stationary state. The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. The proximity light sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the perceived ambient light level. The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, accessing application locks, taking photos with the fingerprint, answering calls with the fingerprint, and so on. The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing method. The touch sensor 180K, also known as a "touch panel," can be located on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch screen." The bone conduction sensor 180M can capture vibration signals. The buttons 190 include a power button, a volume button, and other buttons. The buttons 190 can be mechanical or touch-sensitive. The electronic device 100 can receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100. The motor 191 can generate vibration prompts. The motor 191 can be used for vibration prompts for incoming calls or for touch vibration feedback. The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level change, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect a SIM card.

[0215] The above describes the possible hardware structures of the electronic device 100. It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0216] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

[0217] Figure 21 is a software structure block diagram of the electronic device 100 according to an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime (Android runtime) and system library, the hardware abstraction layer (HAL), the kernel layer, and the physical layer.

[0218] The application layer may include a series of application packages. As shown in Figure 2, the application package may include applications such as WeChat, video, settings, music, etc., which are not listed one by one in the embodiment of this application.

[0219] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined methods.

[0220] As shown in Figure 21, the application framework layer may include a window manager, a content provider, a view system, etc. Among them, the window manager is used to manage window programs.

[0221] The Android runtime consists of a core library and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core library consists of two parts: one containing the functions and methods that Java calls require, and the other containing the Android core library.

[0222] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine performs operations such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0223] System libraries can include multiple functional modules, such as surface managers (or surface flingers), media libraries, 3D graphics processing libraries (such as OpenGL ES), 2D graphics engines (such as SGL), media libraries, and image processing libraries.

[0224] The surface manager is used to manage the display subsystem and provides the fusion of two-dimensional and three-dimensional layers for multiple applications. The media library supports the playback and recording of a variety of commonly used audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing. The two-dimensional graphics engine is a drawing engine for two-dimensional drawing. The image processing library can provide analysis for various image data and provide a variety of image processing algorithms, such as image cutting, image fusion, image blurring, image sharpening, etc., which will not be repeated here.

[0225] The HAL layer is an interface layer between the operating system kernel and the hardware circuits. Its purpose is to abstract the hardware. The HAL layer can include hardware composers (HWCs), which use hardware to combine and display image data, providing service support for the upper layer.

[0226] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0227] Below the kernel layer lies the physical layer (PHY). This layer provides transmission media and interconnection channels for data communication within and between devices, creating a reliable environment for data transmission. The physical layer can be understood as the transport layer that provides "signals and media."

[0228] It is understood that the above software structure layered architecture diagram is merely exemplary, and in other implementations, the software structure layered architecture may also include more or fewer layers, or a layered structure formed in other ways, which is not limited in this application.

[0229] An embodiment of the present application also provides an electronic device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps of any of the above-mentioned method embodiments when executing the computer program.

[0230] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various method embodiments can be implemented.

[0231] An embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned various method embodiments when executing the computer program product.

[0232] If the integrated unit is implemented as a software functional unit and sold or used as a standalone product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process steps in the above-mentioned method embodiments by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed by a processor, the computer program can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can at least include: any entity or device capable of carrying computer program code to a camera / terminal device, a recording medium, computer memory, read-only memory (ROM), random access memory (RAM), an electric carrier signal, a telecommunications signal, and a software distribution medium. Examples include a USB flash drive, a removable hard drive, a magnetic disk, or an optical disk. In some jurisdictions, based on legislation and patent practice, computer-readable media cannot be electric carrier signals or telecommunications signals.

[0233] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0234] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0235] In the embodiments provided in this application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0236] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of the solution of this embodiment according to actual needs.

[0237] In the above description, specific details such as specific system structures and technologies are provided for illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary details.

[0238] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0239] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0240] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0241] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0242] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0243] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A method for reducing device power consumption, applied to electronic equipment, characterized in that: include: The electronic device is in a first video playback scene; Determining that the user is not using the electronic device and that the video state of the electronic device meets a first state condition in the first video playback scenario; At least one operation is performed to reduce power consumption of the electronic device.

2. The method according to claim 1, characterized in that The determining that the user is not using the electronic device includes at least one of the following: Determining that the duration of the electronic device being in the screen-on state is greater than a first preset duration; Determining that the electronic device does not detect a first operation of the user on the electronic device for more than a second preset time period; determining that the electronic device is in a stationary state; It is determined that the user is in a sleeping state.

3. The method according to claim 1, characterized in that The first video playback scenario includes a video loop playback scenario, and the video state of the electronic device satisfies a first state condition under the first video playback scenario, including: The number of times the electronic device plays the same video in a loop is greater than a first threshold, and / or the duration for which the electronic device plays the same video in a loop is greater than a third preset duration.

4. The method according to claim 1, wherein The first video playback scenario includes an automatic video switching scenario, and the video state of the electronic device satisfies a first state condition under the first video playback scenario, including: The number of different videos played by the electronic device is greater than a second threshold, and / or the duration used by the electronic device to play different videos is greater than a fourth preset duration.

5. The method according to claim 1, wherein The first video playback scenario includes a live video broadcast scenario, and the video state of the electronic device satisfies a first state condition in the first video playback scenario, including: The electronic device does not detect a second operation of the user on the electronic device within a fifth preset time period after the current video playback ends.

6. The method according to claim 1, characterized in that The method further comprises: It is detected that the user performs a third operation on the electronic device, and the operation of reducing the power consumption of the electronic device is not performed or is stopped.

7. The method according to claim 6, characterized in that The third operation includes at least one of single click, double click, and pressing of the electronic device by the user.

8. The method according to claim 1, characterized in that The method further comprises: Displaying a first user interface, wherein the first user interface is used to prompt the user to control the electronic device to turn off the screen within a sixth preset time period; If the user is not detected performing a fourth operation within the sixth preset time period, the electronic device is controlled to enter a screen-off state and the power consumption of the electronic device is reduced, wherein the fourth operation is used to control the electronic device not to perform or stop performing an operation to reduce the power consumption of the electronic device.

9. The method according to claim 8, characterized in that The first user interface includes a first control, and the fourth operation includes an operation of a user clicking on the first control.

10. The method according to any one of claims 1 to 9, characterized in that The operation of reducing the power consumption of the electronic device includes at least one of the following: Controlling the electronic device to enter a screen-off state; reducing the screen brightness of the electronic device; Reducing the resolution and frame rate of the video currently being played by the electronic device; Turn off the background application update function of the electronic device; Switch the network positioning method of the electronic device.

11. The method according to claim 3, characterized in that Determining that the first video playback scene of the electronic device is a video loop playback scene includes: Acquire a first image of a first video currently being played by the electronic device; After a seventh preset time interval, obtaining a second image of a second video played by the electronic device; Determine image similarity between the first image and the second image, and if the similarity between the first image and the second image is greater than a first similarity threshold, determine that the first video playback scene of the electronic device is a video loop playback scene.

12. The method according to claim 4, characterized in that Determining that the first video playback scene in which the electronic device is located is a live video scene includes: When the video currently being played by the electronic device ends, acquiring a third image of the video currently being played; An image recognition method is used to identify the text content of the third image. When the text content of the third image includes preset keywords, it is determined that the first video playback scene of the electronic device is a live video scene, wherein the preset keywords include keywords indicating that the type of video currently played by the electronic device is a live video.

13. The method according to claim 11, characterized in that The seventh preset duration includes the video duration of the first video.

14. The method according to claim 1, wherein The electronic device is deployed with an Android operating system, and the Android system of the electronic device includes a video application located in an application layer and a layer display control module located in an application framework layer, wherein: The video application is configured to receive a playback instruction for a third video, and upon receiving the video playback instruction, send an instruction to the layer display control module to create a first layer, wherein the instruction is at least configured to instruct the layer display module to create a first layer corresponding to the video type of the third video; The layer display control module creates the first layer in response to the instruction, the first layer being used to play the third video, the first layer including a layer identifier, the layer identifier including at least information indicating the video type of the third video; and The method further comprises: The type of the first video playback scene in which the electronic device is located is determined according to the identifier corresponding to the first layer.

15. The method according to claim 14, characterized in that The application framework layer also includes a video decoder and a video player, wherein: The video decoder calls a first function to decode the video stream data of the third video, and after completing the decoding of the video stream data of the third video, calls a second function to end the decoding of the video stream data of the third video; The video player is used to receive the video stream data of the third video decoded by the video decoder, and send the decoded video stream data of the third video to the layer display control module, and the layer display module displays the decoded video stream data of the third video on the first layer; And, the method further comprises: According to the function called by the video decoder after calling the first function, determining the first video playback state of the electronic device The type of scene.

16. The method according to claim 15, characterized in that The determining, according to a function called by the video decoder after calling the first function, the type of the first video playback scene in which the electronic device is located, includes: Corresponding to the video decoder calling the third function after calling the first function, determining that the first video playback scene of the electronic device is a first type of video playback scene; Corresponding to the video decoder continuing to call the first function after calling the second function, determining that the first video playback scene of the electronic device is a second type of video playback scene; Corresponding to the video decoder not calling the first function after calling the second function, it is determined that the first video playback scene of the electronic device is a third type of video playback scene.

17. An electronic device, characterized in that: include: one or more processors; One or more memories; the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device executes the method according to any one of claims 1 to 16.

18. A computer-readable storage medium, characterized in that The storage medium stores instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 16.