CN110209978B - Data processing method and related device - Google Patents

Data processing method and related device Download PDF

Info

Publication number
CN110209978B
CN110209978B CN201910081213.4A CN201910081213A CN110209978B CN 110209978 B CN110209978 B CN 110209978B CN 201910081213 A CN201910081213 A CN 201910081213A CN 110209978 B CN110209978 B CN 110209978B
Authority
CN
China
Prior art keywords
screen
image
reference image
pixel points
pixel
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.)
Active
Application number
CN201910081213.4A
Other languages
Chinese (zh)
Other versions
CN110209978A (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910081213.4A priority Critical patent/CN110209978B/en
Publication of CN110209978A publication Critical patent/CN110209978A/en
Application granted granted Critical
Publication of CN110209978B publication Critical patent/CN110209978B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Image Analysis (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a data processing method and a related device, wherein the method comprises the following steps: acquiring a target reference image corresponding to a first screen of a browser; the non-white pixel points in the target reference image are obtained by filling blank pixel points in the historical reference image by the first image; the first image is obtained by intercepting from a pixel statistical area in the first screen; the size of the target reference image is the same as that of the pixel statistical region; intercepting a second image in a pixel statistical area in the first screen; according to the non-white pixel points in the second image, determining stable pixel points in the non-white pixel points in the target reference image, and determining the iteration number of the stable pixel points; when the iteration number meets the first screen stability condition and the screen capturing frequency is smaller than the comparison frequency threshold, determining the accumulated time length when the iteration number meets the stability number threshold in the first screen stability condition as first screen loading time corresponding to the first screen. By adopting the invention, the calculation resources can be saved, and the calculation accuracy can be improved.

Description

Data processing method and related device
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a data processing method and a related device.
Background
With the continuous development of internet technology and the continuous update of front-end technology, the requirement of users on the speed of loading web pages by a browser is also increasing. In other words, from the time when the user initiates access to the first screen content is completely loaded, the first screen loading time is of great importance to the user experience, because the excessively long first screen loading time directly affects the user's knowledge of the website performance provided by each internet company.
When the first screen loading time of the dynamic webpage is calculated, as the dynamic elements in the dynamic webpage are continuously transformed, the first screen loading time when the first screen is completely loaded is difficult to accurately capture by adopting the existing first screen time calculation method, so that a larger calculation error exists between the calculated first screen loading time and the actual first screen loading time.
Disclosure of Invention
The embodiment of the invention provides a data processing method and a related device, which can improve the calculation accuracy of first screen time.
In one aspect, an embodiment of the present invention provides a data processing method, including:
acquiring a target reference image corresponding to a first screen of a browser; the non-white pixel points in the target reference image are obtained by filling blank pixel points in the historical reference image by the first image; the first image is obtained by intercepting from a pixel statistical area in the first screen; the size of the target reference image is the same as the size of the pixel statistical region;
Intercepting a second image in the pixel statistical region in the first screen;
determining stable pixel points according to the non-white pixel points in the second image and the non-white pixel points in the target reference image, and determining the iteration number of the stable pixel points;
when the iteration number meets the initial screen stability condition and the screen capturing frequency is smaller than the comparison frequency threshold, determining the accumulated time length when the iteration number meets the stability number threshold in the initial screen stability condition as initial screen loading time corresponding to the initial screen.
In one aspect, an embodiment of the present invention provides a data processing apparatus, including:
the reference acquisition module is used for acquiring a target reference image corresponding to the first screen of the browser; the non-white pixel points in the target reference image are obtained by filling blank pixel points in the historical reference image by the first image; the first image is obtained by intercepting from a pixel statistical area in the first screen; the size of the target reference image is the same as the size of the pixel statistical region;
an image intercepting module, configured to intercept a second image in the pixel statistics area in the first screen;
the stable point determining module is used for determining stable pixel points according to the non-white pixel points in the second image and the non-white pixel points in the target reference image, and determining the iteration number of the stable pixel points;
And the first screen time determining module is used for determining the accumulated time length when the iteration number meets the stable number threshold value in the first screen stability condition as the first screen loading time corresponding to the first screen when the iteration number meets the first screen stability condition and the screen capturing frequency is smaller than the comparison frequency threshold value.
In one aspect, an embodiment of the present invention provides a data processing apparatus, including: a processor, a memory, and a network interface;
the processor is connected to a memory for storing program code, and to a network interface for connecting to a server, the processor being adapted to invoke the program code to perform the method as in the first aspect of the embodiments of the invention.
An aspect of an embodiment of the present invention provides a computer storage medium storing a computer program comprising program instructions which, when executed by a processor, perform a method as in the first aspect of an embodiment of the present invention.
According to the embodiment of the invention, after the first screen size of the browser is obtained, a pixel statistical region conforming to the visual habit of the user can be determined in the first screen, and then a target reference image with the same size as the pixel statistical region can be obtained in the background, wherein the rendering content carried in the pixel statistical region can reflect the loading condition of the browser on main elements during webpage data rendering. And then, comparing non-white pixel points in the second image intercepted from the pixel statistical area of the first screen with blank pixel points of the target reference image to quickly obtain stable pixel points, and meanwhile, accumulating the iteration number of the stable pixel points in the background, so that whether the iteration number meets the first screen stability condition can be judged within the comparison frequency threshold, and the accumulated time length when the iteration number meets the stability number threshold in the first screen stability condition can be used as the first screen loading time of the first screen. In the process of accumulating the iteration number of the stable pixel points, non-white pixel points in the intercepted screenshot image can be continuously filled in the target reference image until blank pixel points in the filled target reference image are filled into the non-white pixel points, and the non-white pixel points in the filled target reference image reach saturation, so that the non-white pixel points in the intercepted screenshot image again are difficult to refill into the target reference image. Therefore, when the main elements rendered in the browser are changed, the non-white pixel points in the intercepted screen capturing image can not influence the non-white pixel points in the filled target reference image any more, so that the first screen loading time can be accurately obtained through the iteration number of the stable pixel points accumulated in the target reference image, and the accuracy of the first screen time calculation is improved. In addition, by introducing the threshold value of the comparison times, the phenomenon of falling into dead loops can be avoided in the accumulating process, so that the waste of computing resources can be avoided.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a network architecture according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a browser rendering web page data according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a data processing method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an embodiment of the present invention for acquiring an initial reference image;
FIG. 5 is a schematic diagram of capturing a screenshot image according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of acquiring a target reference image according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of determining stable pixel points according to an embodiment of the present invention;
FIG. 8 is a flowchart of another data processing method according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a data processing apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 is a schematic structural diagram of a network architecture according to an embodiment of the present invention. As shown in fig. 1, the network architecture may include a server 2000 and a test terminal cluster; the test terminal cluster may include a plurality of test terminals, as shown in fig. 1, specifically including a test terminal 3000a, test terminals 3000b, …, and a test terminal 3000n; as shown in fig. 1, each of the test terminals 3000a, 3000b, …, and 3000n may be connected to the server 2000 via a network.
Each test terminal as shown in fig. 1 may be used to simulate a process that a user terminal obtains web page data from the server 2000, and further, the web page data may be parsed by a test tool and a browser integrated in each test terminal, so that the web page data that may be parsed from each test terminal may be rendered onto a screen of a corresponding test terminal to be displayed to a tester, so as to simulate a process that a user requests content corresponding to the web page data through a web page address and displays the content on the browser to be displayed. It should be appreciated that this process is completely transparent to the user.
For ease of understanding, in the embodiment of the present invention, one test terminal may be selected from the plurality of test terminals shown in fig. 1 as a target test terminal, and for example, the test terminal 3000a shown in fig. 1 may be selected as a target test terminal. The target test terminal may include: smart terminals carrying test functions, such as smart phones, tablet computers, desktop personal computers, and the like. The target test terminal (e.g., a personal computer) may simulate the operation of a user in the background test system, for example, the target test terminal may simulate a web page loading request sent when the user loads a web page in the background test system to the server 2000 shown in fig. 1 when an automated test tool is integrated in the browser a, so as to request web page data (which may also be referred to as web page content of the web page) related to the web page from the server 2000. Further, when the target test terminal obtains the webpage data returned by the server 2000, the webpage data can be analyzed through the browser a in the target test terminal, and the analyzed webpage data is rendered on the screen of the target test terminal to be displayed to the user.
The test tool may be a Selenium test tool, which is a software framework capable of automatically simulating a user to input a target website and access a web page corresponding to the target website, so that the software framework running in the browser a can control the browser a to perform an operation of simulating the user to access the web page.
In the performance test process of the tester, the target address of the web page, which may also be referred to as URL (Uniform Resource Locator ), is automatically input and executed by the target test terminal according to the corresponding configuration, so as to simulate the operation of inputting the URL in the browser a by the user in the background system, thereby enabling the browser a to send a web page loading request for requesting the web page to the server 2000.
In the embodiment of the invention, the process of accessing the webpage by the target test terminal is transparent to the user, namely, no manual operation is required to be performed in the browser A by the user in the whole course, for example, the user does not need to manually enter the target website, the target website can be automatically obtained through the configuration corresponding to the test tool, and the operation of accessing the webpage corresponding to the URL is automatically performed, so that when the browser displays the rendered webpage data to the user, the browser can be understood to display the webpage data to a tester using the target test terminal. Meanwhile, in the process of rendering the webpage data, the target test terminal can take the time of acquiring the target website as the initial time of the first screen when acquiring the target website, can monitor the rendering event of the webpage corresponding to the URL, and can start iterative calculation of the first screen time (also called as the loading time of the first screen) of the webpage based on the rendering event.
It can be understood that in the embodiment of the invention, the calculation of the first screen time of the static webpage can be compatible, and the calculation of the first screen time of the dynamic webpage can also be supported. In addition, in the embodiment of the invention, when the non-white pixel points in the target reference image reach saturation, whether the currently loaded webpage is a static webpage or a dynamic webpage can be judged, so that different modes can be started according to the environments where different webpage data are located to calculate the corresponding first screen loading time, and the accuracy of calculating the first screen loading time is ensured. The non-white pixel point in the target reference image refers to a pixel point whose pixel value is not a white pixel value, for example, the pixel value of the non-white pixel point may be 120, and thus the blank pixel point in the target reference image refers to a pixel value whose pixel value is a white pixel value, for example, the pixel value of the blank pixel point may be 255. It should be understood that when the target rendering terminal calculates the first screen loading time corresponding to the corresponding environment (e.g., a dynamic web page or a static web page), a first screen loading report corresponding to the first screen loading time may be generated, and the first screen loading report may be fed back to the management terminal managing the web page through the server 2000, so that the management terminal may know the loading performance of the website of its own company based on the first screen loading report, thereby better providing a better service for a wide range of users.
In the embodiment of the invention, the key of the judgment of the dynamic and static web page is whether the non-white pixel point in the target reference image is saturated, namely, whether the pixel point in the target reference image is converted from a blank pixel point to a non-white pixel point, if the non-white pixel point in the target reference image is saturated, the non-white pixel point in the target reference image can be determined as a stable pixel point, so that the intercepted non-white pixel point of the second image is difficult to refill into the target reference image when the pixel points in the target reference image are all non-white pixel points. Optionally, if the non-white pixel point in the target reference image is not saturated, that is, a blank pixel point still exists in the target reference image, the non-white pixel point of the truncated second image may be filled into the target reference image, so as to obtain a filled target reference image. At this time, the target reference image before filling may be referred to as a history reference image, and the second image obtained when the last screen capturing period comes may be referred to as a first image. Similarly, the filled target reference image may be used as a new target reference image, and the truncated screen capture image may be used as a new second image when a new screen capture period arrives, so as to determine the stable pixel point based on the non-white pixel point in the new second image and the non-white pixel point in the new target reference image. It is understood that when blank pixels exist in the target reference image, blank pixels in the target reference image may be filled with non-white pixels in the second image. Therefore, if the number of non-white pixels in the new target reference image reaches the preset stable number threshold (wherein the number of non-white pixels in the new target reference image may be greater than or equal to the stable number threshold) and the pixel values of the non-white pixels in the new target reference image are the same as the pixel values of the non-white pixels in the re-captured screenshot image (i.e., the third image), it may be determined that the web page corresponding to the target address is a static web page; in contrast, if the number of non-white pixels in the new target reference image reaches the preset stable number threshold on the same position coordinate, and the pixel values of the non-white pixels in the new target reference image are different from the pixel values of the non-white pixels in the captured image (i.e., the third image) which is captured again, it can be determined that the web page corresponding to the target address is a dynamic web page. Because each element in the dynamic webpage is continuously changed, the first screen loading time under the corresponding environment can be rapidly and effectively calculated by the method for counting whether the stable pixel point in the new target reference image is saturated or not in the embodiment of the invention. It can be understood that when the stable pixel point in the new target reference image reaches saturation, no matter how the dynamic element loaded in the browser changes, the non-white pixel point in any screen capturing image captured later is not filled into the new target reference image any more, and at this time, the new target reference image can be regarded as the first screen stable image obtained when the first screen element is completely loaded.
Further, please refer to fig. 2, which is a schematic diagram of rendering web page data by a browser according to an embodiment of the present invention. The browser in the target test terminal shown in fig. 2 may be a browser a, where the browser a carries the automatic test tool, and the automatic test tool may control the browser a to simulate the access operation of the user, that is, may automatically input the target web address shown in fig. 2, so that the web page data corresponding to the target web address may be displayed in the first screen display area 100a of the browser shown in fig. 2. In other words, the tester using the test terminal may see the web content of the web page data after the browser analyzes the web page data in the first screen display area 100a shown in fig. 2, and in addition, the test terminal may intercept a second image with the same size as the target reference image in the main element display area 200a in the first screen in the background, so that statistics of stable pixels may be performed based on non-white pixels in the two images, and thus the first screen loading time of the web page in the browser a may be calculated based on the counted stable pixels.
It should be understood that, in the browser a according to the embodiment of the present invention, the arrangement manner of the content of each web page in the web page corresponding to the target address is mainly arranged according to the F-type layout adopted in the web page design. The F-type layout is designed based on the visual behavior of the user, wherein the visual behavior of the user is the visual behavior of the user when the user browses the webpage in the browser A, and the visual behavior can be also understood as the inertial behavior of the user when the user browses the webpage, namely the user usually looks at the top, looks at the upper left corner and then follows the left edge. Therefore, the F-type layout method can be obtained after eye movement analysis is carried out on visual behaviors of a large number of users, and the inertial behavior parameters of the users can be obtained when the browser A adopts the F-type layout mode. Then, when the target test terminal obtains the size (i.e., the first screen width W and the first screen height H) of the first screen display area 100a shown in fig. 2, the main element area 200a shown in fig. 2 may be further determined, where the main element area 200a is the pixel statistics area in the first screen of the browser a. Further, the target test terminal may perform an initialization process on each main element in the pixel statistics area to obtain a white pixel area with the same size as the main element area 200a (i.e. the pixel statistics area), where a blank image in the white pixel area may be referred to as an initial reference image, and all pixel points in the initial reference image are the blank pixel points. When the screen capturing period of the timer reaches the screen capturing period, a screen capturing image with the same size as the initial reference image can be captured in the main element area 200a (i.e., the pixel statistics area) in the browser a, so that non-white pixel points in the screen capturing image can be filled in blank pixel points of the initial reference image, and the filled initial reference image can be determined as a historical reference image. So that when the screenshot period is reached again later, blank pixels in the historical reference image can be filled based on non-white pixels of the screenshot image (namely the first image) which is intercepted up to date, and the filled historical reference image is called as a target reference image. It should be appreciated that the above-described target reference image, historical reference image, and initial reference image may all be collectively referred to as reference images at different times. When blank pixel points exist in the reference image, non-white pixel points in the newly intercepted screen capturing image are continuously filled into the reference image until the filled non-white pixel points in the reference image reach saturation, and the filling is not needed.
The layout manner of each web page content in the first screen display area shown in fig. 2 may follow the F-type layout manner, so that when a user requests to access the web page to the server 2000 through the target address, that is, the user may manually enter the target address in the user terminal used by the user, and when the loading performance of the web page is better, the web page content presented in the main element area 200a shown in fig. 2 may be quickly obtained, so that the commercial value of the data information put in the main element area 200a shown in fig. 2 may be improved.
The webpage in the browser can comprise a static webpage and/or a dynamic webpage, and the static webpage and the dynamic webpage can count the number of stable pixels in the target reference image by continuously comparing the same pixels between the target reference image and the currently intercepted screen capturing image; therefore, when the number of the stable pixel points meets the corresponding first screen stability condition, the first recorded time length reaching the stability threshold value in the first screen stability condition can be further obtained as the first screen loading time. In addition, when the target reference image is compared with the pixel points in the currently intercepted screen capturing image, when the pixel values of the pixel points on the same position coordinates in the target reference image and the target reference image have blank pixel points, the blank pixel points in the screen capturing image can be filled in the blank pixel points of the target reference image so as to convert the blank pixel points in the target reference image into the non-blank pixel points, the number of stable pixel points can be obtained in the filled target reference image in a mode of counting the non-blank pixel points in the filled target reference image, and further when the number of stable pixel points meets the corresponding first screen stability condition, the first recorded time length reaching the stability threshold value in the first screen stability condition can be further obtained as the first screen loading time.
The specific process of the target test terminal acquiring the target reference image, acquiring the currently intercepted screen capturing image, and determining the stable pixel point by using the non-white pixel point in the target reference image and the non-white pixel point in the currently intercepted screen capturing image can be referred to as the implementation manner provided by the embodiments corresponding to the following fig. 3 to 8.
Further, please refer to fig. 3, which is a flowchart illustrating a data processing method according to an embodiment of the present invention. As shown in fig. 3, the method provided by the embodiment of the present invention may include:
step S101, obtaining a target reference image corresponding to a first screen of a browser;
specifically, the test terminal may obtain a history reference image corresponding to the first screen, and intercept a first image from a pixel statistics area in the first screen; further, the target test terminal may acquire non-white pixels in the first image, fill blank pixels in the historical reference image based on the non-white pixels in the first image, and determine the filled historical reference image as the target reference image.
The non-white pixel points in the target reference image are obtained by filling blank pixel points in the historical reference image by the first image; the first image is obtained by intercepting from a pixel statistical area in the first screen; the size of the target reference image is the same as the size of the pixel statistical region;
The non-white pixel points in the historical reference image are obtained by filling blank pixel points in the initial reference image by using a truncated screen capturing image, and the screen capturing image can be an image which is truncated in a pixel statistical area of the initial screen and has the same size as the initial reference image. When the browser renders the webpage data, the image in the pixel statistics area in the first screen may be initialized in the background, for example, the non-white pixel point of the image in the main element area 200a shown in fig. 2 may be initialized in the background of the test terminal, so that an initial reference image with the same size as the pixel statistics area in the first screen may be obtained. Wherein, all pixels in the initial reference image are blank pixels, and the position coordinates of each blank pixel in the initial reference image may be represented as (xi, yj), i and j are non-negative numbers, and i×j may be used to represent the total number of blank pixels in the initial reference image, and the pixel value of each blank pixel may be 255.
For ease of understanding, please refer to fig. 4, which is a schematic diagram illustrating an initial reference image acquisition according to an embodiment of the present invention. In the process of rendering the web page data, the browser in the test terminal (the browser may be the browser a in the embodiment corresponding to fig. 2) may call a first screen size obtaining function (for example, a getb bundle client select () function, which is used to obtain the size of the first screen in the background of the test terminal) to obtain the position information of the first screen in the browser a relative to the browser window, so that the first screen display area with the first screen length of H and the first screen width of W in the embodiment corresponding to fig. 4 may be obtained, that is, the first screen size in the browser a may be obtained, and then the test terminal may obtain the corresponding user inertial behavior parameter based on the F-type layout manner of the web page, so that the pixel statistical area 300a shown in fig. 4 may be obtained based on the first screen size and the user inertial behavior parameter, and since fig. 4 and fig. 2 are the web page corresponding to the same target address, the pixel statistical area 300a shown in fig. 4 may have the same size as the main element display area 200a in the embodiment corresponding to fig. 2. Further, the test terminal may perform an initialization process on the image in the pixel statistics area 300a in the background, that is, may initialize the pixel value of the non-white pixel point in the pixel statistics area 300a to the pixel value of the blank pixel point to obtain a white pixel area 400a with the same size as the pixel statistics area 300a, where the white pixel area 400a may also be referred to as a base pixel area, and the blank image in the white pixel area 400a may be referred to as an initial reference image shown in fig. 4.
It should be appreciated that, during the process of rendering the web page data of the web page by the browser a, the web page content analyzed by the browser may be continuously presented in the first screen display area shown in fig. 4, so as to simulate the operation of accessing the web page by the user. In other words, the browser a may dynamically present the parsed web page content (also referred to as page elements) to the first screen display area to simulate the user accessing the web page via the target address. The process of analyzing and displaying each page element in the web page by the browser a is executed asynchronously, that is, the browser a does not wait until all page elements are downloaded and analyzed, and then displays relevant web page data to the user, so that when the rendering event is monitored, the embodiment of the invention can intercept corresponding screen capturing images in the pixel statistics area in the embodiment corresponding to fig. 4 through a timer.
For ease of understanding, further, please refer to fig. 5, which is a schematic diagram of capturing a screenshot image according to an embodiment of the present invention. As shown in fig. 5, when the screenshot duration reaches the screenshot period, a plurality of screenshot images may be obtained, where the screenshot images may include the screenshot image 10, the screenshot images 20, …, the screenshot image 30, and so on described in fig. 5, that is, each screenshot image shown in fig. 5 is actually an image obtained after the test terminal performs the screenshot operation on the pixel statistics area at different moments, and by continuously filling non-blank pixels in each of the intercepted screenshot images into the reference image with blank pixels, a new reference image may be obtained. It can be understood that by filling the non-white pixels in the truncated screen capturing image into the reference image, the blank pixels in the reference image can be converted into non-blank pixels, so that whether the first screen pixel of the first screen is stable (i.e. whether the iteration number reaches the maximum iteration threshold) can be determined by the reference image when the non-white pixels reach saturation, and when the first screen pixel of the first screen is stable (i.e. the non-white pixels in the filled reference image reach saturation), the truncated screen capturing image again is difficult to fill into the new reference image (i.e. the filled reference image), so that by comparing whether the pixels of the new reference image and the pixel of the truncated screen capturing image are identical, whether the web page is a dynamic web page or a static web page can be determined. Optionally, if the screen capturing number is smaller than the comparison number threshold, when detecting that the non-white pixel point in the reference image is different from the non-white pixel point of the screen capturing image captured again, the number of stable pixel points with different pixel values on the same position coordinate may be accumulated, so that the loading performance of the converted dynamic picture by the browser may be known through the accumulated number of stable pixel points in the process of generating the switching of the dynamic picture.
The screen shot image 10 shown in fig. 5 may be a first screen shot image, the test terminal may fill in the first screen shot image into the initial reference image, and may use the initial reference image after filling as the reference image newly determined from time T1 to time T2, that is, may obtain a new reference image, where the new reference image may be referred to as a history reference image corresponding to the first screen. It should be appreciated that the number of non-white pixels within the filled initial reference image may be used to indirectly reflect the loading performance when loading web page data in a browser. In addition, the screen shot image 20 shown in fig. 5 may be used as a first image, where the size of the first image is equal to the size of the first screen shot image that is first cut, and the non-white pixels in the first image may be used to fill the non-white pixels in the new reference image (i.e., the historical reference image), so that the filled historical reference image may be used as a target reference image, which may be understood as the reference image that is most recently determined by the test terminal in the time T2-Tn, so when the screenshot period reaches the time Tn, the screen shot image 30 shown in fig. 5 may be referred to as a second image, so that the non-white pixels in the second image may be compared with the non-white pixels in the target reference image to determine the stable pixels, and the iteration number of the stable pixels.
When comparing the non-white pixel point in the first image with the non-white pixel point in the historical reference image, the test terminal can determine the non-white pixel point with the same position coordinate and the same pixel value as the non-white pixel point in the first image as a stable pixel point in the historical reference image, and accumulate the iteration number of the stable pixel point, however, when blank pixel points with the same position coordinate and different pixel values exist in the historical reference image in the process of continuing the comparison in the screen capturing period, the test terminal can zero clearing the iteration number of the stable pixel point accumulated by the stable counter, and fill the non-white pixel point in the first image to the blank pixel point in the historical reference image to obtain the target reference image. Thus, when a new screen capture period comes, the test terminal determines that the non-white pixels in the target reference image are re-compared with the non-white pixels in the newly captured screen capture image.
It will be appreciated that, at time t=t1, the timer may intercept the screen capture image 10 shown in fig. 5 (i.e., the first screen capture image described above) from the pixel statistics area 100b shown in fig. 5, and, next, the timer may intercept the screen capture image 20 shown in fig. 5 (i.e., the first image described above) from the pixel statistics area 200b shown in fig. 5 at time t=t2, …, and then, the timer may intercept the screen capture image 30 shown in fig. 5 (i.e., the second image described above) from the pixel statistics area 300b shown in fig. 5 at time t=tn. It will be appreciated that the non-white pixels in the second image may comprise non-white pixels in the first image and the non-white pixels in the first image may comprise non-white pixels in the first screen shot image. The timer can perform screen capturing processing on the image in the image statistics area in the first screen at a certain interval period, and also can perform screen capturing processing on the image in the image statistics area in the first screen in real time, and the screen capturing duration of the timer is not limited here.
Further, when the test terminal obtains the screenshot image 10 shown in fig. 5, the first screenshot image may be referred to as the first screenshot image, and non-white pixel points in the first screenshot image may be acquired. It can be understood that, when the first screen size of the browser is determined, the size of the pixel statistical area in the first screen is determined, so that the number of pixels in each screen capturing image which is captured later is determined. In order to save calculation resources and improve calculation efficiency, a pixel step value adopted in rendering can be obtained in the process of simulating the webpage data in the browser A, so that the browser A can quickly determine the pixel value of a pixel point on a corresponding position coordinate in a corresponding screen capture image based on the pixel step value when the corresponding webpage content is presented, and therefore the corresponding screen capture image can be captured at the test terminal, and compared with the newly determined reference image, the comparison quantity in each pixel point comparison can be reduced, and the calculation resources of the background can be reduced. The non-white pixel points in the screen capturing image may be pixel points obtained in the process that the browser a renders the webpage data based on the pixel step value; the pixel step value may be 3, that is, a point may be made in the browser at every 3 position coordinates, that is, a non-white pixel point may be obtained at every 3 position coordinates. Further, the test terminal may fill the non-white pixel point in the screen capturing image into the newly determined reference image in the background, for example, the newly determined reference image may be the initial reference image, and at this time, in the background of the test terminal, the pixel value of the blank pixel point in the initial reference image may be updated to the pixel value of the non-white pixel point in the screen capturing image on the same position coordinate, so as to obtain a historical reference image, and thus a new reference image is obtained. In other words, the test terminal may fill the non-white pixel point in the first screen capturing image shown in fig. 5 into the initial reference image, and determine the initial reference image after being filled as the historical reference image corresponding to the first screen, so that when the first image shown in fig. 5 is acquired subsequently, the non-white pixel point in the first image may be further filled into the historical reference image to obtain the target reference image corresponding to the first screen, and at this time, the target reference image may also be understood as a reference image that is determined newly.
For ease of understanding, further, please refer to fig. 6, which is a schematic diagram of acquiring a target reference image according to an embodiment of the present invention. Based on the initial reference image in the embodiment corresponding to fig. 4, all the pixels in the initial reference image are blank pixels, so that the area where the blank pixels are located in the initial reference image shown in fig. 6 may be referred to as the area to be filled, that is, the area to be filled 100c shown in fig. 6 may be obtained in the initial reference image shown in fig. 6. Similarly, the area where the blank pixel points in the history reference image are located may be referred to as an area to be filled, that is, the area to be filled 200c shown in fig. 6 may be obtained, and similarly, the area where the blank pixel points in the target reference image are located may be referred to as an area to be filled, that is, the area to be filled 300c shown in fig. 6 may be obtained. In addition, based on the first screenshot image in the embodiment corresponding to fig. 5, each non-white pixel point may be extracted from the first screenshot image, further, please refer to the schematic diagram of the non-white pixel point in the first screenshot image shown in fig. 6. Further, the test terminal may fill non-white pixel points in the first screen capturing image captured at the time T1 into the to-be-filled region 100c of the initial reference image in the background, and determine the initial reference image after filling as a historical reference image corresponding to the first screen. Further, please refer to a schematic diagram of the history reference image in the embodiment corresponding to fig. 6. Similarly, the test terminal may fill the non-white pixel point in the first image captured at the time T2 into the to-be-filled area 200c of the history reference image in the background, and determine the filled history reference image as the target reference image corresponding to the first screen, further, please refer to the schematic diagram of the target reference image in the embodiment corresponding to fig. 6. It may be understood that in the process of obtaining the target reference image, there is necessarily a process of comparing the non-white pixel point in the first image with the non-white pixel point in the history reference image to determine the stable pixel point and count the iteration number of the stable pixel point, for example, in the embodiment of the present invention, in the process of comparing the non-white pixel point in the first image shown in fig. 6 with the non-white pixel point in the history reference image to obtain the first comparison result, there is the non-white pixel point with the same position coordinate and pixel value as the non-white pixel point in the history reference image in the first image, in the history reference image, the non-white pixel point with the same position coordinate and the same pixel value as the non-white pixel point in the first image may be determined as the stable pixel point, that is, as shown in fig. 6, all the non-white pixel points in the stable pixel region in the history reference image may be determined as the stable pixel point, and the number of iterations counted by the stable counter from the time point T1 to the time point in the stable pixel point may be counted as the stable pixel point in the history reference image. For example, the number of iterations of the counted stable pixel point is 14. Then, the test terminal may compare the iteration number with a stable number threshold to determine whether the iteration number satisfies a first screen stability condition. For example, the stable number threshold corresponding to the historical reference image region may be 23, and the maximum number threshold is 28, and the iterative number threshold 23 is 80% of the maximum number threshold. Then, the number of iterations 14 of the stable pixel points counted in the interval duration from the time T1 to the time T2 is smaller than the threshold value 23 of the number of iterations, that is, the first screen stability condition is not reached, so that it is necessary to continuously re-intercept a new screen capturing image from the pixel counting area in the first screen, and based on the non-white pixel points in the new screen capturing image, re-accumulate the number of iterations of the stable pixel points in the filled historical image area. It will be appreciated that the test terminal may use the filled history reference image as the target reference image shown in fig. 6, so as to further perform step S102.
It should be appreciated that in embodiments of the present invention, the initial reference image, the historical reference image, and the target reference image described above may be referred to as reference images within different screen capture periods. The reference image is used for comparing with the screen capturing image intercepted next time so as to obtain stable pixel points.
Step S102, intercepting a second image in the pixel statistical area in the first screen;
the specific process of acquiring the second image may be referred to the description of acquiring the first image by the timer in the embodiment corresponding to fig. 5, and the acquired second image may be the second image in the embodiment corresponding to fig. 5. Then, the test terminal may further acquire a non-white pixel point in the second image. The specific process of acquiring the non-white pixel point in the second image may refer to the description of acquiring the non-white pixel point in the first image in the embodiment corresponding to fig. 6, which will not be described in detail herein.
It should be understood that, in the embodiment corresponding to fig. 5, the first image obtained at the time T1 and the second image obtained at the time T2 may be images obtained during two adjacent screen shots of the timer, in other words, the new reference image obtained after the history reference image is filled by the first image may be a target reference image, and the new screen shot image that is obtained by cutting again may be referred to as the second image. Optionally, at least one screen capturing period may be further spaced between the time T1 and the time T2, for convenience of understanding, in this embodiment of the present invention, when the duration T accumulated by the timer reaches one screen capturing period, the screen capturing image may be re-captured from the graphic statistics area in the first screen of the browser, so that the non-white pixel point in the newly captured screen capturing image may be filled into the target reference image, until the number of times of screen capturing reaches the comparison number threshold (for example, 20), and then the screen capturing operation may be stopped.
Step S103, determining stable pixel points according to the non-white pixel points in the second image and the non-white pixel points in the target reference image, and determining the iteration number of the stable pixel points;
specifically, the test terminal may iteratively compare the non-white pixel points in the second image with the non-white pixel points in the target reference image; further, if a non-white pixel point with the same position coordinate and pixel value as those of the non-white pixel point in the target reference image exists in the second image in the iterative comparison result, determining the non-white pixel point with the same position coordinate and the same pixel value as those of the non-white pixel point in the second image in the target reference image as a stable pixel point, and iteratively calculating the iteration number of the stable pixel point in the target reference image; at this time, the number of iterations of the stable pixel points may be the number of non-white pixel points in the target reference image accumulated by the stable counter. Optionally, after performing the step of performing iterative comparison between the non-white pixel point in the second image and the non-white pixel point in the target reference image, the test terminal may further fill the non-white pixel point in the second image to the blank pixel point in the target reference image according to the non-white pixel point which exists in the second image and has the same position coordinate and different pixel value with the blank pixel point in the target reference image in the iterative comparison result, determine the non-white pixel point in the filled target reference image as a stable pixel point, and iteratively calculate the iteration number of the stable pixel point in the filled target reference image; at this time, the number of iterations of the stable pixel points is the number of non-white pixel points in the filled target reference image accumulated by the stable counter.
Further, please refer to fig. 7, which is a schematic diagram of determining a stable pixel according to an embodiment of the present invention. As shown in fig. 7, two ways may exist in determining the stable pixel point to determine whether the pixel point in the target reference image is the stable pixel point, that is, one way is to find the non-white pixel point with the same pixel value on the same position coordinate as the stable pixel point in the comparing process, further, please refer to the comparing result obtained in the way a shown in fig. 7, that is, the comparing way a focuses on whether the non-white pixel point with the same position coordinate and the same pixel value as the non-white pixel point in the target reference image exists in the second image, if so, the non-white pixel point with the same position coordinate and the same pixel value as the non-white pixel point in the second image may be determined as the stable pixel point in the target reference image shown in fig. 7. For example, the pixel value of each non-white pixel point (for example, the non-white pixel point M ') in the second image shown in fig. 7 may be compared with the pixel value of the non-white pixel point (for example, the non-white pixel point M) in the target reference image at the same position coordinates, wherein the non-white pixel point M ' and the non-white pixel point M have the same position coordinates, and when the pixel value of the non-white pixel point M ' is the same as the pixel value of the non-white pixel point M, the non-white pixel point M may be determined as a stable pixel point in the target reference image shown in fig. 7, and similarly, other non-white pixel points having the same pixel value at the same position coordinates may be subsequently determined as stable pixel points in the target reference image.
Optionally, as shown in fig. 7, in the process of determining the stable pixel point, another manner (i.e., manner B) may be further adopted to implement determination of the stable pixel point, that is, in the comparison result obtained by manner B shown in fig. 7, whether a non-white pixel point with the same position coordinates as the blank pixel point in the target reference image but different pixel values exists may be determined in the second image according to the comparison result, and if so, the non-white pixel point in the second image may be filled into the target reference image first, and the non-white pixel point may be further determined as the stable pixel point in the filled target reference image; for example, taking the non-white pixel N 'in the second image and the blank pixel N in the target reference image as illustrated in fig. 7 as an example, the non-white pixel N' and the blank pixel N have the same position coordinates, but the pixel values of the two pixels are not the same, so the non-white pixel in the second image may be filled into the target reference image to obtain the filled target reference image, then all the non-white pixels may be determined as stable pixels in the target reference image, and further, see the schematic diagram of fig. 7 for determining the non-white point in the filled target reference image as the stable pixel. That is, the test terminal may fill the non-white pixel point N' in the second image to the blank pixel point N in the target reference image when detecting that the pixel value of the blank pixel point in the target reference image is different from the pixel value of the non-white pixel point in the second image on the same position coordinate, until the test terminal fills all the non-white pixel points on the same position coordinate in the second image to the target reference image, a filled target reference image may be obtained, and the filled target reference image may be used to compare the filled target reference image with the non-white pixel point in the intercepted screen capture image again when the next screen capture period is up, so as to repeatedly perform the above comparison process. At this time, the number of iterations of the stable pixel calculated in the method B is the number of non-white pixels in the filled target reference image accumulated by the stable counter. It should be appreciated that, in the manner B, the time when the number of iterations of the stable pixel points reaches the threshold of the stable number may be obtained more quickly and accurately, because the non-white pixel points in the filled target reference image are the pixel points of the web page content currently presented in the first screen.
It will be appreciated that the most recent screenshot image may be truncated from the pixel statistics area as described above each time a screenshot period arrives, so that the most recent screenshot image may be compared to the most recently determined reference image in the last screenshot period. When the pixel values of the non-white pixels in the two images participating in the comparison are compared one by one, if the pixel values of the non-white pixels in the same position coordinates are detected to be the same, the non-white pixels with the same pixel values can be determined as stable pixel points, and the iteration number of the stable pixel points can be accumulated through a stable counter. It should be appreciated that the filled target reference image may be referred to as a new target reference image, and that the target reference image prior to filling may then be referred to as the historical reference image described above. Then, the test terminal can select the mode B to re-accumulate the iteration number in the filled target reference image in the current screen capturing period so as to ensure the accuracy of calculation.
Optionally, the test terminal may further directly fill the non-white pixel point in the latest screen capturing image into the reference image newly determined in the previous screen capturing period after detecting that the pixel values of the two pixel points on the same position coordinates are different and clearing the counted number of iterations in the screen capturing period, for example, the reference image newly determined in the previous screen capturing period may be the target reference image, so that when the filled target reference image arrives as the next screen capturing period, the reference image newly determined in the comparison process with the screen capturing image intercepted next time can be compared, and the process of determining the stable pixel point is performed in the repeated passing mode a until the number of iterations of continuously counting the stable pixel point for multiple times reaches the threshold of the stable number, and when all blank pixel points in the latest determined reference image are converted into the non-white pixel point, the test terminal does not need to fill the intercepted screen image again.
At this time, when there is no blank pixel in the newly determined reference image, whether the web page of the browser is a static web page or a dynamic web page may be further determined by the non-white pixel in the newly determined reference image, that is, the pixel value of the non-white pixel in the newly determined reference image is identical to the pixel value of the non-white pixel in the newly captured screen capturing image (i.e., the third image), which indirectly reflects that the last captured screen capturing image is identical to the currently captured screen capturing image, so that the web page corresponding to the browser a may be determined as the static web page based on the reference image in which the pixel value is no longer changed, so as to further execute step S104 described below. Optionally, if the pixel values of the non-white pixels in the filled target reference image are different from the pixel values of the non-white pixels in the newly intercepted third image, the interface element rendered by the browser is indirectly reflected to be automatically switched from the first picture to the second picture, and at this time, the web page corresponding to the browser a may be determined to be a dynamic web page based on the reference image in which the pixel values no longer change, so as to further execute step S104 described below. The first picture and the second picture may be referred to as dynamic pictures of the dynamic web page, and in the pixel statistics area of the first screen corresponding to the dynamic web page, dynamic switching may be performed between a plurality of preconfigured dynamic pictures.
It will be appreciated that when the number of non-white pixels (the number of stable pixels) counted in the target reference image reaches the maximum iteration threshold, i.e. the number of stable pixels in the target reference image reaches saturation, it will be difficult for the test terminal to fill the non-white pixels in the second image into the target reference image again in the background. Therefore, when a new screen capturing period arrives, the test terminal may iteratively compare the non-white pixel point of the new captured screen capturing image (for example, the third image) with the non-white pixel point of the target reference image to determine whether the web page of the browser is a dynamic web page, for example, if the pixel values of the non-white pixel point of the target reference image are the same as the pixel values of the non-white pixel point of the captured third image, the web page corresponding to the browser is determined to be a dynamic web page, otherwise, the web page corresponding to the browser may be determined to be a static web page. Optionally, if the number of non-white pixels in the target reference image is not saturated, that is, there are still blank pixels that can be filled in the target reference image, the test terminal may further fill the non-white pixels in the second image into the target reference image.
Step S104, when the iteration number meets the initial screen stability condition and the screen capturing frequency is smaller than the comparison frequency threshold, determining the accumulated time length when the iteration number meets the stability number threshold in the initial screen stability condition as initial screen loading time corresponding to the initial screen.
Specifically, when judging whether a dynamic webpage or a static webpage, the test terminal can distinguish the first screen stability condition met by the iteration number into the condition of meeting the static stability condition or the condition of meeting the dynamic stability condition, in other words, when the iteration number meets the static stability condition and the screen capturing frequency is smaller than a comparison frequency threshold value, the test terminal can acquire a first accumulated time length when the iteration number reaches the first threshold value for the first time, and determine the first accumulated time length as first screen loading time corresponding to the first screen of the static webpage; optionally, when the number of iterations meets a dynamic stability condition and the number of screen shots is smaller than a threshold of comparison times, the test terminal may further obtain a second accumulated time length when the number of iterations reaches a second threshold of the dynamic webpage for the first time, and determine the second accumulated time length as a first screen loading time corresponding to a first screen of the dynamic webpage.
The threshold value of the number of times of stabilization of the dynamic web page (i.e., the second threshold value) may be equal to the threshold value of the number of times of stabilization of the static web page (i.e., the first threshold value), and of course, different thresholds of iteration times may also be set for web page data under different environments. It will be appreciated that the threshold number of times the dynamic web page is stabilized may be the second threshold, and then the threshold number of times the static web page is stabilized may be the first threshold, and the specific number of the first threshold and the second threshold will not be limited here.
It should be appreciated that before performing step S104 described above, the following steps may also be performed: the test terminal can further judge whether the webpage rendered by the browser is a static webpage or a dynamic webpage, namely, when the first screen stabilizing condition comprises a static stabilizing condition and a dynamic stabilizing condition, the test terminal can further judge whether the iteration number of the stabilized pixel points obtained in the step S103 reaches a stabilizing frequency threshold, wherein the stabilizing frequency threshold can comprise a first threshold and a second threshold under different environments; therefore, if the screen capturing times are smaller than the comparison times threshold, and the iteration number is counted continuously for multiple times to reach the first threshold, and the pixel value of the non-white pixel point in the filled target reference image is identical to the pixel value of the non-white pixel point in the intercepted third image, determining the webpage corresponding to the browser as a static webpage, and determining that the iteration number meets the static stability condition; optionally, if the number of screen shots is smaller than the threshold of comparison number, and the number of iterations reaches the second threshold, and the pixel values of the non-white pixels in the target reference image after filling are different from the pixel values of the non-white pixels in the third image after cutting, determining the web page corresponding to the browser as a dynamic web page, and determining that the number of iterations meets the dynamic stability condition.
It can be understood that after determining whether the currently requested web page is a dynamic web page or a static web page, the rendering condition of the element in the dynamic image after the dynamic change can be further determined according to the non-white pixel point in the target reference image after the filling, that is, the screen capturing image captured by the switched dynamic image (for example, the second image) in the pixel statistics area of the first screen can be referred to as a fourth image, that is, the non-white pixel point in the target reference image (at this time, each pixel point in the target reference image can be referred to as a stable pixel point) is compared with the non-white pixel point in the fourth image, the rendering condition of the second image in the dynamic web page can be indirectly known through the iteration number of the stable pixel points with different pixel values on the same position coordinates, that is, each stable pixel point with different pixel values is found, the loading condition of the non-white pixel point in the dynamic image can be indirectly determined, that is, the loading performance of the dynamic image after the dynamic image can be loaded through the iteration number of the stable pixel points can be determined.
It can be understood that, for a static web page, only the first picture needs to be rendered in the whole process, while a dynamic web page needs to render a plurality of dynamic pictures which can be dynamically switched. Therefore, the first screen stable pixel of the dynamic webpage is determined by counting the non-white pages formed by all stable pixels when the pixel value of the non-white pixel point in the newly determined reference image is not changed in the process of rendering the first picture through the browser A, namely, when the iteration number of the stable pixel point in the filled target reference image reaches the maximum iteration threshold, the non-white pixel point in the screen capturing image intercepted later can be considered to be difficult to fill into the non-white page, at the moment, the dynamic webpage can be determined to have completely loaded the first picture, so that the second accumulated duration that the second threshold in the dynamic stability condition is met for the first time by the iteration number of the stable pixel point in the non-white page can be reversely deduced forward, and the second accumulated duration is taken as the first screen loading time of the dynamic webpage. Furthermore, the test terminal can also count the loading condition of each element in the second picture intercepted later when the next screen capturing period comes through the first screen stabilizing pixel in the non-white page.
According to the embodiment of the invention, after the first screen size of the browser is obtained, a pixel statistical region conforming to the visual habit of the user can be determined in the first screen, and then a target reference image with the same size as the pixel statistical region can be obtained in the background, wherein the rendering content carried in the pixel statistical region can reflect the loading condition of the browser on main elements during webpage data rendering. And then, comparing non-white pixel points in the second image intercepted from the pixel statistical area of the first screen with blank pixel points of the target reference image to quickly obtain stable pixel points, and meanwhile, accumulating the iteration number of the stable pixel points in the background, so that whether the iteration number meets the first screen stability condition can be judged within the comparison frequency threshold, and the accumulated time length when the iteration number meets the stability number threshold in the first screen stability condition can be used as the first screen loading time of the first screen. In the process of accumulating the iteration number of the stable pixel points, non-white pixel points in the intercepted screenshot image can be continuously filled in the target reference image until blank pixel points in the filled target reference image are filled into the non-white pixel points, and the non-white pixel points in the filled target reference image reach saturation, so that the non-white pixel points in the intercepted screenshot image again are difficult to refill into the target reference image. Therefore, when the main elements rendered in the browser are changed, the non-white pixel points in the intercepted screen capturing image can not influence the non-white pixel points in the filled target reference image any more, so that the first screen loading time can be accurately obtained through the iteration number of the stable pixel points accumulated in the target reference image, and the accuracy of the first screen time calculation is improved. In addition, by introducing the threshold value of the comparison times, the phenomenon of falling into dead loops can be avoided in the accumulating process, so that the waste of computing resources can be avoided.
Further, please refer to fig. 8, which is a flowchart illustrating another data processing method according to an embodiment of the present invention. As shown in fig. 8, the method at least may include:
step S201, acquiring the first screen size of a browser corresponding to webpage data, and acquiring user inertia behavior parameters corresponding to the browser;
the user inertial behavior parameters are behavior parameters obtained based on historical user behaviors corresponding to the browser;
step S202, determining an initial reference image associated with the first screen based on the first screen size and the user inertial behavior parameters;
wherein, all the pixel points in the initial reference image are blank pixel points.
Step S203, when the browser renders the webpage data, capturing a screen capturing image with the same size as the initial reference image in a pixel statistical area in the first screen, and acquiring non-white pixel points in the screen capturing image; the non-white pixel points in the screen capturing image are pixel points obtained in the process that the browser renders the webpage data based on the pixel step value;
and step S204, filling non-white pixel points in the screen capturing image into the initial reference image, and determining the filled initial reference image as the history reference image corresponding to the first screen.
Step S205, acquiring the history reference image corresponding to the first screen, and intercepting a first image from a pixel statistical area in the first screen;
step S206, acquiring non-white pixel points in the first image, filling blank pixel points in the history reference image based on the non-white pixel points in the first image, and determining the filled history reference image as the target reference image.
The specific implementation manner of step S201 to step S206 may be referred to the description of step S101 in the embodiment corresponding to fig. 3, and the detailed description will not be repeated here.
Step S207, a second image is intercepted in the pixel statistical area in the first screen;
step S208, determining stable pixel points according to the non-white pixel points in the second image and the non-white pixel points in the target reference image, and determining the iteration number of the stable pixel points;
step S209, if the screen capturing times are smaller than the comparison times threshold, and the iteration number is counted continuously for multiple times to reach the first threshold, and the pixel value of the non-white pixel point in the filled target reference image is identical to the pixel value of the non-white pixel point in the intercepted third image, determining the webpage corresponding to the browser as a static webpage, and determining that the iteration number meets the static stability condition;
Step S210, when the iteration number meets a static stability condition and the screen capturing frequency is smaller than a comparison frequency threshold, a first accumulated time length when the iteration number reaches the first threshold for the first time is obtained, and the first accumulated time length is determined to be the first screen loading time corresponding to the first screen of the static webpage.
Optionally, step S211, if the number of screen shots is smaller than the threshold of comparison number, and the number of iterations reaches the second threshold, and the pixel values of the non-white pixels in the filled target reference image are different from the pixel values of the non-white pixels in the intercepted third image, determining the web page corresponding to the browser as a dynamic web page, and determining that the number of iterations satisfies the dynamic stability condition;
step S212, when the iteration number meets the dynamic stability condition and the screen capturing frequency is smaller than the comparison frequency threshold, obtaining a second accumulated time length when the iteration number reaches a second threshold of the dynamic webpage for the first time, and determining the second accumulated time length as a first screen loading time corresponding to a first screen of the dynamic webpage.
It should be understood that, for the web page data in different environments, different first-screen stability conditions may be corresponding, for example, the first-screen stability condition corresponding to the static web page may be a static stability condition, and the first-screen stability condition corresponding to the dynamic web page may be a dynamic stability condition.
The specific implementation manner of step S207 to step S212 may be referred to the description of step S102 to step S104 in the corresponding embodiment described above with reference to fig. 3, and the detailed description will not be repeated here.
Optionally, after the test terminal finishes executing the step S210 or the step S212, the first screen loading report corresponding to the first screen loading time may be further generated, and the first screen loading report is sent to a server corresponding to the webpage data rendered in the browser, so that the server pushes the alarm information to the corresponding management terminal.
The server may be the server 2000 in the embodiment corresponding to fig. 1, that is, the server may store the web page data that can be requested by each user terminal based on the target web address. Specifically, please refer to the description of the first screen loading report in the embodiment corresponding to fig. 1, and the description will not be repeated here.
Optionally, when the number of screen shots reaches the threshold of the comparison number, and the number of iterations does not meet the first screen stability condition, the test terminal terminates the operation of performing iterative computation on the number of iterations of the stable pixel points, generates alarm information corresponding to the browser, and sends the alarm information to a server corresponding to webpage data rendered in the browser, so that the server pushes the alarm information to a corresponding management terminal, and the management terminal can perform optimization processing on the performance of the webpage based on the alarm information, thereby better providing services for users.
According to the embodiment of the invention, after the first screen size of the browser is obtained, a pixel statistical region conforming to the visual habit of the user can be determined in the first screen, and then a target reference image with the same size as the pixel statistical region can be obtained in the background, wherein the rendering content carried in the pixel statistical region can reflect the loading condition of the browser on main elements during webpage data rendering. And then, comparing non-white pixel points in the second image intercepted from the pixel statistical area of the first screen with blank pixel points of the target reference image to quickly obtain stable pixel points, and meanwhile, accumulating the iteration number of the stable pixel points in the background, so that whether the iteration number meets the first screen stability condition can be judged within the comparison frequency threshold, and the accumulated time length when the iteration number meets the stability number threshold in the first screen stability condition can be used as the first screen loading time of the first screen. In the process of accumulating the iteration number of the stable pixel points, non-white pixel points in the intercepted screenshot image can be continuously filled in the target reference image until blank pixel points in the filled target reference image are filled into the non-white pixel points, and the non-white pixel points in the filled target reference image reach saturation, so that the non-white pixel points in the intercepted screenshot image again are difficult to refill into the target reference image. Therefore, when the main elements rendered in the browser are changed, the non-white pixel points in the intercepted screen capturing image can not influence the non-white pixel points in the filled target reference image any more, so that the first screen loading time can be accurately obtained through the iteration number of the stable pixel points accumulated in the target reference image, and the accuracy of the first screen time calculation is improved. In addition, by introducing the threshold value of the comparison times, the phenomenon of falling into dead loops can be avoided in the accumulating process, so that the waste of computing resources can be avoided.
Further, please refer to fig. 9, which is a schematic diagram illustrating a structure of a data processing apparatus according to an embodiment of the present invention. As shown in fig. 9, the data processing apparatus 1 may be applied to the target test terminal in the embodiment corresponding to fig. 1. The data processing apparatus 1 may include: referring to the acquisition module 10, the image capturing module 20, the stable point determining module 30, the first screen time determining module 40; further, the data processing apparatus 1 may further include a first screen size obtaining module 50, an initial reference determining module 60, a rendering interception module 70, a history reference determining module 80, a static web page determining module 90, a dynamic web page determining module 100, an alarm generating module 110 and a report transmitting module 120;
the reference acquisition module 10 is used for acquiring a target reference image corresponding to a first screen of the browser; the non-white pixel points in the target reference image are obtained by filling blank pixel points in the historical reference image by the first image; the first image is obtained by intercepting from a pixel statistical area in the first screen; the size of the target reference image is the same as the size of the pixel statistical region;
the reference acquisition module 10 includes a history reference acquisition unit 101 and a pixel point filling unit 102;
A history reference acquiring unit 101, configured to acquire the history reference image corresponding to the first screen, and intercept a first image from a pixel statistics area in the first screen;
and a pixel filling unit 102, configured to obtain a non-white pixel in the first image, fill a blank pixel in the historical reference image based on the non-white pixel in the first image, and determine the filled historical reference image as the target reference image.
The specific implementation manner of the history reference obtaining unit 101 and the pixel point filling unit 102 may refer to the description of step S101 in the embodiment corresponding to fig. 3, and the description will not be repeated here.
An image capturing module 20, configured to capture a second image in the pixel statistics area in the first screen;
a stable point determining module 30, configured to determine a stable pixel point according to a non-white pixel point in the second image and a non-white pixel point in the target reference image, and determine an iteration number of the stable pixel point;
wherein the stabilization point determination module 30 comprises: a first comparing unit 301, a same determining unit 302 and a first iterating unit 303; optionally, the stable point determination module 30 may further include: a second comparing unit 304, a filling determining unit 305 and a second iterating unit 306;
A first comparing unit 301, configured to iteratively compare the non-white pixel point in the second image with the non-white pixel point in the target reference image;
the same determining unit 302 is configured to determine, as a stable pixel point, a non-white pixel point having the same position coordinate and the same pixel value as those of the non-white pixel point in the second image in the target reference image if the non-white pixel point having the same position coordinate and the same pixel value as those of the non-white pixel point in the second image exists in the second image in the iterative comparison result;
a first iteration unit 303, configured to iteratively calculate the iteration number of the stable pixel point in the target reference image; the iteration number of the stable pixel points is the number of non-white pixel points in the target reference image accumulated by the stable counter.
Optionally, a second comparing unit 304 is configured to iteratively compare the non-white pixel points in the second image with the non-white pixel points in the target reference image;
a filling determining unit 305, configured to fill a non-white pixel point in the second image to a blank pixel point in the target reference image if a non-white pixel point having the same position coordinate and a different pixel value as those of the blank pixel point in the target reference image exists in the second image in the iterative comparison result, and determine the non-white pixel point in the filled target reference image as a stable pixel point;
A second iteration unit 306, configured to iteratively calculate the iteration number of the stable pixel point in the filled target reference image; the iteration number of the stable pixel points is the number of non-white pixel points in the filled target reference image accumulated by the stable counter.
It can be understood that in the embodiment of the present invention, the stable pixel point may be determined by the first comparing unit 301, the same determining unit 302 and the first iterating unit 303, or the stable pixel point may be determined by the second comparing unit 304, the filling determining unit 305 and the second iterating unit 306. The specific implementation manner of the first comparing unit 301, the same determining unit 302, the first iterating unit 303, and the second comparing unit 304, the filling determining unit 305, and the second iterating unit 306 may refer to the description of two ways of determining the stable pixel point in the embodiment corresponding to fig. 3, and the description will not be repeated here.
And the first screen time determining module 40 is configured to determine, when the number of iterations satisfies a first screen stability condition and the number of screen shots is smaller than a comparison number threshold, an accumulated time length when the number of iterations satisfies a stability number threshold in the first screen stability condition as a first screen loading time corresponding to the first screen.
Wherein, first screen time determining module 40 includes: a first time length determination unit 401 and a second time length determination unit 402;
a first time length determining unit 401, configured to obtain a first accumulated time length when the number of iterations reaches the first threshold for the first time when the number of iterations satisfies a static stability condition and the number of screen shots is smaller than a comparison number threshold, and determine the first accumulated time length as a first screen loading time corresponding to a first screen of the static webpage;
and a second duration determining unit 402, configured to obtain a second accumulated duration when the number of iterations reaches a second threshold of the dynamic web page for the first time when the number of iterations satisfies a dynamic stability condition and the number of screen shots is smaller than a threshold of comparison times, and determine the second accumulated duration as a first screen loading time corresponding to a first screen of the dynamic web page.
The execution manner of the first duration determining unit 401 and the second duration determining unit 402 may refer to the description of step S104 in the embodiment corresponding to fig. 3, and the description thereof will not be repeated here.
The specific implementation manner of the obtaining module 10, the image capturing module 20, the stable point determining module 30, and the first screen time determining module 40 may refer to the description of step S101 to step S104 in the embodiment corresponding to fig. 3, and will not be further described herein.
Optionally, the first screen size obtaining module 50 is configured to obtain a first screen size of a browser corresponding to web page data, and obtain a user inertia behavior parameter corresponding to the browser; the user inertial behavior parameters are behavior parameters obtained based on historical user behaviors corresponding to the browser;
an initial reference determination module 60 for determining an initial reference image associated with the first screen based on the first screen size and user inertial behavior parameters; all pixel points in the initial reference image are blank pixel points;
a rendering interception module 70, configured to intercept a screen capturing image having the same size as the initial reference image in a pixel statistics area in the first screen, and obtain a non-white pixel point in the screen capturing image when the browser renders the web page data; the non-white pixel points in the screen capturing image are pixel points obtained in the process that the browser renders the webpage data based on the pixel step value;
the history reference determining module 80 is configured to fill non-white pixel points in the screen capturing image into the initial reference image, and determine the filled initial reference image as the history reference image corresponding to the first screen.
The first screen stabilizing condition comprises a static stabilizing condition and a dynamic stabilizing condition;
the static webpage determining module 90 is configured to determine, if the number of screen shots is smaller than the threshold of comparison number, and the number of iterations reaches a first threshold after continuously counting for multiple times, and the pixel values of the non-white pixels in the filled target reference image are the same as the pixel values of the non-white pixels in the intercepted third image, a webpage corresponding to the browser as a static webpage, and determine that the number of iterations satisfies the static stability condition;
the dynamic web page determining module 100 is configured to determine, if the number of screen shots is smaller than the threshold of comparison number, and the number of iterations reaches the second threshold, and the pixel values of the non-white pixels in the filled target reference image are different from the pixel values of the non-white pixels in the intercepted third image, a web page corresponding to the browser as a dynamic web page, and determine that the number of iterations satisfies the dynamic stability condition.
And the alarm generating module 110 is configured to generate alarm information corresponding to the browser and send the alarm information to a server corresponding to webpage data rendered in the browser, so that the server pushes the alarm information to a corresponding management terminal if the number of screen shots reaches the threshold of the comparison number and the iteration number does not meet the initial screen stability condition.
The report sending module 120 is configured to generate a first screen loading report corresponding to the first screen loading time, and send the first screen loading report to a server corresponding to the webpage data rendered in the browser, so that the server pushes the alarm information to a corresponding management terminal.
The specific implementation manner of the first screen size obtaining module 50, the initial reference determining module 60, the rendering interception module 70, the history reference determining module 80, the static web page determining module 90, the dynamic web page determining module 100, the alarm generating module 110 and the report sending module 120 may be referred to the description of the steps S201 to S212 in the embodiment corresponding to fig. 8, and will not be further described herein.
According to the embodiment of the invention, after the first screen size of the browser is obtained, a pixel statistical region conforming to the visual habit of the user can be determined in the first screen, and then a target reference image with the same size as the pixel statistical region can be obtained in the background, wherein the rendering content carried in the pixel statistical region can reflect the loading condition of the browser on main elements during webpage data rendering. And then, comparing non-white pixel points in the second image intercepted from the pixel statistical area of the first screen with blank pixel points of the target reference image to quickly obtain stable pixel points, and meanwhile, accumulating the iteration number of the stable pixel points in the background, so that whether the iteration number meets the first screen stability condition can be judged within the comparison frequency threshold, and the accumulated time length when the iteration number meets the stability number threshold in the first screen stability condition can be used as the first screen loading time of the first screen. In the process of accumulating the iteration number of the stable pixel points, non-white pixel points in the intercepted screenshot image can be continuously filled in the target reference image until blank pixel points in the filled target reference image are filled into the non-white pixel points, and the non-white pixel points in the filled target reference image reach saturation, so that the non-white pixel points in the intercepted screenshot image again are difficult to refill into the target reference image. Therefore, when the main elements rendered in the browser are changed, the non-white pixel points in the intercepted screen capturing image can not influence the non-white pixel points in the filled target reference image any more, so that the first screen loading time can be accurately obtained through the iteration number of the stable pixel points accumulated in the target reference image, and the accuracy of the first screen time calculation is improved. In addition, by introducing the threshold value of the comparison times, the phenomenon of falling into dead loops can be avoided in the accumulating process, so that the waste of computing resources can be avoided.
Further, please refer to fig. 10, which is a schematic diagram illustrating another data processing apparatus according to an embodiment of the present invention. As shown in fig. 10, the data processing apparatus 1000 may be applied to the target test terminal in the corresponding embodiment of fig. 1. The data processing apparatus 1000 may include: processor 1001, network interface 1004, and memory 1005, and the above-described data processing apparatus 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display (Display), a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 10, an operating system, a network communication module, a user interface module, and a device control application program may be included in the memory 1005, which is one type of computer storage medium.
In the data processing apparatus 1000 shown in fig. 10, the network interface 1004 may provide a network communication function; while user interface 1003 is primarily used as an interface for providing input to a user; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
acquiring a target reference image corresponding to a first screen of a browser; the non-white pixel points in the target reference image are obtained by filling blank pixel points in the historical reference image by the first image; the first image is obtained by intercepting from a pixel statistical area in the first screen; the size of the target reference image is the same as the size of the pixel statistical region;
intercepting a second image in the pixel statistical region in the first screen;
determining stable pixel points according to the non-white pixel points in the second image and the non-white pixel points in the target reference image, and determining the iteration number of the stable pixel points;
when the iteration number meets the initial screen stability condition and the screen capturing frequency is smaller than the comparison frequency threshold, determining the accumulated time length when the iteration number meets the stability number threshold in the initial screen stability condition as initial screen loading time corresponding to the initial screen.
It should be understood that the data processing apparatus 1000 described in the embodiment of the present invention may perform the description of the data processing method described above in the embodiment corresponding to fig. 3 or fig. 8, and may also perform the description of the data processing apparatus 1 described above in the embodiment corresponding to fig. 9, which is not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present invention further provides a computer storage medium, in which the aforementioned computer program executed by the data processing apparatus 1 is stored, and the computer program includes program instructions, when executed by the processor, can execute the description of the data processing method in the embodiment corresponding to fig. 3 or fig. 8, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer storage medium according to the present invention, please refer to the description of the method embodiments of the present invention.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of computer programs, which may be stored on a computer-readable storage medium, and which, when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
The foregoing disclosure is illustrative of the present invention and is not to be construed as limiting the scope of the invention, which is defined by the appended claims.

Claims (15)

1. A method of data processing, comprising:
acquiring a target reference image corresponding to a first screen of a browser; the non-white pixel points in the target reference image are obtained by filling blank pixel points in the historical reference image by the first image; the first image is obtained by intercepting from a pixel statistical area in the first screen; the size of the target reference image is the same as the size of the pixel statistical region; the pixel statistical region is a main element region determined based on the inertial behavior when browsing the webpage in a first screen display region corresponding to the first screen; the web pages comprise dynamic web pages and static web pages; the non-white pixel points in the history reference image are obtained by filling blank pixel points in the initial reference image by the intercepted non-white pixel points in the first screen capturing image; the first screen shot image is an image having the same size as the initial reference image, which is cut out from the main element region; the initial reference image is a blank image in a white pixel area with the same size as the main element area, which is obtained by initializing all main elements in the main element area when the browser renders webpage data based on a pixel step value, and all pixel points in the initial reference image are blank pixel points;
Intercepting a second image in the pixel statistical region in the first screen;
determining stable pixel points according to the non-white pixel points in the second image and the non-white pixel points in the target reference image, and determining the iteration number of the stable pixel points; the stable pixel points are non-white pixel points with the same position coordinates and the same pixel value in the target reference image and the non-white pixel points in the second image;
when the iteration number meets a first screen stability condition and the screen capturing frequency is smaller than a comparison frequency threshold, determining that the number of stable pixel points in the target reference image reaches saturation, and determining the accumulated time length when the iteration number meets the stability number threshold in the first screen stability condition as first screen loading time corresponding to the first screen.
2. The method of claim 1, further comprising, prior to acquiring the target reference image corresponding to the first screen of the browser:
acquiring the first screen size of a browser corresponding to webpage data, and acquiring user inertia behavior parameters corresponding to the browser; the user inertial behavior parameters are behavior parameters obtained based on historical user behaviors corresponding to the browser;
Determining an initial reference image associated with the first screen based on the first screen size and a user inertial behavior parameter; all pixel points in the initial reference image are blank pixel points;
when the browser renders the webpage data, capturing a screen capturing image with the same size as the initial reference image in a pixel statistical area in the first screen, and acquiring non-white pixel points in the screen capturing image; the non-white pixel points in the screen capturing image are pixel points obtained in the process that the browser renders the webpage data based on the pixel step value;
and filling non-white pixel points in the screen capturing image into the initial reference image, and determining the filled initial reference image as a history reference image corresponding to the first screen.
3. The method according to claim 2, wherein the obtaining the target reference image corresponding to the first screen of the browser includes:
acquiring the history reference image corresponding to the first screen, and intercepting a first image from a pixel statistical area in the first screen;
acquiring non-white pixel points in the first image, filling blank pixel points in the historical reference image based on the non-white pixel points in the first image, and determining the filled historical reference image as the target reference image.
4. A method according to claim 3, wherein said determining a stable pixel from non-white pixels in said second image and non-white pixels in said target reference image and determining a number of iterations of said stable pixel comprises:
iteratively comparing the non-white pixel points in the second image with the non-white pixel points in the target reference image;
if the second image in the iterative comparison result has the non-white pixel point with the same position coordinate and pixel value as the non-white pixel point in the target reference image, determining the non-white pixel point with the same position coordinate and pixel value as the non-white pixel point in the second image as a stable pixel point in the target reference image;
iteratively calculating the iteration number of the stable pixel points in the target reference image; the iteration number of the stable pixel points is the number of non-white pixel points in the target reference image accumulated by the stable counter.
5. A method according to claim 3, wherein said determining a stable pixel from non-white pixels in said second image and non-white pixels in said target reference image and determining a number of iterations of said stable pixel comprises:
Iteratively comparing the non-white pixel points in the second image with the non-white pixel points in the target reference image;
if the second image has non-white pixel points with the same position coordinates and different pixel values with the blank pixel points in the target reference image in the iterative comparison result, filling the non-white pixel points in the second image into the blank pixel points in the target reference image, and determining the non-white pixel points in the filled target reference image as stable pixel points;
iteratively calculating the iteration number of the stable pixel points in the filled target reference image; the iteration number of the stable pixel points is the number of non-white pixel points in the filled target reference image accumulated by the stable counter.
6. The method of claim 5, wherein the first screen stabilization conditions include static stabilization conditions and dynamic stabilization conditions;
the method further comprises the steps of:
if the screen capturing times are smaller than the comparison times threshold, continuously counting for many times until the iteration number reaches a first threshold, and the pixel value of a non-white pixel point in the filled target reference image is identical to the pixel value of a non-white pixel point in the intercepted third image, determining a webpage corresponding to the browser as a static webpage, and determining that the iteration number meets the static stability condition;
If the screen capturing times are smaller than the comparison times threshold, and the iteration number reaches a second threshold, and the pixel values of the non-white pixel points in the filled target reference image are different from the pixel values of the non-white pixel points in the intercepted third image, determining the webpage corresponding to the browser as a dynamic webpage, and determining that the iteration number meets the dynamic stability condition.
7. The method according to claim 6, wherein when the number of iterations satisfies a first screen stability condition and the number of screen shots does not reach a comparison number threshold, determining an accumulated duration when the number of iterations satisfies a stability number threshold in the first screen stability condition as a first screen loading time corresponding to the first screen, includes:
when the iteration number meets a static stability condition and the screen capturing frequency is smaller than a comparison frequency threshold value, acquiring a first accumulated time length when the iteration number reaches the first threshold value for the first time, and determining the first accumulated time length as a first screen loading time corresponding to a first screen of the static webpage;
when the iteration number meets a dynamic stability condition and the screen capturing frequency is smaller than a comparison frequency threshold, a second accumulated time length when the iteration number reaches a second threshold of the dynamic webpage for the first time is obtained, and the second accumulated time length is determined to be the first screen loading time corresponding to the first screen of the dynamic webpage.
8. The method as recited in claim 1, further comprising:
and if the screen capturing times reach the comparison times threshold and the iteration number does not meet the initial screen stabilizing condition, generating alarm information corresponding to the browser, and sending the alarm information to a server corresponding to webpage data rendered in the browser, so that the server pushes the alarm information to a corresponding management terminal.
9. The method according to claim 1, characterized in that the method further comprises:
generating a first screen loading report corresponding to the first screen loading time, and sending the first screen loading report to a server corresponding to the webpage data rendered in the browser, so that the server pushes the first screen loading report to a corresponding management terminal.
10. A data processing apparatus, comprising:
the reference acquisition module is used for acquiring a target reference image corresponding to the first screen of the browser; the non-white pixel points in the target reference image are obtained by filling blank pixel points in the historical reference image by the first image; the first image is obtained by intercepting from a pixel statistical area in the first screen; the size of the target reference image is the same as the size of the pixel statistical region; the pixel statistical region is a main element region determined based on the inertial behavior when browsing the webpage in a first screen display region corresponding to the first screen; the web pages comprise dynamic web pages and static web pages; the non-white pixel points in the history reference image are obtained by filling blank pixel points in the initial reference image by the intercepted non-white pixel points in the first screen capturing image; the first screen shot image is an image having the same size as the initial reference image, which is cut out from the main element region; the initial reference image is a blank image in a white pixel area with the same size as the main element area, which is obtained by initializing all main elements in the main element area when the browser renders webpage data based on a pixel step value, and all pixel points in the initial reference image are blank pixel points;
An image intercepting module, configured to intercept a second image in the pixel statistics area in the first screen;
the stable point determining module is used for determining stable pixel points according to the non-white pixel points in the second image and the non-white pixel points in the target reference image, and determining the iteration number of the stable pixel points; the stable pixel points are non-white pixel points with the same position coordinates and the same pixel value in the target reference image and the non-white pixel points in the second image;
and the first screen time determining module is used for determining that the number of stable pixel points in the target reference image reaches saturation when the iteration number meets a first screen stability condition and the screen capturing frequency is smaller than a comparison frequency threshold value, and determining the accumulated time length when the iteration number meets the stability number threshold value in the first screen stability condition as the first screen loading time corresponding to the first screen.
11. The apparatus of claim 10, wherein the apparatus further comprises:
the first screen size acquisition module is used for acquiring the first screen size of the browser corresponding to the webpage data and acquiring the user inertia behavior parameters corresponding to the browser; the user inertial behavior parameters are behavior parameters obtained based on historical user behaviors corresponding to the browser;
An initial reference determining module, configured to determine an initial reference image associated with the first screen based on the first screen size and a user inertial behavior parameter; all pixel points in the initial reference image are blank pixel points;
the rendering interception module is used for intercepting a screen capturing image with the same size as the initial reference image in a pixel statistical area in the first screen when the browser renders the webpage data, and acquiring non-white pixel points in the screen capturing image; the non-white pixel points in the screen capturing image are pixel points obtained in the process that the browser renders the webpage data based on the pixel step value;
and the history reference determining module is used for filling non-white pixel points in the screen capturing image into the initial reference image and determining the filled initial reference image as the history reference image corresponding to the first screen.
12. The apparatus of claim 11, wherein the reference acquisition module comprises:
the history reference acquisition unit is used for acquiring the history reference image corresponding to the first screen and intercepting a first image from a pixel statistical area in the first screen;
The pixel point filling unit is used for acquiring non-white pixel points in the first image, filling blank pixel points in the historical reference image based on the non-white pixel points in the first image, and determining the filled historical reference image as the target reference image.
13. The apparatus of claim 12, wherein the stability point determination module comprises:
the first comparison unit is used for iteratively comparing the non-white pixel points in the second image with the non-white pixel points in the target reference image;
the same determining unit is used for determining the non-white pixel point with the same position coordinate and the same pixel value as those of the non-white pixel point in the second image as a stable pixel point in the target reference image if the non-white pixel point with the same position coordinate and the same pixel value as those of the non-white pixel point in the second image exists in the second image in the iterative comparison result;
the first iteration unit is used for iteratively calculating the iteration number of the stable pixel points in the target reference image; the iteration number of the stable pixel points is the number of non-white pixel points in the target reference image accumulated by the stable counter.
14. A data processing apparatus, comprising: a processor, a memory, and a network interface;
the processor is connected to a memory for connection to a server, a network interface for storing program code, and for invoking the program code to perform the method according to any of claims 1-9.
15. A computer storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method of any of claims 1-9.
CN201910081213.4A 2019-01-28 2019-01-28 Data processing method and related device Active CN110209978B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910081213.4A CN110209978B (en) 2019-01-28 2019-01-28 Data processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910081213.4A CN110209978B (en) 2019-01-28 2019-01-28 Data processing method and related device

Publications (2)

Publication Number Publication Date
CN110209978A CN110209978A (en) 2019-09-06
CN110209978B true CN110209978B (en) 2023-05-16

Family

ID=67785004

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910081213.4A Active CN110209978B (en) 2019-01-28 2019-01-28 Data processing method and related device

Country Status (1)

Country Link
CN (1) CN110209978B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110909739B (en) * 2019-11-19 2021-01-08 广东润联信息技术有限公司 Picture identification and operation method and device, computer equipment and storage medium
CN111782464B (en) * 2020-06-22 2024-04-26 北京异乡旅行网络科技有限公司 Webpage dynamic anomaly monitoring method and system
CN112131493A (en) * 2020-08-27 2020-12-25 长沙市到家悠享网络科技有限公司 Page first screen time determining method and device, electronic equipment and storage medium
CN113453069B (en) * 2021-06-18 2022-11-11 海信视像科技股份有限公司 Display device and thumbnail generation method
CN115617637A (en) * 2022-12-20 2023-01-17 北京仁科互动网络技术有限公司 Application page loading duration determining method, device and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4204207A (en) * 1977-08-30 1980-05-20 Harris Corporation Video display of images with video enhancements thereto
CN103324521A (en) * 2013-06-20 2013-09-25 张家港保税区润桐电子技术研发有限公司 Method for measuring initial screen time of webpage
CN103777939A (en) * 2013-03-18 2014-05-07 北京基调网络系统有限公司 Method for measuring webpage first screen time
CN103930885A (en) * 2011-11-16 2014-07-16 微软公司 Measuring web page rendering time
CN104394026A (en) * 2014-10-08 2015-03-04 百度在线网络技术(北京)有限公司 Method and device for measuring webpage load time

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102624576B (en) * 2011-01-27 2016-04-20 腾讯科技(深圳)有限公司 A kind of method and system of web page download time of automatic test browser
CN103812713A (en) * 2012-11-06 2014-05-21 腾讯科技(深圳)有限公司 Method and apparatus for testing webpage loading time
CN103955428A (en) * 2014-04-30 2014-07-30 百度在线网络技术(北京)有限公司 Method and equipment for testing response speed of application
US20180052943A1 (en) * 2016-08-18 2018-02-22 Qualcomm Incorporated Systems and methods for controlling webpage pre-rendering
CN107301231A (en) * 2017-06-26 2017-10-27 腾讯科技(深圳)有限公司 The page opens time-consuming method of testing and test system
CN107885645B (en) * 2017-10-31 2020-06-23 阿里巴巴集团控股有限公司 Method and device for calculating rendering duration of first screen of page and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4204207A (en) * 1977-08-30 1980-05-20 Harris Corporation Video display of images with video enhancements thereto
CN103930885A (en) * 2011-11-16 2014-07-16 微软公司 Measuring web page rendering time
CN103777939A (en) * 2013-03-18 2014-05-07 北京基调网络系统有限公司 Method for measuring webpage first screen time
CN103324521A (en) * 2013-06-20 2013-09-25 张家港保税区润桐电子技术研发有限公司 Method for measuring initial screen time of webpage
CN104394026A (en) * 2014-10-08 2015-03-04 百度在线网络技术(北京)有限公司 Method and device for measuring webpage load time

Also Published As

Publication number Publication date
CN110209978A (en) 2019-09-06

Similar Documents

Publication Publication Date Title
CN110209978B (en) Data processing method and related device
US11489934B2 (en) Method and system for monitoring and tracking browsing activity on handled devices
US9961129B2 (en) Business transaction correlation with client request monitoring data
US9979618B2 (en) Detecting and alerting performance degradation during features ramp-up
US20170237799A1 (en) Real user monitoring of single-page applications
CN103324521A (en) Method for measuring initial screen time of webpage
CN103777939A (en) Method for measuring webpage first screen time
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN104881273A (en) Webpage rendering analysis method and terminal device
US10445412B1 (en) Dynamic browsing displays
US20170169122A1 (en) Webpage display method, mobile terminal, intelligent terminal, program and storage medium
CN111814086A (en) Method and system for screenshot of webpage
CN111079048B (en) Page loading method and device
CN105677678B (en) Method and system for determining first screen position of webpage and displaying webpage information
Arellano-Uson et al. Protocol-agnostic method for monitoring interactivity time in remote desktop services
JP5563703B2 (en) Content distribution apparatus, content distribution method, content distribution program, and terminal program
CN110781427A (en) Method, device, equipment and storage medium for calculating first screen time
US10769352B2 (en) Providing dynamic web content without flicker
JP6339550B2 (en) Terminal program, terminal device, and terminal control method
CN117040799A (en) Page interception rule generation and page access control method and device and electronic equipment
CN113467867B (en) Information processing method, information processing device, electronic equipment and storage medium
US9367931B1 (en) Motion vectors for cross-platform display
CN112084444B (en) Page loading time detection method, device and computer readable storage medium
JP2018036687A (en) Information processing device and information processing method
CN113268307A (en) Page component display method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant