CN112199131A - Page detection method, device and equipment - Google Patents

Page detection method, device and equipment Download PDF

Info

Publication number
CN112199131A
CN112199131A CN201910610386.0A CN201910610386A CN112199131A CN 112199131 A CN112199131 A CN 112199131A CN 201910610386 A CN201910610386 A CN 201910610386A CN 112199131 A CN112199131 A CN 112199131A
Authority
CN
China
Prior art keywords
page
pixel
target
screenshot
block
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.)
Granted
Application number
CN201910610386.0A
Other languages
Chinese (zh)
Other versions
CN112199131B (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 CN201910610386.0A priority Critical patent/CN112199131B/en
Publication of CN112199131A publication Critical patent/CN112199131A/en
Application granted granted Critical
Publication of CN112199131B publication Critical patent/CN112199131B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/40Analysis of texture
    • G06T7/41Analysis of texture based on statistical description of texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Probability & Statistics with Applications (AREA)
  • User Interface Of Digital Computer (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a page detection method, a device and equipment, wherein the method comprises the following steps: determining a page obtained after the initial page is loaded for a preset time length as a target page, and acquiring a page screenshot of the target page; preprocessing the page screenshot to obtain a target screenshot; carrying out block division on the target screenshot to obtain a block image set, and determining a reference pixel point in each block image; comparing a plurality of pixel points of each block map in the block map set with the reference pixel points in the corresponding block map respectively to obtain a comparison result set; determining a target output result from the comparison result set; and determining the page state of the target page according to the target output result. The method and the device can analyze the pixels of the screenshot of the current page, so that whether the current page is pure color or not is judged, business logic does not need to be invaded, and only the base class page needs to be processed.

Description

Page detection method, device and equipment
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a page detection method, apparatus, and device.
Background
The white screen detection is commonly used in scenes such as online service monitoring, and in these scenes, whether the page is white or not can be judged by judging whether each pixel in the screenshot of the page is white or not, and whether the page carries information for a user to read or not can be judged.
For the reason causing the white screen phenomenon, two aspects can be roughly included: on one hand, under the condition of poor network, network delay and file loading delay occur, and a page can be blocked; on the other hand, the client has bug and the cache module is messy. In order to realize the purpose of monitoring data by detecting and reporting a page white screen, the prior art provides a technical scheme for judging whether original pixel data is pure color or not by performing pixel sampling and analysis on bottom layer data acquired by an X5 kernel during WebView drawing in an Android platform. The technical scheme has no universality and cannot be applied to platforms except the Android platform; and a misjudgment situation may also occur.
Disclosure of Invention
The technical problem to be solved by the present application is to provide a page detection method, device and apparatus, which can determine whether a current page is a pure color by performing pixel analysis on a screenshot of the current page, and only need to process the current page in a base class page without intruding business logic.
In order to solve the above technical problem, the present application provides a page detection method, where the method includes:
determining a page obtained after the initial page is loaded for a preset time length as a target page, and acquiring a page screenshot of the target page;
preprocessing the page screenshot to obtain a target screenshot;
carrying out block division on the target screenshot to obtain a block image set, wherein the block image set comprises at least one block image, each block image comprises a plurality of pixel points, and reference pixel points in each block image are determined;
comparing a plurality of pixel points of each block map in the block map set with the reference pixel points in the corresponding block map respectively to obtain a comparison result set;
determining a target output result from the comparison result set;
and determining the page state of the target page according to the target output result.
In another aspect, the present application provides a page detecting apparatus, including:
the target page determining module is used for determining that a page obtained after the initial page is loaded for a preset time length is a target page and acquiring a page screenshot of the target page;
the target screenshot determining module is used for preprocessing the page screenshot to obtain a target screenshot;
the block image dividing module is used for carrying out block division on the target screenshot to obtain a block image set, wherein the block image set comprises at least one block image, each block image comprises a plurality of pixel points, and reference pixel points in each block image are determined;
the pixel comparison module is used for comparing a plurality of pixel points of each block map in the block map set with the reference pixel points in the corresponding block map respectively to obtain a comparison result set;
the target result determining module is used for determining a target output result from the comparison result set;
and the page state determining module is used for determining the page state of the target page according to the target output result.
In another aspect, the present application provides an apparatus comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by the processor to implement the page detection method as described above.
In another aspect, the present application further provides a computer storage medium having at least one instruction, at least one program, a set of codes, or a set of instructions stored therein, the at least one instruction, at least one program, set of codes, or set of instructions being loaded by a processor and executing the page detection method as described above.
The method comprises the steps of obtaining a page screenshot of a target page after loading for a preset duration, and preprocessing the page screenshot to obtain a target screenshot; carrying out block division on the target screenshot to obtain at least one block image, and correspondingly determining reference pixel points in each block image; comparing the pixel points in each block image with the reference pixel points in the corresponding block image respectively to obtain a comparison result set; and determining a target output result from the comparison result set, and determining the page state of the target page according to the target output result. According to the method and the device, whether the current page screenshot is a pure color or not is determined through pixel analysis of the target screenshot, business logic is not required to be invaded, only the base class page needs to be processed, and page display conditions of various pages of different platforms can be detected in a relatively simple mode.
Drawings
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a flowchart of a page detection method provided in an embodiment of the present application;
fig. 3 is a flowchart of a method for preprocessing a page screenshot according to an embodiment of the present application;
fig. 4 is a flowchart of a method for determining a reference pixel point according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a pixel point comparison method according to an embodiment of the present disclosure;
fig. 6 is a flowchart of a page state determination method according to an embodiment of the present application;
fig. 7 is a flowchart of a method for data analysis reporting according to an embodiment of the present application;
fig. 8 is a block diagram of an implementation of monitoring page detection data according to an embodiment of the present application;
fig. 9 is an overall flowchart of a page processing process provided in an embodiment of the present application;
FIG. 10 is a first exemplary schematic diagram provided by an embodiment of the present application;
FIG. 11 is a second exemplary schematic diagram provided by an embodiment of the present application;
fig. 12 is a schematic diagram of a page detection apparatus according to an embodiment of the present application;
FIG. 13 is a schematic diagram of a target screenshot determination module provided in an embodiment of the present application;
FIG. 14 is a block diagram partitioning module according to an embodiment of the present disclosure;
FIG. 15 is a schematic diagram of a pixel comparison module according to an embodiment of the present disclosure;
FIG. 16 is a block diagram of a page status determination module according to an embodiment of the present application;
fig. 17 is a schematic structural diagram of an apparatus according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, the present application will be further described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Please refer to fig. 1, which shows a schematic view of an application scenario of an embodiment of the present application, where the scenario may include: at least one terminal 110 and a server 120, the terminal 110 and the server 120 being in data communication via a network; specifically, each terminal 110 determines the page state of the corresponding page according to the page screenshot of the current page, and sends the statistical data related to the page state to the server 120; or the server 120 judges the page state of the corresponding page according to the screenshot of each page, and counts and records the related data of the page state.
The terminal 110 may include a physical device such as a smart phone, a desktop computer, a tablet computer, a notebook computer, a digital assistant, a smart wearable device, and the like, and may also include software running in the physical device, such as a browser or an application program. The operating system running on the terminal 110 in this embodiment of the present application may include, but is not limited to, an android system, an IOS system, linux, windows, and the like.
The server 120 and the terminal 110 may be connected in communication through a wired or wireless connection, and the server 120 may include a server operating independently, or a distributed server, or a server cluster composed of a plurality of servers, where the server may be a cloud server.
In the prior art, a technical scheme that pixel sampling and analysis are performed on bottom layer data acquired by an X5 kernel during WebView drawing in an App of Android to determine whether original pixel data is pure color is generally adopted for page detection, but the technical scheme has no universality and may cause erroneous determination.
To this end, an embodiment of the present application provides a page detection method, please refer to fig. 2, which can be applied to a terminal side or a server side, and the method includes:
s210, determining a page obtained after the initial page is loaded for a preset time length as a target page, and obtaining a page screenshot of the target page.
For a newly opened initial page, the initial page needs to be loaded for a period of time to display related page information, if the screen capture is performed when the initial page is just opened, the screen capture cannot represent the page condition after the loading is finished, for example, the page is white when the page is loaded for the first second, but the page is loaded for the third second and is not white, and in this case, the screen capture result is inaccurate in the time period just before the page is opened for the third second; therefore, in order to make the screenshot result more accurate, in this embodiment, a preset duration is set according to the average loading duration of the page loading completion; when the loading duration of a newly opened initial page reaches the preset duration, the page is considered to be loaded completely, and at the moment, a system interface can be called to capture the screenshot of the target page, so that the pixel data of the screenshot of the page of the current page is obtained.
The specific screen capture operation may be to implement screen capture inside an access API (Application Programming Interface), and in different operating systems, different tools may be used to capture the screen, where the screen capture tools include but are not limited to Native, Web, Weex, and the like.
And S220, preprocessing the page screenshot to obtain a target screenshot.
The obtained screenshot of the page is the screenshot condition of the whole page, and in order to remove some invalid peripheral information and retain information effective for page analysis, the screenshot of the page needs to be preprocessed, which may be specifically referred to fig. 3, which shows a preprocessing method for the screenshot of the page, including:
and S310, removing the top area of the page screenshot and the bottom area of the page screenshot.
Information such as a top or bottom border or a navigation bar in the page screenshot may be removed, specifically, the information may be removed by setting a corresponding number of pixels, for example, in this embodiment, 64 pixels in the top navigation bar may be cut off, and 50 pixels in the bottom may be cut off.
S320, determining the page screenshot after the removing operation as the target screenshot.
After the removal operation of the screenshot of the page, the remaining screenshot is useful screenshot content, namely, the screenshot part used for displaying the content in the middle, and the following operations are all performed based on the target screenshot.
And S230, carrying out block division on the target screenshot to obtain a block image set, wherein the block image set comprises at least one block image, each block image comprises a plurality of pixel points, and determining reference pixel points in each block image.
In this embodiment, the target screenshot is analyzed in a block division manner, after the target screenshot is divided into a preset number of block images, each block image is analyzed, and finally, analysis results are synthesized to obtain a detection result of the target page. The number of the specific partitions may be determined according to implementation, and the embodiment is not particularly limited.
For example, in this embodiment, the target screenshot may be divided into an upper, a middle, and a lower trisections from top to bottom in sequence to obtain three block maps, where each block map includes a plurality of pixel points.
For each block diagram, a reference pixel point needs to be determined so as to facilitate comparison between other pixel points in the block diagram and the reference pixel point, please refer to fig. 4, which shows a method for determining a reference pixel point, including:
and S410, determining a pixel matrix of each block map in the block map set.
Each block diagram is composed of a plurality of pixel points, and based on the pixel points, a pixel point matrix corresponding to the block diagram can be constructed.
And S420, determining the pixel point at the preset position in the pixel point matrix as the reference pixel point.
For a block map, only one reference pixel point can be set for the whole block map, and other pixel points in the block map can be compared with the reference pixel point; or, a reference pixel point may be set in each row of the pixel point matrix, and the pixel points in each row are compared with the reference pixel points in the row.
The position of the specific selection reference pixel point can be the first pixel in each row, and the pixel of the central point can also be selected; in addition, for the case where the reference pixel points are respectively set in each row, the reference pixel points in each row may not be in the same column, that is, the positions of the reference pixel points may be freely set.
S240, comparing a plurality of pixel points of each block image in the block image set with the reference pixel points in the corresponding block images respectively to obtain a comparison result set.
After the reference pixel point of each block map is determined, comparing other pixel points in the block map with the reference pixel point, specifically referring to fig. 5, which shows a pixel point comparison method, the method includes:
and S510, for each block image in the block image set, determining pixel rows to be compared from the pixel dot matrix according to the row unit of the pixel dot matrix of the corresponding block image.
Because the number of pixels in the pixel matrix corresponding to the block diagram is possibly more, under the condition of not influencing the accuracy of the result, a part of pixel rows can be extracted from the pixel matrix for analysis, so that the consumption of the system performance can be reduced, and the analysis result can not be influenced.
The specific method for determining the pixel rows to be compared may be as follows: and determining the pixel rows in the pixel dot matrix at preset row intervals.
S520, comparing the pixel value of each pixel point in each pixel row with the reference pixel value of the reference pixel point in the row to obtain the statistical number of the pixel points with different pixel values in each pixel row from the reference pixel values.
Similarly, in consideration of reducing performance consumption, under the condition that the accuracy of the result is not affected, the middle pixel point of each pixel row may be sampled at intervals, which may specifically be:
in each row, pixel points to be compared are obtained at preset pixel intervals from left to right in sequence, and pixel values of the pixel points to be compared are compared with the reference pixel values.
Specifically, in this embodiment, the pixel points may be determined at intervals of 20 pixels in the horizontal and vertical directions, and a higher identification degree may be achieved by reducing the sampling times.
The pixel value in this embodiment may specifically refer to RGB values of the pixel points, and in a specific comparison process, it is determined that the pixel values of two pixel points are the same only when the RGB values of the two pixel points are completely the same; if only one RGB value is different, the pixel values of the two pixel points are judged to be different, and 1 is added to the different number. And counting the number of different pixel values of the pixel points to be compared in each pixel row and the reference pixel points in the row.
And S530, integrating the statistical number of each pixel row in the block diagram to obtain a statistical total number.
And summarizing the statistical number of each pixel row of each block diagram to obtain the statistical total number corresponding to the block diagram.
S540, calculating a comparison result corresponding to each block diagram, and constructing a comparison result set according to the comparison result of each block diagram; and the comparison result is the ratio of the statistical total number of the block map to the total number of the pixel points of the block map.
And for each block image, calculating the ratio of the statistical total number corresponding to the block image to the total number of pixel points of the block image.
And S250, determining a target output result from the comparison result set.
In this embodiment, the target screenshot is divided into an upper block diagram, a middle block diagram and a lower block diagram, so that the comparison result set correspondingly includes ratios corresponding to the three block diagrams.
And analyzing each ratio in the comparison result set according to a preset rule, and determining the maximum ratio as a target output result corresponding to the target page. Because the larger the ratio is, the more the number of the pixels different from the reference pixels in the block diagram corresponding to the ratio is, the higher the possibility of the existence of the page information is, and the probability that the target page is not a blank page can be expressed to a certain extent.
And S260, determining the page state of the target page according to the target output result.
Based on the finally determined target output result and a preset threshold, a page state of the target page may be determined, specifically, refer to fig. 6, which shows a page state determination method, where the method includes:
s610, comparing the target output result with a first threshold value.
S620, judging whether the target output result is smaller than a first threshold value.
S630, when the target output result is smaller than the first threshold value, judging that the target page is in a white screen state.
And S640, when the target output result is greater than or equal to the first threshold value, judging that the target page is in a non-white screen state.
In this embodiment, the first threshold may be preset to be 10%, that is, when the target output result is less than 10%, it is determined that the target page is a white-screen page; and when the target output result is more than or equal to 10%, judging that the target page is a non-white screen page.
It should be noted that, in this embodiment, it may also be determined whether the current page is a white-screen page by calculating a ratio of the total number of white pixels in the target screenshot to the total detected pixel number, and if the ratio of the total number of the white pixels to the total detected pixel number is greater than a preset value, it is determined that the current page is a white-screen page. The preset value can be set empirically and can be varied, and can be set to 90%.
Because the data volume of the application program in the running process is large, the pixel analysis process of page detection can be realized by recreating an independent thread in the embodiment; the method is independent of the thread running by the application program, does not influence each other, and has higher processing efficiency.
After the page is detected to obtain the relevant detection result, the detection result is analyzed and counted, and the data can be reported through the network interface, so that the purpose of monitoring the data is achieved. Please refer to fig. 7, which illustrates a method for data analysis and reporting, which may also be applied to a terminal side or a server side, where the server may refer to a detection server for performing page detection, and specifically, the method includes:
s710, when the target page is detected to be in a white screen state, determining the page identification and the uniform resource locator of the target page.
Each page is provided with a corresponding page identifier and a uniform resource locator, the corresponding target page can be uniquely determined through the page identifier, and the information resource pointed by the target page can be found in the network through the uniform resource locator.
S720, obtaining the ratio of the statistical total number of each block image in the target page to the total number of pixel points of each block image.
For the calculation of the ratio of each block map, the above calculation method of the present embodiment can be referred to, and is not described herein again.
And S730, sending the page identifier, the uniform resource locator and the ratio of the block maps of the target page to a data storage server.
And sending the related information of the target pages to a data storage server so that the data storage server can collect the acquired data of the plurality of target pages and analyze possible reasons causing the white screen, thereby continuously optimizing the scheme and reducing the white screen rate of the application.
Please refer to fig. 8, which illustrates a block diagram of implementing page detection data monitoring, wherein when a target page is detected to be in a white screen state, white screen data is reported through a universal gateway interface and stored in a database, where the white screen data may include data detected by a plurality of devices installed with different operating systems; for the white screen data stored in the database, related white screen information can be searched in a query mode and displayed in a data summarization mode, and particularly, a detail page of the white screen can be displayed through a related statistical platform.
Please refer to fig. 9, which shows an overall flowchart of the page processing procedure in the embodiment, which mainly includes four steps: the method comprises the steps of screen capture, pixel analysis, data reporting and switch control.
The screen capturing step mainly includes screen capturing on a page, and for different operating systems, different system interfaces may be called to perform screen capturing, where the interfaces used to implement screen capturing in this embodiment include, but are not limited to: native, Web, and Weex.
The pixel analysis step is to carry on the pixel analysis to the screen capture picture, because the data bulk is greater while running the application program itself, in this embodiment rebuild a new thread independent of the thread of running of application program for the pixel analysis, through the processing mode of the asynchronous thread, make program run and pixel analysis not influence each other; in addition, dividing the screen capture image into a plurality of block images, analyzing each block image respectively, and summarizing the analysis result of each block image to obtain the analysis result of the screen capture image; in addition, on the premise of not influencing the detection result, the pixel points to be compared are determined in an interval sampling mode, so that the performance consumption of the system is reduced.
The data reporting step is a process of reporting page information detected as a white screen state, and the specific reported information may include: a label or identification of the page, a white screen ratio and location in the page, and a uniform resource locator of the page.
The switch control step is mainly used for controlling data reporting, and can be realized by setting the switch state of a reporting switch, the threshold value and the delay time of the reported page information, and caching and sampling reporting of the reported information.
To illustrate the specific implementation process of the present application, how to determine whether a page is a white-screen page without content is described as a specific example.
When a certain page of an application APP is opened, after loading for a preset time length, obtaining a loaded page; and calling a system screenshot tool to screenshot the current page to obtain a page screenshot, referring to fig. 10, wherein the page screenshot comprises a title bar at the top of the original page and a navigation bar at the bottom, removing the title bar and the navigation bar in the page, and only reserving a middle area for displaying page information.
By adopting the page detection method of the embodiment, the reserved screenshot area is analyzed, and finally, the analysis result of the current page can be obtained.
Compared with the technical scheme of capturing the WebView and calculating the full gray scale of the pixels or the technical scheme of calculating the WebView pixel data comparison by using an X5 kernel in the prior art, the white screen page detection method provided by the embodiment has higher accuracy. For example, the page screenshot shown in fig. 11, when a page test is performed on a current page through the screenshot, a solution in the prior art may determine that the current page is a white-screen page, but for a user, the current page is obviously a white-screen page that does not include available page information; according to the page detection method provided by the embodiment of the application, the top area and the bottom area are removed, and the pixel analysis is carried out according to the page information display area, so that the analysis result that the page is a white screen page is obtained.
The method comprises the steps of obtaining a page screenshot of a current page, and then carrying out pixel analysis on the page screenshot to determine whether the current page screenshot is a pure color or not, so that whether the current page is a white screen page or not is judged; the method can be universally used for different system platforms, whether various pages are white or not can be detected in a relatively simple mode, business logic is not required to be invaded, only the base class page is required to be processed, and a system interface is called to start screen capture to obtain pixel data of a current screen; in addition, if a page only has a few characters or only shows a small picture, the page detection scheme in the application can judge that the current page is a blank page, while other schemes in the prior art can judge that the current page is a non-blank page and does not accord with product and service logic.
The present embodiment further provides a page detecting apparatus, please refer to fig. 12, the apparatus includes:
the target page determining module 1210 is configured to determine that a page obtained after the initial page is loaded for a preset time period is a target page, and obtain a page screenshot of the target page.
And a target screenshot determining module 1220, configured to pre-process the page screenshot to obtain a target screenshot.
A block map dividing module 1230, configured to perform block division on the target screenshot to obtain a block map set, where the block map set includes at least one block map, and each block map includes a plurality of pixel points, and determines a reference pixel point in each block map.
The pixel comparison module 1240 is configured to compare a plurality of pixel points of each block map in the block map set with the reference pixel points in the corresponding block map, respectively, to obtain a comparison result set.
A target result determining module 1250, configured to determine a target output result from the comparison result set.
A page state determining module 1260, configured to determine a page state of the target page according to the target output result.
Referring to fig. 13, the screenshot determining module 1220 includes:
a region removing module 1310, configured to perform a removing operation on a top region of the page screenshot and a bottom region of the page screenshot.
A first determining module 1320, configured to determine that the screenshot of the page after the removing operation is the target screenshot.
Referring to fig. 14, the block diagram dividing module 1230 includes:
a pixel matrix determining module 1410, configured to determine a pixel matrix of each block map in the block map set.
A reference pixel point determining module 1420, configured to determine a pixel point located at a preset position in the pixel point matrix as the reference pixel point.
Referring to fig. 15, the pixel alignment module 1240 includes:
a pixel row determining module 1510, configured to determine, for each block map in the block map set, a pixel row to be compared from the pixel point matrix in a row unit of the pixel point matrix of the corresponding block map; the method may be specifically applied to determine the pixel row at a preset row interval in the pixel dot matrix.
The pixel value comparison module 1520 is configured to compare the pixel value of each pixel point in each pixel row with the reference pixel value of the reference pixel point in the row, so as to obtain the statistical number of the pixel points in each pixel row, where the pixel values are different from the reference pixel value; the method can be specifically used for acquiring pixel points to be compared at preset pixel intervals in each row, and comparing the pixel values of the pixel points to be compared with the reference pixel values.
And an integrating module 1530, configured to integrate the statistical number of each pixel row in the block map to obtain a statistical total number.
A comparison result calculation module 1540, configured to calculate a comparison result corresponding to each block diagram, and construct the comparison result set according to the comparison result of each block diagram; and the comparison result is the ratio of the statistical total number of the block map to the total number of the pixel points of the block map.
Further, the target result determination module 1250 includes:
and the ratio analysis module is used for analyzing each ratio in the comparison result set and determining the maximum ratio as a target output result corresponding to the target page.
Referring to fig. 16, the page status determining module 1260 includes:
a first comparing module 1610, configured to compare the target output result with a first threshold.
The first determining module 1620 is configured to determine that the target page is in a white screen state when the target output result is smaller than the first threshold.
A second determining module 1630, configured to determine that the target page is in a non-white screen state when the target output result is greater than or equal to the first threshold.
The device provided in the above embodiments can execute the method provided in any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the above embodiments may be referred to a method provided in any of the embodiments of the present application.
The present embodiments also provide a computer-readable storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions that is loaded by a processor and performs any of the methods described above in the present embodiments.
Referring to fig. 17, the apparatus 1700 may include one or more Central Processing Units (CPUs) 1722 (e.g., one or more processors) and a memory 1732, and one or more storage media 1730 (e.g., one or more mass storage devices) storing applications 1742 or data 1744. Memory 1732 and storage media 1730 may be transitory storage or persistent storage, among other things. The program stored in the storage medium 1730 may include one or more modules (not shown), each of which may include a sequence of instructions operating on the device. Further, a central processor 1722 may be provided in communication with the storage medium 1730 to execute a series of instruction operations on the storage medium 1730 on the device 1700. The apparatus 1700 may also include one or more power supplies 1726, one or more wired or wireless network interfaces 1750, one or more input-output interfaces 1758, and/or one or more operating systems 1741 such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc. Any of the methods described above in this embodiment can be implemented based on the apparatus shown in fig. 17.
The present specification provides method steps as described in the examples or flowcharts, but may include more or fewer steps based on routine or non-inventive labor. The steps and sequences recited in the embodiments are but one manner of performing the steps in a multitude of sequences and do not represent a unique order of performance. In the actual system or interrupted product execution, it may be performed sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) according to the embodiments or methods shown in the figures.
The configurations shown in the present embodiment are only partial configurations related to the present application, and do not constitute a limitation on the devices to which the present application is applied, and a specific device may include more or less components than those shown, or combine some components, or have an arrangement of different components. It should be understood that the methods, apparatuses, and the like disclosed in the embodiments may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a division of one logic function, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or unit modules.
Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A page detection method is characterized by comprising the following steps:
determining a page obtained after the initial page is loaded for a preset time length as a target page, and acquiring a page screenshot of the target page;
preprocessing the page screenshot to obtain a target screenshot;
carrying out block division on the target screenshot to obtain a block image set, wherein the block image set comprises at least one block image, each block image comprises a plurality of pixel points, and reference pixel points in each block image are determined;
comparing a plurality of pixel points of each block map in the block map set with the reference pixel points in the corresponding block map respectively to obtain a comparison result set;
determining a target output result from the comparison result set;
and determining the page state of the target page according to the target output result.
2. The method of claim 1, wherein the preprocessing the page screenshot to obtain a target screenshot comprises:
removing the top area of the page screenshot and the bottom area of the page screenshot;
and determining the page screenshot after the removing operation as the target screenshot.
3. The method according to claim 1, wherein the block dividing the target screenshot to obtain a block map set, the block map set includes at least one block map, each block map includes a plurality of pixels, and determining the reference pixel in each block map includes:
determining a pixel point matrix of each block map in the block map set;
and determining the pixel point at the preset position in the pixel point matrix as the reference pixel point.
4. The method according to claim 3, wherein comparing the plurality of pixel points of each block map in the block map set with the reference pixel points in the corresponding block map to obtain a comparison result set comprises:
for each block map in the block map set, determining pixel rows to be compared from the pixel point matrix according to the row unit of the pixel point matrix of the corresponding block map;
comparing the pixel value of each pixel point in each pixel row with the reference pixel value of the reference pixel point in the row to obtain the statistical number of the pixel points with different pixel values in each pixel row from the reference pixel value;
synthesizing the statistical number of each pixel row in the block diagram to obtain a statistical total number;
calculating a comparison result corresponding to each block diagram, and constructing a comparison result set according to the comparison result of each block diagram; and the comparison result is the ratio of the statistical total number of the block map to the total number of the pixel points of the block map.
5. The method as claimed in claim 4, wherein the determining the pixel rows to be compared from the pixel matrix in the row unit of the pixel matrix of the corresponding block diagram comprises:
and determining the pixel rows in the pixel dot matrix at preset row intervals.
6. The method of claim 4, wherein comparing the pixel value of each pixel in each pixel row with the reference pixel value of the reference pixel in the row comprises:
in each row, obtaining pixel points to be compared at preset pixel intervals, and comparing the pixel values of the pixel points to be compared with the reference pixel values.
7. The method according to claim 4, wherein said determining a target output result from said comparison result set comprises:
and analyzing all ratios in the comparison result set, and determining the maximum ratio as a target output result corresponding to the target page.
8. The method according to claim 7, wherein said determining the page status of the target page according to the target output result comprises:
comparing the target output result with a first threshold;
when the target output result is smaller than the first threshold value, judging that the target page is in a white screen state;
and when the target output result is larger than or equal to the first threshold value, judging that the target page is in a non-white screen state.
9. A page detecting apparatus, comprising:
the target page determining module is used for determining that a page obtained after the initial page is loaded for a preset time length is a target page and acquiring a page screenshot of the target page;
the target screenshot determining module is used for preprocessing the page screenshot to obtain a target screenshot;
the block image dividing module is used for carrying out block division on the target screenshot to obtain a block image set, wherein the block image set comprises at least one block image, each block image comprises a plurality of pixel points, and reference pixel points in each block image are determined;
the pixel comparison module is used for comparing a plurality of pixel points of each block map in the block map set with the reference pixel points in the corresponding block map respectively to obtain a comparison result set;
the target result determining module is used for determining a target output result from the comparison result set;
and the page state determining module is used for determining the page state of the target page according to the target output result.
10. An apparatus comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement the page detection method according to any one of claims 1 to 8.
CN201910610386.0A 2019-07-08 2019-07-08 Page detection method, device and equipment Active CN112199131B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910610386.0A CN112199131B (en) 2019-07-08 2019-07-08 Page detection method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910610386.0A CN112199131B (en) 2019-07-08 2019-07-08 Page detection method, device and equipment

Publications (2)

Publication Number Publication Date
CN112199131A true CN112199131A (en) 2021-01-08
CN112199131B CN112199131B (en) 2024-04-16

Family

ID=74004384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910610386.0A Active CN112199131B (en) 2019-07-08 2019-07-08 Page detection method, device and equipment

Country Status (1)

Country Link
CN (1) CN112199131B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117556162A (en) * 2023-11-01 2024-02-13 书行科技(北京)有限公司 Picture loading detection method, video rendering detection method and related products

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120320223A1 (en) * 2011-06-15 2012-12-20 Hon Hai Precision Industry Co., Ltd. Computing device, storage medium and method for identifying differences between two images
CN103136094A (en) * 2011-11-25 2013-06-05 阿里巴巴集团控股有限公司 Page testing method and device
CN105979092A (en) * 2016-05-13 2016-09-28 腾讯科技(深圳)有限公司 Abnormity monitoring method and device
CN105989597A (en) * 2015-02-13 2016-10-05 中国科学院西安光学精密机械研究所 Hyperspectral image anomaly target detection method based on pixel selection process
CN106168872A (en) * 2016-06-23 2016-11-30 珠海市魅族科技有限公司 Screenshotss method and apparatus
CN106611431A (en) * 2015-10-22 2017-05-03 阿里巴巴集团控股有限公司 An image detection method and apparatus
CN107832774A (en) * 2017-10-09 2018-03-23 无线生活(杭州)信息科技有限公司 A kind of page exception detection method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120320223A1 (en) * 2011-06-15 2012-12-20 Hon Hai Precision Industry Co., Ltd. Computing device, storage medium and method for identifying differences between two images
CN103136094A (en) * 2011-11-25 2013-06-05 阿里巴巴集团控股有限公司 Page testing method and device
CN105989597A (en) * 2015-02-13 2016-10-05 中国科学院西安光学精密机械研究所 Hyperspectral image anomaly target detection method based on pixel selection process
CN106611431A (en) * 2015-10-22 2017-05-03 阿里巴巴集团控股有限公司 An image detection method and apparatus
CN105979092A (en) * 2016-05-13 2016-09-28 腾讯科技(深圳)有限公司 Abnormity monitoring method and device
CN106168872A (en) * 2016-06-23 2016-11-30 珠海市魅族科技有限公司 Screenshotss method and apparatus
CN107832774A (en) * 2017-10-09 2018-03-23 无线生活(杭州)信息科技有限公司 A kind of page exception detection method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117556162A (en) * 2023-11-01 2024-02-13 书行科技(北京)有限公司 Picture loading detection method, video rendering detection method and related products
CN117556162B (en) * 2023-11-01 2024-06-25 书行科技(北京)有限公司 Picture loading detection method, video rendering detection method and related products

Also Published As

Publication number Publication date
CN112199131B (en) 2024-04-16

Similar Documents

Publication Publication Date Title
WO2021003825A1 (en) Video shot cutting method and apparatus, and computer device
CN108579094B (en) User interface detection method, related device, system and storage medium
CN108961316B (en) Image processing method and device and server
CN111666915A (en) Monitoring method, device, equipment and storage medium
CN112199131A (en) Page detection method, device and equipment
CN112149570B (en) Multi-person living body detection method, device, electronic equipment and storage medium
CN111277724B (en) Detection method and device for abnormal operation application, electronic equipment and storage medium
CN108475430B (en) Picture quality evaluation method and device
CN115098238B (en) Application program task scheduling method and device
CN113221742B (en) Video split screen line determining method, device, electronic equipment, medium and program product
CN111127701B (en) Vehicle failure scene detection method and system
CN113627534A (en) Method and device for identifying type of dynamic image and electronic equipment
CN115134677A (en) Video cover selection method and device, electronic equipment and computer storage medium
CN114842476A (en) Watermark detection method and device and model training method and device
CN114677615A (en) Environment detection method and system
CN114359166A (en) Screen color detection method, device, equipment and storage medium
CN109726741B (en) Method and device for detecting multiple target objects
CN112000559A (en) Abnormal equipment detection method and device
CN115953723B (en) Static frame detection method and device, electronic equipment and storage medium
CN114092739B (en) Image processing method, apparatus, device, storage medium, and program product
CN113449542B (en) Face-changing identification method, device, equipment and medium
CN113365027B (en) Video processing method and device, electronic equipment and storage medium
CN114022498A (en) Blank area detection method, device, equipment and storage medium
CN117290207A (en) Application component detection method, system, device, equipment and storage medium
CN113849757A (en) Webpage loading time consumption calculation method and device, storage medium and terminal

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