CN113312117A - Method and equipment for detecting page transmission performance - Google Patents
Method and equipment for detecting page transmission performance Download PDFInfo
- Publication number
- CN113312117A CN113312117A CN202110601751.9A CN202110601751A CN113312117A CN 113312117 A CN113312117 A CN 113312117A CN 202110601751 A CN202110601751 A CN 202110601751A CN 113312117 A CN113312117 A CN 113312117A
- Authority
- CN
- China
- Prior art keywords
- page
- screen page
- refresh rate
- screen
- rendering
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 230000005540 biological transmission Effects 0.000 title claims description 20
- 238000009877 rendering Methods 0.000 claims abstract description 71
- 238000001514 detection method Methods 0.000 claims abstract description 19
- 230000002159 abnormal effect Effects 0.000 claims description 4
- 230000004044 response Effects 0.000 claims description 3
- 230000015654 memory Effects 0.000 description 15
- 230000005291 magnetic effect Effects 0.000 description 5
- 238000004590 computer program Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
- 238000013024 troubleshooting Methods 0.000 description 1
- 230000003936 working memory Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4482—Procedural
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Debugging And Monitoring (AREA)
Abstract
The method comprises the steps of creating a detection thread for detecting the frequency of screen refreshing; when the screen page is refreshed, calling a page rendering component through the detection thread to render the screen page and recording the calling starting time; counting the execution times of the page rendering component, and recording the calling end time when the refreshing of the screen page is finished; according to the execution times, the calling start time and the calling end time, the refresh rate of the screen page is determined, the refresh rate of the screen page is presented, the problem of performance in a development stage is solved, research personnel can check the sliding refresh rate of the screen page drawn by the research personnel in real time without leaving technical debt, the fluency of the screen page can be improved, the refresh condition of the screen page can be detected in real time, and user experience is further improved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for detecting page transmission performance.
Background
In the prior art, a project is normally required to be developed, time is often tight, tasks are heavy, programmers only want to complete development requirements during development, no redundant time is needed to pay attention to performance problems, but along with the fact that the project is larger and larger, functions are more and more, the problem of blockage is more and more serious, and user experience is poor. For example, each time of development needs, a task is completed as soon as possible, performance problems are considered after the development needs to be completed, optimization is performed when the development is not busy, but when the development needs to be performed again, the development needs to be familiar with codes again for a long time, a lot of technical debts are left, performance problems needing to be solved in the development stage cannot be solved in real time, and therefore the problems that a system is stuck when more and more subsequent functional items are generated are solved.
The development stage of the secondary solution solves the performance problem, and the frame rate of the page sliding drawn by the user can be seen in real time without leaving technical debt.
Disclosure of Invention
An object of the present application is to provide a method and an apparatus for detecting page transmission performance, which can solve the problem of performance in a development phase, and can see the sliding refresh rate of a screen page drawn by a developer in real time without leaving technical debt, thereby not only improving the fluency of the screen page, but also detecting the refresh condition of the screen page in real time, and further improving user experience.
According to an aspect of the present application, a method for detecting page transmission performance is provided, wherein the method includes:
creating a detection thread for detecting the frequency of screen refreshing;
when the screen page is refreshed, calling a page rendering component through the detection thread to render the screen page and recording the calling starting time;
counting the execution times of the page rendering component, and recording the calling end time when the refreshing of the screen page is finished;
determining the refresh rate of the screen page according to the execution times, the calling start time and the calling end time;
presenting a refresh rate of the screen page.
Further, in the above method, the determining a refresh rate of the screen page according to the execution times, the call start time, and the call end time includes:
determining the rendering duration of the page rendering component according to the calling start time and the calling end time;
and determining the refresh rate of the screen page according to the rendering duration and the execution times of the page rendering component.
Further, in the above method, the determining a refresh rate of the screen page according to the rendering duration and the execution times of the page rendering component includes:
dividing the rendering duration of the page rendering component by the execution times to obtain the rendering frequency of the page rendering component in rendering the screen page;
determining the rendering frequency as a refresh rate of the screen page.
Further, in the above method, the method further includes:
judging whether the refresh rate of the screen page reaches a preset refresh rate threshold value in real time;
and if not, generating response information for indicating that the refreshing of the screen page is abnormal.
According to another aspect of the present application, there is also provided a non-volatile storage medium having computer readable instructions stored thereon, which, when executed by a processor, cause the processor to implement the method for detecting page transmission performance as described above.
According to another aspect of the present application, there is also provided a device for detecting page transmission performance, wherein the device includes:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, cause the one or more processors to implement a method for detecting page transmission performance of a client as described above.
Compared with the prior art, the method and the device have the advantages that the detection thread for detecting the screen refreshing frequency is created; when the screen page is refreshed, calling a page rendering component through the detection thread to render the screen page and recording the calling starting time; counting the execution times of the page rendering component, and recording the calling end time when the refreshing of the screen page is finished; according to the execution times, the calling start time and the calling end time, the refresh rate of the screen page is determined, the refresh rate of the screen page is presented, the problem of performance in a development stage is solved, research personnel can check the sliding refresh rate of the screen page drawn by the research personnel in real time without leaving technical debt, the fluency of the screen page can be improved, the refresh condition of the screen page can be detected in real time, and user experience is further improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 illustrates a flow diagram of a method for detecting page transmission performance according to an aspect of the subject application;
fig. 2 is an interface diagram illustrating a screen refresh rate of a current controller in a method for detecting page transmission performance according to an aspect of the present application.
The same or similar reference numbers in the drawings identify the same or similar elements.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
In a typical configuration of the present application, the terminal, the device serving the network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
As shown in fig. 1, an aspect of the present application provides a flowchart of a method for detecting page transmission performance, where the method includes steps S11, S12, S13, S14, and S15, and specifically includes the following steps:
step S11, creating a detection thread for detecting the frequency of screen refresh; here, the frequency detection threads for screen refresh created by different systems are different, for example, in an IOS system, the created detection thread may be a CAD display Link, and the page rendering component Selector may be called by the detection thread; of course, when the other systems create the detection thread, the detection thread matching with the type of the system may be created, so that the detection thread can call the corresponding page rendering component to render the screen page.
Step S12, when the screen page is refreshed, calling a page rendering component through the detection thread to render the screen page and recording the calling start time;
step S13, counting the execution times of the page rendering component, and recording the calling end time when the screen page is refreshed;
step S14, determining the refresh rate of the screen page according to the execution times, the calling start time and the calling end time;
and step S15, presenting the refresh rate of the screen page.
Through the steps S11 to S15, the refresh rate of the screen page can be presented in time, the problem of performance in the development stage is solved, research personnel can check the sliding refresh rate of the screen page drawn by the research personnel in real time without technical debt, the fluency of the screen page can be improved, the refresh condition of the screen page can be detected in real time, and the user experience is further improved.
In the embodiment of the application, FPS (frames Per second) is the frame number of transmission of a picture Per second, that is, the refresh rate (Hz) of a page, FPS is a measure for storing the amount of information of displaying dynamic video, the more the frame number Per second, the smoother the page display is, the lower the FPS value, the more the page is stuck, so that the value can measure the performance of the application in the process of rendering and drawing an image to a certain extent, generally, the FPS of an application program APP is only kept between 50 and 60, and the user experience is smoother; in the IOS system, the refresh rate FPS of the screen page can be monitored by detecting the CAD display Link, wherein in the IOS system, the preset refresh frequency of the screen page can be 60Hz, as shown in fig. 2, that is only to count the number of times of executing the page rendering component per second by the detecting thread, so as to obtain the refresh frequency of the current screen by the number/time of executing the page rendering component. The CAD displayLink is another class similar to an NS Timer provided by Core Animation, is always started before the screen is updated once, has a similar interface design to the NStimer, so that the CAD displayLink is actually a substitute for a built-in implementation, but is different from the time Interval in seconds, has an integer frame IterVal attribute and is executed after the Interval of a plurality of frames, the prior art defaults to 1, which means that the CAD displayLink is executed once before each screen update, but if Animation codes are executed for more than sixty seconds, the frame Iterval can be designated to 2, namely, the Animation is executed once every other frame.
In a preferred embodiment of the present application, calculating the refresh rate of the screen page can be implemented by:
following the above embodiment of the present application, the step S14 determining the refresh rate of the screen page according to the execution times, the call start time, and the call end time includes:
determining the rendering duration of the page rendering component according to the calling start time and the calling end time;
and determining the refresh rate of the screen page according to the rendering duration and the execution times of the page rendering component.
For example, when the refresh rate of a screen page is calculated, the calling start time for starting calling the page rendering component is recorded, and the rendering duration of the page rendering component for performing page rendering is calculated through the calling end time recorded when the page rendering is ended; and then, calculating the refresh rate of the screen page according to the calculated rendering duration of the page rendering component and the execution times of the page rendering component, and realizing timely determination of the refresh rate of the screen page through calling and executing times of the page rendering component.
Next, in the foregoing embodiment of the present application, the determining a refresh rate of the screen page according to the rendering duration and the execution times of the page rendering component includes:
dividing the rendering duration of the page rendering component by the execution times to obtain the rendering frequency of the page rendering component in rendering the screen page;
determining the rendering frequency as a refresh rate of the screen page.
For example, when the refresh rate of a screen page is calculated, dividing the rendering duration of the page rendering component by the execution times to obtain the rendering frequency of the page rendering component for rendering on the screen page; since the page rendering component renders once, that is, refreshes a frame of picture on a screen page, the rendering frequency can be determined as the refresh rate of the screen page, so that the refresh rate of the screen page is determined by the rendering frequency of the page rendering component.
Next to the foregoing embodiment of the present application, the method for detecting page transmission performance provided in the embodiment of the present application further includes:
judging whether the refresh rate of the screen page reaches a preset refresh rate threshold value in real time;
and if not, generating response information for indicating that the refreshing of the screen page is abnormal.
For example, the refresh rate FPS of the screen page may be detected in the form of a code, and if the current controller renders no preset refresh rate threshold, for example, no refresh rate value is less than 50FPS or less than 40FPS, the abnormal troubleshooting and detection may be performed on the refresh of the screen page through the following code:
according to another aspect of the present application, there is also provided a non-volatile storage medium having computer readable instructions stored thereon, which, when executed by a processor, cause the processor to implement the method for detecting page transmission performance as described above.
According to another aspect of the present application, there is also provided a device for detecting page transmission performance, wherein the device includes:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, cause the one or more processors to implement a method for detecting page transmission performance as described above.
Here, the details of each embodiment of the device for detecting page transmission performance may specifically refer to the corresponding part of the above embodiment of the method for detecting page transmission performance, and are not described herein again.
In summary, the present application creates a detection thread for detecting the frequency of screen refresh; when the screen page is refreshed, calling a page rendering component through the detection thread to render the screen page and recording the calling starting time; counting the execution times of the page rendering component, and recording the calling end time when the refreshing of the screen page is finished; according to the execution times, the calling start time and the calling end time, the refresh rate of the screen page is determined, the refresh rate of the screen page is presented, the problem of performance in a development stage is solved, research personnel can check the sliding refresh rate of the screen page drawn by the research personnel in real time without leaving technical debt, the fluency of the screen page can be improved, the refresh condition of the screen page can be detected in real time, and user experience is further improved.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, for example, implemented using Application Specific Integrated Circuits (ASICs), general purpose computers or any other similar hardware devices. In one embodiment, the software programs of the present application may be executed by a processor to implement the steps or functions described above. Likewise, the software programs (including associated data structures) of the present application may be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Additionally, some of the steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
In addition, some of the present application may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present application through the operation of the computer. Program instructions which invoke the methods of the present application may be stored on a fixed or removable recording medium and/or transmitted via a data stream on a broadcast or other signal-bearing medium and/or stored within a working memory of a computer device operating in accordance with the program instructions. An embodiment according to the present application comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform a method and/or a solution according to the aforementioned embodiments of the present application.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Claims (6)
1. A method for detecting page transmission performance, wherein the method comprises the following steps:
creating a detection thread for detecting the frequency of screen refreshing;
when the screen page is refreshed, calling a page rendering component through the detection thread to render the screen page and recording the calling starting time;
counting the execution times of the page rendering component, and recording the calling end time when the refreshing of the screen page is finished;
determining the refresh rate of the screen page according to the execution times, the calling start time and the calling end time;
presenting a refresh rate of the screen page.
2. The method of claim 1, wherein said determining a refresh rate of the screen page according to the number of executions, the call start time, and the call end time comprises:
determining the rendering duration of the page rendering component according to the calling start time and the calling end time;
and determining the refresh rate of the screen page according to the rendering duration and the execution times of the page rendering component.
3. The method of claim 2, wherein said determining a refresh rate of the screen page according to the rendering duration and the number of executions of the page rendering component comprises:
dividing the rendering duration of the page rendering component by the execution times to obtain the rendering frequency of the page rendering component in rendering the screen page;
determining the rendering frequency as a refresh rate of the screen page.
4. The method of any of claims 1-3, wherein the method further comprises:
judging whether the refresh rate of the screen page reaches a preset refresh rate threshold value in real time;
and if not, generating response information for indicating that the refreshing of the screen page is abnormal.
5. A non-transitory storage medium having stored thereon computer readable instructions which, when executed by a processor, cause the processor to implement the method of any one of claims 1 to 4.
6. A device for detecting page transfer performance, wherein the device comprises:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110601751.9A CN113312117A (en) | 2021-05-31 | 2021-05-31 | Method and equipment for detecting page transmission performance |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110601751.9A CN113312117A (en) | 2021-05-31 | 2021-05-31 | Method and equipment for detecting page transmission performance |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113312117A true CN113312117A (en) | 2021-08-27 |
Family
ID=77376554
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110601751.9A Pending CN113312117A (en) | 2021-05-31 | 2021-05-31 | Method and equipment for detecting page transmission performance |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113312117A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106294098A (en) * | 2015-05-14 | 2017-01-04 | 阿里巴巴集团控股有限公司 | The determination method and apparatus of screen refresh rate |
US20190188109A1 (en) * | 2017-12-19 | 2019-06-20 | Zhuhai Juntian Electronic Technology Co., Ltd. | Method and apparatus for testing performance of a page control and electronic device |
CN110806905A (en) * | 2019-10-30 | 2020-02-18 | 网易(杭州)网络有限公司 | User page processing method and device, electronic equipment and storage medium |
-
2021
- 2021-05-31 CN CN202110601751.9A patent/CN113312117A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106294098A (en) * | 2015-05-14 | 2017-01-04 | 阿里巴巴集团控股有限公司 | The determination method and apparatus of screen refresh rate |
US20190188109A1 (en) * | 2017-12-19 | 2019-06-20 | Zhuhai Juntian Electronic Technology Co., Ltd. | Method and apparatus for testing performance of a page control and electronic device |
CN110806905A (en) * | 2019-10-30 | 2020-02-18 | 网易(杭州)网络有限公司 | User page processing method and device, electronic equipment and storage medium |
Non-Patent Citations (3)
Title |
---|
HAIJUNYA: "FPS性能监测", 《HTTPS://BLOG.CSDN.NET/YANHAIJUNYAN/ARTICLE/DETAILS/111347795》 * |
SILENCEDUT: "fpsviewer—实时显示fps,监控Android卡顿的可视化工具", 《HTTPS://WWW.WANANDROID.COM/BLOG/SHOW/2583》 * |
少轻侯: "android fps检测工具,Android FPS监测方法总结", 《HTTPS://BLOG.CSDN.NET/WEIXIN_36180912/ARTICLE/DETAILS/117319466》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112947969B (en) | Page off-screen rendering method, device, equipment and readable medium | |
CN110990090A (en) | Dynamic wallpaper display method, device and computer readable medium | |
JP5998764B2 (en) | Information processing apparatus, log output method, and log output program | |
CN110764986A (en) | Page fluency detection method and device | |
CN114428657B (en) | Sliding method and equipment based on Taro framework at H5 end | |
CN107220165A (en) | The method and apparatus of pressure test on a kind of artificial line | |
CN109284101B (en) | Method and device for changing association of object attributes | |
US20200294057A1 (en) | Business processing method, apparatus, and equipment | |
CN113342434A (en) | Visualization method and device for display occupation of display object | |
CN113312117A (en) | Method and equipment for detecting page transmission performance | |
CN112115395A (en) | Method and equipment for realizing animation configuration during page routing jump | |
CN112711445B (en) | Application program management method and system | |
CN108089904B (en) | Display page expansion method and device | |
CN109388716B (en) | Relationship graph updating method and device | |
US11201683B2 (en) | Monitoring video broadcasts | |
CN110569184B (en) | Test method and terminal equipment | |
CN108304294B (en) | Real-time frame number monitoring method, storage medium, equipment and system for IOS application | |
CN111966557B (en) | Method and device for monitoring browser frame rate | |
CN112486489B (en) | Rendering method and device of auction component | |
CN112749282A (en) | Knowledge graph display method, device, equipment and storage medium | |
US11966320B1 (en) | Techniques for capturing software application session replay data from devices | |
CN106652879B (en) | Method and equipment for displaying frame data | |
CN114356478A (en) | Method and equipment for determining page content display | |
CN110275816A (en) | Progress bar display control method, device and computer readable storage medium | |
CN115690684A (en) | Method and equipment for setting video monitoring area |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210827 |