CN113538629A - Detection method and device - Google Patents

Detection method and device Download PDF

Info

Publication number
CN113538629A
CN113538629A CN202110873867.8A CN202110873867A CN113538629A CN 113538629 A CN113538629 A CN 113538629A CN 202110873867 A CN202110873867 A CN 202110873867A CN 113538629 A CN113538629 A CN 113538629A
Authority
CN
China
Prior art keywords
page
image
verification
detection
detected
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
CN202110873867.8A
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.)
Shanghai Hode Information Technology Co Ltd
Original Assignee
Shanghai Hode Information 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 Shanghai Hode Information Technology Co Ltd filed Critical Shanghai Hode Information Technology Co Ltd
Priority to CN202110873867.8A priority Critical patent/CN113538629A/en
Publication of CN113538629A publication Critical patent/CN113538629A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a detection method and a device, wherein the detection method comprises the following steps: acquiring an operation sequence predefined for a page to be detected; sequentially executing operation instructions corresponding to the operation position data according to the arrangement sequence of the operation position data in the operation sequence, and performing screenshot on a target page after the operation instructions are executed to obtain a page image set to be verified; and determining a verification image set corresponding to the operation sequence, and determining a detection result of the page to be detected based on the verification image set and the page image set. The method and the device realize that the corresponding operation instruction is carried out on the page to be detected according to the position data in the operation sequence, and the image verification is carried out on the image of the operation result, thereby realizing the page detection of the page to be detected.

Description

Detection method and device
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a detection method. The application also relates to a detection apparatus, a computing device, and a computer-readable storage medium.
Background
With the development of the internet, online activities usually play a significant role in business, and the running time of the online activities is usually not fixed, and the running time is set by a business party initiated by the activities, such as setting the online activities to run all day or run within a preset time interval. In the prior art, monitoring whether the activities are normally started, whether page display is correct or whether a processing flow is correct is usually achieved through manual monitoring, so that great labor consumption is caused.
Disclosure of Invention
In view of this, the present application provides a detection method. The application also relates to a detection device, a computing device and a computer readable storage medium, which are used for solving the defect of large human resource consumption in the prior art.
According to a first aspect of embodiments of the present application, there is provided a detection method, including:
acquiring an operation sequence predefined for a page to be detected;
sequentially executing operation instructions corresponding to the operation position data according to the arrangement sequence of the operation position data in the operation sequence, and performing screenshot on a target page after the operation instructions are executed to obtain a page image set to be verified;
and determining a verification image set corresponding to the operation sequence, and determining a detection result of the page to be detected based on the verification image set and the page image set.
According to a second aspect of embodiments of the present application, there is provided a detection apparatus, including:
the acquisition module is configured to acquire an operation sequence predefined for the page to be detected;
the execution module is configured to sequentially execute the operation instructions corresponding to the operation position data according to the arrangement sequence of the operation position data in the operation sequence, and perform screenshot on a target page after the operation instructions are executed to obtain a page image set to be verified;
the determining module is configured to determine a verification image set corresponding to the operation sequence, and determine a detection result of the page to be detected based on the verification image set and the page image set.
According to a third aspect of embodiments herein, there is provided a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the detection method when executing the computer instructions.
According to a fourth aspect of embodiments herein, there is provided a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the detection method.
The detection method provided by the application obtains the predefined operation sequence aiming at the page to be detected, and sequentially executing the operation instructions corresponding to the operation position data according to the arrangement sequence of the operation position data in the operation sequence, and then performing screenshot on a target page after the operation instructions are executed to obtain a page image set to be verified, thereby realizing the simulated operation on the page, screenshot is carried out on the operation result, on the basis, the verification image set corresponding to the operation sequence is determined, the detection result of the page to be detected is determined based on the verification image set and the page image set, so that the correctness of the comparison operation result is verified through the image, the page to be detected is detected, so that the condition that human resources are consumed to detect the page to be detected is avoided, and the detection efficiency and the detection accuracy are effectively improved.
Drawings
Fig. 1 is a flowchart of a detection method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a page image after image decoloring in a detection method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a binary page image in a detection method according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating a detection method applied to an interactive scene according to an embodiment of the present application;
fig. 5 is a simplified flowchart of a detection method applied to an interactive scene according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a detecting device according to an embodiment of the present disclosure;
fig. 7 is a block diagram of a computing device according to an embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The terminology used in the one or more embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the present application. As used in one or more embodiments of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present application refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments of the present application to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first aspect may be termed a second aspect, and, similarly, a second aspect may be termed a first aspect, without departing from the scope of one or more embodiments of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
First, the noun terms to which one or more embodiments of the present application relate are explained.
Image Binarization (Image Binarization) is a process of setting the gray value of a pixel point on an Image to be 0 or 255, namely, the whole Image presents an obvious black-white effect.
In the present application, a detection method is provided, and the present application relates to a detection apparatus, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments one by one.
In practical application, the page is detected in a manual mode, the labor cost is consumed, and the detection result is easy to deviate.
Fig. 1 shows a flowchart of a detection method according to an embodiment of the present application, which specifically includes the following steps:
step 102: and acquiring an operation sequence predefined for the page to be detected.
The page to be detected may be any page opened in any application program, or may be any web page opened through the terminal, which is not limited herein. The operation sequence may be understood as a data set composed of operation position data having an operation order.
In specific implementation, the method for obtaining the operation sequence is various, for example, the corresponding relationship between the page identifier and the operation sequence may be preset, and based on the page identifier corresponding to the page to be detected, the operation sequence predefined for the page to be detected is extracted from a preset operation sequence library. Or presetting the corresponding relation between the detection time and the operation sequence, and acquiring the operation sequence corresponding to the detection time according to the detection time of the page to be detected; in practical application, the obtaining method of the operation sequence may be selected according to requirements, and the embodiment is not limited herein.
By acquiring the predefined operation sequence, the execution position corresponding to the operation instruction to be executed can be determined so as to further execute the operation instruction, thereby realizing the automatic operation of the page to be detected and detecting the operation result.
In specific implementation, in order to improve accuracy of performing operation detection on a page to be detected and implement operation detection according to a specific detection flow or a specific detection sequence, before obtaining an operation sequence, an operation sequence may be generated according to a preset operation sequence (i.e., a preset operation sequence) for an operation control, so as to improve accuracy of detection and detection efficiency and implement subsequent processing of completing operation detection based on the operation sequence.
Determining position data of each operation control in the page to be detected;
and taking the position data as operation position data, and splicing the operation position data according to a preset operation sequence aiming at the operation control to generate an operation sequence.
The operation control can be understood as a control that can be operated, such as: selection controls, input controls, pull-down controls, and the like, without limitation.
In practical application, because the operation controls in the page to be detected are limited and the positions of the operation controls are relatively fixed, the operation inspection of the page to be detected can determine the position data (such as the position data of page coordinates { x: 100, y: 300} or screen coordinates { x: 300, y: 350} and the like) of the operation controls which can be operated in the page to be detected, and then the position data is used as the operation position data, which indicates that the operation controls are to be operated according to the operation position data, and the operation position data are spliced according to the preset operation sequence (such as the operation sequence from front to back) aiming at the operation controls, so as to generate the operation sequence.
Specifically, the preset operation sequence may be understood as a preset sequence of operations performed on the operation control. On the basis of presetting a preset operation sequence, splicing the operation data at each position according to the preset operation sequence to generate an operation sequence. Specifically, the manner of splicing the position operation data is various, for example, the position operation data may be spliced by using a comma as a separator, or the position operation data may be spliced by using a separator such as a pause, a colon, or a space, which is not limited herein.
For example, the page to be detected includes 3 operation controls, where the three operation controls are an operation control a, an operation control b, and an operation control c, the operation position data of the three operation controls are d1, d2, and d3, and the preset operation sequence for the three operation controls is determined as follows: firstly, operating the operation control c, then operating the operation control b, and finally operating the operation control a; at this time, the operation position data of the 3 operation controls can be spliced by using commas as separators according to a preset operation sequence, and the generated operation sequence specifically includes: (d3, d2, d 1).
In summary, the operation sequence is generated by the position data of each operation space in the page to be detected and the preset operation sequence, so that the accuracy of executing the operation based on the operation sequence can be improved, and the accuracy of detecting the page to be detected can be further improved.
In practical application, considering that the detection of the page to be detected at this moment may generate a waste of computing resources, before acquiring the operation sequence predefined for the page to be detected, the detection triggering condition (that is, the preset detection triggering condition) may be preset, and when the preset detection triggering condition is satisfied, the detection of the page to be detected may be performed again, so as to improve the flexibility of the detection.
And displaying the page to be detected under the condition that the target service to which the page to be detected belongs is detected to meet a preset detection trigger condition.
The target service may be a game service, an e-commerce service, a video service, a forum service, and the like, which is not limited herein. In practical applications, function updates, page updates, online events, and the like may be performed in these services, and in order to ensure the stability of the performance of these updates or events, thereby improving the access experience of the user and increasing the stickiness of the user, these updates or events need to be monitored so as to determine whether these updates or events are operating normally.
Presetting a detection trigger condition, which is a preset condition for triggering detection on a page to be detected; specifically, the time may be used as a preset detection trigger condition, for example: 2021/05/0219 may be: 25 as a preset detection trigger condition, or a received detection instruction may be used as a preset detection trigger condition, and the like, which is not limited herein.
Such as: the page to be detected is an activity page of online game activity in the game service, and the opening time of the online game activity is 2021/05/0219: 25, setting the on-time as a preset detection trigger condition, and when the detected time reaches 2021/05/0219: at 25, the activity page is presented and a detection of the activity page is performed.
In practical application, after the page to be detected is displayed, the screenshot can be directly performed on the page to be detected, so that whether the page to be detected runs normally or not can be verified before operation.
It should be noted that, the execution sequence of the steps of obtaining the operation sequence for the page to be detected and the steps of displaying the page to be detected may be changed, and the change of the execution sequence does not affect the implementation effect of the embodiment.
In summary, when it is detected that the target service to which the page to be detected belongs meets the preset detection trigger condition, the page to be detected is detected, so that accurate detection of the object to be detected in the page to be detected can be realized.
Step 104: and sequentially executing the operation instructions corresponding to the operation position data according to the arrangement sequence of the operation position data in the operation sequence, and performing screenshot on the target page after the operation instructions are executed to obtain a page image set to be verified.
On the basis of the above-mentioned operation sequence for obtaining the page to be detected, since the arrangement order of the operation position data in the operation sequence represents the operation order, the operation instructions corresponding to the operation position data need to be sequentially executed according to the arrangement order. In addition, considering that screenshot verification is not required to be performed on a page after an operation instruction is executed each time, screenshot may be performed only on a page (i.e., a target page) after some specific operations (such as a click operation) are executed, or screenshot may be performed on some specific pages (i.e., target pages) after an operation instruction is executed, so as to obtain a page image set to be verified, which is not limited herein.
The operation instruction corresponding to the operation position data may be understood as an instruction for operating a position pointed by the operation position data, and in addition, the operation instruction may also carry its own operation position data, which is not limited herein. In specific implementation, the operation position data may be used as a parameter of the operation command, or the operation position may be located according to the operation position data, and then the corresponding operation command is executed at the operation position.
Furthermore, the screenshot of the target page after the operation instruction is executed may be the screenshot of a specific position in the target page, or the screenshot of the target page, which is not limited herein.
In specific implementation, in order to avoid verifying the page to be detected on the basis of manually operating the page to be detected, an operation instruction corresponding to the operation sequence may be further predefined on the basis of predefined operation sequence, where the operation instruction may be a kernel instruction, and the operation instruction is executed by calling, so that manual simulation operation on the page may be implemented, for example, the instruction corresponding to the screenshot operation is: adb shell/system/bin/hierarchy-p/sdcard/$ hierarchy; the command corresponding to the input operation is as follows: adb shell input keyervent 4.
Following the above example, the predefined sequence of operations for an active page is obtained as: (d3, d2, d1), assuming that the operation command corresponding to the operation position data d1 is a click command, the operation command corresponding to the operation position data d2 is an input command, and the operation command corresponding to the operation position data d3 is a click command. According to the sorting sequence of the operation position data in the operation sequence, firstly executing a click command on the position indicated by the operation position data d3, and carrying out screenshot on the page after the click command is executed to obtain a page image p 1; then, executing an input instruction on the position indicated by the operation position data d2, and performing screenshot on the page after the input instruction is executed to obtain a page image p 2; and finally, executing a click instruction on the position indicated by the operation position data d1, and performing screenshot on the page after the click instruction is executed to obtain a page image p 3. The page image p1, the page image p2 and the page image p3 are formed into a page image set a to be verified.
Further, because more than one operation instruction corresponding to each operation position data and the operation instructions at the same position have the operation sequence, in order to execute the operation instructions in order, the operation instructions corresponding to each operation position data may form an operation sequence and point to the operation instructions in the operation sequence in sequence, and in an optional implementation manner provided in the embodiment of the present application, the following implementation manner is specifically adopted:
determining an operation instruction sequence corresponding to each operation position data in the operation sequence;
and sequentially executing the operation instructions in the operation instruction sequence corresponding to each operation position data according to the arrangement sequence of the operation position data in the operation sequence, and performing screenshot on the target page after the operation instructions are executed.
The operation instruction sequence may be understood as a set of operation instructions having an operation order. In specific implementation, the operation position of the first operation instruction in the operation instruction sequence is the position pointed by the operation position data in the operation sequence; if the other operation instructions in the operation instruction sequence do not carry the operation position data, the operation instruction is executed at the position by default, and if the other operation instructions in the operation instruction sequence carry the operation position data, the corresponding operation instruction is executed at the position pointed by the carried operation position data.
For example, the operation instruction sequence corresponding to the operation position data d4 includes 3 operation instructions, which are a click instruction 1 (the operation position data of the operation instruction is d4), an input instruction and a click instruction 2 (these two instructions carry their own operation position data), and a page after the click instruction 3 is executed is preset as a target page, the operation instruction 1 is executed on a position pointed by the operation position data d4, the page 2 is executed after the operation instruction 1 is executed, and the input instruction is executed at a position in the page 2 pointed by the operation position data carried in the input instruction, where a character input by the input instruction is a preset character, and finally the click instruction 3 is executed at a position pointed by the operation position data carried in the operation instruction 3, and a screenshot is performed on the target page after the click instruction 3 is executed.
In summary, when it is detected that the target service to which the page to be detected belongs meets the preset detection trigger condition, the page to be detected is detected, so that the accurate detection of the detected event, activity or function and the like in the page to be detected, which needs to be triggered under the detection trigger condition, can be realized.
Step 106: and determining a verification image set corresponding to the operation sequence, and determining a detection result of the page to be detected based on the verification image set and the page image set.
And on the basis of obtaining the page image set to be verified by the screenshot of the target page, verifying the page image set obtained by the screenshot through the verification image set corresponding to the operation sequence, and determining the detection result of the page to be detected.
The verification of the image set can be understood as an image set obtained by capturing images of the target page in advance under the condition that the target page is displayed correctly, namely an image set consisting of correct images. In specific implementation, a correspondence between a sequence identifier (such as a sequence name or a sequence number) of an operation sequence and a set identifier (such as a set name or a set number) of a verification image set may be pre-established, so as to determine a corresponding verification image set according to the obtained sequence identifier of the operation sequence.
Before determining the detection result of the page to be detected, in order to accurately complete the detection processing operation of the page, the correspondence between the verification images in the verification image set and the page images in the page image set may be determined first, so as to implement one-to-one comparison of the images in the two sets according to the image sequence in the sets based on the correspondence, thereby achieving the purpose of determining the detection result of the page to be detected.
Further, since both the page image in the page image set and the verification image in the verification set have a corresponding relationship with the position operation data, in order to facilitate verification of the page image, the corresponding relationship between the page image and the verification image may also be established based on the position operation data, and verification of the page image to determine the detection result of the page to be detected is implemented on the basis of the corresponding relationship, in an optional implementation manner provided in the embodiment of the present application, the following implementation manner is specifically adopted:
determining a detection data structure corresponding to the operation sequence;
extracting a verification image set formed by verification images corresponding to the operation position data in the operation sequence from the detection data structure;
determining the corresponding relation between the verification images in the verification image set and the page images in the page image set according to the operation position data;
based on the corresponding relation, carrying out similarity comparison on the verification images in the verification image set and the page images in the page image set;
and determining the detection result of the page to be detected according to the similarity comparison result.
The detection data structure may be understood as a data structure preset to include a verification image of a page to be detected, specifically, the detection data structure may be an operation sequence + screenshot structure, where operation position data in the operation sequence may form a linked list structure with the verification image of the verification image set.
Specifically, the first data of the linked list structure is the first operation position data in the operation sequence, a verification image captured after an operation instruction is executed according to the operation position data is linked behind the first operation position data in the operation sequence, the second operation position data is linked behind the verification image, the verification image captured after the operation instruction is executed according to the operation position data is linked behind the second operation position data, and the like, so that the linked list structure is formed.
In practical application, a linked list structure which is the same as the detection data structure can be formed for the page image based on the same link mode, and because the linked list structure is the same storage structure as the linked list structure of the verification image, the corresponding relation between the verification image and the page image can be determined based on the operation position data in the storage structure.
In addition, in the process of determining the correspondence between the verification image and the page image, in addition to the above determination method, other determination methods may be adopted, such as: because the page images in the page image set are obtained by screenshot according to the operation sequence, the verification images in the verification image set can also be obtained according to the same sequence, and the corresponding relation between the page images in the page image set and the verification images in the verification image set can be determined according to the sequence of the page images in the page image set and the verification images in the verification image set in the respective sets; or, each page image in the page image set and the corresponding verification image in the verification image may be named in the same manner (for example, in the manner of the same prefix), and then the correspondence between the page image in the page image set and the verification image in the verification image set may be determined according to the naming of each page image in the page image set and the corresponding verification image in the verification image set.
After the correspondence between the verification images and the page images is determined, similarity comparison can be performed on the verification images and the page images with the correspondence, specifically, if the similarity comparison results between each group of images with the correspondence are all similar, the detection result of the page to be detected is determined to be passed, and if the similarity comparison results between any group of images with the correspondence are not similar, the detection result of the page to be detected is determined to be failed.
Specifically, the way of comparing the similarity of the two images is various, for example, the image features of the two images can be respectively extracted through a deep learning algorithm, and then the extracted image features are compared in similarity; or respectively screening out the pixel points at the preset positions from each image, and performing similarity comparison on the pixel values of the pixel points at the preset positions, and the like, without limitation.
Following the above example, the detection data structure corresponding to the operation sequence is determined to be [ operation position data d1, verification image p 4; operation position data d2, verification image p 5; on the basis of the operation position data d3 and the verification image p6], a verification image p4 corresponding to the operation position data is extracted from the detection data structure, and the verification image p5 and the verification image p6 form a verification image set B, wherein the verification image p4 corresponds to the operation position data d3, the verification image p5 corresponds to the operation position data d2, and the verification image p6 corresponds to the operation position data d 1; and the page image p1 corresponds to the operation position data d3, the page image p2 corresponds to the operation position data d2, and the page image p4 corresponds to the operation position data d1, based on which, it can be determined that the page image p1 corresponds to the verification image p4, the page image p2 corresponds to the verification image p5, and the page image p3 corresponds to the verification image p6, then the page image p1 and the verification image p4 are respectively subjected to similarity comparison, the page image p2 and the verification image p5 are subjected to similarity comparison, the page image p3 and the verification image p6 are subjected to similarity comparison, and under the condition that the results of each similarity comparison are similar, the detection result of the page to be detected is determined to be passed.
In summary, through the predefined detection data structure, the verification image set is extracted and the corresponding relation between the verification image in the verification image set and the page image in the page image set is determined, so that the efficiency of determining the corresponding relation is improved, and the contrast efficiency of carrying out similarity contrast on the images with the corresponding relation is indirectly improved.
Further, because a terminal intercepting the verification image and a terminal intercepting the page image may be different, and a terminal intercepting the page image each time may also be different, and the difference of the terminals is reflected in the difference of the type, model, configuration, and the like of the terminal, based on this, the compression ratio examples of the page by different terminals are also different, and further the compression ratio examples of the page image obtained by screenshot are also different, in order to implement the similarity comparison in the same way for the page images with different compression ratios, and also ensure the accuracy of the similarity comparison, and implement the similarity comparison between the verification image in the verification image set and the page image in the page image set, an optional implementation manner provided by the embodiment of the present application is specifically implemented in the following way:
respectively performing image decoloring on the page images in the page image set and the verification images in the verification image set;
processing the page image after image decoloration into a binary page image according to a preset binarization threshold, and processing the verification image after image decoloration into a binary verification image;
and carrying out similarity comparison on the binary page image corresponding to the page image in the page image set and the binary verification image corresponding to the verification image in the verification image set.
The image decoloring refers to converting a color image into a gray image through operation. Therefore, the page image with the image decolored obtained by performing the image decoloration on the page image is the gray level image of the page image, and similarly, the verification image with the image decolored obtained by performing the image decoloration on the verification image is the gray level image of the verification image. For example, the page image after image decoloring may be as shown in fig. 2, where the page image includes an operation control a, an operation control b, an operation control c, and a background, and pixel points in these page elements may present different gray values.
In specific implementation, the page image after the image is decolored is processed into a binary page image according to a preset binarization threshold, and the verification image after the image is decolored is processed into a binary verification image, namely, the page image after the image is decolored is subjected to binarization processing (namely, image binarization) to be converted into a binary image (namely, a binary page image), and the verification image after the image is decolored is subjected to binarization processing (namely, image binarization) to be converted into a binary image (namely, a binary verification image). For example, as shown in fig. 3, the binary page image may include an operation control a, an operation control b, and an operation control c, where the gray level values of the pixel points corresponding to the three controls in the image are 255, and the gray level value of the pixel point corresponding to the background is 0.
The gray image is an image in which colors are represented by gray scales obtained by dividing the colors into 256 levels in a logarithmic relationship between white and black. The binary image is an image with only two gray levels in the image, that is, the gray level of any pixel in the image is 0 or 255, where 0 represents black and 255 represents white.
In specific implementation, the binarization processing is performed according to a preset binarization threshold, and it can be understood that if the gray value of a pixel point in a page image (or a verification image) after the image is decolored is greater than or equal to the preset binarization threshold, the gray value of the pixel point is binarized to 255, and if the gray value of the pixel point is less than the preset binarization threshold, the gray value of the pixel point is binarized to 0.
Note that all images may be binarized using the same binarization threshold. In addition, the same binarization threshold value can be used for carrying out binarization processing on every two images for carrying out similarity comparison, namely, different binarization threshold values can be used for carrying out binarization processing on each group of comparison images.
Taking the above-mentioned similarity comparison between the page image p1 and the verification image p4 as an example, the page image p1 is subjected to image decoloring to obtain a page image p11 after image decoloring, the verification image p4 is subjected to image decoloring to obtain a verification image p44 after image decoloring, the page image p11 after image decoloring is subjected to binarization processing according to a preset binarization threshold value to obtain a binary page image p111, and the verification image p44 after image decoloring is subjected to binarization processing according to the preset binarization threshold value to obtain a binary verification image p 444.
In practical application, because the sizes of the verification images of the mobile phone screenshots with different resolutions are inconsistent, and in order to verify the expressiveness of the page to be detected (such as a game activity page) at different types of mobile phone terminals, in the embodiment of the application, a binary image is used for carrying out similarity comparison, and because the binary image is used for carrying out similarity comparison, the difference of the image in color can not be considered, for example, the pixel value of a pixel point on the image can be 0x000000(0) or 0xfffff (255), so that the method can accurately verify the similarity of the two images, and can also avoid misjudgment of a UI picture in different terminal (such as a mobile phone) environments due to the obstruction of compression ratios (because the UI compression ratios are different, the clear pictures of the possible pictures are fuzzy, and if the pixels of the two images are single-to-compare, the misjudgment can be caused).
In specific implementation, considering the setting of a binarization threshold, the recognition degree of a binarization image may be affected, an average pixel value of a pixel point in a verification image (correct image) may be used as the binarization threshold, and a grayscale image is binarized by using the correct image as a reference, so that the contrast between the binarized binary images is more accurate.
Determining the total number of pixel points in the verification image and the pixel value of each pixel point;
and calculating the average pixel value of the pixel points in the verification image based on the pixel value and the total number, and taking the average pixel value as the binarization threshold value.
Specifically, the pixel value is a value given by a computer when an image is digitized, and represents average luminance information of a certain small block of an original, or average reflection (transmission) density information of the small block.
In practical application, according to the pixel value of each pixel point, the sum of the pixel values of the pixel points in the verification image can be obtained, and then the sum of the pixel values is divided by the total number of the pixel points, so that the average pixel value of the pixel points in the verification image can be calculated, and the average pixel value is used as a binarization threshold, specifically, the calculation formula for calculating the average pixel value can be expressed as: threshold is a binarization threshold value, Avg is a function of averaging, and pixel1, pixel2 and the like are pixel values of pixel points in the verification image.
For example, the verification image p4 has 5 pixels, and the pixel values of the five pixels are pixel1, pixel2, pixel3, pixel5 and pixel5, respectively, so that the average pixel value of the verification image p4 is (pixel1+ pixel2+ pixel3+ pixel4+ pixel 5)/5. And the calculated average pixel value is used as a binarization threshold value for performing binarization processing on the verification image p4 and the page image p1 corresponding to the verification image p 4.
In summary, the verification image and the page image with the corresponding relationship adopt the pixel average value of the verification image as the binarization threshold, so that the identification degree of the binary image corresponding to the verification image and the page image is improved, and the accuracy of the binary image contrast is improved.
Further, considering that if there is a small amount of difference (for example, a digital anomaly) between two images, it cannot be said that a page image is incorrect, and only when the ratio of the difference is large, it can be determined that the similarity comparison results of the two images are not similar, in an optional implementation manner provided in the embodiment of the present application, the similarity comparison between the binary page image in the page image set and the binary verification image in the verification image set is specifically implemented in the following manner:
determining the pixel corresponding relation between the pixel points in the binary page image and the pixel points in the binary verification image;
based on the pixel correspondence, consistency comparison is carried out on the gray values of the pixel points in the binary page image and the gray values of the pixel points in the binary verification image, and the number of the pixel points with inconsistent comparison is determined;
and calculating the ratio of the number to the total number of the pixel points in the verification image, and determining a similarity contrast result based on the ratio.
Because the page image and the verification image subjected to similarity comparison are images of the same scene page, the verification image and the page image with the corresponding relationship still have the corresponding relationship between the binary images obtained after image processing (after image decoloring and binarization processing), and pixel corresponding relationship also exists between pixel points of the binary images with the corresponding relationship, so that the pixel points with the pixel corresponding relationship in the binary images with the corresponding relationship are further subjected to consistency comparison.
Along with the above example, the gray value of the pixel point a in the binary page image p111 is 0, the gray value of the pixel point aa corresponding to the pixel point a in the binary verification image p444 is 255, and if the consistency comparison result between the two pixel points is inconsistent, the number of the pixel points with inconsistent comparison is increased by one.
Under the condition that consistency comparison between pixel points in the binary page image p111 and pixel points in the binary verification image p444 is completed, the number of pixel points with inconsistent comparison is determined to be 5. Under the condition that the total number of the pixel points in the binary verification image p444 is 100, the ratio of the number of the pixel points with inconsistent contrast to the total number of the pixel points is 5/100-0.05, and under the condition that the preset ratio threshold is 0.06, 0.05 is smaller than 0.06, it is determined that the similarity contrast results of the binary page image p111 and the binary verification image p444 are similar, that is, the similarity contrast results of the page image p1 and the verification image p4 are similar.
Assuming that the similarity contrast results of the page image p2 and the verification image p5 are similar, and the similarity contrast results of the page image p3 and the verification image p6 are also similar, it is determined that the similarity contrast results of the page images in the page image set a and the verification images in the verification image set B are similar.
If any one or more groups of the three groups of similarity comparison results are not similar, the similarity comparison results of the page images in the page image set A and the verification images in the verification image set B are determined to be not similar.
In summary, the binary images corresponding to the page images are compared one by one, the gray value of each pixel point in the binary images corresponding to the verification images is determined, the number of inconsistent pixel points in the two binary images is determined, the accuracy of the binary image comparison is improved, the difference between the images can be accurately calculated according to the ratio of the number of inconsistent pixel points in the images to the total number of the pixel points, and the accuracy of the similarity comparison between the two binary images is further improved.
In practical application, considering that the access experience of a user may be affected and a loss may occur to a target service to which a page to be detected belongs when a detection result is that the detection fails, in order to timely repair a page that fails to be detected after determining the detection result of the page to be detected, in an optional implementation manner provided in the embodiment of the present application, the method may further include:
acquiring contact information of a detection party corresponding to the page to be detected under the condition that the detection result of the page to be detected is determined to be that the detection is failed;
and sending a detection failure notice to the detection party based on the detection result and the contact information.
The detecting party can be understood as a developer or an operation and maintenance person of the page to be detected, and the like, and is not limited herein. Correspondingly, the contact information may be information such as a telephone number, a mailbox, and/or a communication identifier of a communication program. And the detection failure notification is used for notifying the detection party of the detail information of the detection failure. Specifically, the detection failure notification may include: the page identifier of the page to be detected, the page image with inconsistent detection time and similarity contrast result, the verification image and other information are not limited herein.
Along the above example, in the case that the detection result of the active page is determined to be that the detection fails, the mailbox of the developer of the active page is acquired: e1, and generating a detection failure notice based on the detection result, the image with inconsistent similarity contrast result and the detection time, and sending the detection failure notice to the e1 mailbox.
In summary, when it is determined that the detection result of the active page is that the detection fails, a detection failure notification is sent to the detecting party, so that the detecting party can know the details of the failure, and the fast repair of the page with the detection failure is facilitated.
In summary, the detection method provided by the application obtains the predefined operation sequence for the page to be detected, sequentially executes the operation instructions corresponding to the operation position data according to the arrangement sequence of the operation position data in the operation sequence, and then captures the target page after the operation instructions are executed to obtain the page image set to be verified, thereby realizing the simulation operation of the page, capturing the operation result, and further on this basis, by determining the verification image set corresponding to the operation sequence and determining the detection result of the page to be detected based on the verification image set and the page image set, realizing the verification of the correctness of the comparison operation result by the image, namely detecting the page to be detected, avoiding the detection of the page to be detected by consuming manpower, and improving the detection efficiency, and the detection accuracy is improved.
The following description will further describe the detection method with reference to fig. 4 by taking an application of the detection method provided in the present application in an interactive scene as an example. Fig. 4 shows a processing flow chart of a detection method applied in an interactive scene according to an embodiment of the present application, which specifically includes the following steps:
step 402: the client receives an operation sequence predefined by the server for the page to be detected.
The client may be understood as a terminal that needs to perform page detection, and the terminal may be an intelligent terminal such as a mobile phone, a tablet computer, a laptop computer, and a desktop computer, which is not limited herein. The server side can be understood as a detection side.
Specifically, after the server predefines an operation sequence for the page to be detected, the operation sequence is sent to the client, so that the client executes a corresponding operation instruction on the page to be detected based on the operation sequence.
Step 404: the method comprises the steps that a client displays a page to be detected and acquires a predefined operation sequence aiming at the page to be detected under the condition that the target service to which the page to be detected belongs meets a preset detection trigger condition.
Specifically, the page to be detected is an activity page in the game service, and when the game service meets the activity starting time, the activity page is displayed, and an operation sequence S predefined for the activity page is acquired.
The operation sequence includes at least one operation position data, which can also be understood as a screen coordinate or a page coordinate.
Step 406: and the client determines an operation instruction sequence corresponding to each operation position data in the operation sequence.
Specifically, the operation sequence S includes 3 pieces of operation position data, which are the operation position data dd1, the operation position data dd2, and the operation position data dd3, the client determines that the operation instruction sequence corresponding to the operation position data dd1 is os1, the operation instruction sequence corresponding to the operation position data dd2 is os2, and the operation instruction sequence corresponding to the operation position data dd3 is os 3.
Step 408: and the client sequentially executes the operation instructions in the operation instruction sequence corresponding to each operation position data according to the arrangement sequence of the operation position data in the operation sequence, and captures the target page after the operation instructions are executed to obtain a page image set to be verified.
Specifically, the operation instruction sequence os1 corresponding to the operation position data dd1 and the operation instruction sequence os1 include 2 operation instructions, where the two operation instructions are an operation instruction 1 and an operation instruction 2, respectively, where a page after the operation instruction 1 is executed is a target page, a screenshot is performed on the target page after the operation instruction 1 is executed, a page image pp1 to be verified is obtained, and a page image set is formed by the page image pp1 and page images obtained by screenshot of operation results corresponding to other operation position data.
Step 410: and the client sends the operation sequence and the page image set to the server.
Step 412: and determining a corresponding verification image set according to the operation sequence through the server.
Specifically, the server determines a verification image set corresponding to the operation sequence S according to the operation sequence S.
Step 414: and the server side determines the corresponding relation between the verification image in the verification image set and the page image in the page image set according to the operation position data in the operation sequence.
Specifically, the page image set includes 3 page images, which are page image 1, page image 2, and page image 3, respectively. The verification image set includes 3 verification images, which are respectively verification image 1, verification image 2, and verification image 3, and it can be determined that page image 1 and verification image 1 have a correspondence, page image 2 and verification image 2 have a correspondence, and page image 3 and verification image 3 have a correspondence, according to the correspondence between the operation position data dd1 and the two images.
Step 416: and the server side performs image decoloring on the page images in the page image set and the verification images in the verification image set respectively.
Specifically, image decoloring refers to converting a color image into a grayscale image through operation.
Performing image decoloring on 3 page images in the page image set to obtain 3 page images after image decoloring (namely, grayscale images of the 3 page images), wherein the 3 page images after image decoloring are respectively a grayscale page image pp1, a grayscale page image pp2 and a grayscale page image pp3, and performing image decoloring on 3 verification images in the verification image set to obtain 3 verification images after image decoloring (namely, grayscale images of the 3 verification images), and the 3 verification images after image decoloring are respectively a grayscale verification image pp1, a grayscale verification image pp2 and a grayscale verification image pp 3.
Step 418: the service terminal conducts binarization processing on the page image after the image is decolored according to a preset binarization threshold value to obtain a binary page image, and conducts binarization processing on the verification image after the image is decolored according to the preset binarization threshold value to obtain a binary verification image.
Specifically, the binarization processing may be understood as converting a page image after image decoloring and a verification image after image decoloring into a binary image, where the binary image is an image with only two gray levels (for example, 0 or 255) in the image.
Specifically, according to a preset binarization threshold, performing binarization processing on the grayscale image of the 3 page images to obtain 3 binary page images, where the 3 binary page images are respectively: a binary page image ppp1, a binary page image ppp2 and a binary page image ppp3, wherein the binary page image ppp1 is a binarized image of the grayscale image pp1 of the page image 1. And according to a preset binarization threshold value, performing binarization processing on the 3 gray level images of the verification images to obtain 3 binary verification images, wherein the 3 binary verification images are respectively as follows: a binary verification image ppp1, a binary verification image ppp1, and a binary verification image ppp 3.
Step 420: and the server side determines the pixel corresponding relation between the pixel points in the binary page image and the pixel points in the binary verification image according to the corresponding relation.
The server may determine a correspondence between the binary page image and the binary verification image according to the correspondence between the page image and the verification image, for example, the correspondence between the binary page image ppp1 and the binary verification image ppp1 may be determined according to the correspondence between the page image 1 and the verification image 1, and further, the correspondence between the binary page image having the correspondence and the pixel point in the binary verification image may be determined.
Step 422: and the server side performs consistency comparison on the gray values of the pixels in the binary page image and the gray values of the pixels in the binary verification image based on the pixel corresponding relation, and determines the number of the pixels with inconsistent comparison.
Specifically, based on the pixel correspondence, consistency comparison is performed between the gray value of the pixel point in the binary page image and the gray value of the pixel point in the binary verification image, which means consistency comparison is performed between the pixel points having the pixel correspondence in the two images.
Specifically, the binary page image ppp1 and the binary verification image ppp1 have a corresponding relationship, and then a pixel point in the binary page image ppp1 and a pixel point in the binary verification image ppp1 have a pixel corresponding relationship, wherein a pixel point a in the binary page image ppp1 and a pixel point aa in the binary verification image ppp1 have a corresponding relationship, then consistency comparison is performed on the gray value of the pixel point a and the gray value of the pixel point aa, and in the case of inconsistent comparison, the number of the pixel points with inconsistent comparison is increased by one. Under the condition that consistency comparison between the pixel points in the binary page image ppp1 and the pixel points in the binary verification image ppp1 is completed, the number of the pixel points with inconsistent comparison is determined to be 5.
Step 424: and the server calculates the ratio of the number to the total number of the pixel points in the verification image, and determines a similarity comparison result based on the ratio.
Specifically, under the condition that the total number of the pixels in the binary verification image ppp1 is 100, the ratio of the number of the pixels with inconsistent contrast to the total number of the pixels is 5/100-0.05, and under the condition that the preset ratio threshold is 0.06, 0.05 is smaller than 0.06, it is determined that the similarity contrast results of the binary page image ppp1 and the binary verification image ppp1 are similar.
With the same comparison manner as described above, it is determined that the similarity comparison results of the binary page image ppp2 and the binary verification image ppp2 are similar, and the similarity comparison results of the binary page image ppp3 and the binary verification image ppp3 are also similar. And under the condition that the contrast similarity contrast results of the 3 groups of images are similar, determining that the similarity contrast results of the verification images in the verification image set and the page images in the page image set are similar.
And if the similarity contrast results of the 3 groups of images are different from the similarity contrast results of any group of images, determining that the similarity contrast results of the verification images in the verification image set and the page images in the page image set are different.
Step 426: and the server determines the detection result of the page to be detected according to the similarity comparison result.
According to the above example, on the basis of determining that the similarity comparison results of the verification images in the verification image set and the page images in the page image set are similar, determining that the detection result of the page to be detected is a detection pass.
And if the similarity contrast results of the verification images in the verification image set and the page images in the page image set are determined to be dissimilar, determining that the detection result of the page to be detected is that the detection is failed.
Further, acquiring contact information of a detection party corresponding to the page to be detected under the condition that the detection result of the page to be detected is determined to be that the detection is failed; and sending a detection failure notice to the detection party based on the detection result and the contact information.
In summary, the detection method provided by the application obtains the predefined operation sequence for the page to be detected, sequentially executes the operation instructions corresponding to the operation position data according to the arrangement sequence of the operation position data in the operation sequence, and then captures the target page after the operation instructions are executed to obtain the page image set to be verified, thereby realizing the simulation operation of the page, capturing the operation result, and further on this basis, by determining the verification image set corresponding to the operation sequence and determining the detection result of the page to be detected based on the verification image set and the page image set, realizing the verification of the correctness of the comparison operation result by the image, namely detecting the page to be detected, avoiding the detection of the page to be detected by consuming manpower, and improving the detection efficiency, and the detection accuracy is improved.
Fig. 5 shows a processing flow chart of a detection method provided in an embodiment of the present application, which specifically includes the following steps:
step 502: and the server defines monitoring information and sends the monitoring information to the client.
Specifically, the monitoring information may include: a click queue (which may be understood as a form of the operation sequence described above and is composed of a series of screen coordinates, and the monitoring information may further include a detection time, a verification screen shot (which may be understood as a verification image in the above embodiment), and the like, which are not limited herein.
Step 504: when the detection time is up, the client executes the click operation on the page to be detected according to the screen coordinates in the click queue in the monitoring information, and activates the active interfaces needing to be verified by clicking, and captures the screens of the active interfaces to obtain the page image set to be verified.
In practical application, the client sends the obtained page image set to the server, and the server executes the following step 506, or the client may execute the following step 506 if the monitoring information includes the verification screenshot.
Step 506: and carrying out image verification on the page image through a pre-stored verification screen capture to obtain a detection result of the page to be detected.
Step 508: judging whether the detection result is that the detection fails;
if so, indicating that the page to be detected needs to be repaired, executing the following step 510;
if not, the page to be detected runs normally, and no operation is required.
Step 510: and sending an alarm notice to the developer.
Specifically, the purpose of sending the alarm notification to the developer is to: and developers can know the details of detection failure so as to repair the page to be detected as soon as possible.
In summary, according to the detection method provided by the application, the monitoring information is predefined, the click operation is performed on the page to be detected based on the screen coordinates in the click queue in the monitoring information, the operation result is subjected to screen capture, the page image set to be verified is obtained, and the page images in the page image set are verified through the prestored verification screen capture, so that the verification of the correctness of the comparison operation result through the image is realized, namely the page to be detected is detected, the detection of the page to be detected by manpower is avoided, the detection efficiency is improved, and the detection accuracy is improved.
Corresponding to the above method embodiment, the present application further provides an embodiment of a detection apparatus, and fig. 6 shows a schematic structural diagram of the detection apparatus provided in an embodiment of the present application. As shown in fig. 6, the apparatus includes:
an obtaining module 602 configured to obtain an operation sequence predefined for a page to be detected;
the execution module 604 is configured to sequentially execute the operation instructions corresponding to the operation position data according to the arrangement sequence of the operation position data in the operation sequence, and perform screenshot on a target page after the operation instructions are executed to obtain a page image set to be verified;
a determining module 606 configured to determine a verification image set corresponding to the operation sequence, and determine a detection result of the page to be detected based on the verification image set and the page image set.
Optionally, the determining module 606 is further configured to:
a determining structure submodule configured to determine a detection data structure corresponding to the operation sequence;
the extraction sub-module is configured to extract a verification image set formed by verification images corresponding to the operation position data in the operation sequence from the detection data structure;
a relation determining sub-module configured to determine a correspondence between a verification image in the verification image set and a page image in the page image set according to the operation position data;
the comparison sub-module is configured to compare similarity of the verification images in the verification image set and the page images in the page image set based on the corresponding relation;
and the determination result submodule is configured to determine the detection result of the page to be detected according to the similarity comparison result.
Optionally, the comparison sub-module is further configured to:
a decolorizing unit configured to perform image decolorizing on the page images in the page image set and the verification images in the verification image set respectively;
the binarization unit is configured to process the page image after the image is decolored into a binary page image according to a preset binarization threshold value, and process the verification image after the image is decolored into a binary verification image;
a comparison unit configured to compare the similarity between the binary page image corresponding to the page image in the page image set and the binary verification image corresponding to the verification image in the verification image set.
Optionally, the comparison unit is further configured to:
determining the corresponding relation between the pixel points in the binary page image and the pixel points in the binary verification image;
on the basis of the corresponding relation, consistency comparison is carried out on the gray values of the pixel points in the binary page image and the gray values of the pixel points in the binary verification image, and the number of the pixel points with inconsistent comparison is determined;
and calculating the ratio of the number to the total number of the pixel points in the verification image, and determining a similarity contrast result based on the ratio.
Optionally, the binarization threshold is determined by:
determining the total number of pixel points in the verification image and the pixel value of each pixel point;
and calculating the average pixel value of the pixel points in the verification image based on the pixel value and the total number, and taking the average pixel value as the binarization threshold value.
Optionally, the executing module 604 is further configured to:
determining an operation instruction sequence corresponding to each operation position data in the operation sequence;
and sequentially executing the operation instructions in the operation instruction sequence corresponding to each operation position data according to the arrangement sequence of the operation position data in the operation sequence, and performing screenshot on the target page after the operation instructions are executed.
Optionally, the determination result sub-module is further configured to:
acquiring contact information of a detection party corresponding to the page to be detected under the condition that the detection result of the page to be detected is determined to be that the detection is failed;
and sending a detection failure notice to the detection party based on the detection result and the contact information.
Optionally, the detection apparatus further includes:
the data determining module is configured to determine position data of each operation control in the page to be detected;
and the generating module is configured to take the position data as operation position data, splice the operation position data according to a preset operation sequence aiming at the operation control, and generate an operation sequence.
Optionally, the detection apparatus further includes:
and the display module is configured to display the page to be detected under the condition that the target service to which the page to be detected belongs is detected to meet a preset detection trigger condition.
In summary, the detection device provided by the present application obtains the predefined operation sequence for the page to be detected, sequentially executes the operation instructions corresponding to the operation position data according to the arrangement sequence of the operation position data in the operation sequence, and then captures the target page after the operation instructions are executed, to obtain the page image set to be verified, thereby realizing the simulation operation of the page, capturing the operation result, and further on this basis, by determining the verification image set corresponding to the operation sequence, and determining the detection result of the page to be detected based on the verification image set and the page image set, realizing the verification of the correctness of the operation result by comparing the image, that is, detecting the page to be detected, avoiding the detection of the page to be detected by consuming manpower, and improving the detection efficiency, and the detection accuracy is improved.
The above is a schematic scheme of a detection apparatus of the present embodiment. It should be noted that the technical solution of the detection device and the technical solution of the detection method belong to the same concept, and details that are not described in detail in the technical solution of the detection device can be referred to the description of the technical solution of the detection method.
FIG. 7 illustrates a block diagram of a computing device 700 provided in accordance with one embodiment of the present description. The components of the computing device 700 include, but are not limited to, memory 710 and a processor 720. Processor 720 is coupled to memory 710 via bus 730, and database 750 is used to store data.
Computing device 700 also includes access device 740, access device 740 enabling computing device 700 to communicate via one or more networks 760. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 740 may include one or more of any type of network interface, e.g., a Network Interface Card (NIC), wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 700, as well as other components not shown in FIG. 7, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 7 is for purposes of example only and is not limiting as to the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 700 may also be a mobile or stationary server.
Wherein processor 720 is configured to implement the steps of the detection method when executing the computer instructions.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that the technical solution of the computing device and the technical solution of the detection method belong to the same concept, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the detection method.
An embodiment of the present application further provides a computer readable storage medium, which stores computer instructions, and the computer instructions, when executed by a processor, implement the steps of the detection method as described above.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the detection method, and details that are not described in detail in the technical solution of the storage medium can be referred to the description of the technical solution of the detection method.
The foregoing description of specific embodiments of the present application has been presented. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and its practical applications, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.

Claims (12)

1. A method of detection, comprising:
acquiring an operation sequence predefined for a page to be detected;
sequentially executing operation instructions corresponding to the operation position data according to the arrangement sequence of the operation position data in the operation sequence, and performing screenshot on a target page after the operation instructions are executed to obtain a page image set to be verified;
and determining a verification image set corresponding to the operation sequence, and determining a detection result of the page to be detected based on the verification image set and the page image set.
2. The detection method according to claim 1, wherein the determining a verification image set corresponding to the operation sequence and determining a detection result of the page to be detected based on the verification image set and the page image set comprises:
determining a detection data structure corresponding to the operation sequence;
extracting a verification image set formed by verification images corresponding to the operation position data in the operation sequence from the detection data structure;
determining the corresponding relation between the verification images in the verification image set and the page images in the page image set according to the operation position data;
based on the corresponding relation, carrying out similarity comparison on the verification images in the verification image set and the page images in the page image set;
and determining the detection result of the page to be detected according to the similarity comparison result.
3. The detection method according to claim 2, wherein the comparing the similarity between the verification image in the verification image set and the page image in the page image set comprises:
respectively performing image decoloring on the page images in the page image set and the verification images in the verification image set;
processing the page image after image decoloration into a binary page image according to a preset binarization threshold, and processing the verification image after image decoloration into a binary verification image;
and carrying out similarity comparison on the binary page image corresponding to the page image in the page image set and the binary verification image corresponding to the verification image in the verification image set.
4. The detection method according to claim 3, wherein said comparing the similarity of the binary page image in the set of page images with the binary verification image in the set of verification images comprises:
determining the pixel corresponding relation between the pixel points in the binary page image and the pixel points in the binary verification image;
based on the pixel correspondence, consistency comparison is carried out on the gray values of the pixel points in the binary page image and the gray values of the pixel points in the binary verification image, and the number of the pixel points with inconsistent comparison is determined;
and calculating the ratio of the number to the total number of the pixel points in the verification image, and determining a similarity contrast result based on the ratio.
5. The detection method according to claim 3, wherein the binarization threshold is determined by:
determining the total number of pixel points in the verification image and the pixel value of each pixel point;
and calculating the average pixel value of the pixel points in the verification image based on the pixel value and the total number, and taking the average pixel value as the binarization threshold value.
6. The detection method according to any one of claims 1 to 5, wherein the sequentially executing the operation instructions corresponding to the operation position data according to the arrangement order of the operation position data in the operation sequence, and performing screenshot on the target page after the operation instructions are executed includes:
determining an operation instruction sequence corresponding to each operation position data in the operation sequence;
and sequentially executing the operation instructions in the operation instruction sequence corresponding to each operation position data according to the arrangement sequence of the operation position data in the operation sequence, and performing screenshot on the target page after the operation instructions are executed.
7. The detection method according to any one of claims 1 to 5, wherein after determining the detection result of the page to be detected, the method further comprises:
acquiring contact information of a detection party corresponding to the page to be detected under the condition that the detection result of the page to be detected is determined to be that the detection is failed;
and sending a detection failure notice to the detection party based on the detection result and the contact information.
8. The detection method according to any one of claims 1 to 5, wherein before the obtaining of the predefined operation sequence for the page to be detected, the method further comprises:
determining position data of each operation control in the page to be detected;
and taking the position data as operation position data, and splicing the operation position data according to a preset operation sequence aiming at the operation control to generate an operation sequence.
9. The detection method according to any one of claims 1 to 5, wherein before the obtaining of the predefined operation sequence for the page to be detected, the method further comprises:
and displaying the page to be detected under the condition that the target service to which the page to be detected belongs is detected to meet a preset detection trigger condition.
10. A detection device, comprising:
the acquisition module is configured to acquire an operation sequence predefined for the page to be detected;
the execution module is configured to sequentially execute the operation instructions corresponding to the operation position data according to the arrangement sequence of the operation position data in the operation sequence, and perform screenshot on a target page after the operation instructions are executed to obtain a page image set to be verified;
the determining module is configured to determine a verification image set corresponding to the operation sequence, and determine a detection result of the page to be detected based on the verification image set and the page image set.
11. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 1-9 when executing the computer instructions.
12. A computer-readable storage medium storing computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1 to 9.
CN202110873867.8A 2021-07-30 2021-07-30 Detection method and device Pending CN113538629A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110873867.8A CN113538629A (en) 2021-07-30 2021-07-30 Detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110873867.8A CN113538629A (en) 2021-07-30 2021-07-30 Detection method and device

Publications (1)

Publication Number Publication Date
CN113538629A true CN113538629A (en) 2021-10-22

Family

ID=78089923

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110873867.8A Pending CN113538629A (en) 2021-07-30 2021-07-30 Detection method and device

Country Status (1)

Country Link
CN (1) CN113538629A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114124564A (en) * 2021-12-03 2022-03-01 北京天融信网络安全技术有限公司 Counterfeit website detection method and device, electronic equipment and storage medium
CN114640507A (en) * 2022-02-28 2022-06-17 天翼安全科技有限公司 WebShell detection method and device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077119A (en) * 2013-03-29 2014-10-01 阿里巴巴集团控股有限公司 Page comparing method and page comparing device
CN109446095A (en) * 2018-11-07 2019-03-08 北京奇艺世纪科技有限公司 A kind of test method, device and the electronic equipment of page presentation speed
CN109634788A (en) * 2017-10-09 2019-04-16 阿里巴巴集团控股有限公司 A kind of terminal adaptation verification method and system, terminal
CN112446850A (en) * 2019-08-14 2021-03-05 阿里巴巴集团控股有限公司 Adaptation test method and device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077119A (en) * 2013-03-29 2014-10-01 阿里巴巴集团控股有限公司 Page comparing method and page comparing device
CN109634788A (en) * 2017-10-09 2019-04-16 阿里巴巴集团控股有限公司 A kind of terminal adaptation verification method and system, terminal
CN109446095A (en) * 2018-11-07 2019-03-08 北京奇艺世纪科技有限公司 A kind of test method, device and the electronic equipment of page presentation speed
CN112446850A (en) * 2019-08-14 2021-03-05 阿里巴巴集团控股有限公司 Adaptation test method and device and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114124564A (en) * 2021-12-03 2022-03-01 北京天融信网络安全技术有限公司 Counterfeit website detection method and device, electronic equipment and storage medium
CN114124564B (en) * 2021-12-03 2023-11-28 北京天融信网络安全技术有限公司 Method and device for detecting counterfeit website, electronic equipment and storage medium
CN114640507A (en) * 2022-02-28 2022-06-17 天翼安全科技有限公司 WebShell detection method and device and storage medium
CN114640507B (en) * 2022-02-28 2024-03-12 天翼安全科技有限公司 WebShell detection method, webShell detection device and storage medium

Similar Documents

Publication Publication Date Title
US10997752B1 (en) Utilizing a colorization neural network to generate colorized images based on interactive color edges
CN111598164B (en) Method, device, electronic equipment and storage medium for identifying attribute of target object
CN108307021B (en) Parallel following test equipment, cloud real machine and method for mobile terminal
WO2020041399A1 (en) Image processing method and apparatus
CN113538629A (en) Detection method and device
CN109800153A (en) Mobile application test method and device, electronic equipment, storage medium
CN114331829A (en) Countermeasure sample generation method, device, equipment and readable storage medium
CN109784369A (en) H5 page test method and device, electronic equipment, storage medium
CN111985281B (en) Image generation model generation method and device and image generation method and device
CN111931719B (en) High-altitude parabolic detection method and device
CN111225299A (en) ONU (optical network Unit) fault identification and repair method and device
CN115269359A (en) Terminal interface testing method and device
CN110955891A (en) File detection method, device and system and data processing method
CN111949517A (en) Remote real machine testing method and device and electronic equipment
CN105678301A (en) Method, system and device for automatically identifying and segmenting text image
CN113342627B (en) Application service monitoring method and monitoring system of terminal
CN108108299B (en) User interface testing method and device
CN108401106B (en) Shooting parameter optimization method and device, terminal and storage medium
CN111277724B (en) Detection method and device for abnormal operation application, electronic equipment and storage medium
CN116229188B (en) Image processing display method, classification model generation method and equipment thereof
CN113283388A (en) Training method, device and equipment of living human face detection model and storage medium
CN113468066A (en) User interface testing method and device
CN112597828A (en) Training method and device of webpage recognition model and webpage recognition method
CN112749769A (en) Graphic code detection method and device, computer equipment and storage medium
CN115934179B (en) Service function control method and equipment

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