CN109885446A - Determine that Website page shows the method and device of state - Google Patents

Determine that Website page shows the method and device of state Download PDF

Info

Publication number
CN109885446A
CN109885446A CN201811595459.5A CN201811595459A CN109885446A CN 109885446 A CN109885446 A CN 109885446A CN 201811595459 A CN201811595459 A CN 201811595459A CN 109885446 A CN109885446 A CN 109885446A
Authority
CN
China
Prior art keywords
mentioned
page
screenshot
difference ratio
current page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811595459.5A
Other languages
Chinese (zh)
Inventor
周筱川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Mutual Gold New Finance Technology Co Ltd
Original Assignee
Beijing Mutual Gold New Finance Technology 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 Beijing Mutual Gold New Finance Technology Co Ltd filed Critical Beijing Mutual Gold New Finance Technology Co Ltd
Priority to CN201811595459.5A priority Critical patent/CN109885446A/en
Publication of CN109885446A publication Critical patent/CN109885446A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses the method and devices that a kind of determining Website page shows state.Wherein, this method comprises: obtaining the current page screenshot of the current page of above-mentioned target webpage using objective browser, above-mentioned objective browser includes at least: without interface browser after determining that target webpage updates;The first identifier data of above-mentioned current page screenshot and the second identifier data of benchmark page screenshot are obtained, said reference page screenshot is the screenshot of the Webpage in display normal condition;Determine the difference ratio value between above-mentioned first identifier data and above-mentioned second identifier data;Determine whether above-mentioned current page is in display abnormality according to above-mentioned difference ratio value.The page that the present invention solves web page monitored in the prior art show whether Yi Chang mode, performing environment is more complex and the technical issues of taking a long time.

Description

Determine that Website page shows the method and device of state
Technical field
The present invention relates to web monitor technical fields, and the side of state is shown in particular to a kind of determining Website page Method and device.
Background technique
In internet industry, a website is usually made of tens or even several hundred specific webpages.Not due to demand Disconnected to update, developer can frequently modify the elements such as structure, pattern, the content of webpage.
Since webpage quantity is more, tend not to carry out webpage whole inspections in close beta, and test environment with Environment has differences on line, so after on the Homepage Publishing to line of update, it sometimes appear that the situation that page display is abnormal.Cause This, after needing on the Homepage Publishing to line of update, whether the page of real-time web page monitored shows abnormal.
Implementation method disclosed in the prior art, be with a kind of automated test frame selenium webdriver, Progress page screenshot carries out picture comparison again after starting true browser, and performing environment is more complex, and takes a long time;In webpage mistake It is long, more than a screen length when, can not the not shown part of screen printing;The automatic Iterative for lacking reference base picture updates machine System and abnormal alarm mechanism, can only be manually specified and update reference base picture.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
It is existing at least to solve the embodiment of the invention provides the method and device that a kind of determining Website page shows state In technology the page of web page monitored show whether Yi Chang mode, performing environment is more complex and the technical issues of taking a long time.
According to an aspect of an embodiment of the present invention, a kind of method that determining Website page shows state is provided, comprising: After determining that target webpage updates, the current page screenshot of the current page of above-mentioned target webpage is obtained using objective browser, Above-mentioned objective browser includes at least: without interface browser;Obtain the first identifier data and benchmark of above-mentioned current page screenshot The second identifier data of page screenshot, said reference page screenshot are the screenshot of the Webpage in display normal condition;Really Difference ratio value between fixed above-mentioned first identifier data and above-mentioned second identifier data;It is determined according to above-mentioned difference ratio value State whether current page is in display abnormality.
Further, using objective browser obtain above-mentioned target webpage current page current page screenshot it Before, the above method further include: initialize above-mentioned objective browser;It is obtained using above-mentioned objective browser above-mentioned normal in display The screenshot of the Webpage of state, as said reference page screenshot;Said reference page screenshot is stored to predetermined storage location, Wherein, said reference page screenshot is obtained from above-mentioned predetermined storage location.
Further, the first identifier data of above-mentioned current page screenshot and the second identifier number of benchmark page screenshot are obtained According to, comprising: targeted graphical method base and gray level image algorithm are used, above-mentioned first identifier data and second identifier data are obtained, Wherein, above-mentioned targeted graphical method base includes at least: the GD2 graphical method library based on hypertext processor PHP;Above-mentioned first mark Know data to include at least: for the fisrt feature fingerprint string data of the above-mentioned current page screenshot of unique identification, above-mentioned second Mark data includes at least: the second feature fingerprint string data for unique identification said reference page screenshot.
Further, it is determined that the difference ratio value between above-mentioned first identifier data and above-mentioned second identifier data, comprising: Calculate the above-mentioned difference ratio between above-mentioned fisrt feature fingerprint string data and above-mentioned second feature fingerprint string data Value, wherein above-mentioned difference ratio value includes at least: difference ratio percent value;It is above-mentioned being determined according to above-mentioned difference ratio value Whether current page is in front of display abnormality, the above method further include: preset difference ratio threshold value, wherein on Difference ratio threshold value is stated for reflecting whether above-mentioned current page is in display abnormality.
Further, determine whether above-mentioned current page is in display abnormality according to above-mentioned difference ratio value, comprising: Compare above-mentioned difference ratio value and above-mentioned difference ratio threshold value;If comparison result indicates that above-mentioned difference ratio value is greater than above-mentioned difference Proportion threshold value, it is determined that above-mentioned current page is in above-mentioned display abnormality;If above-mentioned comparison result indicates above-mentioned diversity ratio Example value is less than or equal to above-mentioned difference ratio threshold value, it is determined that above-mentioned current page is not in above-mentioned display abnormality.
Further, after determining that above-mentioned current page is in above-mentioned display abnormality, the above method further include: defeated Warning information is alerted out, wherein above-mentioned warning information is for prompting target object to carry out exception to above-mentioned current page Reason;After determining that above-mentioned current page is not in above-mentioned display abnormality, the above method further include: by above-mentioned current page Screenshot is set as said reference page screenshot.
Further, above-mentioned display abnormality includes at least one of: page composition entanglement, picture missing, content Wrong row, page ratio are excessive, page ratio is too small.
According to another aspect of an embodiment of the present invention, a kind of device of determining Website page display state, packet are additionally provided Include: first obtains module, for obtaining the current of above-mentioned target webpage using objective browser after determining that target webpage updates The current page screenshot of the page, above-mentioned objective browser include at least: without interface browser;Second obtains module, for obtaining The first identifier data of above-mentioned current page screenshot and the second identifier data of benchmark page screenshot, said reference page screenshot are The screenshot of Webpage in display normal condition;First determining module, for determine above-mentioned first identifier data with it is above-mentioned Difference ratio value between second identifier data;Second determining module, it is above-mentioned current for being determined according to above-mentioned difference ratio value Whether the page is in display abnormality.
According to another aspect of an embodiment of the present invention, a kind of storage medium is additionally provided, above-mentioned storage medium includes storage Program, wherein equipment where controlling above-mentioned storage medium in above procedure operation executes the above-mentioned determination net of any one The page of standing shows status method.
According to another aspect of an embodiment of the present invention, a kind of processor is additionally provided, above-mentioned processor is used to run program, Wherein, any one above-mentioned determination Website page is executed when above procedure is run shows status method.
In embodiments of the present invention, by obtaining above-mentioned target using objective browser after determining that target webpage updates The current page screenshot of the current page of webpage, above-mentioned objective browser include at least: without interface browser;It obtains above-mentioned current The first identifier data of page screenshot and the second identifier data of benchmark page screenshot, said reference page screenshot are in display The screenshot of the Webpage of normal condition;Determine the difference ratio between above-mentioned first identifier data and above-mentioned second identifier data Value;It determines whether above-mentioned current page is in display abnormality according to above-mentioned difference ratio value, is browsed by using no interface The mode of the complete screenshot of device has reached execution speed faster and the more acurrate comprehensive purpose of monitored results, to realize raising The page of web page monitored shows the accuracy of state and the technical effect of real-time, and then solves web page monitored in the prior art The page show whether Yi Chang mode, performing environment is more complex and the technical issues of taking a long time.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart for the method that a kind of determining Website page according to an embodiment of the present invention shows state;
Fig. 2 is the flow chart for the method that a kind of optional determining Website page according to an embodiment of the present invention shows state;
Fig. 3 is the flow chart for the method that a kind of optional determining Website page according to an embodiment of the present invention shows state;
Fig. 4 is the structural schematic diagram for the device that a kind of determining Website page according to an embodiment of the present invention shows state.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product Or other step or units that equipment is intrinsic.
Firstly, understand the embodiment of the present invention for convenience, below will to part term involved in the present invention or noun into Row illustrates:
PhantomJs: being the JavaScript API based on webkit, and Qtwebkit is used to browse as its core The function of device, serve not only as a stealthy browser provide such as CSS selector, support Web standard, DOM operation, JSON, The functions such as HTML5, Canvas, SVG, while additionally providing the operating function of processing file I/O.
No interface browser: i.e. without the browser under graphical interfaces environment.
Embodiment 1
According to embodiments of the present invention, the embodiment of a kind of method of determining Website page display state is provided, is needed Bright, step shown in the flowchart of the accompanying drawings can be held in a computer system such as a set of computer executable instructions Row, although also, logical order is shown in flow charts, and it in some cases, can be to be different from sequence herein Execute shown or described step.
Fig. 1 is the flow chart for the method that a kind of determining Website page according to an embodiment of the present invention shows state, such as Fig. 1 institute Show, this method comprises the following steps:
Step S102 obtains the current page of above-mentioned target webpage using objective browser after determining that target webpage updates The current page screenshot in face, above-mentioned objective browser include at least: without interface browser;
Step S104 obtains the first identifier data of above-mentioned current page screenshot and the second identifier number of benchmark page screenshot According to said reference page screenshot is the screenshot of the Webpage in display normal condition;
Step S106 determines the difference ratio value between above-mentioned first identifier data and above-mentioned second identifier data;
Step S108 determines whether above-mentioned current page is in display abnormality according to above-mentioned difference ratio value.
Implement the embodiment of the present application institute it should be noted that can be, but not limited to dispose automatic running script on the server The method that the determination Website page of offer shows state, to realize that the timing to Website page monitors, if monitoring Website page Whether then alerted in display abnormality;It can also be artificial to run after the Website page publication updated every time is online The method that Website page shows state is determined provided by the embodiment of the present application, to realize that the timing to Website page monitors.
In an alternative embodiment, above-mentioned display abnormality includes at least one of: page composition entanglement, figure Piece missing, interior fault-tolerant row, page ratio is excessive, page ratio is too small.
Optionally, after determining that target webpage updates, Open-Source Tools PhantomJs can be used to obtain with no interface browser The current page screenshot of the current page of above-mentioned target webpage is taken, above-mentioned current page screenshot and said reference page screenshot are The complete screenshot of the page is not shown comprising display screen.
If the current page of above-mentioned target webpage is too long, for example, more than the display length of a screen, then in screen The part not shown will also be intercepted into a full picture together, that is, above-mentioned current page screenshot is a complete figure Piece.
Still need to it is noted that above-mentioned PhantomJs can with but be not limited to use in network monitoring, page screenshotss, be not necessarily to The Web of browser is tested, page access automates etc..
Optionally, above-mentioned first identifier data include at least: first for the above-mentioned current page screenshot of unique identification is special Fingerprint string data is levied, above-mentioned second identifier data include at least: second for unique identification said reference page screenshot Characteristic fingerprint string data.
In the embodiment of the present application, it can be, but not limited to calculate above-mentioned fisrt feature fingerprint string data and above-mentioned second Above-mentioned difference ratio value between characteristic fingerprint string data, and by comparing above-mentioned difference ratio value and predetermined difference Different proportion threshold value;If comparison result indicates that above-mentioned difference ratio value is greater than above-mentioned difference ratio threshold value, it is determined that above-mentioned current page Face is in above-mentioned display abnormality;If above-mentioned comparison result indicates that above-mentioned difference ratio value is less than or equal to above-mentioned difference ratio Threshold value, it is determined that above-mentioned current page is not in above-mentioned display abnormality.
In embodiments of the present invention, by obtaining above-mentioned target using objective browser after determining that target webpage updates The current page screenshot of the current page of webpage, above-mentioned objective browser include at least: without interface browser;It obtains above-mentioned current The first identifier data of page screenshot and the second identifier data of benchmark page screenshot, said reference page screenshot are in display The screenshot of the Webpage of normal condition;Determine the difference ratio between above-mentioned first identifier data and above-mentioned second identifier data Value;It determines whether above-mentioned current page is in display abnormality according to above-mentioned difference ratio value, is browsed by using no interface The mode of the complete screenshot of device has reached execution speed faster and the more acurrate comprehensive purpose of monitored results, to realize raising The page of web page monitored shows the accuracy of state and the technical effect of real-time, and then solves web page monitored in the prior art The page show whether Yi Chang mode, performing environment is more complex and the technical issues of taking a long time.
In an alternative embodiment, Fig. 2 is that a kind of optional determining Website page according to an embodiment of the present invention is aobvious Show the flow chart of the method for state, as shown in Fig. 2, obtaining working as the current page of above-mentioned target webpage using objective browser Before preceding page screenshot, the above method further include:
Step S202 initializes above-mentioned objective browser;
Step S204 obtains the screenshot of the above-mentioned Webpage in display normal condition using above-mentioned objective browser, As said reference page screenshot;
Step S206, storage said reference page screenshot to predetermined storage location, wherein obtained from above-mentioned predetermined storage location Take said reference page screenshot.
It, can be before obtaining benchmark page screenshot in above-mentioned optional embodiment, first initialization appeal target browsing Device, that is, without interface browser;And it is obtained using the objective browser after above-mentioned initialization above-mentioned in display normal condition Webpage screenshot, as said reference page screenshot.
Optionally, can use Open-Source Tools PhantomJs with no interface browser to manual confirmation be in display just The Webpage of normal state carries out screenshot, if the above-mentioned Webpage in display normal condition is too long, for example, more than one The display length of screen, then the part not shown in screen will also be intercepted into a full picture together, that is, above-mentioned base Quasi- page screenshot is a complete picture.
In addition, by by said reference page screenshot to predetermined storage location current page screenshot and base can be being compared In the case where quasi- page screenshot, said reference page screenshot is obtained from above-mentioned predetermined storage location.
In an alternative embodiment, the first identifier data and benchmark page screenshot of above-mentioned current page screenshot are obtained Second identifier data, comprising: step S302 obtains above-mentioned first mark using targeted graphical method base and gray level image algorithm Know data and second identifier data.
In above-mentioned steps S302, above-mentioned targeted graphical method base is included at least: the GD2 based on hypertext processor PHP Graphical method library;Above-mentioned first identifier data include at least: the fisrt feature for the above-mentioned current page screenshot of unique identification refers to Line string data, above-mentioned second identifier data include at least: the second feature for unique identification said reference page screenshot Fingerprint string data.
Optionally, the GD2 graphical method library based on hypertext processor PHP is for dynamically handling image;Above-mentioned gray scale Image algorithm can be, but not limited to as gray level image floating-point arithmetic, gray level image two-value method etc., it is still necessary to explanation, above-mentioned figure As gray scale algorithm can also be any one gray level image algorithm in the prior art, the embodiment of the present application not specific limit to this It is fixed, also it may be implemented subject to the embodiment of the present application.
Optionally, above-mentioned fisrt feature fingerprint string data and second feature fingerprint string data all can be represent The md5 character string of one picture uniqueness.
In an alternative embodiment, the difference between above-mentioned first identifier data and above-mentioned second identifier data is determined Ratio value, comprising: calculate between above-mentioned fisrt feature fingerprint string data and above-mentioned second feature fingerprint string data Above-mentioned difference ratio value, wherein above-mentioned difference ratio value includes at least: difference ratio percent value;According to above-mentioned diversity ratio Example value determines whether above-mentioned current page is in front of display abnormality, the above method further include: preset difference ratio Threshold value, wherein above-mentioned difference ratio threshold value is for reflecting whether above-mentioned current page is in display abnormality.
Optionally, above-mentioned difference ratio threshold value can be, but not limited to be set as 25%-40%, for example, can be defaulted as 30%.
In an alternative embodiment, according to above-mentioned difference ratio value determine above-mentioned current page whether be in display it is different Normal state, comprising:
Step S402 compares above-mentioned difference ratio value and above-mentioned difference ratio threshold value;
Step S404, if comparison result indicates that above-mentioned difference ratio value is greater than above-mentioned difference ratio threshold value, it is determined that above-mentioned Current page is in above-mentioned display abnormality;
Step S406, if above-mentioned comparison result indicates that above-mentioned difference ratio value is less than or equal to above-mentioned difference ratio threshold value, Then determine that above-mentioned current page is not in above-mentioned display abnormality.
In the embodiment of the present application, it can be, but not limited to by comparing above-mentioned difference ratio value and predetermined diversity ratio Example threshold value, determines whether above-mentioned current page is in display abnormality;If comparison result indicates that above-mentioned difference ratio value is greater than Above-mentioned difference ratio threshold value, it is determined that above-mentioned current page is in above-mentioned display abnormality;If in above-mentioned comparison result instruction Difference ratio value is stated less than or equal to above-mentioned difference ratio threshold value, it is determined that above-mentioned current page is not in above-mentioned display exception shape State.
In an alternative embodiment, above-mentioned after determining that above-mentioned current page is in above-mentioned display abnormality Method further include: step S502, outputting alarm information are alerted, wherein above-mentioned warning information is for prompting target object pair Above-mentioned current page carries out abnormality processing.
By above-mentioned optional embodiment, after determining that above-mentioned current page is in above-mentioned display abnormality, output Warning information is alerted, and to prompt target object to carry out abnormality processing to above-mentioned current page, may be implemented under abnormality Auto-alarming is conducive to faster processing problem.
In an alternative embodiment, after determining that above-mentioned current page is not in above-mentioned display abnormality, The above method further include: above-mentioned current page screenshot is set said reference page screenshot by step S504.
It, will after determining that above-mentioned current page is not in above-mentioned display abnormality by above-mentioned optional embodiment Above-mentioned current page screenshot is set as said reference page screenshot;The automatic Iterative that benchmark page screenshot may be implemented updates, and subtracts The workload of manual intervention is lacked.
Below by way of a kind of optional embodiment, state is shown to determining Website page provided by the embodiment of the present application Method is illustrated, and Fig. 3 is the stream for the method that a kind of optional determining Website page according to an embodiment of the present invention shows state Cheng Tu, as shown in figure 3, the method that above-mentioned optional determining Website page shows state, comprises the following methods:
Step S602, initialized target browser;
Optionally, above-mentioned objective browser includes at least: without interface browser.
Step S604 obtains the screenshot of the Webpage in display normal condition using objective browser, as benchmark Page screenshot;
Step S606, Memory Reference page screenshot to predetermined storage location;
Step S608 obtains the current page of target webpage using objective browser after determining that target webpage updates Current page screenshot;
Step S610 obtains the first identifier of current page screenshot using targeted graphical method base and gray level image algorithm The second identifier data of data and benchmark page screenshot;
Step S612 determines the difference ratio value between first identifier data and second identifier data;
Optionally, targeted graphical method base includes at least: the GD2 graphical method library based on hypertext processor PHP;First Mark data includes at least: for the fisrt feature fingerprint string data of unique identification current page screenshot, second identifier number According to including at least: the second feature fingerprint string data for unique identification benchmark page screenshot.
In an alternative embodiment, fisrt feature fingerprint string data and second feature fingerprint can be calculated Difference ratio value between string data.
In an alternative embodiment, determining whether current page is in the abnormal shape of display according to difference ratio value Before state, difference ratio threshold value is preset, wherein difference ratio threshold value is for reflecting it is abnormal whether current page is in display State.
Step S614 compares difference ratio value and difference ratio threshold value;
Step S616, if comparison result instruction difference ratio value is greater than difference ratio threshold value, it is determined that current page is in Show abnormality;
Step S618, if comparison result instruction difference ratio value is less than or equal to difference ratio threshold value, it is determined that current page Face is not in display abnormality;
Wherein, after executing above-mentioned steps S616, step S620 is executed;After executing above-mentioned steps S618, execute Step S622.
Step S620, outputting alarm information are alerted, wherein warning information is for prompting target object to current page Carry out abnormality processing.
Current page screenshot is arranged as benchmark page screenshot step S622.
Embodiment 2
According to embodiments of the present invention, it additionally provides a kind of for implementing the method for above-mentioned determining Website page display state Installation practice, Fig. 4 are the structural schematic diagrams for the device that a kind of determining Website page according to an embodiment of the present invention shows state, As shown in figure 4, above-mentioned determining Website page shows the device of state, comprising: the first acquisition acquisition of module 40, second module 42, First determining module 44 and the second determining module 46, in which:
First obtains module 40, for obtaining above-mentioned target network using objective browser after determining that target webpage updates The current page screenshot of the current page of page, above-mentioned objective browser include at least: without interface browser;Second obtains module 42, for obtaining the first identifier data of above-mentioned current page screenshot and the second identifier data of benchmark page screenshot, above-mentioned base Quasi- page screenshot is the screenshot of the Webpage in display normal condition;First determining module 44, for determining above-mentioned first Difference ratio value between mark data and above-mentioned second identifier data;Second determining module 46, for according to above-mentioned diversity ratio Example value determines whether above-mentioned current page is in display abnormality.
It should be noted that above-mentioned modules can be realized by software or hardware, for example, for the latter, Can be accomplished by the following way: above-mentioned modules can be located in same processor;Alternatively, above-mentioned modules are with any Combined mode is located in different processors.
Herein it should be noted that above-mentioned first obtains module 40, second and obtain module 42, the first determining module 44 and the Two determining modules 46 correspond to the step S102 to step S108 in embodiment 1, and above-mentioned module is realized with corresponding step Example is identical with application scenarios, but is not limited to the above embodiments 1 disclosure of that.It should be noted that above-mentioned module conduct A part of device may operate in terminal.
It should be noted that the optional or preferred embodiment of the present embodiment may refer to the associated description in embodiment 1, Details are not described herein again.
Above-mentioned determination Website page shows that the device of state can also include processor and memory, and above-mentioned first obtains Module 40, second obtains module 42, the first determining module 44 and second determining module 46 etc. and is stored in as program unit In reservoir, above procedure unit stored in memory is executed by processor to realize corresponding function.
Include kernel in processor, is gone in memory to transfer corresponding program unit by kernel, above-mentioned kernel can be set One or more.Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) And/or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM), memory includes at least one Storage chip.
According to the embodiment of the present application, a kind of storage medium embodiment is additionally provided.Optionally, in the present embodiment, above-mentioned Storage medium includes the program of storage, wherein equipment where controlling above-mentioned storage medium in above procedure operation executes above-mentioned Any one determines the method that Website page shows state.
Optionally, in the present embodiment, above-mentioned storage medium can be located in computer network in computer terminal group In any one terminal, or in any one mobile terminal in mobile terminal group, above-mentioned storage medium packet Include the program of storage.
Optionally, when program is run, equipment where control storage medium executes following functions: determining target webpage more After new, the current page screenshot of the current page of above-mentioned target webpage is obtained using objective browser, above-mentioned objective browser is extremely It less include: no interface browser;Obtain the first identifier data of above-mentioned current page screenshot and the second mark of benchmark page screenshot Know data, said reference page screenshot is the screenshot of the Webpage in display normal condition;Determine above-mentioned first identifier number According to the difference ratio value between above-mentioned second identifier data;Determine whether above-mentioned current page is located according to above-mentioned difference ratio value In display abnormality.
Optionally, when program is run, equipment where control storage medium executes following functions: it is clear to initialize above-mentioned target Look at device;The screenshot that the above-mentioned Webpage in display normal condition is obtained using above-mentioned objective browser, as said reference Page screenshot;Said reference page screenshot is stored to predetermined storage location, wherein obtain above-mentioned base from above-mentioned predetermined storage location Quasi- page screenshot.
Optionally, when program is run, equipment where control storage medium executes following functions: using targeted graphical method Library and gray level image algorithm obtain above-mentioned first identifier data and second identifier data, wherein above-mentioned targeted graphical method base is extremely It less include: the GD2 graphical method library based on hypertext processor PHP;Above-mentioned first identifier data include at least: for uniquely marking Know the fisrt feature fingerprint string data of above-mentioned current page screenshot, above-mentioned second identifier data include at least: for unique Identify the second feature fingerprint string data of said reference page screenshot.
Optionally, when program is run, equipment where control storage medium executes following functions: calculating above-mentioned fisrt feature Above-mentioned difference ratio value between fingerprint string data and above-mentioned second feature fingerprint string data, wherein above-mentioned difference Ratio value includes at least: difference ratio percent value;Determining whether above-mentioned current page is according to above-mentioned difference ratio value Before showing abnormality, the above method further include: preset difference ratio threshold value, wherein above-mentioned difference ratio threshold value is used Display abnormality whether is in the above-mentioned current page of reflection.
Optionally, when program is run, equipment where control storage medium executes following functions: comparing above-mentioned difference ratio Value and above-mentioned difference ratio threshold value;If comparison result indicates that above-mentioned difference ratio value is greater than above-mentioned difference ratio threshold value, it is determined that Above-mentioned current page is in above-mentioned display abnormality;If it is upper that above-mentioned comparison result indicates that above-mentioned difference ratio value is less than or equal to State difference ratio threshold value, it is determined that above-mentioned current page is not in above-mentioned display abnormality.
Optionally, when program is run, equipment where control storage medium executes following functions: outputting alarm information carries out Alarm, wherein above-mentioned warning information is for prompting target object to carry out abnormality processing to above-mentioned current page;Determining above-mentioned work as The preceding page is not in after above-mentioned display abnormality, the above method further include: sets above-mentioned for above-mentioned current page screenshot Benchmark page screenshot.
According to the embodiment of the present application, a kind of processor embodiment is additionally provided.Optionally, in the present embodiment, above-mentioned place Reason device is for running program, wherein above procedure executes any one of the above and determines that Website page shows the side of state when running Method.
The embodiment of the present application provides a kind of equipment, equipment include processor, memory and storage on a memory and can The program run on a processor, processor is performed the steps of when executing program after determining that target webpage updates, using mesh Mark browser obtains the current page screenshot of the current page of above-mentioned target webpage, and above-mentioned objective browser includes at least: unbounded Face browser;The first identifier data of above-mentioned current page screenshot and the second identifier data of benchmark page screenshot are obtained, it is above-mentioned Benchmark page screenshot is the screenshot of the Webpage in display normal condition;Determine above-mentioned first identifier data and above-mentioned second Difference ratio value between mark data;Determine whether above-mentioned current page is in the abnormal shape of display according to above-mentioned difference ratio value State.
Optionally, when above-mentioned processor executes program, above-mentioned objective browser can also be initialized;It is clear using above-mentioned target Device of looking at obtains the screenshot of the above-mentioned Webpage in display normal condition, as said reference page screenshot;Store above-mentioned base Quasi- page screenshot is to predetermined storage location, wherein obtains said reference page screenshot from above-mentioned predetermined storage location.
Optionally, when above-mentioned processor executes program, targeted graphical method base and gray level image algorithm can also be used, is obtained Take above-mentioned first identifier data and second identifier data, wherein above-mentioned targeted graphical method base includes at least: based at hypertext Manage the GD2 graphical method library of device PHP;Above-mentioned first identifier data include at least: being used for the above-mentioned current page screenshot of unique identification Fisrt feature fingerprint string data, above-mentioned second identifier data include at least: cutting for the unique identification said reference page The second feature fingerprint string data of figure.
Optionally, when above-mentioned processor executes program, above-mentioned fisrt feature fingerprint string data and upper can also be calculated State the above-mentioned difference ratio value between second feature fingerprint string data, wherein above-mentioned difference ratio value includes at least: difference Proportionality percentage value;Before determining whether above-mentioned current page is in display abnormality according to above-mentioned difference ratio value, on State method further include: preset difference ratio threshold value, wherein above-mentioned difference ratio threshold value is for reflecting that above-mentioned current page is It is no to be in display abnormality.
Optionally, when above-mentioned processor executes program, above-mentioned difference ratio value and above-mentioned difference ratio threshold can also be compared Value;If comparison result indicates that above-mentioned difference ratio value is greater than above-mentioned difference ratio threshold value, it is determined that above-mentioned current page is in upper State display abnormality;If above-mentioned comparison result indicates that above-mentioned difference ratio value is less than or equal to above-mentioned difference ratio threshold value, Determine that above-mentioned current page is not in above-mentioned display abnormality.
Optionally, it when above-mentioned processor executes program, can be alerted with outputting alarm information, wherein above-mentioned alarm Information is for prompting target object to carry out abnormality processing to above-mentioned current page;Determining that it is above-mentioned aobvious that above-mentioned current page is not in After showing abnormality, the above method further include: set said reference page screenshot for above-mentioned current page screenshot.
Present invention also provides a kind of computer program products, when executing on data processing equipment, are adapted for carrying out just The program of beginningization there are as below methods step: after determining that target webpage updates, above-mentioned target webpage is obtained using objective browser Current page current page screenshot, above-mentioned objective browser includes at least: without interface browser;Obtain above-mentioned current page The first identifier data of screenshot and the second identifier data of benchmark page screenshot, said reference page screenshot are normal in display The screenshot of the Webpage of state;Determine the difference ratio value between above-mentioned first identifier data and above-mentioned second identifier data; Determine whether above-mentioned current page is in display abnormality according to above-mentioned difference ratio value.
Optionally, when above-mentioned computer program product executes program, above-mentioned objective browser can also be initialized;Using upper The screenshot that objective browser obtains the above-mentioned Webpage in display normal condition is stated, as said reference page screenshot;It deposits Said reference page screenshot is stored up to predetermined storage location, wherein obtain said reference page screenshot from above-mentioned predetermined storage location.
Optionally, when above-mentioned computer program product executes program, targeted graphical method base and grayscale image can also be used As algorithm, above-mentioned first identifier data and second identifier data are obtained, wherein above-mentioned targeted graphical method base includes at least: base In the GD2 graphical method library of hypertext processor PHP;Above-mentioned first identifier data include at least: working as unique identification to be above-mentioned The fisrt feature fingerprint string data of preceding page screenshot, above-mentioned second identifier data include at least: above-mentioned for unique identification The second feature fingerprint string data of benchmark page screenshot.
Optionally, when above-mentioned computer program product executes program, above-mentioned fisrt feature fingerprint character string can also be calculated Above-mentioned difference ratio value between data and above-mentioned second feature fingerprint string data, wherein above-mentioned difference ratio value is at least It include: difference ratio percent value;Determining whether above-mentioned current page is in the abnormal shape of display according to above-mentioned difference ratio value Before state, the above method further include: preset difference ratio threshold value, wherein above-mentioned difference ratio threshold value is above-mentioned for reflecting Whether current page is in display abnormality.
Optionally, when above-mentioned computer program product executes program, above-mentioned difference ratio value and above-mentioned difference can also be compared Different proportion threshold value;If comparison result indicates that above-mentioned difference ratio value is greater than above-mentioned difference ratio threshold value, it is determined that above-mentioned current page Face is in above-mentioned display abnormality;If above-mentioned comparison result indicates that above-mentioned difference ratio value is less than or equal to above-mentioned difference ratio Threshold value, it is determined that above-mentioned current page is not in above-mentioned display abnormality.
Optionally, it when above-mentioned computer program product executes program, can be alerted with outputting alarm information, wherein Above-mentioned warning information is for prompting target object to carry out abnormality processing to above-mentioned current page;Determining that above-mentioned current page do not locate After above-mentioned display abnormality, the above method further include: set the said reference page for above-mentioned current page screenshot and cut Figure.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, Ke Yiwei A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module It connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code Medium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (10)

1. a kind of method that determining Website page shows state characterized by comprising
After determining that target webpage updates, cut using the current page that objective browser obtains the current page of the target webpage Figure, the objective browser include at least: without interface browser;
Obtain the first identifier data of the current page screenshot and the second identifier data of benchmark page screenshot, the benchmark page Face screenshot is the screenshot of the Webpage in display normal condition;
Determine the difference ratio value between the first identifier data and the second identifier data;
Determine whether the current page is in display abnormality according to the difference ratio value.
2. the method according to claim 1, wherein obtaining working as the target webpage using objective browser Before the current page screenshot of the preceding page, the method also includes:
Initialize the objective browser;
The screenshot that the Webpage in display normal condition is obtained using the objective browser, as the benchmark page Face screenshot;
The benchmark page screenshot is stored to predetermined storage location, wherein obtain the benchmark page from the predetermined storage location Face screenshot.
3. the method according to claim 1, wherein obtain the current page screenshot first identifier data and The second identifier data of benchmark page screenshot, comprising:
Using targeted graphical method base and gray level image algorithm, the first identifier data and second identifier data are obtained, wherein The targeted graphical method base includes at least: the GD2 graphical method library based on hypertext processor PHP;The first identifier number According to including at least: for the fisrt feature fingerprint string data of current page screenshot described in unique identification, the second identifier Data include at least: the second feature fingerprint string data for benchmark page screenshot described in unique identification.
4. according to the method described in claim 3, it is characterized in that,
Determine the difference ratio value between the first identifier data and the second identifier data, comprising: calculate described first The difference ratio value between characteristic fingerprint string data and the second feature fingerprint string data, wherein described Difference ratio value includes at least: difference ratio percent value;
Before determining whether the current page is in display abnormality according to the difference ratio value, the method is also wrapped It includes: presetting difference ratio threshold value, wherein the difference ratio threshold value is for reflecting whether the current page is in display Abnormality.
5. according to the method described in claim 4, it is characterized in that, determining that the current page is according to the difference ratio value It is no to be in display abnormality, comprising:
Compare the difference ratio value and the difference ratio threshold value;
If comparison result indicates that the difference ratio value is greater than the difference ratio threshold value, it is determined that the current page is in institute State display abnormality;
If the comparison result indicates that the difference ratio value is less than or equal to the difference ratio threshold value, it is determined that described current The page is not in the display abnormality.
6. method as claimed in any of claims 1 to 5, which is characterized in that
After determining that the current page is in the display abnormality, the method also includes: outputting alarm information into Row alarm, wherein the warning information is for prompting target object to carry out abnormality processing to the current page;
After determining that the current page is not in the display abnormality, the method also includes: by the current page Face screenshot is set as the benchmark page screenshot.
7. method as claimed in any of claims 1 to 5, which is characterized in that the display abnormality include with At least one lower: page composition entanglement, picture missing, interior fault-tolerant row, page ratio is excessive, page ratio is too small.
8. the device that a kind of determining Website page shows state characterized by comprising
First obtains module, for obtaining working as the target webpage using objective browser after determining that target webpage updates The current page screenshot of the preceding page, the objective browser include at least: without interface browser;
Second obtains module, for obtaining the first identifier data of the current page screenshot and the second mark of benchmark page screenshot Know data, the benchmark page screenshot is the screenshot of the Webpage in display normal condition;
First determining module, for determining the difference ratio value between the first identifier data and the second identifier data;
Second determining module, for determining whether the current page is in display abnormality according to the difference ratio value.
9. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program When control the storage medium where equipment perform claim require any one of 1 to 7 described in determination Website page show shape State method.
10. a kind of processor, which is characterized in that the processor is for running program, wherein right of execution when described program is run Benefit require any one of 1 to 7 described in determination Website page show status method.
CN201811595459.5A 2018-12-25 2018-12-25 Determine that Website page shows the method and device of state Pending CN109885446A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811595459.5A CN109885446A (en) 2018-12-25 2018-12-25 Determine that Website page shows the method and device of state

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811595459.5A CN109885446A (en) 2018-12-25 2018-12-25 Determine that Website page shows the method and device of state

Publications (1)

Publication Number Publication Date
CN109885446A true CN109885446A (en) 2019-06-14

Family

ID=66925224

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811595459.5A Pending CN109885446A (en) 2018-12-25 2018-12-25 Determine that Website page shows the method and device of state

Country Status (1)

Country Link
CN (1) CN109885446A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110609794A (en) * 2019-09-12 2019-12-24 中国联合网络通信集团有限公司 Page detection method and device
CN110879780A (en) * 2019-10-25 2020-03-13 北京奇艺世纪科技有限公司 Page abnormity detection method and device, electronic equipment and readable storage medium
CN111401416A (en) * 2020-03-05 2020-07-10 支付宝(杭州)信息技术有限公司 Abnormal website identification method and device and abnormal countermeasure identification method
CN112380478A (en) * 2020-11-17 2021-02-19 平安养老保险股份有限公司 Webpage screenshot method and device, computer equipment and computer-readable storage medium
CN112948267A (en) * 2021-03-31 2021-06-11 北京房江湖科技有限公司 Webpage testing method, webpage testing system, storage medium and electronic equipment
WO2024045064A1 (en) * 2022-08-31 2024-03-07 京东方科技集团股份有限公司 Playing content monitoring method, main unit, system, apparatus, medium and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104111960A (en) * 2013-04-22 2014-10-22 阿里巴巴集团控股有限公司 Page matching method and device
US20150347284A1 (en) * 2014-05-27 2015-12-03 International Business Machines Corporation Screenshot validation testing
CN107832428A (en) * 2017-11-14 2018-03-23 北京知行锐景科技有限公司 Webpage method for monitoring state and system based on Website page
CN108595304A (en) * 2018-04-19 2018-09-28 腾讯科技(深圳)有限公司 Web monitor method and device
CN108614762A (en) * 2016-12-09 2018-10-02 武汉斗鱼网络科技有限公司 A kind of browser testing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104111960A (en) * 2013-04-22 2014-10-22 阿里巴巴集团控股有限公司 Page matching method and device
US20150347284A1 (en) * 2014-05-27 2015-12-03 International Business Machines Corporation Screenshot validation testing
CN108614762A (en) * 2016-12-09 2018-10-02 武汉斗鱼网络科技有限公司 A kind of browser testing method and device
CN107832428A (en) * 2017-11-14 2018-03-23 北京知行锐景科技有限公司 Webpage method for monitoring state and system based on Website page
CN108595304A (en) * 2018-04-19 2018-09-28 腾讯科技(深圳)有限公司 Web monitor method and device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110609794A (en) * 2019-09-12 2019-12-24 中国联合网络通信集团有限公司 Page detection method and device
CN110879780A (en) * 2019-10-25 2020-03-13 北京奇艺世纪科技有限公司 Page abnormity detection method and device, electronic equipment and readable storage medium
CN111401416A (en) * 2020-03-05 2020-07-10 支付宝(杭州)信息技术有限公司 Abnormal website identification method and device and abnormal countermeasure identification method
CN112380478A (en) * 2020-11-17 2021-02-19 平安养老保险股份有限公司 Webpage screenshot method and device, computer equipment and computer-readable storage medium
CN112948267A (en) * 2021-03-31 2021-06-11 北京房江湖科技有限公司 Webpage testing method, webpage testing system, storage medium and electronic equipment
WO2024045064A1 (en) * 2022-08-31 2024-03-07 京东方科技集团股份有限公司 Playing content monitoring method, main unit, system, apparatus, medium and device

Similar Documents

Publication Publication Date Title
CN109885446A (en) Determine that Website page shows the method and device of state
CN110413510B (en) Data processing method, device and equipment
KR20140091555A (en) Measuring web page rendering time
CN111741002B (en) Method and device for training network intrusion detection model
CN110689084B (en) Abnormal user identification method and device
CN109460361B (en) Performance test method and device, storage medium and electronic device
CN108268296A (en) Loading method, the client and server of page layout
CN113344862B (en) Defect detection method, device, electronic equipment and storage medium
CN112506581B (en) Method, apparatus, electronic device and readable storage medium for rendering applet
CN110955590A (en) Interface detection method, image processing method, device, electronic equipment and storage medium
CN110555488A (en) Image sequence auditing method and system, electronic equipment and storage medium
CN109460930B (en) Method for determining risk account and related equipment
CN111652282B (en) Big data-based user preference analysis method and device and electronic equipment
CN111696095B (en) Method and device for detecting surface defects of object
CN110365682B (en) Anti-cheating method and device
WO2017133229A1 (en) Mobile terminal image display method and device
CN117009221A (en) Processing method, device, equipment, storage medium and program product for product test
CN111127601A (en) Animation switching method and device, electronic equipment and storage medium
CN115860877A (en) Product marketing method, device, equipment and medium
CN107920127A (en) Dispose controller
CN113886906A (en) CAD drawing loading method, font file replacing method, device and storage medium
CN109688025B (en) Test monitoring method, device, terminal and storage medium based on digital KVM
CN117349189B (en) APP new version testing method, equipment and medium
CN111124854A (en) Method, system, terminal and storage medium for distributing smoking test cases
CN106055370B (en) Drive programe installation method, device 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190614

RJ01 Rejection of invention patent application after publication