Frame rate control method, electronic device, and storage medium

By combining the display screen information from the layer compositor with the frame rate decision center, erroneous frame rate decision events are removed, solving the problem of electronic devices making mistakes when the frame rate changes. This achieves more efficient frame rate control and lower power consumption, thus improving the user experience.

CN122308765APending Publication Date: 2026-06-30HONOR DEVICE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-12-31
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

When electronic devices change their frame rate, frame rate errors may occur, leading to unnecessary increases in power consumption or failure to meet normal usage requirements.

Method used

By combining the frame rate decision center with the display screen information from the layer compositor, erroneous frame rate decision events are removed, and correct suggested frame rates are generated to ensure the accuracy of frame rate decisions.

Benefits of technology

Reduce frame rate errors, improve the accuracy of frame rate decisions, reduce power consumption, and enhance user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122308765A_ABST
    Figure CN122308765A_ABST
Patent Text Reader

Abstract

This application discloses a frame rate control method, an electronic device, and a storage medium. The frame rate control method obtains information about the display screen of an electronic device synthesized by a layer compositor; identifies a target frame rate decision event among at least one frame rate decision events recorded by the electronic device that does not match the information of the display screen; the at least one frame rate decision event is used by a frame rate decision center to decide the frame rate of the electronic device's display screen; the target frame rate decision event is deleted from the at least one frame rate decision event; and a suggested frame rate is determined for the electronic device based on the remaining frame rate decision events among the at least one frame rate decision events. Embodiments of this application can reduce the probability of frame rate decision errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a frame rate control method, electronic device, and storage medium. Background Technology

[0002] Frame rate is the frequency (rate) at which bitmap images, measured in frames, appear continuously on a display. When running different applications or processing different information, the display of an electronic device may use different frame rates to meet usage requirements and reduce unnecessary power consumption. In some cases, frame rate errors may occur when the display of an electronic device changes its frame rate. Summary of the Invention

[0003] This application provides a frame rate control method, an electronic device, and a storage medium that help reduce frame rate errors.

[0004] The technical solution is as follows:

[0005] In a first aspect, a frame rate control method is provided, comprising: an electronic device obtaining information about a display screen image synthesized by a layer compositor; the electronic device determining a target frame rate decision event among at least one frame rate decision events recorded by the electronic device that does not match the information of the display screen image; the at least one frame rate decision event being used by a frame rate decision center to decide the frame rate of the display screen of the electronic device; the electronic device deleting the target frame rate decision event from the at least one frame rate decision event; and the electronic device deciding on a suggested frame rate to be provided to the electronic device based on the remaining frame rate decision events among the at least one frame rate decision events.

[0006] In the embodiments of this application, the frame rate control method described above can be executed by a frame rate decision center set up inside the electronic device, or it can be executed by other suitable functional modules. In the various embodiments of this application, the steps executed by the frame rate decision center can also be executed by other suitable functional modules.

[0007] When an electronic device performs frame rate decisions, it generates a suggested frame rate and provides it to the layer compositor. Theoretically, the layer compositor should refer to this suggested frame rate for composition. However, anomalies may occur during frame rate decision-making. For example, when generating the suggested frame rate, the electronic device may base it on at least one frame rate decision event. However, the electronic device may not promptly delete frame rate decision events that need to be removed. For instance, a frame rate decision event may have ended, but the electronic device may not have detected its termination in time, thus failing to delete the undeleted event and affecting the correct execution of frame rate decisions. The method provided in this application embodiment can use the information from the display screen image composed by the layer compositor as a reference to delete erroneous target frame rate decision events, preventing these events from affecting the correct generation of suggested frame rates by the electronic device.

[0008] In one embodiment, the information of the display screen includes: the number of screens managed by the layer synthesizer; determining the target frame rate decision event that does not match the information of the screen among at least one frame rate decision event recorded by the electronic device includes: when the number of screens managed by the layer synthesizer is less than a set threshold, determining the frame rate decision event recorded when the number of screens managed by the layer synthesizer is greater than or equal to the set threshold as the target frame rate decision event.

[0009] The layer compositor can accurately determine the current number of screens on an electronic device, including the sum of the number of actual screens and the number of virtual screens. Actual screens can include visual screens, while virtual screens can include non-visual screens. Visual screens can include physical screens, projection screens, split screens, etc. Non-visual screens can include screens not presented to the user, such as virtual screens created during screen recording. In the above embodiments, if the number of screens managed by the layer compositor is less than the set {a} of at least one frame rate decision event relied upon by the frame rate decision center, then set {a} is incorrect and should be removed from the frame rate decision events relied upon by the frame rate decision center to prevent at least one frame rate decision event {a} from affecting the frame rate decision center's correct implementation of frame rate decisions.

[0010] In one implementation, when the number of screens managed by the layer compositor is less than a set threshold, the target frame rate decision event includes a hot-plug event and / or a virtual screen event; the hot-plug event indicates that the electronic device is connected to an external display screen; the virtual screen event indicates that the electronic device has created a virtual display screen.

[0011] A hot-plug event indicates that an electronic device has multiple physical screens, while a virtual screen event indicates that the electronic device has multiple virtual screens. If the display screen information synthesized by the layer compositor corresponds to only one screen, then the hot-plug event and / or virtual screen event are incorrect target frame rate decision events. By using the above method, hot-plug events and / or virtual screen events can be promptly deleted if they incorrectly occur in the frame rate decision events used by the frame rate decision center.

[0012] In one embodiment, the information of the display screen includes: the target application that generated the information of the display screen; determining the target frame rate decision event that does not match the information of the display screen among at least one frame rate decision event recorded by the electronic device includes: determining the frame rate decision event that contradicts the operation of the target application as the target frame rate decision event.

[0013] Through the layer compositor, electronic devices can accurately determine the target application for generating the current display screen image. Therefore, applications that users typically use frequently can be identified as target applications, and these target applications can be used to further filter target frame rate decision events.

[0014] In one implementation, the target application is a desktop application; the target frame rate decision event includes: motion estimation motion compensation interpolation event, lock screen notification event, pull-down notification bar event, and / or boot navigation event; the motion estimation motion compensation interpolation event indicates that the electronic device is running a preset non-desktop application; the lock screen notification event indicates that the electronic device is in a lock screen state; the pull-down notification bar event indicates that the system pull-down notification bar of the electronic device is expanded; and the boot navigation event provides function indication information when the electronic device starts up.

[0015] Desktop applications are among the most frequently used applications by users under normal circumstances. When switching applications, unlocking, or when not needing to run applications in the foreground, electronic devices often invoke desktop applications to run in the foreground based on user commands. When the target application includes a desktop application, because the desktop application is composited more frequently by the layer compositor, the opportunities for frame rate decision information to determine the target frame rate decision event based on the target application can also be relatively increased. This can further improve the number of frame rate decision event corrections and reduce the error rate of frame rate decisions.

[0016] In one embodiment, after obtaining information about the display screen image of the electronic device synthesized by the layer compositor, the frame rate control method further includes: if the application package name recorded in the frame rate decision center of the electronic device is inconsistent with the application package name recorded in the frame rate decision center, changing the application package name recorded in the frame rate decision center to the package name of the target application; the advanced graphics platform service is a service of the frame rate decision center.

[0017] The application package name can be recorded by the Advanced Graphics Platform (ATP) in the Frame Rate Decision Center. To provide the correct recommended frame rate, the application package name recorded by the ATP service should be the package name of the application currently running on the electronic device. If the electronic device can determine the currently running target application through the layer compositor, it can further determine whether the application package name recorded by the ATP service is correct based on the target application.

[0018] In one embodiment, the frame rate control method further includes: reporting abnormal information of frame rate decision events, wherein the abnormal information of the frame rate decision events includes at least one of the following: deleting information of the target frame rate decision event; when a frame-cutting event occurs, the target frame rate of the layer synthesizer is inconsistent with the frame rate corresponding to the screen hardware tearing effect signal of the electronic device; the target application that generates the information of the display screen is inconsistent with the application package name recorded by the frame rate decision center of the electronic device; when a frame-cutting event occurs, the target frame rate of the layer synthesizer is inconsistent with the optimal frame rate decision event selected by the frame rate decision center of the electronic device; when a frame-cutting event of a set type occurs, the suggested frame rate is inconsistent with the frame-cutting event of the set type; when a frame-cutting event of a set type occurs, the frame rate of the layer synthesizer is inconsistent with the event of the set type; when a frame-cutting event of a set type occurs, the duration of the frame-cutting event of the set type times out.

[0019] In this embodiment, theoretically, under correct electronic device operation, the recommended frame rate provided by the frame rate decision center should be consistent with the application running in the foreground of the electronic device, consistent with the information of the display screen image synthesized by the layer compositor, and also consistent with the frame rate of the actual image displayed by the hardware display module. Based on these expected consistency conditions, any abnormalities in the electronic device's frame rate decision center, layer compositor, and hardware display module can be investigated.

[0020] Anomaly information in frame rate decision events can indicate an anomaly in the frame rate decision event itself, the frame rate decision center, the layer compositor, or the hardware display module. After reporting the anomaly information, the electronic device can determine the pattern of the anomaly based on the information, thereby improving the frame rate decision center, the layer compositor, and / or the hardware display module.

[0021] In one implementation, the abnormal information of the frame rate decision event includes: when a frame-switching event of a set type occurs, if the suggested frame rate is inconsistent with the frame-switching event of the set type, the occurrence of the frame-switching event of the set type indicates that the upper limit of the frame rate in the suggested frame rate is equal to the lower limit of the frame rate in the suggested frame rate.

[0022] Using the above method, special frame-cutting events (frame-cutting events of a set type) can be pre-defined. When a frame-cutting event of a set type occurs, the recommended frame rate can be determined based on the characteristics of the frame-cutting event. This allows for further detection of the frame rate decision-making process and the correct application of the recommended frame rate.

[0023] In one implementation, the frame-cutting events of the specified type include: fingerprint recognition events and / or animation effect events.

[0024] In electronic devices, the suggested frame rates for fingerprint recognition events and / or animation effect events are quite unique. By utilizing the unique characteristics of the suggested frame rates for fingerprint recognition events and / or animation effect events, a portion of abnormal information can be effectively screened out.

[0025] In one implementation, before reporting the abnormal information of the frame rate decision event, the method further includes: when the frame rate decision center detects the occurrence of the frame-switching event of the specified type, starting a detection thread to detect the frame rate at the time of the frame-switching event of the specified type; when the frame rate decision center executes the sending decision function during the frame rate decision process, and the upper limit of the frame rate in the suggested frame rate is equal to the lower limit of the frame rate in the suggested frame rate, sending the suggested frame rate to the detection thread; after the detection thread starts detecting the frame rate of the frame-switching event of the specified type, and receives the suggested frame rate, if it is inconsistent with the frame rate of the frame-switching event of the specified type, determining that abnormal information of the frame rate decision event has occurred.

[0026] By setting up a detection thread in the frame rate decision center, it is possible to determine whether there is any abnormal information based on the data generated during the frame rate decision-making process, without affecting the frame rate decision center's execution. This effectively eliminates some abnormal situations.

[0027] In one implementation, after the detection thread of the frame rate decision center is activated to detect the frame-switching event of the set type, the frame rate control method further includes: if the detection thread does not receive the suggested frame rate within a set time, determining abnormal information indicating that a frame rate decision event has occurred.

[0028] By setting a time limit for the detection thread, the electronic device can effectively detect some abnormal information by determining whether the correct suggested frame rate has been generated within the set time.

[0029] In one implementation, after sending the suggested frame rate to the detection thread, the frame rate control method further includes: if the detection thread detects a frame-switching event of the set type and receives the suggested frame rate, which is consistent with the frame rate of the frame-switching event of the set type, obtaining the frame rate of the layer compositor; if the frame rate of the display screen is inconsistent with the frame rate of the frame-switching event of the set type, detecting a frame rate switching action of the layer compositor; and if the frame rate switching action is inconsistent with the frame rate of the event of the set type, determining abnormal information indicating the occurrence of a frame rate decision event.

[0030] In the above embodiments, the detection thread can make judgments on the frame rate decision center and the layer compositor, thereby screening out abnormal information not only in the frame rate decision center but also in the layer compositor.

[0031] In one implementation, the abnormal information of the frame rate decision event includes: when a frame-cutting event of a specified type occurs, if the frame rate of the layer compositor is inconsistent with the specified type of event, the specified type of event indicates that the recommended frame rate is the maximum frame rate of the electronic device.

[0032] Among the frame rate decision events that electronic devices can recognize, there are special frame rate decision events that correspond to the maximum recommended frame rate supported by the electronic device. Through the above embodiments, the electronic device can utilize these special frame rate decision events to screen for a portion of abnormal information.

[0033] In one embodiment, before reporting the abnormal information of the frame rate decision event, the frame rate control method further includes: when the frame rate decision center detects the occurrence of the frame-cutting event of the set type, obtaining the frame rate of the layer compositor; and when the frame rate of the layer compositor is inconsistent with the frame-cutting event of the set type, and the frame rate of the layer compositor does not change to the frame rate corresponding to the frame-cutting event of the set type within a set time, determining the abnormal information of the occurrence of the frame rate decision event.

[0034] Through the above embodiments, electronic devices can screen for cases where the layer compositor fails to switch frame rates correctly and report the corresponding abnormal information, which helps electronic devices improve frame rate control from multiple dimensions.

[0035] In one embodiment, after obtaining the frame rate of the layer synthesizer, the frame rate decision control method further includes: if the frame rate of the layer synthesizer is inconsistent with the frame-cutting event of the set type, triggering a detection thread to wait for the frame rate change of the layer synthesizer; if the detection thread receives information about the frame rate change of the layer synthesizer, and the information about the frame rate change of the layer synthesizer is inconsistent with the frame-cutting event of the set type, determining that the frame rate of the layer synthesizer has not changed to the frame rate corresponding to the frame-cutting event of the set type within a set time.

[0036] Through the above embodiments, electronic devices can further screen for abnormal information such as the layer synthesizer failing to switch frame rates correctly, and more comprehensively detect abnormalities in the frame rate control process.

[0037] In one implementation, after the trigger detection thread waits for the frame rate change of the layer compositor, the frame rate decision method further includes: if the detection thread does not receive information about the frame rate change of the layer compositor within a set time, obtaining the frame rate of the layer compositor; if the obtained frame rate of the layer compositor is inconsistent with the frame-cutting event of the set type, determining that the frame rate of the layer compositor has not changed to the frame rate corresponding to the frame-cutting event of the set type within the set time.

[0038] Using the above method, the detection thread can receive and actively acquire the frame rate of the layer compositor, thereby improving the detection thread's ability to detect abnormal information.

[0039] In one embodiment, the frame rate decision method further includes: obtaining a newly generated frame rate decision event; and adding the newly generated frame rate decision event to the at least one frame rate decision event.

[0040] The frame rate decision center can add recorded frame rate decision events to the decision pool. The decision pool can be a storage pool maintained by the frame rate decision center. When the frame rate decision center (or other functional modules) generates a suggested frame rate, it generates the suggested frame rate at certain time intervals based on at least one frame rate decision event in the decision pool.

[0041] In other possible implementations, the decision pool can also be implemented through other storage function modules of the electronic device. During the time interval in which the frame rate decision center (or other function modules) generates suggested frame rates, new frame-cutting events may occur. The electronic device replenishes the frame rate decision events in the decision pool in real time based on the newly occurring frame-cutting events, and deletes terminated frame rate decision events and erroneous frame rate decision implementations, thus maintaining the effectiveness of the electronic device's frame rate decision function.

[0042] Secondly, embodiments of this application provide an electronic device, which includes a processor and a memory;

[0043] The memory is used to store a program for an electronic device to perform the method provided in any embodiment of the present application, and to store data involved in implementing the method provided in any embodiment of the present application;

[0044] The processor is configured to execute programs stored in memory.

[0045] Optionally, there may be one or more processors and one or more memories.

[0046] Alternatively, the memory can be integrated with the processor, or the memory can be set up separately from the processor.

[0047] The processing device in the second aspect above can be a chip. The processor can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. The memory can be integrated into the processor or located outside the processor and exist independently.

[0048] In the specific implementation process, the memory can be a non-transitory memory, such as read-only memory (ROM), which can be integrated with the processor on the same chip or set on different chips. This application does not limit the type of memory or the way the memory and processor are set.

[0049] Thirdly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, enable the computer to perform the method described in the first aspect.

[0050] Fourthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to perform any of the possible implementations of the first aspect.

[0051] Fifthly, embodiments of this application also provide a processor, including: an input circuit, an output circuit, and a processing circuit. The processing circuit is used to receive signals through the input circuit and transmit signals through the output circuit, causing the processor to execute the method in any of the embodiments of the first aspect described above.

[0052] In specific implementation, the processor can be a chip, the input circuit can be input pins, the output circuit can be output pins, and the processing circuit can be transistors, gate circuits, flip-flops, and various logic circuits. The input signal received by the input circuit can be received and input by, for example, but not limited to, a receiver, and the signal output by the output circuit can be, for example, but not limited to, output to and transmitted by a transmitter. Furthermore, the input circuit and the output circuit can be the same circuit, which is used as both the input circuit and the output circuit at different times. This application does not limit the specific implementation of the processor and various circuits.

[0053] The technical effects achieved by the second to fifth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0054] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0055] Figure 2 This is a schematic diagram of a software architecture according to an embodiment of this application;

[0056] Figure 3 This is a schematic diagram of a scenario according to an embodiment of this application;

[0057] Figure 4 This is a schematic diagram of another scenario according to an embodiment of this application;

[0058] Figure 5 These are schematic diagrams illustrating other scenarios in the embodiments of this application;

[0059] Figure 6 This is a schematic diagram of the frame rate control method according to an embodiment of this application;

[0060] Figure 7 This is a schematic diagram illustrating the process of the frame rate decision center performing frame rate decision in an embodiment of this application;

[0061] Figure 8 This is a schematic diagram of a frame rate control method in one example of this application. Detailed Implementation

[0062] In the following description, specific details such as particular system architectures and technologies are set forth for illustrative purposes and not for limiting purposes, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details.

[0063] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0064] It should be understood that "one or more" as mentioned in this application refers to one, two, or more, and "multiple" as mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.

[0065] Furthermore, to facilitate a clear description of the technical solutions of this application, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that the terms "first" and "second" do not necessarily imply that they are different.

[0066] The terms "one embodiment" or "some embodiments" used in this application mean that one or more embodiments of this application include the specific features, structures, or characteristics described in that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this application do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0067] The display method provided in this application can be applied to electronic devices. These electronic devices can be mobile phones, tablets, wearable devices, digital cameras, in-vehicle devices, augmented reality (AR) devices, virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), laptops, etc., and this application does not limit the specific application to these devices.

[0068] First, the possible structures of the electronic devices in the embodiments of this application will be introduced.

[0069] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0070] See Figure 1 The electronic device 1000 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity 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.

[0071] It should be noted that, Figure 1 The structure shown does not constitute a specific limitation on the electronic device 1000. In other embodiments of this application, the electronic device 1000 may include more than Figure 1 The components shown may include more or fewer components, or the electronic device 1000 may include... Figure 1 The components shown may be a combination of certain components, or the electronic device 1000 may include... Figure 1 The components shown are sub-components of certain components. For example, Figure 1 The proximity sensor 180G shown is optional. Figure 1 The components shown can be implemented in hardware, software, or a combination of both.

[0072] Processor 110 may include one or more processing units. For example, processor 110 may include at least one of the following processing units: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and neural network processing unit (NPU). These different processing units may be independent devices or integrated devices.

[0073] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0074] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0075] Figure 1 The connection relationships between the modules shown are merely illustrative and do not constitute a limitation on the connection relationships between the modules of the electronic device 1000. Optionally, the modules of the electronic device 1000 may also adopt a combination of various connection methods described in the above embodiments.

[0076] Electronic device 1000 can implement display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0077] The display screen 194 can be used to display images or videos. In some embodiments, the electronic device 1000 may include one or N display screens 194, where N is a positive integer greater than 1.

[0078] Electronic device 1000 can achieve shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0079] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, 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, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can perform algorithmic optimization of image noise, brightness, and color. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0080] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard red-green-blue (RGB) formats, luminance, and chrominance (YUV). In some embodiments, the electronic device 1000 may include one or N cameras 193, where N is a positive integer greater than 1.

[0081] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 1000 is selecting a frequency, the DSP is used to perform Fourier transforms on the frequency energy.

[0082] Video codecs are used to compress or decompress digital video. Electronic device 1000 may support one or more video codecs. Thus, electronic device 1000 can play or record video in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, and MPEG 4.

[0083] An NPU (Neural Processing Unit) is a processor that borrows from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, to rapidly process input information and continuously learn. NPUs can enable intelligent cognitive functions in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0084] Electronic device 1000 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0085] The distance sensor 180F is used to measure distance. The electronic device 1000 can measure distance via infrared or laser. In some embodiments, such as in a shooting scenario, the electronic device 1000 can utilize the distance sensor 180F to measure distance for rapid focusing.

[0086] Button 190 includes a power button and volume buttons. Motor 191 can generate vibration when the electronic device receives information. Motor 191 can be used to display notification information.

[0087] exist Figure 1 Based on the electronic device shown, the user can control the camera 193 to capture images or videos via button 190 or display screen 194.

[0088] Figure 1 The electronic device shown can be configured with a certain software architecture. Figure 2 This is a schematic diagram of an architecture (including a software system and some hardware) applied in an embodiment of this application. Figure 2 As shown, the architecture of an electronic device is divided into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the application architecture can be divided into five layers, from top to bottom: application layer, application framework layer, hardware abstraction layer (HAL), driver layer, and hardware layer.

[0089] like Figure 2 As shown, the application layer includes desktop applications, game applications, video applications, screen mirroring applications, screen recording applications, fingerprint unlocking applications, lock screen applications, etc. This is understandable. Figure 2 The application layer in the document may only include a portion of the application programs of the electronic device's application layer. In fact, the application layer of an electronic device may also include other applications, which is not limited in this application.

[0090] like Figure 2 As shown, the application framework layer, also known as the application framework layer, can include multiple access interfaces. The application framework layer can include the native application framework (native layer). The native application framework layer can also include a surfaceflinger, a window manager service (WMS), and an activity manager service (AMS), etc.

[0091] It should be understood that the frame rate decision center can be placed at the application framework layer or the application layer.

[0092] The driver layer is used to drive hardware resources. The driver layer can include multiple driver modules. For example... Figure 2 As shown, the driver layer includes camera device drivers, digital signal processor drivers, and graphics processor drivers, etc.

[0093] The hardware layer includes sensors, image signal processors, digital signal processors, and graphics processors. Figure 2 This only shows a portion of the software architecture of an electronic device. The software architecture of an electronic device may also include other modules or layers. Figure 2 Not shown in the image.

[0094] The frame rate control method provided in this application can be applied to scenarios where electronic devices use a screen (also known as a display screen) for display. The following provides examples of scenarios to which this application embodiment can be applied.

[0095] Figure 3 This is a schematic diagram illustrating an application scenario according to an embodiment of this application. Taking a mobile phone as an example, multiple applications are pre-configured on the phone. When the phone screen is off, in response to a user touching the screen, a notification message, or pressing the power button, the phone screen can be turned on, displaying an image such as... Figure 3 The lock screen interface is shown in (a) above. The lock screen interface can also display the lock screen background, quick launch icon, time, signal icon, unlock prompt, etc. If the phone can be unlocked, the lock screen interface can also display the fingerprint unlock icon 31. For example... Figure 3 As shown in (b), in response to the information that a fingerprint is covered on the fingerprint unlock icon 31, the mobile phone can recognize the finger pressing information covering the fingerprint unlock icon 31 and unlock the mobile phone according to the recognition result.

[0096] After the phone's screen is unlocked, the phone can display the desktop, and the display effect may be as follows: Figure 3 As shown in (c), multiple application icons are displayed on the phone's home screen. Each application icon on the home screen corresponds to a pre-configured application on the phone, such as a game application, a screen recording application, and a screen mirroring application. In response to clicking an application icon, the phone launches the corresponding application. For example, see reference... Figure 3 As shown in (d) above, in response to clicking the game application icon, the phone displays as shown below. Figure 4 The game interface shown in (a) is shown in the image.

[0097] In such Figure 4As shown in (a) of the image, the game interface allows the phone to display visuals generated during the game application's operation, including both static and dynamic images. During the phone's operation of the game application, such as... Figure 4 As shown in (b), in response to swiping up from the bottom of the game's interface, the phone can return to the previous screen as shown in Figure (b). Figure 3 The desktop shown in (c) is an example. Alternatively, in response to a partial swipe up from the bottom of the game's running interface, the phone can display something like... Figure 4 The multitasking interface is shown in (c). In the multitasking interface, the phone displays thumbnails of multiple applications running in the background. In response to clicking any thumbnail in the multitasking interface, the phone can bring the corresponding application to the foreground.

[0098] The game interface can also display jump controls, and the phone can also display such as Figure 4 In the case of the game interface shown in (d), in response to clicking the jump control, the user switches to the interface of another application. For example, as shown in... Figure 5 As shown in (a), the phone can respond to clicking control A and jump to the running interface of the screen recording application, as follows. Figure 5 As shown in (b) above. The phone displays as follows: Figure 3 When the screen is as shown in (c), the phone can respond to clicking the game application icon, displaying a screen like... Figure 4 During the game's running interface as shown in (a), the phone may display the game application's launch animation, such as... Figure 4 As shown in (a) of this application. In this embodiment, motion effect can refer to animation effect.

[0099] exist Figure 3 and Figure 5 In the scenario shown, multiple different events occur, which not only cause changes to the displayed interface but may also affect the phone's screen frame rate. Furthermore, in addition to the launch animation corresponding to clicking the game application, corresponding animations can be displayed in various other situations.

[0100] For example, the phone displays as follows Figure 4 In the case of the game interface shown in (a), in response to swiping up from the bottom of the game interface to switch to the desktop or multitasking interface, corresponding animation effects can be displayed. Therefore, when displaying corresponding animation effects due to switching applications or other reasons, the frame rate of the phone's screen may also change.

[0101] Apart from Figures 3 to 5Beyond the scenarios shown, the embodiments of this application may also be applied to other scenarios, which will not be listed here one by one. From a visual perspective, the higher the frame rate, the smoother the animation or video will play. A high frame rate can reduce screen tearing and stuttering, making the action more fluid and natural. This is because the frame rate represents the number of frames displayed per unit of time; the higher the frame rate, the more information is presented per unit of time, thus giving the user a smoother visual experience.

[0102] Frame rate has a particularly significant impact on the user experience of certain applications. For example, in gaming, a high frame rate can significantly reduce latency and stuttering, allowing players to operate more quickly and accurately. Improving the display effect from a frame rate perspective is especially important in games that require fast reactions and precise operations, such as shooting and racing games. However, a higher frame rate also means higher power consumption for electronic devices such as mobile phones. Therefore, some electronic devices will lower the display's frame rate unnecessarily, and increase it when necessary to ensure a good user experience.

[0103] When electronic devices such as mobile phones change their display frame rate due to changes in display requirements, frame rate change failures or frame rate adjustments may occur. These situations may lead to unnecessary increases in power consumption of the electronic device, or prevent the electronic device from displaying as required for normal use. Therefore, embodiments of this application provide a frame rate control method, including as follows: Figure 6 Steps S61 to S64 are shown.

[0104] exist Figure 6 In the illustrated embodiment, the electronic device includes a frame rate decision center. This center manages the frame rate of the electronic device, providing suggested frame rates to the device's layer compositor. The frame rate decision center can dynamically adjust the frame rate based on application scenarios and user needs. For example, during gaming or video playback, the center might increase the suggested frame rate to ensure smoothness; while in daily use, it might decrease the suggested frame rate to save power and extend battery life.

[0105] Step S61: The frame rate decision center obtains information about the display screen of the electronic device synthesized by the surfaceflinger.

[0106] When step S61 is executed, the display screen of the electronic device may be lit up and displaying the screen of at least one application.

[0107] In an electronic device system, a layer compositor and a frame rate decision center can both be used. The layer compositor is used to composite the content displayed on the screen and can be located at the system layer of the electronic device. Applications running on the electronic device can send content generated during their operation to the layer compositor through the surface controller and the surface. The layer compositor is responsible for compositing the layers of at least one application into a unified screen frame. The layer compositor can use the hardware capabilities of the GPU or display controller to perform window compositing. Simultaneously, the layer compositor and window manager collaborate to ensure that the layout and hierarchical order of the windows displayed on the screen are presented according to system requirements. The layer compositor can manage the screen refresh rate, and this management method can use vertical synchronization (VSync) technology to ensure that content updates are synchronized with the display hardware. A layer can refer to an area that can be drawn on the screen; a layer can represent a drawing buffer in the memory of an electronic device.

[0108] In possible implementations, the information displayed on the screen, also known as the information about the screen's layers, can refer to related information about those layers. This information can include the content of the screen's layers, the application used to generate that content, and information obtained (or inferred) based on those layers. When an electronic device can display content on multiple screens, the information about the screen can include the number of screens. The frame rate decision center obtaining the information about the electronic device's screen composed by the layer compositor can be expressed as: the frame rate decision center obtaining the information about the image composed by the layer compositor. The frame rate decision center can capture this information using the debugging tools in the system settings.

[0109] In possible implementations, the frame rate decision center obtains information about the display screen in either an active acquisition or a passive reception manner.

[0110] When the frame rate decision center actively acquires information from the display screen, it can proactively capture the content sent by the layer compositor to the hardware display screen during the process of the layer compositor sending the composited display screen content to the hardware display screen. Based on this content, the frame rate decision center obtains information about the display screen. The content sent by the layer compositor to the hardware display screen, also known as the layer compositor's output content, is used by the hardware display screen of the electronic device to perform display operations.

[0111] In addition, the frame rate decision center can also obtain information about the display screen after the layer compositor has composited the information corresponding to the drawing instructions. In this case, the information about the display screen can be obtained from the information generated after the layer compositor has completed the compositing.

[0112] When the frame rate decision center passively receives information from the display screen, the layer compositor can send the display screen information to the frame rate decision center after completing the compositing process or during the output of the display screen content to the hardware display screen. For example, the layer compositor can utilize the inter-process communication (binder) mechanism of the electronic device to send the display screen information to the frame rate decision center.

[0113] The binder mechanism, based on a client-server architecture, allows for efficient data exchange and communication between different processes. In the binder mechanism, the communicating parties are designated as a client and a server, which interact through the binder driver of the electronic device. The layer compositor and the frame rate decision center can be used as the client and server in the binder mechanism, respectively.

[0114] Step S62: The frame rate decision center determines at least one frame rate decision event recorded by the electronic device that does not match the information displayed on the screen; the at least one frame rate decision event is used by the frame rate decision center to decide the frame rate of the electronic device's screen.

[0115] In this embodiment, the frame rate decision center may include advanced graphics platform services. Alternatively, in a possible implementation, the frame rate decision center may be equivalent to advanced platform services.

[0116] In a possible implementation, the frame rate decision center can maintain (record) multiple frame rate decision events. These events can be recorded as a list, using names, numbers, etc., in specific implementations. For example, when screen recording occurs, the frame rate decision center can record "screen recording" as the frame rate decision event. Since multiple frame rate decision events can occur simultaneously (or within short time intervals) on an electronic device, these events can be used to determine the suggested frame rate to be provided to the layer compositor. Among these events, the frame rate decision center selects the highest priority event and determines the suggested frame rate based on the preset frame rate corresponding to that event.

[0117] In one possible implementation, each of the multiple frame rate decision events corresponds to a set frame rate. When a frame rate decision event occurs, the electronic device's display should switch to the corresponding set frame rate. Multiple frame rate decision events may occur within a set time interval.

[0118] For example, an electronic device might run a game application in the foreground during the set time interval of screen recording. Or, an electronic device might unlock itself using a fingerprint during the set time interval after receiving a lock screen notification.

[0119] Alternatively, an electronic device might run a game application and record its screen while displaying multiple screens simultaneously. If multiple frame rate decision events occur within a set time interval, the electronic device can add these events to a decision pool and generate a suggested frame rate in real time based on the multiple frame rate decision events in the pool.

[0120] The information displayed on the screen may have a certain correlation with the frame rate decision events. However, when the information on the screen contradicts the frame rate decision events, it can be considered that the information on the screen does not match the frame rate decision events. For example, if the information on the screen indicates that a certain frame rate decision event A should not occur, but this frame rate decision event A exists in the decision pool, then this frame rate decision event A is incorrect. This could be because frame rate decision event A was not promptly removed after it was added to the decision pool, or it could be because the frame rate decision center incorrectly identified frame rate decision event A.

[0121] The frame rate decision center determines a target frame rate decision event among multiple frame rate decision events of the electronic device that does not match the information displayed on the screen. This can include: the frame rate decision center determines at least one frame rate decision event among multiple frame rate decision events in the current decision pool of the electronic device that does not match the information displayed on the screen, and the at least one frame rate decision event that does not match the information displayed on the screen is the target frame rate decision event, and the at least one frame rate decision event includes the target frame rate decision event.

[0122] Multiple frame rate decision events of an electronic device can refer to multiple frame rate decision events currently maintained in the decision pool of the electronic device. These multiple frame rate decision events can be used by the frame rate decision center each time it executes a frame rate decision. In other words, each time the frame rate decision center executes a frame rate decision, it makes a suggested frame rate decision based on the multiple frame rate decision events currently maintained (or stored) by the electronic device.

[0123] Figure 7 The process of frame rate decision-making by the frame rate decision center of an electronic device is demonstrated. The frame rate decision-making by the frame rate decision center includes the following steps S71 to S74.

[0124] Step S71: The framerate manager of the framerate decision center calls the refresh rate action handle function to obtain the latest at least one frame-switching event.

[0125] Step S72: The refresh rate decision manager of the frame rate decision center adds at least one frame-slicing event as a new frame rate decision event to the decision pool.

[0126] The decision pool includes at least one frame rate decision event.

[0127] Step S73: The frame rate manager performs postaction on frame rate decision events in the decision pool.

[0128] Through post-processing, the frame rate manager can organize frame rate decision events, etc.

[0129] Step S74: The refresh rate execution decision manager can find the optimal frame rate decision event (filteraction) from the decision pool and determine the decision frame rate based on the optimal frame rate decision event.

[0130] In possible implementations, the frame rate decision-making steps of the frame rate decision center can be combined with... Figure 6 The steps shown can be performed synchronously in parallel, or in any order.

[0131] At least one frame rate decision event is used by the frame rate decision center to decide the frame rate of the electronic device's display screen. In other words, the frame rate decision center performs a frame rate decision based on at least one frame rate decision event. When performing the frame rate decision, the frame rate decision center generates a suggested frame rate and provides (or sends) the suggested frame rate to the layer compositor.

[0132] Step S63: The frame rate decision center deletes the target frame rate decision event from the at least one frame rate decision event.

[0133] In one possible implementation, at least one frame rate decision event may be stored in a designated storage location of the electronic device. For example, at least one frame rate decision event may be stored in a decision pool maintained by a frame rate decision center. Deleting a target frame rate decision event by the frame rate decision center may include: deleting the target frame rate decision event from the designated storage location of the electronic device.

[0134] After the target frame rate decision event is deleted from the frame rate decision center, the frame rate decision center will no longer perform frame rate decisions based on the target frame rate decision event.

[0135] After step S63, if the deleted target frame rate decision event occurs again during the subsequent operation of the electronic device, the frame rate decision center will add the target frame rate decision event back into the decision pool.

[0136] In a possible implementation, the electronic device may include multiple frame rate decision events. When a frame rate decision event occurs, if the frame rate decision center fails to identify it, or if the frame rate decision center fails to successfully add the frame rate decision event to the decision pool, the electronic device may also only have one frame rate decision event.

[0137] Step S64: The frame rate decision center determines the recommended frame rate to be provided to the electronic device based on the remaining frame rate decision events in the at least one frame rate decision event.

[0138] In possible implementations, the target frame rate decision event may include at least zero frame rate decision events, and after deleting the target decision event, the electronic device may have at least one remaining frame rate decision event. That is, the information displayed on the screen may not conflict with any frame rate decision events.

[0139] The frame rate decision center determines the frame rate displayed by electronic devices, which can be expressed as: The frame rate decision center performs frame rate decisions. When deciding the frame rate displayed by electronic devices, the frame rate decision center generates a suggested frame rate.

[0140] After the frame rate decision center generates a suggested frame rate, it can send the suggested frame rate to modules such as the layer compositor, so that the layer compositor can synthesize the display layer according to the suggested frame rate.

[0141] In possible implementations, each frame rate decision event can correspond to at least one frame rate, or each frame rate decision event can correspond to an upper frame rate limit and a lower frame rate limit. Simultaneously, each frame rate decision event can be assigned a priority. Step S64 may include: the frame rate decision center determining the highest priority frame rate decision event from the remaining frame rate decision events among the at least one frame rate decision event, and then determining a suggested frame rate based on the highest priority frame rate decision event. Further, the frame rate decision center can use the frame rate corresponding to the frame rate decision event as the suggested frame rate.

[0142] In possible implementations, the frame rate decision center's recommended frame rate can include an upper limit and a lower limit. The frame rate decision center can use the frame rate corresponding to the highest priority frame rate decision event as both the upper and lower limits. Alternatively, the frame rate decision center can use the highest priority frame rate decision event as the upper limit and set the lower limit according to default values. Or, the frame rate decision center can use the highest priority frame rate decision event as the lower limit and set the upper limit according to default values.

[0143] Step S65: The frame rate decision center sends the suggested frame rate to the layer compositor.

[0144] Correspondingly, the layer compositor receives the suggested frame rate from the frame rate decision center.

[0145] The layer compositor can determine the frame rate of the composite layer based on the current application display information (display information can also be expressed as "sending display") and the suggested frame rate provided by the frame rate decision center. Based on the frame rate of the composite layer, the layer compositor sends display information to the hardware display module of the electronic device. If the hardware display module of the electronic device can display normally, then the hardware display module can display according to the frame rate of the composite layer. The hardware display module may include the display screen of the electronic device.

[0146] When there are no errors in the operation of the layer compositor of the electronic device, the layer compositor can synthesize layers based on the information sent by the application, and the frame rate information included in the layer compositor is consistent with the suggested frame rate.

[0147] Step S66: The hardware display module of the electronic device displays the frame rate according to the recommended frame rate provided by the frame rate decision center.

[0148] Step S66 may include: the layer compositor sending the synthesized layer to the hardware display module of the electronic device, and the hardware display module displaying the layer. The layer synthesized by the layer compositor may include frame rate information, and the hardware display module can display the layer based on the frame rate information included in the layer.

[0149] Provided that there are no faults in the frame rate decision center, layer compositor, and hardware display module of the electronic device, and there are no errors in the communication between the frame rate decision center, layer compositor, and hardware display module, the hardware display module of the electronic device will eventually be able to display at the recommended frame rate.

[0150] The hardware display module displays the image according to the recommended frame rate provided by the frame rate decision center. This can also include situations where the layer compositor composites the image according to the recommended frame rate, and the hardware display module displays the image at the recommended frame rate. For example, if the frame rate decision center provides a recommended frame rate of 60Hz, the layer compositor composites the image at 60Hz, and then the hardware display module displays the image at 60Hz.

[0151] The frame rate control method provided in this application can determine whether at least one frame rate decision event of an electronic device is correct based on the information of the display screen image synthesized by the layer compositor. If there is a contradiction between the frame rate decision event and the information of the display screen image, the electronic device can determine that the target frame rate decision event is incorrect based on the information of the display screen image. If the target frame rate decision event is determined to be incorrect, the electronic device can delete the target frame rate decision event and determine the frame rate suggested by the frame rate decision center to the electronic device (i.e., the suggested frame rate) based on the remaining frame rate decision events. This avoids the electronic device mistakenly retaining the target frame rate decision event, which could affect the frame rate decision center's generation of a correct suggested frame rate, and reduces the probability of frame rate errors in the electronic device's display screen.

[0152] In one embodiment, the information displayed on the screen may not necessarily be the content of the screen itself, but may also be related information about the screen. For example, the information displayed on the screen may include: the number of screens managed by the layer synthesizer; determining the target frame rate decision event among at least one frame rate decision event recorded by the electronic device that does not match the information of the screen may include: frame rate decision events generated when the number of screens managed by the layer synthesizer is less than a set threshold, or when the number of screens managed by the layer synthesizer is greater than or equal to the set threshold, can be determined by the layer synthesizer as the target frame rate decision event. The frame rate decision event generated when the number of screens managed by the layer synthesizer is greater than or equal to the set threshold, and determined by the frame rate decision center as the target frame rate decision event, can also be expressed as: the frame rate decision center can determine the frame rate decision events recorded when the number of screens managed by the layer synthesizer is greater than or equal to the set threshold as the target frame rate decision event.

[0153] The above embodiment can also be expressed as follows: the information of the display screen includes: the number of screens managed by the layer synthesizer; when the number of screens managed by the layer synthesizer is less than a set threshold, the target frame rate decision event is generated when the number of screens managed by the layer synthesizer is greater than or equal to the set threshold.

[0154] In possible implementations, a screen projection module, screen peripheral interface, or screen recording application pre-installed in the electronic device system can create multiple screens at runtime. The multiple screens created by the screen projection module, screen peripheral interface, or screen recording application can be virtual screens or visual screens created on actual physical displays.

[0155] If the display information includes the number of screens managed by the layer compositor, this information can be queried through built-in system tools and / or the layer control application programming interface (API). For example, if the electronic device's system has built-in tools, the number of screens managed by the layer compositor can be obtained directly from the layer compositor's output information, or indirectly by analyzing the layer compositor's output information. Furthermore, the frame rate decision center can also access the WMS to obtain information about the current window and screen.

[0156] In the above embodiments, the number of screens managed by the layer compositor contradicts the conditions for generating the target frame rate decision event. That is, the target frame rate decision event cannot occur when the number of screens managed by the layer compositor is less than a set threshold. If any of the frame rate decision events currently recorded by the electronic device occur when the number of screens is greater than or equal to the set threshold, it indicates that there is an error among the multiple frame rate decision events. By identifying erroneous target frame rate decision events, it is possible to prevent the frame rate decision center from providing suggested frame rates to the electronic device based on erroneous target frame rate decision events.

[0157] In one embodiment, when the number of screens managed by the layer compositor is less than a set threshold, the target frame rate decision event includes a hot-plug event and / or a virtual screen event; the hot-plug event indicates that the electronic device is connected to an external display screen; the virtual screen event indicates that the electronic device has created a virtual display screen.

[0158] In this embodiment, hot-swapping, also known as live plugging or hot-swapping, refers to the technique of inserting or removing modules, boards, storage devices, or other external devices into or from an electronic device system without shutting down the system power, and without affecting the normal operation of the electronic device system. A hot-swapping event can also refer to an event where an electronic device connects to an external display device based on hot-swapping technology. The external display device can be an external display screen, an external electronic device, or other devices.

[0159] The number of screens managed by a layer compositor corresponds to the number of layers it composites. For example, if a layer compositor manages one screen, it may only need to composite one layer. If it manages two screens, it may need to composite two layers. Hot-plugging events may occur when an electronic device is projected, connected to an external display, or otherwise shared. In such cases, the electronic device's layer compositor needs to create more layers for the external display device.

[0160] In other possible implementations, when the electronic device itself is equipped with multiple displays, the target frame rate decision event can be generated when the electronic device displays through its multiple displays. For example, if the electronic device is a foldable phone with an inner screen and an outer screen, then even if the foldable phone only displays through the inner screen or the outer screen, but there is one frame rate decision event among the multiple frame rate decision events indicating that the phone displays through multiple displays, then this frame rate decision event is the target frame rate decision event.

[0161] In one embodiment, the information of the display screen includes: the target application that generated the information of the display screen; determining the target frame rate decision event that does not match the information of the display screen among at least one frame rate decision event recorded by the electronic device includes: determining the frame rate decision event that contradicts the operation of the target application as the target frame rate decision event.

[0162] In possible implementations, the target application generating the display screen information may include multiple applications or a single application. A frame rate decision event that contradicts the operation of the target application may be a frame rate decision event generated by another application that cannot run during the operation of the target application. Alternatively, a frame rate decision event that contradicts the operation of the target application may be a frame rate decision event that cannot be generated during the operation of the target application. If a frame rate decision event contradicts the currently running target application, it indicates that this frame rate decision event was incorrectly added to the electronic device or was not deleted in a timely manner due to an error.

[0163] In possible implementations, the target application can be a frequently used application. For example, if a user frequently uses a game application, the target application could be a game application.

[0164] In one embodiment, the target application is a desktop application; the target frame rate decision event can be a frame rate decision event that contradicts that of a desktop application. For example, the target frame rate decision event includes: a motion estimation and motion compensation (MEMC) frame interpolation event, a lock screen notification event, a pull-down notification bar event, and / or a boot navigation event; the motion estimation and motion compensation frame interpolation event indicates that the electronic device is running a preset non-desktop application; the lock screen notification event indicates that the electronic device is in a lock screen state; the pull-down notification bar event indicates that the system pull-down notification bar of the electronic device is expanded; and the boot navigation event provides function indication information when the electronic device starts up.

[0165] MEMC frame interpolation events can occur during video playback in a video playback application. In other words, a MEMC event indicates that the electronic device is running a video playback application. Correspondingly, the default non-desktop application represented by a MEMC event can include video applications. During a MEMC event, the electronic device uses chips and algorithms to estimate the motion trajectory of objects in the video and insert motion-compensated frames into the middle of low frame rate videos, thereby increasing the frame rate of the played video and providing a smoother viewing experience. Lock screen notification events are events that occur when an electronic device receives a notification message while the screen is locked.

[0166] In this embodiment, a desktop application can refer to an application installed on an electronic device and running locally on the electronic device. When the desktop application is running, the screen of the electronic device can display the desktop, for example... Figure 3 As shown in (c) in the figure.

[0167] In one embodiment, after obtaining the information of the layer compositor compositing the display screen image of the electronic device, the frame rate control method may further include: if the application package name recorded in the Advanced Graphics Platform Service (AGP service) of the electronic device is inconsistent with that of the target application, the frame rate decision center or the AGP service may change the application package name recorded in the AGP service to the package name of the target application; the AGP service is a service of the frame rate decision center. The AGP service may be an interface service abstracted from the graphics card bus of the electronic device, which can be used to improve the display data transmission speed of the electronic device.

[0168] In one possible implementation, the advanced graphics platform of the electronic device can record the application name used for frame rate decision-making at the current moment. In other words, the application package name recorded by the advanced graphics platform service of the electronic device can be used by the frame rate decision center for frame rate decision-making. Therefore, theoretically, the application package name recorded by the advanced graphics platform service should be consistent with the application from which the image composed by the layer compositor originates; otherwise, the application package name recorded by the accelerated image interface service is likely to be incorrect.

[0169] The application package name mentioned above can be a unique identifier for each application on an electronic device, and the application package name can ensure the uniqueness of the application on the electronic device.

[0170] In possible implementations, the application package name can be determined during application development based on specified information, enabling the electronic device's system to correctly identify and manage the corresponding application based on the application package name. When the frame rate decision center or advanced graphics platform service changes the application package name recorded in the advanced graphics platform service to the target application's package name, the information recorded by the advanced graphics platform is consistent with the information in the frame composed by the layer compositor.

[0171] In a possible implementation, the Advanced Graphics Platform Service is a service of the Frame Rate Decision Center, and thus, the application package name recorded by the Advanced Graphics Platform Service can also be considered as the one recorded by the Frame Rate Decision Center service.

[0172] In one embodiment, the frame rate decision center deletes the target frame rate decision event, indicating that there is an error in the frame rate decision events managed by the frame rate decision center.

[0173] After deleting the target frame rate decision event, abnormal information about the frame rate decision event can be reported. In other possible implementations, even without deleting the target frame rate decision event, abnormal information about the frame rate decision event can be monitored and reported. Accordingly, the abnormal information about the frame rate decision event includes at least one of the following.

[0174] Information (1) Delete the information of the target frame rate decision event.

[0175] In the embodiments of this application, Figure 6 When the method shown is executed, after deleting the target frame rate decision event, the frame rate decision center can send an exception message to the server corresponding to the specified address. The reported exception message may include the deleted target frame rate decision event, the reason for deleting the target frame rate decision event, etc.

[0176] Information (2) When a frame-cutting event occurs, the target frame rate of the layer synthesizer is inconsistent with the frame rate corresponding to the screen hardware tearing effect (TE) signal of the electronic device.

[0177] In this embodiment, the frame-slicing event can be the original event of the frame rate decision event, such as the original event of the fingerprint recognition event (finger press event). After a frame-slicing event occurs, if no abnormality occurs in the frame rate decision center, a new frame rate decision event is generated based on the frame-slicing event, and the new frame rate decision event is added to the list of frame rate decision events.

[0178] The frame rate decision center performs frame rate decisions, which rely on various frame-switching events from other modules within the electronic device. Each frame-switching event corresponds to a frame rate decision event with its own priority. After comprehensive processing, the frame rate decision center selects the appropriate upper and lower limits of the current frame rate and sends them to SurfaceFlinger to achieve frame rate control.

[0179] Taking fingerprint notification as an example, the fingerprint recognition area of ​​an electronic device is located on the display screen. When a user touches the fingerprint recognition area, the electronic device may lock the current display refresh rate to 120Hz to avoid the problem of the fingerprint spot not illuminating. When the user presses on the fingerprint area, the fingerprint module obtains the Advanced Graphics Platform Service of the Frame Rate Decision Center through the service manager, sends the finger press information to the AGP service, and after receiving the finger press information, the AGP service adds the fingerprint recognition event to the decision pool and re-determines the highest priority event (Filter Action) to determine the final refresh rate.

[0180] The TE signal arises from the synchronization problem of read and write pointers (read and write pointers, R and W pointers) during screen refresh. When the write pointer (W) and read pointer (R) of the display overlap within a single frame, tearing occurs, meaning that portions of both the old and new frames can be displayed simultaneously on the screen. The TE signal can be a feedback signal sent from the display controller to an external device (such as a microcontroller) to indicate the display status. Specifically, the TE signal can indicate the end of one frame and the beginning of the next, thus indicating the synchronization of the read and write pointers and preventing tearing.

[0181] The frame rate corresponding to the hardware TE signal can refer to the frame rate directly or indirectly determined by the hardware TE signal. The frame rate corresponding to the hardware TE signal can be the actual frame rate displayed on the hardware display screen.

[0182] The target application for generating the information (3) of the display screen is inconsistent with the application package name recorded in the Advanced Graphics Platform Service of the electronic device.

[0183] When information (3) appears, the application package name recorded in the Advanced Graphics Platform Service can also be changed to the package name of the target application.

[0184] Information (4) When a frame-cutting event occurs, the target frame rate of the layer synthesizer is inconsistent with the optimal frame rate decision event selected by the advanced graphics platform service of the electronic device.

[0185] In a possible implementation, the frame rate decision center includes an advanced graphics platform service. The advanced graphics platform service can manage a list of multiple frame rate decision events and periodically determine the optimal frame rate decision event. For example, the frame rate decision events managed by the frame rate decision center or the advanced graphics platform service may have pre-configured priorities and suggested frame rates, as shown in Table 1 below.

[0186] Frame rate decision events Priority Recommended frame rate Event 1 300 Fixed 120Hz Event 2 290 Do not switch frame rate Event 3 280 Fixed 120Hz Event 4 270 Fixed 90Hz Event 5 260 Fixed 60Hz

[0187] Table 1

[0188] As shown in Table 1, different frame rate decision events can be pre-configured with different priorities. Furthermore, the suggested frame rates may differ. Among the frame rate decision events managed by the frame rate decision center, at least one of the frame rate decision events listed in Table 1 may exist. When multiple frame rate decision events exist, the frame rate decision center can determine the optimal frame rate decision event based on the priority of each event. Simultaneously, the frame rate decision center can use the suggested frame rate of the optimal frame rate decision event as the suggested frame rate provided to the layer compositor.

[0189] If the target frame rate of the layer compositor is inconsistent with the optimal frame rate decision event selected by the advanced graphics platform service of the electronic device, an anomaly may have occurred in the layer compositor or the advanced graphics platform service. In this case, the frame rate decision center or the advanced graphics platform service reports the anomaly information to the designated server.

[0190] Information (5) When a frame-cutting event of a specified type occurs, the suggested frame rate is inconsistent with the frame-cutting event of the specified type.

[0191] In this embodiment, frame-slicing events can be added to the frame rate decision event list of the frame rate decision center. However, due to certain abnormal situations, frame-slicing events are not correctly added to the frame rate decision event list of the frame rate decision center. A frame-slicing event of a specified type can refer to a frame-slicing event that the frame rate decision center can determine through information sent by itself or other modules. Furthermore, a frame-slicing event of a specified type is either the highest priority frame rate decision event (different from the aforementioned optimal frame rate decision event) or the lowest priority frame rate decision event.

[0192] Alternatively, the suggested frame rate for a specified frame-switching event can have characteristics that distinguish it from other possible frame rate decision events. For example, when a specified frame-switching event occurs, the upper limit of the suggested frame rate is equal to the lower limit of the suggested frame rate.

[0193] For example, when the fingerprint recognition module inside an electronic device detects a fingerprint recognition event, it sends a notification to the frame rate decision center, informing it of the presence of the event. Simultaneously, assuming the fingerprint recognition event is the highest priority frame rate decision event—meaning it is necessarily the optimal frame rate decision event—if the frame rate decision center does not provide a suggested frame rate based on the fingerprint recognition event, it indicates a potential malfunction in the frame rate decision center and / or the fingerprint recognition module.

[0194] Information (6) When a frame-cutting event of a specified type occurs, the frame rate of the layer compositor is inconsistent with the event of the specified type.

[0195] The frame rate of the layer compositor can refer to the frame rate of the display screen image synthesized by the layer compositor, or simply the frame rate of the display screen image. In possible implementations, the information of the display screen image includes the frame rate of the display screen image.

[0196] In one embodiment, the abnormal information of the frame rate decision event includes: when a frame-switching event of a specified type occurs, if the suggested frame rate is inconsistent with the frame-switching event of the specified type, the occurrence of the frame-switching event of the specified type indicates that the upper limit of the suggested frame rate is equal to the lower limit of the suggested frame rate. That is, after a frame-switching event of a specified type occurs, the upper limit of the suggested frame rate provided by the frame rate decision center should be equal to the lower limit of the suggested frame rate, but the upper limit of the suggested frame rate is not equal to the lower limit of the suggested frame rate.

[0197] In this embodiment of the application, the upper limit of the frame rate can also be called the maximum frame rate, and the lower limit of the frame rate can also be called the minimum frame rate.

[0198] In one embodiment, the frame-cutting events of the specified type include: fingerprint recognition events and / or animation effect events.

[0199] In this embodiment, the electronic device may be configured with a fingerprint recognition area, which may be located in the display area of ​​the electronic device's screen. A fingerprint recognition event can refer to an event in which the electronic device initiates fingerprint recognition based on the finger press information detected by the fingerprint recognition area of ​​the display screen. Before a fingerprint recognition event occurs, a finger press event may occur, i.e., an event in which a finger is detected pressing on the fingerprint recognition area.

[0200] Animation effect events refer to events in which an electronic device detects the occurrence of animation playback. For example, when switching between applications running in the foreground, the electronic device may play animation effects during the opening and closing of the application. Similarly, when a non-desktop application is running in the foreground, the electronic device may also play animation effects during the display of the desktop.

[0201] In one embodiment, before the frame rate decision center (or advanced graphics platform service) reports abnormal information about the frame rate decision event, the process may further include: when the advanced graphics platform service (or frame rate decision center) detects the occurrence of the frame-switching event of the specified type, it starts a detection thread to detect the frame rate at the time of the frame-switching event of the specified type; when the advanced graphics platform service (or frame rate decision center) executes the send decision function during the frame rate decision process, and the upper limit of the frame rate in the suggested frame rate is equal to the lower limit of the frame rate in the suggested frame rate, it may send the suggested frame rate to the detection thread; after the detection thread starts detecting the frame rate of the frame-switching event of the specified type, and receives the suggested frame rate, if it is inconsistent with the frame rate of the frame-switching event of the specified type, the frame rate decision center (or advanced graphics platform service) may determine that abnormal information about the frame rate decision event has occurred.

[0202] In this embodiment, the decision function can be an execution step in the frame rate decision process. The frame rate decision process can be the process by which a frame rate decision center generates a suggested frame rate. The decision function can be used to generate a suggested frame rate during the frame rate decision process performed by the frame rate decision center. The detection thread can be a thread set up in the frame rate decision center to detect whether there is any abnormal information.

[0203] After a frame-switching event of a specified type occurs, the detection thread obtains information about the event's occurrence. The detection thread can then enter a waiting state, awaiting the advanced graphics platform service or the frame rate decision center to send the current suggested frame rate. If, within the pre-set detection waiting time, the detection thread fails to detect the suggested frame rate corresponding to the specified frame-switching event, it determines that an event has occurred and reports an exception.

[0204] In one embodiment, after the frame rate decision center (or advanced graphics platform service) starts the detection thread of the advanced graphics platform service to detect the frame-switching event of the set type, the method further includes: if the detection thread does not receive the suggested frame rate within a set time, determining abnormal information that a frame rate decision event has occurred.

[0205] In possible implementations, the frame rate decision center serves an advanced graphics platform, or the frame rate decision center includes advanced graphics platform services. If the detection thread obtains information about a frame-cutting event of a specific type, it can determine whether the frame rate of the layer compositor or the suggested frame rate generated by the frame rate decision center is consistent with the frame-cutting event of the specified type. Simultaneously, the detection thread can also utilize the specific characteristics of the suggested frame rate corresponding to the frame-cutting event of the specified type to conduct a check on the suggested frame rate of the frame rate decision center or the frame rate of the layer compositor.

[0206] In one embodiment, after the frame rate decision center sends the suggested frame rate to the detection thread, the process may further include: if the detection thread detects a frame-switching event of the specified type and the frame rate received by the detection thread is consistent with the frame rate of the frame-switching event of the specified type, the frame rate decision center (or the detection thread) obtains the frame rate of the layer compositor; if the frame rate of the layer compositor is inconsistent with the frame rate of the frame-switching event of the specified type, the frame rate decision center (or the advanced graphics platform service) may detect the frame rate switching action of the layer compositor; if the frame rate switching action is inconsistent with the frame rate of the event of the specified type, the frame rate decision center (or the detection thread) determines abnormal information indicating the occurrence of a frame rate decision event.

[0207] The frame rate of the frame-switching event of the above-mentioned setting type can refer to the suggested frame rate when the frame-switching event of the setting type is used as a frame rate decision event.

[0208] In one embodiment, the abnormal information of the frame rate decision event includes: when a frame-cutting event of a certain type occurs, if the frame rate of the layer compositor is inconsistent with the frame-cutting event of the certain type, the frame-cutting event of the certain type can indicate that the recommended frame rate is the maximum frame rate of the electronic device.

[0209] In this embodiment, the maximum frame rate of the electronic device can refer to the maximum frame rate supported by the electronic device. When a frame-switching event of a certain type occurs, the frame rate decision center should provide a recommended frame rate of a specific type, such as an upper limit equal to a lower limit, a maximum frame rate supported by the electronic device, or a minimum frame rate supported by the electronic device.

[0210] In one embodiment, before reporting the abnormal information of the frame rate decision event, the method may further include: when the advanced graphics platform service (or frame rate decision center) detects the occurrence of the frame-cutting event of the specified type, the advanced graphics platform service (or frame rate decision center) can obtain the frame rate of the layer compositor; if the frame rate of the layer compositor is inconsistent with the frame-cutting event of the specified type, and the frame rate of the layer compositor does not change to the frame rate corresponding to the frame-cutting event of the specified type within a specified time, the frame rate decision center (or advanced graphics platform) can determine the abnormal information of the occurrence of the frame rate decision event.

[0211] If the advanced graphics platform or frame rate decision center can detect a frame-switching event of a specified type, the frame rate decision center can provide a suggested frame rate based on the frame-switching event of the specified type. If the frame rate of the composited screen image by the layer compositor is inconsistent with the suggested frame rate, it indicates that there is an anomaly in either the layer compositor or the frame rate decision center.

[0212] In one embodiment, after the advanced graphics platform service (or frame rate decision center) obtains the frame rate of the layer compositor, it may further include: if the frame rate of the layer compositor is inconsistent with the frame-cutting event of the set type, the advanced graphics platform service (or frame rate decision center) may trigger a detection thread to wait for the frame rate change of the layer compositor; if the detection thread receives information about the frame rate change of the layer compositor, and the information about the frame rate change of the layer compositor is inconsistent with the frame-cutting event of the set type, the frame rate decision center (or advanced graphics platform) determines that the frame rate of the layer compositor has not changed to the frame rate corresponding to the frame-cutting event of the set type within a set time.

[0213] In a possible implementation, if the detection thread receives information about the frame rate change of the layer compositor, and the information about the frame rate change of the layer compositor is inconsistent with the frame-cutting event of the set type, and no further frame rate change of the layer compositor to be consistent with the frame-cutting event of the set type is detected within a set time, the frame rate decision center (or advanced graphics platform) can determine that the frame rate of the layer compositor has not changed to the frame rate corresponding to the frame-cutting event of the set type within the set time.

[0214] In one embodiment, after the frame rate decision center (or advanced graphics platform) triggers the detection thread to wait for the frame rate change of the layer compositor, it may further include: if the detection thread does not receive information about the frame rate change of the layer compositor within a set time, the frame rate decision center (or advanced graphics platform) may obtain the frame rate of the layer compositor; if the obtained frame rate of the layer compositor is inconsistent with the frame-cutting event of the set type, the frame rate decision center (or advanced graphics platform) may determine that the frame rate of the layer compositor has not changed to the frame rate corresponding to the frame-cutting event of the set type within the set time.

[0215] In one embodiment, Figure 6 Based on the method shown, before step S61, the frame rate control method may further include: the frame rate decision center (or advanced graphics platform) can obtain newly generated frame rate decision events; the frame rate decision center (or advanced graphics platform) can add the newly generated frame rate decision events to the at least one frame rate decision event.

[0216] The frame rate decision center receives newly generated frame rate decision events, which may include: receiving information about frame-switching events and generating frame rate decision events based on that information. During the interval in which the frame rate decision center generates a suggested frame rate, multiple frame rate decision events may occur. Whenever a new frame rate decision event occurs, the frame rate decision center adds it to its list of frame rate decision events, enabling it to generate a suggested frame rate based on all frame rate decision events occurring within the frame rate decision time interval.

[0217] In one example of this application, Figure 6 When step S61 is implemented, the layer compositor can use the binder mechanism in the electronic device to send information about the display screen to the frame rate decision center. The binder mechanism can refer to an inter-process communication (IPC) mechanism used in electronic device systems. Through the binder mechanism, different processes in an electronic device can communicate and exchange data efficiently, providing support for the interaction between various system services and applications.

[0218] For example, in execution Figure 6 During step S61, the surfaceflinger of the electronic device can maintain a count of the currently synthesized screens while synthesizing the display screen image. When it detects a return to the desktop, the surfaceflinger can send a binder notification to the frame rate decision center, informing the frame rate decision center that it has returned to the desktop and the current number of screens is N. N is an integer greater than or equal to 1. Accordingly, the information of the display screen image synthesized by the surfaceflinger can be represented as follows: the application generating the display screen image is a desktop application, and the current display screen image corresponds to the number of screens N.

[0219] For example, after step S61, the frame rate decision center receives a binder notification and reads the current number of screens from the information on the display screen. The frame rate decision center first checks whether the application package name recorded by the frame rate decision center is the desktop. If the application package name recorded by the frame rate decision center is not the package name of a desktop application, and the current scenario is not a multi-window scenario, it means that the target application that generated the information on the display screen is inconsistent with the application package name recorded by the advanced graphics platform service of the electronic device. In this case, the frame rate decision center can actively replace the currently recorded application package name with the desktop and report the abnormal information. If the application package name recorded by the frame rate decision center is the desktop, then the next check is performed.

[0220] Based on the application package name "Desktop" recorded in the frame rate decision center, applications such as... can be executed. Figure 6 Step S62 in the illustrated embodiment. (As shown) Figure 8 As shown, when the information of the display screen image synthesized by the layer compositor is provided by the desktop application, the frame rate decision center is notified. If the application package currently recorded by the frame rate decision center is named "desktop", the frame rate decision center then checks in the current decision pool whether the following target frame rate decision events exist: fingerprint unlock event, MEMC frame interpolation event, lock screen notification event, pull-down notification bar event, and boot navigation event. None of the above frame rate decision events can exist when the desktop application is running in the foreground. If at least one of the above frame rate decision events exists in the decision pool, the frame rate decision center can obtain the target frame rate decision event, actively release (or delete) the above target frame rate decision event, avoid generating incorrect suggested frame rates, realize frame rate self-recovery, and report the abnormal information that the target frame rate decision event is incorrectly present in the decision pool. If there is no above target frame rate decision event, the next self-check is performed.

[0221] In execution Figure 6 During the steps shown, or in addition to performing Figure 6 In addition to the steps shown, the frame rate decision center can also continuously monitor abnormal information that occurs during the frame rate decision process (i.e., abnormal information of the frame rate decision events in the aforementioned embodiments) and report the abnormal information to the server at the specified address.

[0222] The process by which the frame rate decision center listens for and reports anomalies is as follows: When the number of screens sent from SurfaceFlinger is 1, the frame rate decision center checks if the following target frame rate decision events exist in the decision pool: hot-plug events and virtual screen events. If both events exist, the frame rate decision center can proactively release the hot-plug event and virtual screen (equivalent to deleting the target frame rate decision event) and report it to the server at the specified address. When the number of screens corresponding to the information of the display screen image synthesized by the layer compositor is greater than 1, the frame rate decision center can check if hot-plug events and virtual screens exist. If not, it reports an anomaly. The aforementioned hot-plug events, also known as live plug-in events, refer to inserting or removing hardware components from electronic devices without shutting down the system power or interrupting device operation. Hot-plug events occur when some pluggable hardware components of an electronic device are inserted or removed.

[0223] When SurfaceFlinger performs a frame rate switch (also known as frame cutting), the frame cutting event can be notified to the frame rate decision center via the binder interface—the interface for setting the layer compositor frame rate state (SetSFFpsState). In one possible implementation, after SurfaceFlinger completes frame cutting, the target frame rate at the time of frame cutting and the hardware tearing effect signal synchronized from the screen driver can be periodically notified to the frame rate decision center.

[0224] When the frame rate decision center receives the target frame rate and hardware tearing effect signal synchronized by SurfaceFlinger, it can first detect whether the target frame rate value of SurfaceFlinger is consistent with the actual screen refresh rate value corresponding to the hardware tearing effect signal. If they are inconsistent, an abnormal information is reported. The abnormal information here is equivalent to the following in the previous embodiment: when a frame cutting event occurs, the target frame rate of the layer compositor is inconsistent with the frame rate corresponding to the screen hardware tearing effect signal of the electronic device.

[0225] If the target frame rate value of SurfaceFlinger is consistent with the actual screen refresh rate value corresponding to the hardware tearing effect signal, and the current frame rate detection center's detection thread is in the refresh rate test start state, then the frame rate decision center determines whether the target frame rate sent by the layer compositor and the hardware tearing effect signal are consistent with the real-time frame rate currently detected by the detection thread. If they are consistent, the detection is canceled; otherwise, it continues to wait.

[0226] In this embodiment, the suggested frame rate upper limit corresponding to the motion effect event is equal to the suggested frame rate lower limit. When the frame rate decision center receives the start-up data of the motion effect from other application processes (equivalent to a frame-switching event of a set type), it triggers the detection thread to execute the first type of scene detection (SceneTestStart), and starts to detect whether the suggested frame rate upper limit (maximum frame per second, maxFps) generated by the frame rate decision center is equal to the suggested frame rate lower limit (minimum frame per second, minFps). If the suggested frame rate upper limit and the suggested frame rate lower limit are not equal, it is equivalent to the suggested frame rate being inconsistent with the frame-switching event of the set type when the frame-switching event occurs, and the frame rate decision center reports abnormal information.

[0227] The frame rate decision center initiates the normal frame rate decision process based on frame rate decision events in the decision pool. Figure 7Following step S74, the step of sending a suggested frame rate (sendPolicyByAction) is executed. If the upper limit of the suggested frame rate is equal to the lower limit, the detection thread is notified of the suggested frame rate. If the detection thread is in the SceneTestStart state at this time, it is determined whether the suggested frame rate is consistent with the frame rate the detection thread is waiting to detect. If they are inconsistent, it means that the suggested frame rate is inconsistent with the frame-switching event of a specified type, and an exception is reported. If the suggested frame rate is consistent with the frame rate the detection thread is waiting to detect, the frame rate decision center determines whether the suggested frame rate is consistent with the frame rate of the maintained SurfaceFlinger. If they are consistent, the frame rate decision center does not need to trigger frame-switching detection; otherwise, the frame rate decision center can trigger frame-switching detection for SurfaceFlinger and wait for the SurfaceFlinger's frame-switching event.

[0228] In this application example, if the suggested frame rate corresponding to the fingerprint recognition event is the maximum frame rate among all frame rate decision events, when the frame rate detection center receives the fingerprint recognition event, it notifies the detection thread. The detection thread determines whether the current frame rate of the SurfaceFlinger is the maximum value. If the current frame rate of the SurfaceFlinger is the maximum value, then it is not necessary to trigger the detection thread to perform frame switching detection on the SurfaceFlinger. Otherwise, the detection thread is triggered to perform frame switching detection on the SurfaceFlinger, and waits for the SurfaceFlinger to perform a frame switching event.

[0229] If the detection thread does not receive a frame-switching event from SurfaceFlinger within a set time, the detection thread can trigger a timeout mechanism to actively obtain the frame rate of SurfaceFlinger and the screen refresh rate. If the obtained frame rate of SurfaceFlinger is still inconsistent with the suggested frame rate, it is equivalent to the target frame rate of the layer compositor being inconsistent with the optimal frame rate decision event selected by the advanced graphics platform service of the electronic device when a frame-switching event occurs. In this case, the frame rate decision center reports an abnormality.

[0230] If the duration of the animation expires, it is equivalent to the frame rate decision center reporting abnormal information when a frame-switching event of a certain type occurs and the duration of the frame-switching event of that type expires.

[0231] This application embodiment also provides a frame rate control device, including: a display information acquisition module, used to acquire information about the display screen image of an electronic device synthesized by a layer synthesizer; a target frame rate decision event module, used to determine a target frame rate decision event among at least one frame rate decision events recorded by the electronic device that does not match the information of the display screen image; the at least one frame rate decision event is used by the frame rate decision center to decide the frame rate of the display screen of the electronic device; a deletion module, used to delete the target frame rate decision event from the at least one frame rate decision event; and a decision module, used to decide on a suggested frame rate to be provided to the electronic device based on the remaining frame rate decision events among the at least one frame rate decision events.

[0232] In the embodiments of this application, the frame rate control device can implement the steps of the frame rate control method provided in any embodiment of this application.

[0233] This application also provides an electronic device having the frame rate control device provided in any embodiment of this application.

[0234] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0235] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0236] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the above-described method embodiments.

[0237] This application also provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.

[0238] This application also provides a chip system, which includes a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the steps of any method embodiment of this application. The chip system can be a single chip or a chip module composed of multiple chips.

[0239] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer, or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).

[0240] The above-described embodiments are optional embodiments provided by this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the technical scope disclosed in this application should be included within the protection scope of this application.

Claims

1. A frame rate control method characterized by, include: Obtain information about the display screen of the electronic device composited by the layer compositor; Identify at least one frame rate decision event recorded by the electronic device that does not match the information displayed on the screen. The at least one frame rate decision event is used by the frame rate decision center to decide the frame rate of the display screen of the electronic device; Delete the target frame rate decision event from the at least one frame rate decision event; Based on the remaining frame rate decision events in the at least one frame rate decision event, a recommended frame rate is determined to be provided to the electronic device.

2. The method of claim 1, wherein, The information of the display screen includes: the number of screens managed by the layer compositor; the determination of the target frame rate decision event that does not match the information of the display screen among at least one frame rate decision event recorded by the electronic device includes: If the number of screens managed by the layer compositor is less than a set threshold, the frame rate decision events recorded when the number of screens managed by the layer compositor is greater than or equal to the set threshold are determined as the target frame rate decision events.

3. The method of claim 2, wherein, When the number of screens managed by the layer compositor is less than a set threshold, the target frame rate decision event includes a hot-plug event and / or a virtual screen event; the hot-plug event indicates that the electronic device is connected to an external display screen; the virtual screen event indicates that the electronic device has created a virtual display screen.

4. The method according to any one of claims 1 to 3, characterized in that, The information displayed on the screen includes: the target application that generated the information displayed on the screen; the determination of at least one frame rate decision event recorded by the electronic device that does not match the information displayed on the screen includes: Identify a frame rate decision event that contradicts the operation of the target application, and designate it as the target frame rate decision event.

5. The method of claim 4, wherein, The target application is a desktop application; The target frame rate decision events include: motion estimation motion compensation frame interpolation events, lock screen notification events, pull-down notification bar events, and / or boot navigation events; the motion estimation motion compensation frame interpolation event indicates that the electronic device is running a preset non-desktop application; the lock screen notification event indicates that the electronic device is in a lock screen state; the pull-down notification bar event indicates that the system pull-down notification bar of the electronic device is expanded; and the boot navigation event provides function indication information when the electronic device starts up.

6. The method according to claim 4 or 5, characterized in that, After obtaining the information of the display screen image of the electronic device synthesized by the layer synthesizer, the method further includes: If the target application's package name is inconsistent with the application package name recorded in the frame rate decision center, the application package name recorded in the frame rate decision center will be changed to the package name of the target application.

7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Report abnormal information of frame rate decision events, wherein the abnormal information of frame rate decision events includes at least one of the following: Delete the information of the target frame rate decision event; When a frame-cutting event occurs, the target frame rate of the layer compositor is inconsistent with the frame rate corresponding to the screen hardware tearing effect signal of the electronic device. The target application that generates the information of the display screen is inconsistent with the application package name recorded by the frame rate decision center; When a frame-cutting event occurs, the target frame rate of the layer compositor is inconsistent with the optimal frame rate decision event selected by the frame rate decision center; When a frame-switching event of a specified type occurs, the suggested frame rate is inconsistent with the frame-switching event of the specified type. When a frame-cutting event of a specified type occurs, the frame rate of the layer compositor is inconsistent with the event of the specified type. When a frame-slicing event of a specified type occurs, the duration of the frame-slicing event of that specified type times out.

8. The method of claim 7, wherein, The abnormal information of the frame rate decision event includes: when a frame-switching event of a set type occurs, if the suggested frame rate is inconsistent with the frame-switching event of the set type, the occurrence of the frame-switching event of the set type indicates that the upper limit of the suggested frame rate is equal to the lower limit of the suggested frame rate.

9. The method of claim 8, wherein, The frame-cutting events of the specified type include: fingerprint recognition events and / or animation effect events.

10. The method according to claim 8 or 9, characterized in that, Before reporting the abnormal information of the frame rate decision event, it also includes: When the frame rate decision center detects a frame-switching event of the specified type, it starts a detection thread to detect the frame rate at the time of the frame-switching event of the specified type. During the frame rate decision-making process, when the frame rate decision center executes the decision-making function and the upper limit of the frame rate in the suggested frame rate is equal to the lower limit of the frame rate in the suggested frame rate, the suggested frame rate is sent to the detection thread. After the detection thread starts detecting the frame rate of the frame-switching event of the set type, and if the received suggested frame rate is inconsistent with the frame rate of the frame-switching event of the set type, abnormal information of a frame rate decision event is determined.

11. The method of claim 10, wherein, After the detection thread of the frame rate decision center is activated to detect the frame-switching event of the specified type, the method further includes: If the detection thread does not receive the suggested frame rate within a set time, it determines that an abnormal information of a frame rate decision event has occurred.

12. The method according to claim 10 or 11, characterized in that, After sending the suggested frame rate to the detection thread, the method further includes: If the detection thread detects a frame-cutting event of the specified type and receives the suggested frame rate, and the frame rate is consistent with the frame rate of the frame-cutting event of the specified type, the frame rate of the layer compositor is obtained. If the frame rate of the display screen is inconsistent with the frame rate of the frame-switching event of the set type, the frame rate switching action of the layer compositor is detected; If the frame rate switching action is inconsistent with the frame rate of the event of the specified type, an abnormal information of a frame rate decision event is determined.

13. The method according to claim 7, characterized in that, The abnormal information of the frame rate decision event includes: when a frame-cutting event of a certain type occurs, if the frame rate of the layer compositor is inconsistent with the event of the certain type, the event of the certain type indicates that the recommended frame rate is the maximum frame rate of the electronic device.

14. The method according to claim 13, characterized in that, Before reporting the abnormal information of the frame rate decision event, it also includes: When the frame rate decision center detects a frame-cutting event of the specified type, the frame rate of the layer compositor is obtained; If the frame rate of the layer compositor is inconsistent with the frame-cutting event of the set type, and the frame rate of the layer compositor does not change to the frame rate corresponding to the frame-cutting event of the set type within a set time, abnormal information indicating that the frame rate decision event has occurred is determined.

15. The method according to claim 14, characterized in that, After obtaining the frame rate of the layer compositor, the process also includes: If the frame rate of the layer compositor is inconsistent with the frame-cutting event of the set type, a detection thread is triggered to wait for the frame rate of the layer compositor to change. If the detection thread receives information about the frame rate change of the layer compositor, and the information about the frame rate change of the layer compositor is inconsistent with the frame-cutting event of the set type, it is determined that the frame rate of the layer compositor has not changed to the frame rate corresponding to the frame-cutting event of the set type within a set time period.

16. The method according to claim 15, characterized in that, After the trigger detection thread waits for the frame rate change of the layer compositor, it also includes: If the detection thread does not receive information about the frame rate change of the layer compositor within a set time, the frame rate of the layer compositor is obtained. If the frame rate of the acquired layer compositor is inconsistent with the frame-cutting event of the set type, it is determined that the frame rate of the layer compositor has not changed to the frame rate corresponding to the frame-cutting event of the set type within a set time period.

17. The method according to any one of claims 1-16, characterized in that, The method further includes: Obtain the newly generated frame rate decision event; The newly generated frame rate decision event is added to the at least one frame rate decision event.

18. An electronic device, characterized in that, The electronic device includes: a processor and a memory; The memory is used to store a program for the electronic device to perform the method as described in any one of claims 1-17, and to store data related to implementing the method as described in any one of claims 1-17; The processor is configured to execute programs stored in the memory.

19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-17.