[go: up one dir, main page]

CN106294098A - The determination method and apparatus of screen refresh rate - Google Patents

The determination method and apparatus of screen refresh rate Download PDF

Info

Publication number
CN106294098A
CN106294098A CN201510246595.3A CN201510246595A CN106294098A CN 106294098 A CN106294098 A CN 106294098A CN 201510246595 A CN201510246595 A CN 201510246595A CN 106294098 A CN106294098 A CN 106294098A
Authority
CN
China
Prior art keywords
function
screen
image rendering
layer
refresh
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510246595.3A
Other languages
Chinese (zh)
Inventor
郭诗计
沈洋斌
李年
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510246595.3A priority Critical patent/CN106294098A/en
Publication of CN106294098A publication Critical patent/CN106294098A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Abstract

The invention relates to the determination method and apparatus of screen refresh rate, the method includes: uses the mode injected that dynamic link library adds figure layer and delivers process, it is system process that figure layer delivers process, and figure layer is delivered process and completed screen-refresh operation by calling the first image rendering function;Deliver process by figure layer and call dynamic link library, in order to by hook method, the first image rendering function is replaced with the second image rendering function;When screen-refresh repaints, deliver process by figure layer and call the second image rendering function, in order to by the second image rendering function statistical screens refreshing frequency, determine screen refresh rate according to screen-refresh number of times.Therefore, in the embodiment of the present application, realize determining screen refresh rate by the way of dynamic link library is added system process, application itself will not be produced any impact, and system screen refresh rate under any application switching state can be obtained.

Description

The determination method and apparatus of screen refresh rate
Technical field
The application relate to apply field tests, particularly relate to screen refresh rate (Frames Per Second, FPS) determination method and apparatus.
Background technology
Currently, along with popularizing of smart mobile phone, the mobile phone application developed for smart mobile phone is also that kind is numerous Many.Due to the hardware limitations of smart mobile phone, mobile phone application generally requires more tightened up than computer utility has Performance requirement, wherein, application run smoothness be to mobile phone apply a basic performance requirement, it Directly affect Consumer's Experience, run the most smooth to weigh mobile phone application, generally, hands can be obtained Screen refresh rate when machine application runs, using screen refresh rate as weighing the amount that mobile phone application is the most smooth Change index.
In prior art, for Android (Android) operating system conventional on mobile phone, should by obtaining With page root node DecorView, then event sniffer OnPreDrawListener pair is set DecorView monitors, thus realizes repainting the page monitoring, in order to determine screen refresh rate.
Therefore, when using mode of the prior art to determine screen refresh rate, due to just for answering With root node, audiomonitor is set, so when tested application call third-party activity assembly, it is impossible to Obtain screen refresh rate now.
Summary of the invention
The embodiment of the present application provides the determination method and apparatus of screen refresh rate, by being added by dynamic link library Enter system process, it is possible to obtain system screen refresh rate under any application switching state.
On the one hand, it is provided that a kind of determination method of screen refresh rate, described method includes:
Using the mode injected that dynamic link library adds figure layer and deliver process, described figure layer delivers process for being System process, described figure layer is delivered process and is completed screen-refresh operation by calling the first image rendering function;
Deliver process by described figure layer and call described dynamic link library, in order to by hook method by described the One image rendering function replaces with the second image rendering function;
When screen-refresh repaints, deliver process by described figure layer and call described second image rendering function, Will pass through described second image rendering function statistical screens refreshing frequency, according to described screen-refresh number of times Determine screen refresh rate.
Preferably, described when screen-refresh repaints, deliver process by described figure layer and call described second figure As rendering function, in order to by described second image rendering function statistical screens refreshing frequency, according to described Screen-refresh number of times determines screen refresh rate, including:
When screen-refresh repaints, deliver process by described figure layer and call described second image rendering function, Complete screen-refresh by the first image rendering function described in described second image rendering function call to operate, And added up screen-refresh number of times by variable, determine screen refresh rate according to described screen-refresh number of times.
Preferably, dynamic link library is added figure layer and delivers process by the described mode using injection, including:
Figure layer is found to deliver the process file directory address of process;
According to described directory address, utilize system to call function control figure layer and deliver process;
Obtain storehouse loading function, address search function and storehouse in described figure layer delivery process and remove the function of function Address, described storehouse loading function is delivered in process for described dynamic link library is loaded into described figure layer In depositing, described address search function is for searching the specified function in described dynamic link library at described internal memory In address, described storehouse remove function for when meeting pre-conditioned by described dynamic link library from described The internal memory of figure layer delivery process removes;
According to described function address, call described storehouse loading function, described address search function and described storehouse and move Process is delivered except described dynamic link library is added described figure layer by function.
Preferably, described by described figure layer deliver process call described dynamic link library, in order to pass through hook Described first image rendering function is replaced with the second image rendering function by method, including:
Deliver process by described figure layer and call described dynamic link library, record described first image rendering function Function address;
Obtain the function address of described first image rendering function at global offset table (Global Offset Tables, GOT) in positional information;
According to described positional information, cover the institute in GOT with the function address of described second image rendering function State the function address of the first image rendering function, in order to call described second image when screen-refresh repaints Render function rather than described first image rendering function.
Preferably, described by described figure layer deliver process call described dynamic link library, in order to pass through hook Described first image rendering function is replaced with the second image rendering function by method, including:
Deliver process by described figure layer and call described dynamic link library, in order to create shared drive, and pass through Described first image rendering function is replaced with the second image rendering function by hook method;
Described when screen-refresh repaints, deliver process by described figure layer and call described second image rendering letter Number, in order to by described second image rendering function statistical screens refreshing frequency, according to described screen-refresh Number of times determines screen refresh rate, including:
When screen-refresh repaints, deliver process by described figure layer and call described second image rendering function, Will pass through described second image rendering function statistical screens refreshing frequency, according to described screen-refresh number of times Determine screen refresh rate, and described screen refresh rate is write described shared drive.
On the other hand, it is provided that the determination device of a kind of screen refresh rate, described device includes:
Injection unit, for using the mode of injection that dynamic link library addition figure layer is delivered process, described figure Layer delivery process is system process, and described figure layer is delivered process and completed by calling the first image rendering function Screen-refresh operates;
Hook unit, calls, for delivering process by described figure layer, the dynamic link that described injection unit injects Storehouse, in order to described first image rendering function is replaced with the second image rendering function by hook method;
Determine unit, for when screen-refresh repaints, deliver process by described figure layer and call described hook Described second image rendering function after unit replacement, in order to added up by described second image rendering function Screen-refresh number of times, determines screen refresh rate according to described screen-refresh number of times.
Preferably, described determine that unit includes:
Screen-refresh subelement, for when screen-refresh repaints, delivers process by described figure layer and calls institute State the second image rendering function, by the first image rendering letter described in described second image rendering function call Count up to into screen-refresh operation;
Determine subelement, for being added up screen-refresh number of times by variable, true according to described screen-refresh number of times Determine screen refresh rate.
Preferably, described injection unit includes:
Search subelement, for finding figure layer to deliver the process file directory address of process;
Control subelement, for the directory address found according to described lookup subelement, utilize system to call letter Numerical control drawing layer delivers process;
Address acquisition subelement, is used for obtaining storehouse loading function, address search letter in described figure layer delivery process Number and storehouse remove the function address of function, and described storehouse loading function is for being loaded into described dynamic link library Described figure layer is delivered in the internal memory of process, and described address search function is used for searching in described dynamic link library Specified function address in described internal memory, described storehouse removes function for will when meeting pre-conditioned Described dynamic link library is delivered the internal memory of process from described figure layer and is removed;
Inject subelement, for the function address obtained according to described address acquisition subelement, call described storehouse Loading function, described address search function and described storehouse remove function and are added by described dynamic link library described Figure layer delivers process.
Preferably, described hook unit includes:
Record subelement, calls described dynamic link library for delivering process by described figure layer, and record is described The function address of the first image rendering function;
Position acquisition subelement, for obtaining the function address of described first image rendering function in GOT Positional information;
Cover subelement, for the positional information obtained according to described position acquisition subelement, with described second The function address of image rendering function covers the function address of the described first image rendering function in GOT, To call described second image rendering function when screen-refresh repaints rather than described first image rendering letter Number.
Preferably, described hook unit includes:
Create subelement, call described dynamic link library for delivering process by described figure layer, in order to create Shared drive;
Replace subelement, for described first image rendering function being replaced with the second image by hook method Render function;
Described determine that unit includes:
Determine subelement, for when screen-refresh repaints, deliver process by described figure layer and call described the Two image rendering functions, in order to by described second image rendering function statistical screens refreshing frequency, according to Described screen-refresh number of times determines screen refresh rate;
Write subelement, for by single for described screen refresh rate write described establishment determining that subelement determines The shared drive that unit creates.
This application provides a kind of determination method of screen refresh rate, first use the mode of injection by dynamic link Storehouse adds figure layer and delivers process, and it is system process that described figure layer delivers process, and described figure layer is delivered process and led to Cross call the first image rendering function complete screen-refresh operation;Deliver process by described figure layer and call institute State dynamic link library, in order to by hook method, described first image rendering function is replaced with the second image Render function;When screen-refresh repaints, deliver process by described figure layer and call described second image wash with watercolours Dye function, in order to by described second image rendering function statistical screens refreshing frequency, according to described screen Refreshing frequency determines screen refresh rate.Therefore, in the embodiment of the present application, by by dynamic link library Addition figure layer is delivered the mode of process and is realized determining screen refresh rate, owing to aforesaid way belongs to for being The change of system process, will not on application itself produce any impact, and can obtain system any should By the screen refresh rate under switching state.
Accompanying drawing explanation
The determination method flow diagram of the screen refresh rate that Fig. 1 provides for the embodiment of the present application;
The method for implanting flow chart that Fig. 2 provides for one specific embodiment of the application;
The hook method flow diagram that Fig. 3 provides for one specific embodiment of the application;
The screen refresh rate data transmission schematic diagram that Fig. 4 provides for one specific embodiment of the application;
The determination structure drawing of device of the screen refresh rate that Fig. 5 provides for the embodiment of the present application.
Detailed description of the invention
For making the purpose of the embodiment of the present application, technical scheme and advantage clearer, below in conjunction with this Shen Please accompanying drawing in embodiment, the technical scheme in the embodiment of the present application is clearly and completely described, Obviously, described embodiment is some embodiments of the present application rather than whole embodiments.Based on Embodiment in the application, those of ordinary skill in the art are obtained under not making creative work premise The every other embodiment obtained, broadly falls into the scope of the application protection.
For ease of the understanding to the embodiment of the present application, do further with specific embodiment below in conjunction with accompanying drawing Explanation, embodiment is not intended that the restriction to the embodiment of the present application.
The determination method flow diagram of the screen refresh rate that Fig. 1 provides for the embodiment of the present application, holding of the method Row main body can be the smart mobile phone with Android operation system, or, there is its of Android operation system His terminal, as it is shown in figure 1, the method specifically includes:
Step 101, uses the mode injected that dynamic link library adds figure layer and delivers process, and described figure layer is thrown Journey of going forward one by one is system process, and described figure layer is delivered process and completed screen by calling the first image rendering function Refresh operation.
Wherein, figure layer is delivered process and be may be used for content drawn by converse routine, and is delivered to bottom hardware and enters Row display, such as, the Surfaceflinger process of Android operation system.First image rendering function can For the next frame picture material needing display is exchanged in the image buffer storage that screen is showing, example As, Eglswapbuffers function.
In the embodiment of the present application, dynamic link library is added figure layer and delivers process by the described mode using injection, Specifically may include that the process file directory address finding figure layer to deliver process;According to described directory address, Utilize system to call function control figure layer and deliver process;Obtain storehouse loading function in described figure layer delivery process, Address search function and storehouse remove the function address of function, and described storehouse loading function is for by described dynamic chain Connecing storehouse to be loaded in the internal memory that described figure layer delivers process, described address search function is used for searching described moving The specified function in state chained library address in described internal memory, described storehouse removes function for meeting in advance Remove if described dynamic link library being delivered the internal memory of process from described figure layer during condition;According to described letter Number address, calls described storehouse loading function, described address search function and described storehouse and removes function by described Dynamic link library adds described figure layer and delivers process.The note that Fig. 2 provides for one specific embodiment of the application Enter method flow diagram, with reference to Fig. 2, in order to dynamic link library being added Surfaceflinger process, can First to find the proc directory address of Surfaceflinger process, then according to described directory address, Utilize ptrace function to control Surfaceflinger process, obtain in Surfaceflinger process Dlopen function, dlsym function and the function address of dlclose function, further according to described function address, Call dlopen function, dlsym function and dlclose function to be added by dynamic link library Surfaceflinger process.
Step 102, delivers process by described figure layer and calls described dynamic link library, in order to by hook side Described first image rendering function is replaced with the second image rendering function by method.
Wherein, specifically described dynamic link library can be called by Surfaceflinger process, in order to logical Cross hook method and Eglswapbuffers function is replaced with fakeEglswapbuffers function.
In the embodiment of the present application, described by described figure layer deliver process call described dynamic link library, in order to By hook method, described first image rendering function is replaced with the second image rendering function, can include Following processing procedure: deliver process by described figure layer and call described dynamic link library, record described first The function address of image rendering function;The function address obtaining described first image rendering function is inclined in the overall situation Move the positional information in table (Global Offset Tables, GOT);According to described positional information, use The function address of described second image rendering function covers the letter of the described first image rendering function in GOT Number address, in order to call described second image rendering function when screen-refresh repaints rather than described first figure As rendering function.
Additionally, in above-mentioned hook method, it is also possible to first create shared drive, determine screen refresh rate After, screen refresh rate is write shared drive, in order to application program can read screen from this shared drive Curtain refresh rate, thus realize the numerical value of the screen refresh rate obtained in system process is delivered to application process In.
Fig. 3 is the hook method flow diagram that one specific embodiment of the application provides, with reference to Fig. 3, in order to incite somebody to action Eglswapbuffers function replaces with fakeEglswapbuffers function, can pass through Surfaceflinger process calls dynamic link library, records the function address of Eglswapbuffers function, The function address of acquisition Eglswapbuffers function positional information in GOT table, according to described position Information, covers in GOT table with the function address of fakeEglswapbuffers function The function address of Eglswapbuffers function, in order to call when screen-refresh repaints FakeEglswapbuffers function rather than Eglswapbuffers function.
In above-mentioned hook method, it is also possible to first use mmap function creation shared drive, determining screen After curtain refresh rate, screen refresh rate is write shared drive, in order to application program can be from this shared drive Middle reading screen refresh rate, thus realize the screen refresh rate that obtains in Surfaceflinger process Numerical value is delivered in application process.
The screen refresh rate data transmission schematic diagram that Fig. 4 provides for one specific embodiment of the application, with reference to figure 4, in the embodiment of the present application, dynamic link library can be added operating by injecting program Surfaceflinger process, is called this dynamic link library by Surfaceflinger process, thus completes Eglswapbuffers function hook, replaces with Eglswapbuffers function FakeEglswapbuffers function, when screen-refresh repaints, Surfaceflinger process is called FakeEglswapbuffers function, first calls in fakeEglswapbuffers function Eglswapbuffers function completes screen-refresh operation, is then added up refreshing frequency by a variable, It is calculated FPS finally by this count value and writes shared drive.Application program can be connect by JNI Mouth reads the FPS value in shared drive and is supplied to upper strata use.
Step 103, when screen-refresh repaints, delivers process by described figure layer and calls described second image Render function, in order to by described second image rendering function statistical screens refreshing frequency, according to described screen Curtain refreshing frequency determines screen refresh rate.
Specifically, when screen-refresh repaints, process can be delivered by described figure layer and call described second figure As rendering function, complete screen by the first image rendering function described in described second image rendering function call Curtain refresh operation, and added up screen-refresh number of times by variable, determine screen according to described screen-refresh number of times Curtain refresh rate.
Such as, when screen-refresh repaints, called by Surfaceflinger process FakeEglswapbuffers function, in order to statistical screens refreshing frequency, according to described screen-refresh number of times Determine screen refresh rate.Wherein, fakeEglswapbuffers function can be by calling Eglswapbuffers function completes screen-refresh operation, and is added up screen-refresh number of times by variable, root Screen refresh rate is determined according to screen-refresh number of times.
The embodiment of the present application provides a kind of determination method of screen refresh rate, and the mode first using injection will Dynamic link library adds figure layer and delivers process, and it is system process that described figure layer delivers process, and described figure layer is thrown Journey of going forward one by one completes screen-refresh operation by calling the first image rendering function;By described figure layer deliver into Journey calls described dynamic link library, in order to replaced with by described first image rendering function by hook method Second image rendering function;When screen-refresh repaints, deliver process by described figure layer and call described the Two image rendering functions, in order to by described second image rendering function statistical screens refreshing frequency, according to Described screen-refresh number of times determines screen refresh rate.Therefore, in the embodiment of the present application, by moving State chained library addition figure layer is delivered the mode of process and is realized determining screen refresh rate, owing to aforesaid way belongs to In the change for system process, application itself will not be produced any impact, and system can be obtained Screen refresh rate under any application switching state.
Specifically, Surfaceflinger service is used to complete the refreshing weight of screen due to Android bottom Drawing, and repaint EglSwapBuffers method of all calling every time, the application is by injecting Surfaceflinger process, is then oneself by EglSwapBuffers Function Mapping FakeEglswapbuffers function completes the counting of each screen updates, and calculates screen by this counting Curtain refresh rate.Whole process all oneself realizes, and is independent of framework, simultaneously as inject the system of liking clothes Business, so not affecting application program and can obtaining system screen under any application switching state Curtain refresh rate.
The determination structure drawing of device of the screen refresh rate that Fig. 5 provides for the embodiment of the present application, this device is used for Performing the determination method of the screen refresh rate that the embodiment of the present application provides, described device includes:
Injection unit 501, for using the mode of injection that dynamic link library addition figure layer is delivered process, institute Stating figure layer and delivering process is system process, and described figure layer delivers process by calling the first image rendering function Complete screen-refresh operation;
Hook unit 502, calls what described injection unit 501 injected for delivering process by described figure layer Dynamic link library, in order to described first image rendering function is replaced with the second image wash with watercolours by hook method Dye function;
Determine unit 503, for when screen-refresh repaints, deliver process by described figure layer and call described Described second image rendering function after hook unit 502 replacement, in order to by described second image rendering Function statistical screens refreshing frequency, determines screen refresh rate according to described screen-refresh number of times.
Preferably, described determine that unit 503 includes:
Screen-refresh subelement, for when screen-refresh repaints, delivers process by described figure layer and calls institute State the second image rendering function, by the first image rendering letter described in described second image rendering function call Count up to into screen-refresh operation;
Determine subelement, for being added up screen-refresh number of times by variable, true according to described screen-refresh number of times Determine screen refresh rate.
Preferably, described injection unit 501 includes:
Search subelement, for finding figure layer to deliver the process file directory address of process;
Control subelement, for the directory address found according to described lookup subelement, utilize system to call letter Numerical control drawing layer delivers process;
Address acquisition subelement, is used for obtaining storehouse loading function, address search letter in described figure layer delivery process Number and storehouse remove the function address of function, and described storehouse loading function is for being loaded into described dynamic link library Described figure layer is delivered in the internal memory of process, and described address search function is used for searching in described dynamic link library Specified function address in described internal memory, described storehouse removes function for will when meeting pre-conditioned Described dynamic link library is delivered the internal memory of process from described figure layer and is removed;
Inject subelement, for the function address obtained according to described address acquisition subelement, call described storehouse Loading function, described address search function and described storehouse remove function and are added by described dynamic link library described Figure layer delivers process.
Preferably, described hook unit 502 includes:
Record subelement, calls described dynamic link library for delivering process by described figure layer, and record is described The function address of the first image rendering function;
Position acquisition subelement, for obtaining the function address of described first image rendering function in GOT Positional information;
Cover subelement, for the positional information obtained according to described position acquisition subelement, with described second The function address of image rendering function covers the function address of the described first image rendering function in GOT, To call described second image rendering function when screen-refresh repaints rather than described first image rendering letter Number.
Preferably, described hook unit 502 includes:
Create subelement, call described dynamic link library for delivering process by described figure layer, in order to create Shared drive;
Replace subelement, for described first image rendering function being replaced with the second image by hook method Render function;
Described determine that unit 503 includes:
Determine subelement, for when screen-refresh repaints, deliver process by described figure layer and call described the Two image rendering functions, in order to by described second image rendering function statistical screens refreshing frequency, according to Described screen-refresh number of times determines screen refresh rate;
Write subelement, for by single for described screen refresh rate write described establishment determining that subelement determines The shared drive that unit creates.
The embodiment of the present application provides the determination device of a kind of screen refresh rate, is first adopted by injection unit 501 By the mode injected, dynamic link library being added figure layer and deliver process, it is that system is entered that described figure layer delivers process Journey, described figure layer is delivered process and is completed screen-refresh operation by calling the first image rendering function;Again by Hook unit 502 is delivered process by described figure layer and is called described dynamic link library, in order to by hook side Described first image rendering function is replaced with the second image rendering function by method;Last by determining unit 503 When screen-refresh repaints, deliver process by described figure layer and call described second image rendering function, with Will pass through described second image rendering function statistical screens refreshing frequency, true according to described screen-refresh number of times Determine screen refresh rate.Therefore, in the embodiment of the present application, throw by dynamic link library being added figure layer The mode of journey of going forward one by one realizes determining screen refresh rate, owing to aforesaid way belongs to for system process more Change, application itself will not be produced any impact, and system can be obtained in any application switching state Under screen refresh rate.
Professional should further appreciate that, in conjunction with the embodiments described herein describe each The object of example and algorithm steps, it is possible to come real with electronic hardware, computer software or the combination of the two Existing, in order to clearly demonstrate the interchangeability of hardware and software, the most according to function one As property describe composition and the step of each example.These functions are held with hardware or software mode actually OK, application-specific and the design constraint of technical scheme are depended on.Professional and technical personnel can be to each Specifically should be used for using different methods to realize described function, but this realization is it is not considered that surpass Go out scope of the present application.
The method described in conjunction with the embodiments described herein or the step of algorithm can use hardware, process The software module that device performs, or the combination of the two implements.Software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable ROM, Other form any well known in depositor, hard disk, moveable magnetic disc, CD-ROM or technical field Storage medium in.
Above-described detailed description of the invention, is carried out purpose, technical scheme and the beneficial effect of the application Further describe, be it should be understood that the foregoing is only the application detailed description of the invention and , it is not used to limit the protection domain of the application, all within spirit herein and principle, done Any modification, equivalent substitution and improvement etc., within should be included in the protection domain of the application.

Claims (10)

1. the determination method of a screen refresh rate, it is characterised in that described method includes:
Using the mode injected that dynamic link library adds figure layer and deliver process, described figure layer delivers process for being System process, described figure layer is delivered process and is completed screen-refresh operation by calling the first image rendering function;
Deliver process by described figure layer and call described dynamic link library, in order to by hook method by described the One image rendering function replaces with the second image rendering function;
When screen-refresh repaints, deliver process by described figure layer and call described second image rendering function, Will pass through described second image rendering function statistical screens refreshing frequency, according to described screen-refresh number of times Determine screen refresh rate.
2. the method for claim 1, it is characterised in that described when screen-refresh repaints, logical Cross described figure layer delivery process and call described second image rendering function, in order to by described second image wash with watercolours Dye function statistical screens refreshing frequency, determines screen refresh rate according to described screen-refresh number of times, including:
When screen-refresh repaints, deliver process by described figure layer and call described second image rendering function, Complete screen-refresh by the first image rendering function described in described second image rendering function call to operate, And added up screen-refresh number of times by variable, determine screen refresh rate according to described screen-refresh number of times.
3. method as claimed in claim 1 or 2, it is characterised in that the mode that described employing is injected will Dynamic link library adds figure layer and delivers process, including:
Figure layer is found to deliver the process file directory address of process;
According to described directory address, utilize system to call function control figure layer and deliver process;
Obtain storehouse loading function, address search function and storehouse in described figure layer delivery process and remove the function of function Address, described storehouse loading function is delivered in process for described dynamic link library is loaded into described figure layer In depositing, described address search function is for searching the specified function in described dynamic link library at described internal memory In address, described storehouse remove function for when meeting pre-conditioned by described dynamic link library from described The internal memory of figure layer delivery process removes;
According to described function address, call described storehouse loading function, described address search function and described storehouse and move Process is delivered except described dynamic link library is added described figure layer by function.
4. method as claimed in claim 1 or 2, it is characterised in that described by the delivery of described figure layer Process calls described dynamic link library, in order to replaced by described first image rendering function by hook method It is the second image rendering function, including:
Deliver process by described figure layer and call described dynamic link library, record described first image rendering function Function address;
Obtain the function address of the described first image rendering function positional information in global offset table GOT;
According to described positional information, cover the institute in GOT with the function address of described second image rendering function State the function address of the first image rendering function, in order to call described second image when screen-refresh repaints Render function rather than described first image rendering function.
5. the method for claim 1, it is characterised in that described by described figure layer delivery process Call described dynamic link library, in order to by hook method, described first image rendering function replaced with Two image rendering functions, including:
Deliver process by described figure layer and call described dynamic link library, in order to create shared drive, and pass through Described first image rendering function is replaced with the second image rendering function by hook method;
Described when screen-refresh repaints, deliver process by described figure layer and call described second image rendering letter Number, in order to by described second image rendering function statistical screens refreshing frequency, according to described screen-refresh Number of times determines screen refresh rate, including:
When screen-refresh repaints, deliver process by described figure layer and call described second image rendering function, Will pass through described second image rendering function statistical screens refreshing frequency, according to described screen-refresh number of times Determine screen refresh rate, and described screen refresh rate is write described shared drive.
6. the determination device of a screen refresh rate, it is characterised in that described device includes:
Injection unit, for using the mode of injection that dynamic link library addition figure layer is delivered process, described figure Layer delivery process is system process, and described figure layer is delivered process and completed by calling the first image rendering function Screen-refresh operates;
Hook unit, calls, for delivering process by described figure layer, the dynamic link that described injection unit injects Storehouse, in order to described first image rendering function is replaced with the second image rendering function by hook method;
Determine unit, for when screen-refresh repaints, deliver process by described figure layer and call described hook Described second image rendering function after unit replacement, in order to added up by described second image rendering function Screen-refresh number of times, determines screen refresh rate according to described screen-refresh number of times.
7. device as claimed in claim 6, it is characterised in that described determine that unit includes:
Screen-refresh subelement, for when screen-refresh repaints, delivers process by described figure layer and calls institute State the second image rendering function, by the first image rendering letter described in described second image rendering function call Count up to into screen-refresh operation;
Determine subelement, for being added up screen-refresh number of times by variable, true according to described screen-refresh number of times Determine screen refresh rate.
Device the most as claimed in claims 6 or 7, it is characterised in that described injection unit includes:
Search subelement, for finding figure layer to deliver the process file directory address of process;
Control subelement, for the directory address found according to described lookup subelement, utilize system to call letter Numerical control drawing layer delivers process;
Address acquisition subelement, is used for obtaining storehouse loading function, address search letter in described figure layer delivery process Number and storehouse remove the function address of function, and described storehouse loading function is for being loaded into described dynamic link library Described figure layer is delivered in the internal memory of process, and described address search function is used for searching in described dynamic link library Specified function address in described internal memory, described storehouse removes function for will when meeting pre-conditioned Described dynamic link library is delivered the internal memory of process from described figure layer and is removed;
Inject subelement, for the function address obtained according to described address acquisition subelement, call described storehouse Loading function, described address search function and described storehouse remove function and are added by described dynamic link library described Figure layer delivers process.
Device the most as claimed in claims 6 or 7, it is characterised in that described hook unit includes:
Record subelement, calls described dynamic link library for delivering process by described figure layer, and record is described The function address of the first image rendering function;
Position acquisition subelement, for obtaining the function address of described first image rendering function in global offset Positional information in table GOT;
Cover subelement, for the positional information obtained according to described position acquisition subelement, with described second The function address of image rendering function covers the function address of the described first image rendering function in GOT, To call described second image rendering function when screen-refresh repaints rather than described first image rendering letter Number.
10. device as claimed in claim 6, it is characterised in that described hook unit includes:
Create subelement, call described dynamic link library for delivering process by described figure layer, in order to create Shared drive;
Replace subelement, for described first image rendering function being replaced with the second image by hook method Render function;
Described determine that unit includes:
Determine subelement, for when screen-refresh repaints, deliver process by described figure layer and call described the Two image rendering functions, in order to by described second image rendering function statistical screens refreshing frequency, according to Described screen-refresh number of times determines screen refresh rate;
Write subelement, for by single for described screen refresh rate write described establishment determining that subelement determines The shared drive that unit creates.
CN201510246595.3A 2015-05-14 2015-05-14 The determination method and apparatus of screen refresh rate Pending CN106294098A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510246595.3A CN106294098A (en) 2015-05-14 2015-05-14 The determination method and apparatus of screen refresh rate

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510246595.3A CN106294098A (en) 2015-05-14 2015-05-14 The determination method and apparatus of screen refresh rate

Publications (1)

Publication Number Publication Date
CN106294098A true CN106294098A (en) 2017-01-04

Family

ID=57631742

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510246595.3A Pending CN106294098A (en) 2015-05-14 2015-05-14 The determination method and apparatus of screen refresh rate

Country Status (1)

Country Link
CN (1) CN106294098A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108845841A (en) * 2018-06-15 2018-11-20 广州多益网络股份有限公司 Change the method, apparatus and terminal of terminal applies behavior
CN113312117A (en) * 2021-05-31 2021-08-27 上海万物新生环保科技集团有限公司 Method and equipment for detecting page transmission performance

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6721941B1 (en) * 1996-08-27 2004-04-13 Compuware Corporation Collection of timing and coverage data through a debugging interface
CN103136102A (en) * 2013-02-07 2013-06-05 百度在线网络技术(北京)有限公司 Method and device for testing fluency of Android platform

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6721941B1 (en) * 1996-08-27 2004-04-13 Compuware Corporation Collection of timing and coverage data through a debugging interface
CN103136102A (en) * 2013-02-07 2013-06-05 百度在线网络技术(北京)有限公司 Method and device for testing fluency of Android platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ARIESJZJ: "实现Android下的FPS实时显示工具", 《HTTPS://BLOG.CSDN.NET/JINZHUOJUN/ARTICLE/DETAILS/10428435》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108845841A (en) * 2018-06-15 2018-11-20 广州多益网络股份有限公司 Change the method, apparatus and terminal of terminal applies behavior
CN113312117A (en) * 2021-05-31 2021-08-27 上海万物新生环保科技集团有限公司 Method and equipment for detecting page transmission performance

Similar Documents

Publication Publication Date Title
EP4220400A1 (en) Memory management method and apparatus, and electronic device and computer-readable storage medium
CN105094920B (en) A kind of game rendering intent and device
US10185611B2 (en) System for monitoring and tracking application crashes occurring on different mobile devices
CN103064782B (en) A kind of method and device for obtaining control
CN109408223A (en) Resource allocation method, device, terminal and storage medium
CN106293953B (en) A kind of method and system of the shared display data of access
CN107256155A (en) Menu adaptation method, server and the readable storage medium storing program for executing of background management system
CN103823683A (en) Video recording device and method
CN103984781A (en) Webpage loading method and device
CN106339300A (en) Method and system for acquiring FPS of third-party game
CN104881408A (en) Method, device and system for counting number of clicks on page and displaying result
CN107256120A (en) Method for changing scenes, terminal and computer-readable recording medium
CN106062662A (en) System and method for providing power-saving static image display refresh in a DRAM memory system
US20210203811A1 (en) Devices and methods for selective display frame fetch
CN105786713B (en) The split screen of mobile terminal investigates method, device and mobile terminal
CN106294098A (en) The determination method and apparatus of screen refresh rate
CN105224315A (en) Method and device for acquiring screen capture
CN102541567A (en) 2D mobile game engine and compatible mobile operating system method
CN106293585A (en) A kind of method for caching and processing shown for mobile terminal and device
CN115292418A (en) Cross-system business process automatic processing method and system
CN106055637A (en) Buffer memory data processing method and server
CN103365559B (en) A kind of method and mobile terminal for drawing sliding trace
CN106598502A (en) Data storage method and system
CN103246426B (en) It is a kind of to realize the method and device handled multiple icons
CN106888252A (en) The method and terminal of a kind of refresh data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170104

RJ01 Rejection of invention patent application after publication