Frame rate determination method and device and electronic equipment

By calculating the weighted average frame rate on electronic devices based on the number of frames corresponding to multiple time periods, the problem of frame rate acquisition for applications not connected to the SDK is solved, more effective computing resource scheduling is achieved, and the power consumption of electronic devices is saved.

CN119342260AActive Publication Date: 2025-01-21VIVO MOBILE COMM CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411432257.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-01-21
Estimated Expiration
2044-10-14

AI Technical Summary

Technical Problem

Electronic devices cannot obtain the latest frame rate settings of applications that are not connected to the SDK, resulting in the inability to schedule corresponding computing resources, increasing the power consumption of electronic devices.

Method used

The frame rate of the application is determined by determining the frame rate based on the number of frames corresponding to multiple time periods when the application is running, and calculating a weighted average based on the frame rate and weight.

Benefits of technology

It realizes scheduling of computing resources suitable for the application based on the frame rate obtained in real time, avoiding excessive scheduling and saving the power consumption of electronic equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342260A_ABST
    Figure CN119342260A_ABST
Patent Text Reader

Abstract

The invention discloses a frame rate determination method and device and electronic equipment, and belongs to the technical field of communication. The method comprises the steps of determining M frame rates in one-to-one correspondence with M time periods based on M frame numbers in one-to-one correspondence with M time periods under the condition of running a first application, M being an integer greater than 1; determining a weighted average value of the M frame rates based on the M frame rates and the weight of each frame rate; and obtaining a first frame rate based on the weighted average and the maximum frame rate in the M frame rates, and determining the first frame rate as the frame rate of the first application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and specifically relates to a frame rate determination method, device and electronic equipment. Background Art

[0002] With the development of electronic devices, electronic devices can adjust the frame rate of applications to meet the requirements of different application performance. When the frame rate of an application changes, a software development kit (SDK) can notify the electronic device of the frame rate after the application is switched.

[0003] However, there are many applications on electronic devices that are not connected to the SDK. When the application is not connected to the SDK, the electronic device will not be able to know the latest frame rate gear of the application. For example: when the frame rate gear of a game application is 60 Hz, if the user wants to save power on the electronic device, the electronic device can adjust the frame rate of the game application to 30Hz. However, since the electronic device does not know the latest frame rate gear of the game application, the electronic device will still execute according to the 60HZ scheduling strategy, causing the electronic device to tilt more computing resources than expected to the game application. In this way, the power consumption of the electronic device is increased. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a frame rate determination method, device and electronic device, which can save power consumption of the electronic device.

[0005] In a first aspect, an embodiment of the present application provides a frame rate determination method, the method comprising: when running a first application, determining M frame rates corresponding to the M time periods based on the M frame numbers corresponding to the M time periods, where M is an integer greater than 1; determining a weighted average of the M frame rates based on the M frame rates and the weight of each frame rate; obtaining a first frame rate based on the weighted average and the maximum frame rate among the M frame rates, and determining the first frame rate as the frame rate of the first application.

[0006] In a second aspect, an embodiment of the present application provides a frame rate determination device, which includes: a determination module and a processing module. The determination module is used to determine M frame rates corresponding to M time periods based on M frame numbers corresponding to M time periods when running a first application, where M is an integer greater than 1; and based on the M frame rates and the weight of each frame rate, determine a weighted average of the M frame rates; the processing module is used to obtain a first frame rate based on the weighted average determined by the determination module and the maximum frame rate among the M frame rates, and determine the first frame rate as the frame rate of the first application.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0010] In a sixth aspect, an embodiment of the present application provides a computer program / program product, wherein the computer program / program product is stored in a storage medium, and the program / program product is executed by at least one processor to implement the method described in the first aspect.

[0011] In an embodiment of the present application, when the first application is running, based on the M frame numbers corresponding to the M time periods, the M frame rates corresponding to the M time periods are determined, where M is an integer greater than 1; based on the M frame rates and the weight of each frame rate, the weighted average of the M frame rates is determined; based on the weighted average and the maximum frame rate among the M frame rates, the first frame rate is obtained, and the first frame rate is determined as the frame rate of the first application. In this solution, since the electronic device can determine the frame rate corresponding to each time period in the M time periods based on the M frame numbers corresponding to the M time periods obtained in real time, and then further weight the frame rate of the first application based on the M frame rates, the electronic device can schedule computing resources suitable for the first application based on the frame rate, thereby avoiding scheduling too many computing resources for the first application when the electronic device cannot obtain the frame rate of the first application. This saves power consumption of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 This is one of the flow charts of a frame rate determination method provided in an embodiment of the present application;

[0013] Figure 2 This is a second flow chart of a method for determining a frame rate provided in an embodiment of the present application;

[0014] Figure 3 This is a third flow chart of a frame rate determination method provided in an embodiment of the present application;

[0015] Figure 4 This is a fourth flow chart of a frame rate determination method provided in an embodiment of the present application;

[0016] Figure 5 is a structural schematic diagram of a frame rate determination device provided in an embodiment of the present application;

[0017] Figure 6 This is one of the hardware structure diagrams of an electronic device provided in an embodiment of the present application;

[0018] Figure 7 This is the second hardware structure diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0020] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0021] The terms "at least one (item)", "at least one of" and the like in the specification and claims of the present application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".

[0022] The following is an explanation of some concepts and / or terms involved in the frame rate determination method provided in the embodiments of the present application.

[0023] 1. SDK is generally a collection of development tools used by software engineers to build application software for specific software packages, software frameworks, hardware platforms, operating systems, etc.

[0024] 2. Dequeue / Queue Buffer: The game thread requests the buffer through Dequeue Buffer for rendering operations, and releases the buffer through Queue Buffer after rendering.

[0025] 3. SurfaceFlinger is a service in the Android operating system. It starts with the system startup and is mainly used for screen rendering and image synthesis. It is then handed over to the central processing unit (CPU) or graphics processing unit (GPU) to generate the final display on the display device.

[0026] The frame rate determination method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0027] The frame rate determination method in the embodiment of the present application can be applied to the scenario of adjusting the frame rate of an application.

[0028] With the continuous development of electronic devices, the types of applications that electronic devices can support are increasing, and the performance requirements of electronic devices are also increasing. Applications can usually adjust the frame rate gear to control the performance requirements of applications. Many functions of electronic devices also rely on the frame rate gear settings of applications, such as scheduling strategies for different gears, interpolation strategy related functions, etc. When analyzing application-related big data, the frame rate gear of the application is also an important dimension.

[0029] Currently, electronic devices’ acquisition of application frame rates is highly dependent on the SDK that the application party has connected to the electronic device. When the frame rate gear of the application changes, the electronic device is notified of the frame rate gear that the application has switched to through the SDK, and the electronic device updates the corresponding policy based on the latest frame rate gear. However, there are many applications on the market that are not connected to the SDK, which makes it impossible for electronic devices to obtain the frame rate gear of the application, and related functions that depend on the frame rate gear cannot be implemented. When using these applications, the user experience will be far worse than that of applications that can recognize the frame rate gear.

[0030] Take game application A as an example. There are two frame rate levels in game application A: 30HZ and 60HZ. However, since game application A is not connected to the SDK, the electronic device cannot know the frame rate level set by game application A during its operation, and can only default to 60HZ for game application A. When the user sets the frame rate to 30HZ in game application A, the electronic device will still execute according to the 60HZ scheduling strategy, causing the electronic device to tilt more system computing resources than expected to game application A, which in turn increases the power consumption of the electronic device.

[0031] At the same time, since it is impossible to identify that the electronic device has switched to 30HZ, users cannot use the interpolation function and cannot use the independent graphics chip to interpolate game application A from 30HZ to a higher refresh rate. In addition, when electronic device manufacturers conduct big data analysis of game applications, the data of game application A 60HZ and 30HZ will be confused, reducing the overall credibility of the data.

[0032] In the frame rate determination method, device and electronic device provided in the embodiment of the present application, when the first application is running, based on the M frame numbers corresponding to the M time periods, the M frame rates corresponding to the M time periods are determined, where M is an integer greater than 1; based on the M frame rates and the weight of each frame rate, the weighted average of the M frame rates is determined; based on the weighted average and the maximum frame rate among the M frame rates, the first frame rate is obtained, and the first frame rate is determined as the frame rate of the first application. In this solution, since the electronic device can determine the frame rate corresponding to each time period in the M time periods based on the M frame numbers corresponding to the M time periods obtained in real time, and then further weight the frame rate of the first application based on the M frame rates, the electronic device can schedule computing resources suitable for the first application based on the frame rate, thereby avoiding scheduling too many computing resources for the first application when the electronic device cannot obtain the frame rate of the first application. Thereby saving the power consumption of the electronic device.

[0033] The execution subject of the frame rate determination method provided in the embodiment of the present application may be a frame rate determination device, and the frame rate determination device may be an electronic device, or a functional module or entity in an electronic device. The technical solution provided in the embodiment of the present application is described below using an electronic device as an example.

[0034] The present application embodiment provides a method for determining a frame rate. Figure 1 FIG. 1 is a flowchart of a frame rate determination method provided by an embodiment of the present application, which can be applied to electronic devices. Figure 1 As shown, the frame rate determination method provided in the embodiment of the present application may include the following steps 201 to 203.

[0035] Step 201: When running the first application, the electronic device determines M frame rates corresponding to the M time periods based on the M frame numbers corresponding to the M time periods.

[0036] In the embodiments of the present application, M is an integer greater than 1.

[0037] In some embodiments of the present application, the first application may be any one of the following: a game application, a reading application, a chat application, a video application, etc. The embodiments of the present application do not limit this.

[0038] In some embodiments of the present application, the duration corresponding to each of the above M time periods is the same.

[0039] In some embodiments of the present application, the number of frames corresponding to a time period can be understood as: the number of image frames of the first application acquired by the electronic device within a time period.

[0040] In some embodiments of the present application, the frame number may be referred to as buffer_cnt.

[0041] In some embodiments of the present application, the electronic device may start a timer to calculate the number of frames corresponding to each time period.

[0042] In some embodiments of the present application, the timing duration of the above timer is the same as the duration corresponding to each time period.

[0043] In some embodiments of the present application, the electronic device can start a timer through SurfaceFlinger to calculate the number of frames corresponding to each time period.

[0044] For example, when the first application is running, SurfaceFlinger can start a timer with a duration of 200 ms to obtain the total number of application buffers buffer_cnt obtained within 200 ms.

[0045] In some embodiments of the present application, the M frame numbers may be the same or different, which is not limited in the embodiments of the present application.

[0046] It can be understood that, affected by the performance of the electronic device, when the frame rate set by the first application remains unchanged, the number of M frames acquired by the electronic device may also be different.

[0047] In some embodiments of the present application, the electronic device may determine whether the currently acquired number of frames exceeds a preset threshold M during the running of the first application, and when it exceeds the preset threshold M, determine M frame rates based on the M number of frames and the first value.

[0048] In some embodiments of the present application, when running the first application, the electronic device can read the configuration parameters to determine the preset threshold M required for frame rate recognition.

[0049] Exemplarily, the electronic device can read the configuration parameters through SurfaceFlinger to determine the preset threshold M required for frame rate recognition.

[0050] In some embodiments of the present application, Figure 1 ,like Figure 2 As shown, in the above step 201, "the electronic device determines M frame rates corresponding to M time periods one by one based on M frame numbers corresponding to M time periods one by one" can be specifically implemented through the following step 301.

[0051] Step 301: When running a first application, the electronic device multiplies the number of frames corresponding to each of M time periods by a first value to obtain a frame rate corresponding to each time period.

[0052] In an embodiment of the present application, the first value is the number of time periods in the M time periods per second.

[0053] In some embodiments of the present application, the duration of each of the above M time periods is less than 1 second.

[0054] In some embodiments of the present application, the electronic device may divide 1 second by the duration corresponding to the time period to obtain the above-mentioned first value.

[0055] For example, when the length of each time period is 200 ms, the electronic device can calculate that the number of time periods contained in each second is 1000÷200=5, which is the above-mentioned first value.

[0056] In some embodiments of the present application, the electronic device may multiply the number of frames corresponding to each time period by a first value to obtain a frame rate corresponding to each time period.

[0057] It can be understood that when the number of time periods contained in each second is a first value, after the electronic device determines the number of frames corresponding to a time period, it multiplies the number of frames by the first value to obtain the number of frames corresponding to each second, thereby obtaining a frame rate.

[0058] For example, when a time period is 200ms and the number of frames corresponding to the time period is 12, the electronic device can calculate that each second contains 5 time periods, and then the electronic device can calculate a frame rate fps_simulate of 5×12=60HZ.

[0059] In this way, since the duration corresponding to each time period is less than 1 second, the electronic device can also obtain the corresponding frame rate by obtaining the number of frames corresponding to each time period, rather than obtaining a frame rate by the total number of frames obtained per second. Therefore, more frame rate data can be obtained in a shorter time, and the timeliness of the electronic device in determining the first application frame rate is improved.

[0060] In some embodiments of the present application, the duration of each of the above M time periods may be equal to 1 second.

[0061] In some embodiments of the present application, when the length of each time period is 1 second, the electronic device can directly determine the frame rate corresponding to each time period based on the number of frames corresponding to each time period.

[0062] In some embodiments of the present application, when the length of a time period is 1 second and the number of frames corresponding to the time period is n, the electronic device can determine that the frame rate corresponding to the time period is nHZ.

[0063] For example, when the length of a time period is 1 second and the number of frames corresponding to the time period is 30, the electronic device may determine that the frame rate corresponding to the time period is 30 Hz.

[0064] Step 202: The electronic device determines a weighted average of the M frame rates based on the M frame rates and the weight of each frame rate.

[0065] In some embodiments of the present application, the electronic device may determine a weighted average of the M frame rates based on the M frame rates, the second value, and the weight of each frame rate.

[0066] In the embodiment of the present application, the second value is M.

[0067] In some embodiments of the present application, the time corresponding to a time period is negatively correlated with the weight of the frame rate corresponding to the time period.

[0068] In some embodiments of the present application, the later the time corresponding to a time period is, the greater the weight of a frame rate is.

[0069] In some embodiments of the present application, the electronic device may determine a weighted average of the M frame rates according to the M frame rates, the second value, and the weight of each frame rate, as shown in Formula 1:

[0070]

[0071] Among them, fps i is the i-th frame rate, (1-α) M-i is the weight of the i-th frame rate, and α is the weight coefficient.

[0072] In some embodiments of the present application, α is a fixed value, and the value range of α can be 0 to 1, which can be used to balance real-time performance and accuracy. When the value of α is closer to 1, the weight of the frame rate farther away from the current time is lower, and the real-time performance is stronger, and vice versa.

[0073] In some embodiments of the present application, when running the first application, the electronic device can read the configuration parameters and determine the weight coefficient α.

[0074] Step 203: The electronic device obtains a first frame rate based on the weighted average value and the maximum frame rate among the M frame rates, and determines the first frame rate as the frame rate of the first application.

[0075] In some embodiments of the present application, the electronic device may compare the sizes of the M frame rates to determine the maximum frame rate among the M frame rates.

[0076] In the frame rate determination method provided in the embodiment of the present application, since the electronic device can determine the frame rate corresponding to each of the M time periods according to the M frame numbers corresponding to the M time periods obtained in real time, and then further weight the frame rate of the first application based on the M frame rates, the electronic device can schedule computing resources suitable for the first application according to the frame rate, thereby avoiding scheduling too many computing resources for the first application when the electronic device cannot obtain the frame rate of the first application. This saves the power consumption of the electronic device.

[0077] In some embodiments of the present application, the first application supports at least two frame rates, each frame rate corresponds to two frame rate ranges; Figure 1 ,like Figure 3 As shown, the above step 203 can be specifically implemented through the following step 401.

[0078] Step 401: When the weighted average falls within the first frame rate range and the maximum frame rate among the M frame rates falls within the second frame rate range, the electronic device uses the second frame rate among the at least two frame rates as the first frame rate and determines the first frame rate as the frame rate of the first application.

[0079] In the embodiment of the present application, the first frame rate range and the second frame rate range both correspond to the second frame rate.

[0080] In some embodiments of the present application, the two frame rate ranges corresponding to each frame rate are respectively the frame rate range corresponding to the weighted average and the frame rate range corresponding to the maximum frame rate.

[0081] In some embodiments of the present application, for the weighted average, the electronic device can pre-set at least two frame rate ranges, each frame rate range corresponds to a frame rate, and then after obtaining the weighted average of M frame rates, the electronic device can determine in turn which frame rate range the weighted average falls into.

[0082] Exemplarily, in the first application, at least two frame rates are 30 Hz, 60 Hz, 90 Hz and 120 Hz. The electronic device can set the frame rate range corresponding to the frame rate 30 Hz to be: (0, 30]; the frame rate range corresponding to the frame rate 60 Hz to be: (30, 60]; the frame rate range corresponding to the frame rate 90 Hz to be: (60, 90]; the frame rate range corresponding to the frame rate 120 Hz to be: (90, 120]

[0083] In some embodiments of the present application, for the maximum frame rate, the electronic device can pre-set at least two frame rate ranges, each frame rate range corresponds to a frame rate, and then after obtaining the maximum frame rate among the M frame rates, the electronic device can determine in turn which frame rate range the maximum frame rate falls into.

[0084] Exemplarily, in the first application, at least two frame rates are 30 Hz, 60 Hz, 90 Hz and 120 Hz. The electronic device can set the frame rate range corresponding to the frame rate 30 Hz to be: (0, 35]; the frame rate range corresponding to the frame rate 60 Hz to be: (35, 65]; the frame rate range corresponding to the frame rate 90 Hz to be: (65, 95]; the frame rate range corresponding to the frame rate 120 Hz to be: (95, 125].

[0085] It can be understood that since the application frame output may not be uniform within one second, when the time period for frame rate calculation is less than 1 second, the maximum value of the application frame rate converted per second may be slightly larger than the frame rate gear. Therefore, the at least two frame rate ranges set for the maximum frame rate are larger than the at least two frame rate ranges set for the weighted average.

[0086] It can be understood that when the first frame rate range in which the weighted average falls and the second frame rate range in which the maximum frame rate falls correspond to the same frame rate, the electronic device can determine the frame rate as the frame rate of the first application.

[0087] In this way, after the electronic device calculates the weighted average and the maximum frame rate, when the weighted average and the maximum frame rate fall into different frame rate ranges corresponding to the same frame rate, the frame rate that falls into the range is determined as the frame rate of the first application, thereby improving the accuracy of the electronic device in determining the application frame rate.

[0088] In some embodiments of the present application, when the duration corresponding to each time period is 1 second, each of the at least two frame rates supported by the first application may correspond to a frame rate range, that is, the at least two frame rate ranges set for the weighted average and the at least two frame rate ranges set for the maximum frame rate are the same.

[0089] Exemplarily, at least two frame rates included in the first application are 30 Hz, 60 Hz, 90 Hz and 120 Hz. For the weighted average, the electronic device can set the frame rate range corresponding to the frame rate of 30 Hz to be: (0, 30]; the frame rate range corresponding to the frame rate of 60 Hz to be: (30, 60]; the frame rate range corresponding to the frame rate of 90 Hz to be: (60, 90]; the frame rate range corresponding to the frame rate of 120 Hz to be: (90, 120]. For the maximum frame rate, the electronic device can set the frame rate range corresponding to the frame rate of 30 Hz to be: (0, 30]; the frame rate range corresponding to the frame rate of 60 Hz to be: (30, 60]; the frame rate range corresponding to the frame rate of 90 Hz to be: (60, 90]; the frame rate range corresponding to the frame rate of 120 Hz to be: (90, 120].

[0090] It can be understood that since the duration of each time period is 1 second, the calculated maximum frame rate will not be slightly larger than the frame rate gear, so the at least two frame rate ranges set for the weighted average are the same as the at least two frame rate ranges set for the maximum frame rate.

[0091] In some embodiments of the present application, in the above step 401, "the electronic device uses the second frame rate among at least two frame rates as the first frame rate" can be specifically implemented through the following step 501.

[0092] Step 501: When the second frame rate is greater than or equal to the third frame rate, the electronic device uses the second frame rate as the first frame rate.

[0093] In the embodiment of the present application, the third frame rate is determined based on the number of frames corresponding to the time period before the first time period, and the first time period is the last time period of the M time periods.

[0094] It can be understood that after the electronic device obtains the second frame rate based on the number of frames corresponding to M time periods, it can compare the second frame rate with the third frame rate calculated in the previous round, that is, determine whether the frame rate of the first application has changed. When the frame rate of the first application remains unchanged or increases, the electronic device uses the second frame rate as the frame rate of the first application.

[0095] In some embodiments of the present application, the time period before the first time period is a time period adjacent to the first time period, or a time period not adjacent to the first time period, which is not limited in the embodiments of the present application.

[0096] In this way, the frame rate jitter caused by general performance reasons will reduce the frame rate of the application, so when the calculated frame rate of the first application increases, the electronic device can determine that the frame rate of the first application has switched, and then the electronic device can use the calculated frame rate as the frame rate of the first application. This improves the reliability of the electronic device in determining the application frame rate.

[0097] It can be understood that when the second frame rate is lower than the third frame rate, that is, when the frame rate of the first application is reduced, it may be due to a sudden frame rate jitter that causes a frame rate misjudgment. Therefore, in order to avoid such a misjudgment, the electronic device can make further judgments based on the drawing time of the current frame when the frame rate of the first application is reduced.

[0098] In some embodiments of the present application, "the electronic device uses the second frame rate of at least two frame rates as the first frame rate" in the above step 401 can be specifically implemented through the following step 502.

[0099] Step 502: When the second frame rate is lower than the third frame rate and the first drawing duration is lower than the second drawing duration, the electronic device uses the second frame rate as the first frame rate.

[0100] In the embodiment of the present application, the third frame rate is determined based on the number of frames corresponding to the time period before the first time period, and the first time period is the last time period of the M time periods.

[0101] In the embodiment of the present application, the first drawing duration is the drawing duration of the current frame, and the second drawing duration is the average drawing duration of the image frames corresponding to the second frame rate.

[0102] In some embodiments of the present application, the first drawing duration may also be understood as: the CPU time required for the application to draw the current frame.

[0103] In some embodiments of the present application, the electronic device can obtain the time consumed between the application rendering thread dequeue buffer and queue buffer to obtain the CPU time consumed by the application to draw the current frame.

[0104] In some embodiments of the present application, the second drawing duration may also be understood as: an average drawing duration of image frames when the electronic device draws image frames using the second frame rate.

[0105] In some embodiments of the present application, the electronic device may determine the second drawing duration based on the second frame rate and the third value.

[0106] In some embodiments of the present application, the third value is a quantile value β.

[0107] In some embodiments of the present application, the magnitude of the quantile value β can be determined according to the computing power of the electronic device. The better the computing power of the electronic device, the smaller the quantile value β.

[0108] In some embodiments of the present application, when running the first application, the electronic device can read the configuration parameters and determine the percentile value β.

[0109] In some embodiments of the present application, the electronic device may first calculate an average time consumption of an image frame according to the second frame rate, and then multiply the average time consumption by a third value to obtain the second drawing duration.

[0110] For example: when the second frame rate is 30 Hz and the percentile value β is the 80th percentile value, the electronic device can first calculate that the average time consumed per frame is 1000÷30=33.33 ms, and then the electronic device can calculate that the second drawing duration is 33.33*80%=26.64 ms.

[0111] It can be understood that when the CPU time required for the application to draw the current frame is less than the above-mentioned second drawing time, it means that the frame rate reduction of the first application is not caused by frame rate jitter due to performance reasons, but the frame rate gear of the first application is switched. Therefore, the electronic device can use the second frame rate as the frame rate of the first application.

[0112] In this way, when the calculated frame rate of the first application decreases, the electronic device can first determine whether the CPU time required for the application to draw the current frame is less than the average image frame drawing time corresponding to the calculated frame rate, and when the CPU time required for the application to draw the current frame is less than the average image frame drawing time corresponding to the calculated frame rate, it is determined that the frame rate reduction of the first application is not caused by frame rate jitter due to performance reasons, but the frame rate gear of the first application is switched, and then the calculated frame rate can be used as the frame rate of the first application. In this way, the electronic device is prevented from misjudging the frame rate due to sudden frame rate jitter, mistakenly believing that the first application has switched the frame rate, and then outputting an incorrect frame rate. Thereby improving the reliability of the electronic device in determining the application frame rate.

[0113] In some embodiments of the present application, after using the second frame rate as the frame rate of the first application, the electronic device may discard the first frame rate among the M frame rates, and calculate the frame rate corresponding to the time period based on the number of frames corresponding to the first time period after the newly acquired M time periods, and then redetermine the frame rate of the first application based on the frame rate and the frame rates among the M frame rates except the first frame rate.

[0114] In some embodiments of the present application, each time the electronic device obtains a frame rate, it can store the frame rate in a queue. When the number of frame rates existing in the queue reaches a preset threshold M, the electronic device can determine the frame rate of the first application based on the M frame rates.

[0115] In some embodiments of the present application, after using the second frame rate as the frame rate of the first application based on M frame rates, the electronic device can output the first frame rate in the queue, that is, the first frame rate among the M frame rates, and then input the frame rate calculated based on the number of frames newly acquired in the first time period after M time periods into the queue, and then can redetermine the frame rate of the first application based on the updated M frame rates in the queue.

[0116] In some embodiments of the present application, when the first drawing duration is greater than the second drawing duration, it indicates that the frame rate reduction of the first application may be due to frame rate jitter caused by performance reasons, and is not due to the switching of the frame rate gear of the first application. Therefore, the electronic device does not use the second frame rate as the frame rate of the first application, but discards the first frame rate among the M frame rates, and calculates the frame rate corresponding to the first time period based on the number of frames corresponding to the first time period after the newly acquired M time periods, and then redetermines the frame rate of the first application based on the frame rate and the frame rates among the M frame rates except the first frame rate.

[0117] In some embodiments of the present application, the present application can effectively identify the frame rate of the application, ensure that the electronic device can perform refined scheduling and tuning under different frame rate gears, and save the power consumption of the electronic device. In addition, 200ms (the duration corresponding to the time period) calculates the weighted frame rate of the application within a certain time range at a time, ensuring the rapidity and anti-interference of the recognition algorithm. In addition, the time-consuming judgment between the dequeue buffer and the queue buffer when the frame rate is low is increased, avoiding the probability of being misidentified as a frame rate switch when the frame rate is low due to insufficient performance. In addition, multiple adjustable parameters (preset threshold M, weight coefficient α, quantile value β, etc.) are added to support algorithm threshold adjustment on electronic devices with different computing power gears, and further balance between recognition accuracy and recognition speed.

[0118] In some embodiments of the present application, taking the first application as a game application as an example, Figure 4 As shown, the frame rate determination method provided in the embodiment of the present application may include the following steps S1 to S8.

[0119] S1. When running a game application, the electronic device reads configuration parameters and determines a preset threshold M required for frame rate recognition.

[0120] S2. The electronic device calculates the frame rate once with a period of 200 ms and stores it.

[0121] S3. The electronic device determines whether the acquired frame rate quantity reaches a preset threshold M.

[0122] When the number of frame rates acquired by the electronic device reaches a preset threshold value M, the electronic device executes S4;

[0123] When the number of frame rates acquired by the electronic device does not reach the preset threshold value M, the electronic device continues to execute S2;

[0124] S4. The electronic device calculates a weighted average of the M frame rates obtained, and obtains a maximum frame rate among the M frame rates.

[0125] S5. When the weighted average value and the maximum frame rate fall into different frame rate ranges corresponding to the same frame rate, the electronic device acquires the target frame rate.

[0126] S6. The electronic device determines whether the target frame rate of the game application is reduced according to the acquired target frame rate.

[0127] When the target frame rate of the game application is reduced, the electronic device executes step S7;

[0128] If the target frame rate of the game application is not reduced, the electronic device executes step S8;

[0129] S7, the electronic device determines whether the drawing time of the current frame is less than the average drawing time of the image frames corresponding to the target frame rate;

[0130] When the drawing time of the current frame is less than the average drawing time of the image frames corresponding to the target frame rate, the electronic device executes step S8;

[0131] When the drawing time of the current frame is greater than or equal to the average drawing time of the image frames corresponding to the target frame rate, the electronic device executes step S2;

[0132] S8. The electronic device uses the target frame rate as the frame rate of the game application.

[0133] It should be noted that for the relevant description of step S1 to step S8, reference can be made to the contents of the above embodiment, which will not be repeated here.

[0134] It should be noted that the above-mentioned method embodiments, or various possible implementation methods in each method embodiment, can be executed separately, or, under the premise that there is no contradiction, can also be executed in combination with each other. The specific implementation can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.

[0135] It should be noted that the frame rate determination method provided in the embodiment of the present application can be executed by a frame rate determination device. In the embodiment of the present application, the frame rate determination device executing the frame rate determination method is taken as an example to illustrate the frame rate determination device provided in the embodiment of the present application.

[0136] Figure 5 FIG. 2 shows a possible structural diagram of a frame rate determination device involved in an embodiment of the present application. Figure 5 As shown, the frame rate determination device 70 may include: a determination module 71 and a processing module 72 .

[0137] Among them, the determination module 71 is used to determine M frame rates corresponding to M time periods based on M frame numbers corresponding to M time periods when running the first application, where M is an integer greater than 1; and determine the weighted average of the M frame rates based on the M frame rates and the weight of each frame rate.

[0138] The processing module 72 is used to obtain a first frame rate based on the weighted average value determined by the determination module 71 and the maximum frame rate among the M frame rates, and determine the first frame rate as the frame rate of the first application.

[0139] The embodiment of the present application provides a frame rate determination device, because the electronic device can determine the frame rate corresponding to each of the M time periods according to the M frame numbers corresponding to the M time periods obtained in real time, and then further weight the frame rate of the first application based on the M frame rates, the electronic device can schedule computing resources suitable for the first application according to the frame rate, avoiding scheduling too many computing resources for the first application when the electronic device cannot obtain the frame rate of the first application. Thus, the power consumption of the electronic device is saved.

[0140] In one possible implementation, the determination module 71 is specifically used to multiply the number of frames corresponding to each of the M time periods by a first value to obtain a frame rate corresponding to each time period; wherein the first value is the number of time periods in the M time periods per second.

[0141] In one possible implementation, the first application supports at least two frame rates, each frame rate corresponding to two frame rate ranges; the processing module 72 is specifically used to use the second frame rate among the at least two frame rates as the first frame rate when the weighted average falls within the first frame rate range and the maximum frame rate among the M frame rates falls within the second frame rate range; wherein the first frame rate range and the second frame rate range both correspond to the second frame rate.

[0142] In one possible implementation, the processing module 72 is specifically used to use the second frame rate as the first frame rate when the second frame rate is greater than or equal to the third frame rate; wherein the third frame rate is determined based on the number of frames corresponding to the time period before the first time period, and the first time period is the last time period among the M time periods.

[0143] In a possible implementation, the processing module 72 is specifically configured to use the second frame rate as the first frame rate if the first drawing duration is less than the second drawing duration when the second frame rate is less than the third frame rate; wherein the third frame rate is determined based on the number of frames corresponding to a time period before the first time period, the first time period is the last time period of the M time periods, the first drawing duration is the drawing duration of the current frame, and the second drawing duration is the average drawing duration of the image frames corresponding to the second frame rate.

[0144] The frame rate determination device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (Augmented Reality, AR) / virtual reality (Virtual Reality, VR) device, a robot, a wearable device, a super mobile personal computer (Ultra-Mobile Personal Computer, UMPC), a netbook or a personal digital assistant (Personal Digital Assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (Personal Computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0145] The frame rate determination device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0146] The frame rate determination device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.

[0147] Alternatively, if Figure 6 As shown, an embodiment of the present application also provides an electronic device 900, including a processor 901 and a memory 902, wherein the memory 902 stores programs or instructions that can be executed on the processor 901, and when the program or instructions are executed by the processor 901, the various steps of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0148] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0149] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0150] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.

[0151] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0152] Among them, the processor 110 is used to determine M frame rates corresponding to the M time periods based on the M frame numbers corresponding to the M time periods when running the first application, where M is an integer greater than 1; and determine a weighted average of the M frame rates based on the M frame rates and the weight of each frame rate; and obtain a first frame rate based on the weighted average and the maximum frame rate among the M frame rates, and determine the first frame rate as the frame rate of the first application.

[0153] The embodiment of the present application provides an electronic device, because the electronic device can determine the frame rate corresponding to each time period in the M time periods according to the M frame numbers corresponding to the M time periods obtained in real time, and then further weight the frame rate of the first application based on the M frame rates, the electronic device can schedule computing resources suitable for the first application according to the frame rate, avoiding scheduling too many computing resources for the first application when the electronic device cannot obtain the frame rate of the first application. Thus, the power consumption of the electronic device is saved.

[0154] In some embodiments of the present application, the processor 110 is specifically used to multiply the number of frames corresponding to each of the M time periods by a first value to obtain a frame rate corresponding to each time period; wherein the first value is the number of time periods in the M time periods per second.

[0155] In some embodiments of the present application, the first application supports at least two frame rates, each frame rate corresponding to two frame rate ranges; the processor 110 is specifically used to use the second frame rate of at least two frame rates as the first frame rate when the weighted average falls within the first frame rate range and the maximum frame rate among the M frame rates falls within the second frame rate range; wherein the first frame rate range and the second frame rate range both correspond to the second frame rate.

[0156] In some embodiments of the present application, the processor 110 is specifically used to use the second frame rate as the first frame rate when the second frame rate is greater than or equal to the third frame rate; wherein the third frame rate is determined based on the number of frames corresponding to the time period before the first time period, and the first time period is the last time period among the M time periods.

[0157] In some embodiments of the present application, the processor 110 is specifically configured to use the second frame rate as the first frame rate if the first drawing duration is less than the second drawing duration when the second frame rate is less than the third frame rate; wherein the third frame rate is determined based on the number of frames corresponding to a time period before the first time period, the first time period is the last time period of the M time periods, the first drawing duration is the drawing duration of the current frame, and the second drawing duration is the average drawing duration of the image frames corresponding to the second frame rate.

[0158] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0159] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described again here.

[0160] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0161] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0162] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.

[0163] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0164] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0165] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0166] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0167] An embodiment of the present application provides a computer program / program product, which is stored in a storage medium. The program / program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0168] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0169] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0170] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for determining a frame rate, characterized in that: The method comprises: When the first application is running, based on the M frame numbers corresponding to the M time periods, determining the M frame rates corresponding to the M time periods, where M is an integer greater than 1; Determining a weighted average of the M frame rates based on the M frame rates and a weight of each frame rate; A first frame rate is obtained based on the weighted average value and a maximum frame rate among the M frame rates, and the first frame rate is determined as the frame rate of the first application.

2. The method according to claim 1, characterized in that The determining, based on the M frame numbers corresponding to the M time periods in a one-to-one manner, the M frame rates corresponding to the M time periods in a one-to-one manner, includes: Multiply the number of frames corresponding to each of the M time periods by the first value to obtain a frame rate corresponding to each time period; The first value is the number of time periods in the M time periods per second.

3. The method according to claim 1, characterized in that The first application supports at least two frame rates, each frame rate corresponding to two frame rate ranges; and obtaining the first frame rate based on the weighted average and the maximum frame rate among the M frame rates includes: When the weighted average falls within a first frame rate range and a maximum frame rate among the M frame rates falls within a second frame rate range, taking a second frame rate among the at least two frame rates as the first frame rate; The first frame rate range and the second frame rate range both correspond to the second frame rate.

4. The method according to claim 3, characterized in that Using a second frame rate of the at least two frame rates as the first frame rate includes: When the second frame rate is greater than or equal to the third frame rate, using the second frame rate as the first frame rate; The third frame rate is determined based on the number of frames corresponding to a time period before a first time period, and the first time period is the last time period of the M time periods.

5. The method according to claim 3, characterized in that: Using a second frame rate of the at least two frame rates as the first frame rate includes: In the case where the second frame rate is less than the third frame rate, if the first drawing duration is less than the second drawing duration, the second frame rate is used as the first frame rate; The third frame rate is determined based on the number of frames corresponding to the time period before the first time period, the first time period is the last time period of the M time periods, the first drawing duration is the drawing duration of the current frame, and the second drawing duration is the average drawing duration of the image frames corresponding to the second frame rate.

6. A frame rate determination device, characterized in that: The device comprises: a determination module and a processing module; The determination module is configured to determine, when the first application is running, M frame rates corresponding to the M time periods based on the M frame numbers corresponding to the M time periods, where M is an integer greater than 1; and determine a weighted average of the M frame rates based on the M frame rates and the weight of each frame rate; The processing module is used to obtain a first frame rate based on the weighted average value determined by the determination module and a maximum frame rate among the M frame rates, and determine the first frame rate as the frame rate of the first application.

7. The device according to claim 6, characterized in that The determining module is specifically configured to multiply the number of frames corresponding to each of the M time periods by a first value to obtain a frame rate corresponding to each time period; The first value is the number of time periods in the M time periods per second.

8. The device according to claim 7, characterized in that The first application supports at least two frame rates, each frame rate corresponding to two frame rate ranges; the processing module is specifically configured to use the second frame rate of the at least two frame rates as the first frame rate when the weighted average falls within the first frame rate range and the maximum frame rate of the M frame rates falls within the second frame rate range; The first frame rate range and the second frame rate range both correspond to the second frame rate.

9. The device according to claim 8, characterized in that The processing module is specifically configured to use the second frame rate as the first frame rate when the second frame rate is greater than or equal to a third frame rate; The third frame rate is determined based on the number of frames corresponding to a time period before a first time period, and the first time period is the last time period of the M time periods.

10. The device according to claim 8, characterized in that The processing module is specifically configured to use the second frame rate as the first frame rate when the second frame rate is lower than the third frame rate and the first drawing duration is lower than the second drawing duration; The third frame rate is determined based on the number of frames corresponding to the time period before the first time period, the first time period is the last time period of the M time periods, the first drawing duration is the drawing duration of the current frame, and the second drawing duration is the average drawing duration of the image frames corresponding to the second frame rate.

11. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the frame rate determination method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Frame rate identification method and electronic equipment

    CN112516590A

  • Frame rate processing method and device and readable storage medium

    CN115808954A

  • Electronic device and screen refresh method thereof

    US20210225320A1