Detection Method and Device
The automated detection method using pre-defined operation sequences for page monitoring addresses the inefficiencies of manual labor in existing methods, enhancing detection efficiency and accuracy by comparing captured page images to verify correctness.
Patent Information
- Application Number
- CN202110873867.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-30
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-07-30
AI Technical Summary
The monitoring of online activities in the prior art relies on manual detection, which leads to high human resources consumption and prone to deviations in the detection results.
Simulate the page to be detected through a predefined operation sequence, obtain the page image collection, and determine the detection results through image comparison to achieve automated detection.
It reduces human resource consumption, improves detection efficiency and accuracy, and realizes automatic monitoring around the clock.
Smart Images

Figure CN113538629B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and particularly to a detection method. This application also relates to a detection device, a computing device, and a computer-readable storage medium. Background Art
[0002] With the development of the Internet, online activities usually play a crucial role in business. The running time of online activities is usually not fixed and is set by the business party initiating the activity. For example, an online activity can be set to run throughout the day or within a preset time interval. In the prior art, monitoring whether these activities are normally started, whether the page display is correct, or whether the processing flow is correct is often achieved through manual monitoring, which thus consumes a large amount of human resources. Summary of the Invention
[0003] In view of this, embodiments of this application provide a detection method. This application also relates to a detection device, a computing device, and a computer-readable storage medium to solve the defect of large consumption of human resources in the prior art.
[0004] According to the first aspect of the embodiments of this application, a detection method is provided, including:
[0005] Obtaining an operation sequence predefined for a page to be detected;
[0006] Sequentially executing operation instructions corresponding to the operation position data in the operation sequence according to the arrangement order of the operation position data, and taking a screenshot of the target page after executing the operation instructions to obtain a set of page images to be verified;
[0007] Determining a set of verification images corresponding to the operation sequence, and determining a detection result of the page to be detected based on the set of verification images and the set of page images.
[0008] According to the second aspect of the embodiments of this application, a detection device is provided, including:
[0009] An obtaining module, configured to obtain an operation sequence predefined for a page to be detected;
[0010] An execution module, configured to sequentially execute operation instructions corresponding to the operation position data in the operation sequence according to the arrangement order of the operation position data, and take a screenshot of the target page after executing the operation instructions to obtain a set of page images to be verified;
[0011] A determining module, configured to determine a set of verification images corresponding to the operation sequence, and determine a detection result of the page to be detected based on the set of verification images and the set of page images.
[0012] According to a third aspect of the embodiments of the present application, a computing device is provided, including a memory, a processor, and computer instructions stored on the memory and executable on the processor. When the processor executes the computer instructions, the steps of the detection method are implemented.
[0013] According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, which stores computer instructions. When the computer instructions are executed by a processor, the steps of the detection method are implemented.
[0014] The detection method provided by the present application obtains a pre-defined operation sequence for the page to be detected, sequentially executes the operation instructions corresponding to the operation position data according to the arrangement order of the operation position data in the operation sequence, then takes a screenshot of the target page after executing the operation instructions to obtain a set of page images to be verified, realizes the simulation operation of the page, takes a screenshot of the operation result, and on this basis, determines the verification image set corresponding to the operation sequence, and realizes determining the detection result of the page to be detected based on the verification image set and the set of page images, thereby achieving verifying the correctness of the operation result through image comparison, that is, detecting the page to be detected, avoiding consuming human resources to detect the page to be detected, and effectively improving the detection efficiency and the accuracy of the detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 is a flowchart of a detection method provided by an embodiment of the present application;
[0016] Figure 2 is a schematic diagram of a page image after color removal in a detection method provided by an embodiment of the present application;
[0017] Figure 3 is a schematic diagram of a binary page image in a detection method provided by an embodiment of the present application;
[0018] Figure 4 is a processing flowchart of a detection method applied to an interaction scenario provided by an embodiment of the present application;
[0019] Figure 5 is a simple flowchart of a detection method applied to an interaction scenario provided by an embodiment of the present application;
[0020] Figure 6 is a schematic structural diagram of a detection device provided by an embodiment of the present application;
[0021] Figure 7 is a structural block diagram of a computing device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0022] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the present application. Therefore, the present application is not limited by the specific implementations disclosed below.
[0023] The terms used in one or more embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the", and "said" used in one or more embodiments of the present application and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" 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.
[0024] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".
[0025] First, the noun terms related to one or more embodiments of the present application are explained.
[0026] Image Binarization is the process of setting the grayscale value of the pixel points on the image to 0 or 255, that is, presenting the entire image with an obvious black-and-white effect.
[0027] In the present application, a detection method is provided. The present application is also related to a detection device, a computing device, and a computer-readable storage medium, which will be described in detail one by one in the following embodiments.
[0028] In practical applications, detecting a page manually not only consumes labor costs, but also the detection results are prone to deviation. In the embodiments of the present application, by pre-defining an operation sequence, simulating operations on the page to be detected, and then verifying the operation results, the effect of automatic monitoring can be achieved, that is, 24-hour monitoring can be realized without human participation, which not only saves costs for the company, but also is more accurate in detecting operation results by computer compared to detecting operation results manually.
[0029] Figure 1 The figure shows a flowchart of a detection method provided according to an embodiment of the present application, specifically including the following steps:
[0030] Step 102: Obtain an operation sequence predefined for the page to be detected.
[0031] Among them, the page to be detected can be any page opened in any application program or any web page opened through a terminal, without limitation here. The operation sequence can be understood as a data set composed of operation position data with an operation order.
[0032] In specific implementation, there are various methods to obtain the operation sequence. For example, the corresponding relationship between the page identifier and the operation sequence can be preset in advance, 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 the preset operation sequence library. Or the corresponding relationship between the detection time and the operation sequence can be preset in advance, and according to the detection time of the page to be detected, the operation sequence corresponding to this detection time is obtained; in practical applications, the method for obtaining the operation sequence can be selected according to requirements, and this embodiment does not make a limitation here.
[0033] By obtaining the predefined operation sequence, the execution positions corresponding to the operation instructions to be executed can be clarified, so as to further execute the operation instructions, thereby realizing the automated operation of the page to be detected and detecting the operation results.
[0034] In specific implementation, in order to improve the accuracy of the operation detection of the page to be detected and realize the operation detection according to a specific detection process or detection order, before obtaining the operation sequence, an operation sequence can be generated according to the preset operation order for the operation control (i.e., the preset operation order) to improve the detection accuracy and detection efficiency and realize the subsequent processing of the operation detection based on the operation sequence. In an optional implementation manner provided by the embodiment of the present application, before obtaining the operation sequence predefined for the page to be detected, it further includes:
[0035] Determine the position data of each operation control in the page to be detected;
[0036] Use the position data as operation position data, and splice each operation position data according to the preset operation order for the operation control to generate an operation sequence.
[0037] Among them, the operation control can be understood as a control that can be operated, such as a selection control, an input control, a dropdown control, etc., without limitation here.
[0038] In practical applications, since the operation controls in the page to be detected are limited and their positions are relatively fixed, when performing operation inspection on the page to be detected, the position data of the operation controls that can be operated in the page to be detected can be determined first (such as page coordinates {x: 100, y: 300}, or screen coordinates {x: 300, y: 350}, etc.), and then these position data are used as operation position data, indicating that the operation controls will be operated according to the operation position data, and the respective operation position data are concatenated according to the preset operation sequence for the operation controls (such as the operation sequence from front to back) to generate an operation sequence.
[0039] Specifically, the preset operation sequence can be understood as the sequence of operations for operating the operation controls set in advance. On the basis of presetting the preset operation sequence, the respective position operation data are concatenated according to the preset operation sequence to generate an operation sequence. Specifically, there are various ways to concatenate the respective position operation data. For example, the respective position operation data can be concatenated with a comma as the separator, or the respective position operation data can be concatenated with separators such as a semicolon, a colon, or a space, which is not limited herein.
[0040] For example, the page to be detected includes 3 operation controls, which are operation control a, operation control b, and operation control c respectively. The operation position data of these three operation controls are d1, d2, and d3 respectively. The preset operation sequence for these three operation controls is determined as follows: first operate operation control c, then operate operation control b, and finally operate operation control a; at this time, according to the preset operation sequence, the operation position data of these 3 operation controls are concatenated with a comma as the separator, and the generated operation sequence is specifically: (d3, d2, d1).
[0041] In summary, by generating an operation sequence through the position data of each operation space in the page to be detected and the preset operation sequence, the accuracy of performing operations based on the operation sequence can be improved, and further the accuracy of detecting the page to be detected can be improved.
[0042] In practical applications, considering that detecting the page to be detected at all times will result in waste of computing resources, before obtaining the pre-defined operation sequence for the page to be detected, by presetting a detection trigger condition (i.e., a preset detection trigger condition), when the preset detection trigger condition is satisfied, the page to be detected is detected again to improve the flexibility of detection. In an optional implementation manner provided by the embodiments of the present application, before obtaining the pre-defined operation sequence for the page to be detected, it further includes:
[0043] When it is detected that the target service to which the page to be detected belongs satisfies the preset detection trigger condition, the page to be detected is displayed.
[0044] Among them, the target service can be a game service, an e-commerce service, a video service, a forum service, etc., without limitation here. In practical applications, function updates, page updates, or online activities may be carried out in these services. In order to ensure the stability of these updates or activities, improve the user's access experience, and increase user stickiness, it is necessary to monitor these updates or activities to determine whether they are running normally.
[0045] The preset detection trigger condition refers to the condition set in advance to trigger the detection of the page to be detected; specifically, time can be used as the preset detection trigger condition. For example, 2021 / 05 / 02 19:25 can be used as the preset detection trigger condition, or receiving a detection instruction can be used as the preset detection trigger condition, etc., without limitation here.
[0046] For example: The page to be detected is the activity page of an online game activity in the game service. The start time of this online game activity is 2021 / 05 / 02 19:25. Then set this start time as the preset detection trigger condition. When it is detected that the time reaches 2021 / 05 / 02 19:25, display this activity page and perform the detection of this activity page.
[0047] In practical applications, after displaying the page to be detected, it is also possible to directly take a screenshot of the page to be detected to verify whether the page to be detected is running normally before the operation.
[0048] It should be noted that the execution order of obtaining the operation sequence steps for the page to be detected and the step of displaying the page to be detected can be swapped, and swapping the execution order does not affect the implementation effect of this embodiment.
[0049] In summary, when it is detected that the target service to which the page to be detected belongs meets the preset detection trigger condition, then detect the page to be detected, which can achieve accurate detection of the things to be detected in the page to be detected.
[0050] Step 104: Execute the operation instructions corresponding to the operation position data in the order of arrangement of the operation position data in the operation sequence, and take a screenshot of the target page after executing the operation instructions to obtain a set of page images to be verified.
[0051] Based on the above 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, it is necessary to sequentially execute the operation instructions corresponding to the operation position data according to this arrangement order. Additionally, considering that it is not necessary to take screenshots for verification of the page after each execution of the operation instruction, screenshots can be taken only for the page (i.e., the target page) after executing certain specific operations (such as click operations), or for certain specific pages (i.e., the target pages) after executing the operation instructions, to obtain a set of page images to be verified, without any restrictions here.
[0052] Among them, the operation instruction corresponding to the operation position data can be understood as an instruction to operate on the position pointed to by the operation position data. In addition, the operation instruction can also carry its own operation position data, without any restrictions here. In specific implementation, the operation position data can be used as a parameter of the operation instruction, or it can be understood that first, the operation position is located according to the operation position data, and then the corresponding operation instruction is executed at this operation position.
[0053] Furthermore, taking a screenshot of the target page after executing the operation instruction can be to take a screenshot of a specific position in the target page, or to take a screenshot of the entire target page, without any restrictions here.
[0054] In specific implementation, in order to avoid verifying the page to be detected on the basis of manual operations on the page to be detected, on the basis of pre-defining the operation sequence, the operation instructions corresponding to the operation sequence can also be pre-defined. This operation instruction can be a kernel command. Then, by calling and executing this operation instruction, manual simulation operations on the page can be achieved. For example, the command corresponding to the screenshot operation is: adb shell / system / bin / screencap -p / sdcard / $screenfilename; the command corresponding to the input operation is: adb shell input keyevent 4.
[0055] Continuing with the above example, the predefined operation sequence for the activity page is obtained as: (d3, d2, d1). Assuming that the operation instruction corresponding to the operation position data d1 is a click instruction, the operation instruction corresponding to the operation position data d2 is an input instruction, and the operation instruction corresponding to the operation position data d3 is a click instruction. Then, in accordance with the sorting order of the operation position data in the operation sequence, first execute the click instruction on the position indicated by the operation position data d3, and take a screenshot of the page after executing the click instruction to obtain the page image p1; then execute the input instruction on the position indicated by the operation position data d2, and take a screenshot of the page after executing the input instruction to obtain the page image p2; finally, execute the click instruction on the position indicated by the operation position data d1, and take a screenshot of the page after executing the click instruction to obtain the page image p3. The page images p1, p2, and p3 form the set A of page images to be verified.
[0056] Furthermore, since there is more than one operation instruction corresponding to each operation position data, and these operation instructions for the same position also have an order of operation, in order to execute these operation instructions in an orderly manner, the operation instructions corresponding to each operation position data can be formed into an operation sequence, and the operation instructions in the operation sequence are pointed to in turn. In an optional implementation manner provided by the embodiments of the present application, the following specific method is adopted for implementation:
[0057] Determine the operation instruction sequence corresponding to each operation position data in the operation sequence;
[0058] In accordance with the arrangement order of the operation position data in the operation sequence, sequentially execute the operation instructions in the operation instruction sequence corresponding to each operation position data, and take a screenshot of the target page after executing the operation instruction.
[0059] Among them, the operation instruction sequence can be understood as a set of operation instructions with an operation order. Specifically, when implementing, the operation position of the first operation instruction in the operation instruction sequence is the position pointed to by the operation position data in the operation sequence; and if the other operation instructions in the operation instruction sequence do not carry operation position data, it is defaulted that the operation instruction is still executed at this position, and if the other operation instructions in the operation instruction sequence carry operation position data, the corresponding operation instruction is executed at the position pointed to by the operation position data they carry.
[0060] For example, the operation instruction sequence corresponding to the operation position data d4 includes three operation instructions, namely click instruction 1 (the operation position data of this operation instruction is d4), input instruction, and click instruction 2 (these two instructions carry their own operation position data). If the page after executing click instruction 3 is preset as the target page in advance, then execute operation instruction 1 at the position pointed to by the operation position data d4, enter page 2 after executing operation instruction 1, and execute the input instruction at the position in page 2 pointed to by the operation position data carried in the input instruction, where the character input by the input instruction is the preset character. Finally, execute click instruction 3 at the position pointed to by the operation position data carried in operation instruction 3, and take a screenshot of the target page after executing click instruction 3.
[0061] In summary, when it is detected that the target service to which the page to be detected belongs meets the preset detection trigger condition, then detecting the page to be detected can accurately detect events, activities, functions, etc. that need to be triggered under the detection trigger condition in the page to be detected.
[0062] Step 106: Determine the verification image set corresponding to the operation sequence, and determine the detection result of the page to be detected based on the verification image set and the page image set.
[0063] Based on the above-mentioned screenshot of the target page to obtain the page image set to be verified, verifying the page image set obtained by the screenshot through the verification image set corresponding to the operation sequence can determine the detection result of the page to be detected.
[0064] Among them, the verification image set can be understood as the image set obtained by taking a screenshot of the target page in advance when the target page is displayed correctly, that is, the image set composed of correct images. In specific implementation, a correspondence relationship can be established in advance between the sequence identifier of the operation sequence (such as sequence name or sequence number, etc.) and the set identifier of the verification image set (such as set name or set number, etc.), so as to determine the corresponding verification image set according to the sequence identifier of the operation sequence obtained above.
[0065] Before determining the detection result of the page to be detected, in order to accurately complete the detection and processing operation of the page, the correspondence relationship between the verification images in the verification image set and the page images in the page image set can be determined first, so as to achieve the purpose of determining the detection result of the page to be detected by comparing the images in the two sets one by one according to the image order in the set based on this correspondence relationship.
[0066] Further, since both the page images in the page image set and the verification images in the verification set have a corresponding relationship with the position operation data, for the convenience of verifying the page images, a corresponding relationship between the page images and the verification images can also be established based on the position operation data, and on the basis of this corresponding relationship, verify the page images to determine the detection result of the page to be detected. In an optional implementation manner provided by the embodiments of the present application, the following specific method is adopted for implementation:
[0067] Determine the detection data structure corresponding to the operation sequence;
[0068] Extract from the detection data structure a verification image set composed of verification images corresponding to the operation position data in the operation sequence;
[0069] According to the operation position data, determine the corresponding relationship between the verification images in the verification image set and the page images in the page image set;
[0070] Based on the corresponding relationship, compare the similarity between the verification images in the verification image set and the page images in the page image set;
[0071] According to the similarity comparison result, determine the detection result of the page to be detected.
[0072] Among them, this detection data structure can be understood as a data structure preset to include verification images of the page to be detected. Specifically, this detection data structure can be a structure of operation sequence + screenshot. Among them, the operation position data in the operation sequence can form a linked list structure with the verification images in the verification image set.
[0073] Specifically, the first data of this linked list structure is the first operation position data in the operation sequence. After the first operation position data in the operation sequence, link the verification image of the screenshot after executing the operation instruction according to this operation position data. After this verification image, link the second operation position data, and after the second operation position data, link the verification image of the screenshot after executing the operation instruction according to this operation position data, and so on, to form a linked list structure.
[0074] In practical applications, for page images, a linked list structure the same as the detection data structure can also be formed based on the same linking method. Since this linked list structure is the same storage structure as the linked list structure of the above verification images, based on the operation position data in this storage structure, the corresponding relationship between the verification images and the page images can be determined.
[0075] In addition, in the process of determining the correspondence between the verification image and the page image, in addition to the above-mentioned determination method, other determination methods can also be adopted. For example, since the page images in the page image set are captured in the operation order, the verification images in the verification image set can also be obtained in the same order. Then, based on the sorting order of the page images in the page image set and the verification images in the verification image set, the correspondence between the two can be determined. Or, each page image in the page image set and its corresponding verification image in the verification image can be named in the same way (such as the way of the same prefix). Then, based on their names, the correspondence between the page images in the page image set and the verification images in the verification image set can be determined.
[0076] After determining the correspondence between the verification image and the page image, the similarity comparison can be carried out on the verification image and the page image with the corresponding relationship. Specifically, if the similarity comparison results between each group of images with the corresponding relationship are all similar, it is determined that the detection result of the page to be detected is passed. If the similarity comparison result between any group of images with the corresponding relationship is dissimilar, it is determined that the detection result of the page to be detected is not passed.
[0077] Specifically, there are various ways to compare the similarity of two images. For example, the image features of the two images can be extracted respectively through a deep learning algorithm, and then the extracted image features can be compared for similarity. Or, the pixel points at the preset positions can be selected from each image respectively, and the pixel values of the pixel points at the preset positions can be compared for similarity, etc. There is no limitation here.
[0078] Continuing with the above example, on the basis of determining that the detection data structure corresponding to the operation sequence is [operation position data d1, verification image p4; operation position data d2, verification image p5; operation position data d3, verification image p6], extract the verification images p4, verification image p5, and verification image p6 corresponding to the operation position data from this detection data structure to form a verification image set B. Among them, verification image p4 corresponds to operation position data d3, verification image p5 corresponds to operation position data d2, and verification image p6 corresponds to operation position data d1; while page image p1 corresponds to operation position data d3, page image p2 corresponds to operation position data d2, and page image p4 corresponds to operation position data d1. Based on this, it can be determined that page image p1 corresponds to verification image p4, page image p2 corresponds to verification image p5, and page image p3 corresponds to verification image p6. Then, compare the similarity between page image p1 and verification image p4, compare the similarity between page image p2 and verification image p5, and compare the similarity between page image p3 and verification image p6. And when the result of each similarity comparison is similar, determine that the detection result of the page to be detected is passed.
[0079] In summary, by means of the pre-defined detection data structure, extracting the verification image set and determining the corresponding relationship between the verification images in the verification image set and the page images in the page image set improves the efficiency of determining this corresponding relationship and indirectly improves the comparison efficiency of comparing the similarity of the images with the corresponding relationship.
[0080] Furthermore, since the terminal for intercepting the verification image and the terminal for intercepting the page image may be different, and each time the terminal for intercepting the page image may also be different, and the difference in terminals is reflected in the differences in the types, models, or configurations of the terminals. Based on this, the compression ratios of the pages by different terminals are different, and thus the compression ratios of the page images obtained by screenshot are also different. In order to perform similarity comparison on page images with different compression ratios in the same way and ensure the accuracy of the similarity comparison, to achieve the similarity comparison between the verification images in the verification image set and the page images in the page image set, in an optional implementation manner provided by the embodiments of the present application, the following specific method is adopted for implementation:
[0081] Perform image decolorization on the page images in the page image set and the verification images in the verification image set respectively;
[0082] Process the page image after image decolorization into a binary page image according to a preset binary threshold, and process the verification image after image decolorization into a binary verification image;
[0083] Compare the binary page images corresponding to the page images in the page image set with the binary verification images corresponding to the verification images in the verification image set.
[0084] Among them, image desaturation means converting a color image into a grayscale image through operations. Therefore, the page image after image desaturation obtained by desaturating the page image is the grayscale image of the page image. Similarly, the verification image after image desaturation obtained by desaturating the verification image is the grayscale image of the verification image. For example, the page image after image desaturation can be as Figure 2 shown. This image includes operation control a, operation control b, operation control c, and the background. The pixel points in these page elements can present different grayscale values.
[0085] In specific implementation, processing the page image after image desaturation into a binary page image according to a preset binarization threshold, and processing the verification image after image desaturation into a binary verification image means performing binarization processing (i.e., image binarization) on the page image after image desaturation to convert it into a binary image (i.e., binary page image), and performing binarization processing (i.e., image binarization) on the verification image after image desaturation to convert it into a binary image (i.e., binary verification image). For example, the binary page image can be as Figure 3 shown. This image includes operation control a, operation control b, and operation control c. The grayscale values of the pixel points corresponding to these three controls in this image are 255, and the grayscale value of the pixel points corresponding to the background is 0.
[0086] Among them, a grayscale image is an image that represents colors using 256 levels of grayscale divided logarithmically between white and black. A binary image refers to an image in which there are only two grayscale levels, that is, the grayscale value of any pixel point in the image is either 0 or 255, where 0 represents black and 255 represents white.
[0087] In specific implementation, performing binarization processing according to a preset binarization threshold can be understood as follows: if the grayscale value of a pixel point in the page image (or verification image) after image desaturation is greater than or equal to the preset binarization threshold, then binarize the grayscale value of this pixel point to 255; if the grayscale value of the pixel point is less than the preset binarization threshold, then binarize the grayscale value of this pixel point to 0.
[0088] It should be noted that all images can be binarized using the same binarization threshold. In addition, it is also possible to use the same binarization threshold for binarizing every two images for similarity comparison, that is, each group of comparison images can use different binarization thresholds for binarization processing.
[0089] Taking the similarity comparison between the page image p1 and the verification image p4 as an example above, the page image p1 is decolorized to obtain the page image p11 after image decolorization, and the verification image p4 is decolorized to obtain the verification image p44 after image decolorization. Then, according to the preset binarization threshold, the page image p11 after image decolorization is binarized to obtain the binary page image p111, and according to the preset binarization threshold, the verification image p44 after image decolorization is binarized to obtain the binary verification image p444.
[0090] In practical applications, since the sizes of verification images of mobile phone screenshots with different resolutions are inconsistent, in order to verify the performance of the page to be detected (such as a game activity page) on different types of mobile devices, in the embodiments of the present application, binary images are used for similarity comparison. Since similarity comparison of binary images can ignore the color differences in the images, for example, the pixel values of pixel points in the image can be 0x000000 (0) or 0xffffff (255), this method can more accurately verify the similarity of two images and avoid misjudgment caused by different compression ratios of UI images in different terminal (such as mobile phone) environments (because different UI compression ratios may result in some clear and some blurred images, and misjudgment may occur if only the pixels of two images are compared).
[0091] Specifically, considering that the setting of the binarization threshold will affect the recognition of the binarized image, the average pixel value of the pixel points in the verification image (correct image) can be used as the binarization threshold, and the grayscale image is binarized based on the correct image as the reference to make the comparison between the binarized images more accurate. In an optional implementation manner provided by the embodiments of the present application, the binarization threshold is determined by the following method:
[0092] Determine the total number of pixel points in the verification image and the pixel value of each pixel point;
[0093] Based on the pixel value and the total number, calculate the average pixel value of the pixel points in the verification image, and use the average pixel value as the binarization threshold.
[0094] Specifically, the pixel value is the value assigned by the computer when the image is digitized, which represents the average brightness information of a small square of the original manuscript, or the average reflection (transmission) density information of the small square.
[0095] In practical applications, according to the pixel values of each pixel, the sum of the pixel values of the pixels in the verification image can be obtained. Then, dividing the sum of the pixel values by the total number of pixels can calculate the average pixel value of the pixels in the verification image, and this average pixel value is used as the binarization threshold. Specifically, the calculation formula for calculating the average pixel value can be expressed as: Thresold = Avg(pixel1 + pixel2…), where Thresold is the binarization threshold, Avg is the function for calculating the average value, and pixel1, pixedl2, etc. are the pixel values of the pixels in the verification image.
[0096] For example, verification image p4 has 5 pixels, and the pixel values of these five pixels are pixel1, pixel2, pixed3, pixel4, and pixed5 respectively. Then the average pixel value of verification image p4 is (pixel1 + pixel2 + pixel3 + pixel4 + pixel5) / 5. And the calculated average pixel value is used as the binarization threshold for binarizing the verification image p4 and the page image p1 corresponding to the verification image p4.
[0097] In summary, by using the average pixel value of the verification image as the binarization threshold for the verification image and the page image with a corresponding relationship, the recognition rate of the corresponding binary images of the two is improved, and the accuracy of binary image comparison is also improved.
[0098] Furthermore, considering that if there are a small number of differences (such as digital anomalies) between two images, it cannot be stated that the page image is incorrect. Only when the proportion of the differences is relatively large can it be determined that the similarity comparison result of the two images is dissimilar. In an optional implementation manner provided by the embodiments of the present application, when comparing the similarity between the binary page images in the page image set and the binary verification images in the verification image set, the following specific method is adopted for implementation:
[0099] Determine the pixel correspondence between the pixels in the binary page image and the pixels in the binary verification image;
[0100] Based on the pixel correspondence, compare the gray values of the pixels in the binary page image with the gray values of the pixels in the binary verification image to determine the number of pixels with inconsistent comparison;
[0101] Calculate the ratio of the number to the total number of pixels in the verification image, and determine the similarity comparison result based on the ratio.
[0102] Since the page image and the verification image for similarity comparison are images of the same scene page, the verification image and the page image with a corresponding relationship still have a corresponding relationship between the binary images obtained after image processing (after image desaturation and binarization processing), and there is also a pixel correspondence between the pixel points of the binary images with a corresponding relationship. Then, the pixel points with a pixel correspondence in the binary images with a corresponding relationship are further compared for consistency.
[0103] Continuing with the above example, the grayscale value of pixel point a in the binary page image p111 is 0, while the grayscale value of pixel point aa corresponding to pixel point a in the binary verification image p444 is 255. The consistency comparison result between these two pixel points is inconsistent, so the number of pixel points with inconsistent comparison is incremented by one.
[0104] Assume that when the consistency comparison of the pixel points in the binary page image p111 and the pixel points in the binary verification image p444 is completed, the number of pixel points with inconsistent comparison is determined to be 5. When the total number of pixel points in the binary verification image p444 is 100, the ratio of the number of pixel points with inconsistent comparison to the total number of pixel points is 5 / 100 = 0.05. And when the preset ratio threshold is 0.06, since 0.05 is less than 0.06, it is determined that the similarity comparison result of the binary page image p111 and the binary verification image p444 is similar, that is, the similarity comparison result of the page image p1 and the verification image p4 is similar.
[0105] Assume that the similarity comparison result of the page image p2 and the verification image p5 is similar, and the similarity comparison result of the page image p3 and the verification image p6 is also similar. Then, it is determined that the similarity comparison result of the page images in the page image set A and the verification images in the verification image set B is similar.
[0106] Assume that in the case where any one or more of the above three groups of similarity comparison results are dissimilar, it is determined that the similarity comparison result of the page images in the page image set A and the verification images in the verification image set B is dissimilar.
[0107] In summary, by comparing the grayscale values of each pixel point in the binary image corresponding to the page image and the binary image corresponding to the verification image one by one, the number of pixel points inconsistent in the two binary images is determined, which improves the accuracy of binary image comparison. And through the ratio of the number of inconsistent pixel points in the image to the total number of pixels, the difference between the images can be accurately calculated, and further improves the accuracy of similarity comparison between the two binary images.
[0108] In practical applications, considering that when the detection result is a failure, it will affect the user's access experience and may cause losses to the target service to which the page to be detected belongs. Therefore, after determining the detection result of the page to be detected, in order to promptly repair the page with a detection failure, in an optional implementation provided by the embodiments of the present application, the following can also be done:
[0109] When it is determined that the detection result of the page to be detected is a failure, obtain the contact information of the detector corresponding to the page to be detected;
[0110] Based on the detection result and the contact information, send a detection failure notice to the detector.
[0111] Among them, the detector can be understood as a developer or an operation and maintenance personnel of the page to be detected, etc., which is not limited here. Correspondingly, the contact information can be telephone numbers, email addresses, and / or communication identifiers of communication programs, etc. The detection failure notice is used to notify the detector of the detailed information of the detection failure. Specifically, the detection failure notice may include: page identifier of the page to be detected, detection time, page images with inconsistent similarity comparison results, and verification images, etc., which is not limited here.
[0112] Continuing with the above example, when it is determined that the detection result of the activity page is a failure, obtain the email address e1 of the developer of the activity page, and generate a detection failure notice based on the detection result, the images with inconsistent similarity comparison results, and the detection time, and send the detection failure notice to the email address e1.
[0113] In summary, when it is determined that the detection result of the activity page is a failure, sending a detection failure notice to the detector can enable the detector to understand the details of the failure and is conducive to the quick repair of the page with a detection failure.
[0114] In summary, the detection method provided by the present application realizes the simulation operation of the page by obtaining the predefined operation sequence for the page to be detected, 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, then taking a screenshot of the target page after executing the operation instructions to obtain a set of page images to be verified, realizes the screenshot of the operation result, and further, on this basis, by determining the set of verification images corresponding to the operation sequence and determining the detection result of the page to be detected based on the set of verification images and the set of page images, realizes the verification of the correctness of the operation result through image comparison, that is, detects the page to be detected, avoids the consumption of manpower for detecting the page to be detected, improves the detection efficiency, and improves the detection accuracy.
[0115] The following combination of attachedFigure 4 Taking the application of the detection method provided in this application in an interaction scenario as an example, the detection method will be further described. Among them, Figure 4 FIG. shows a processing flow chart of a detection method applied to an interaction scenario provided by an embodiment of the present application, which specifically includes the following steps:
[0116] Step 402: The client receives the operation sequence predefined by the server for the page to be detected.
[0117] Among them, the client can be understood as the terminal that needs to perform page detection, and this terminal can be an intelligent terminal such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc., which is not limited here. The server can be understood as the detection end.
[0118] Specifically, after the server predefines the operation sequence for the page to be detected, the operation sequence is sent to the client so that the client can execute the corresponding operation instructions for the page to be detected based on this operation sequence.
[0119] Step 404: When the client detects that the target service to which the page to be detected belongs meets the preset detection trigger condition, the client displays the page to be detected and obtains the operation sequence predefined for the page to be detected.
[0120] Specifically, the page to be detected is an activity page in the game service. When the game service meets the activity start time, the activity page is displayed, and the operation sequence S predefined for the activity page is obtained.
[0121] Among them, the operation sequence includes at least one operation position data, which can also be understood as the screen coordinate or the page coordinate.
[0122] Step 406: The client determines the operation instruction sequence corresponding to each operation position data in the operation sequence.
[0123] Specifically, the operation sequence S includes 3 operation position data, which are the operation position data dd1, the operation position data dd2, and the operation position data dd3 respectively. 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 os3.
[0124] Step 408: The client sequentially executes the operation instructions in the operation instruction sequence corresponding to each operation position data according to the arrangement order of the operation position data in the operation sequence, and takes a screenshot of the target page after executing the operation instructions to obtain a set of page images to be verified.
[0125] Specifically, the operation instruction sequence os1 corresponding to the operation position data dd1 includes two operation instructions, namely operation instruction 1 and operation instruction 2. Among them, the page after executing operation instruction 1 is the target page. Then, a screenshot of the target page after executing operation instruction 1 is taken to obtain the page image pp1 to be verified, and the page image pp1 is combined with the page images obtained by taking screenshots of the operation results corresponding to other operation position data to form a page image set.
[0126] Step 410: The client sends the operation sequence and the page image set to the server.
[0127] Step 412: The server determines the corresponding verification image set according to the operation sequence.
[0128] Specifically, the server determines the verification image set corresponding to the operation sequence S according to the operation sequence S.
[0129] Step 414: The server determines the corresponding relationship between the verification images in the verification image set and the page images in the page image set according to the operation position data in the operation sequence.
[0130] Specifically, the page image set includes three page images, namely page image 1, page image 2, and page image 3. The verification image set includes three verification images, namely verification image 1, verification image 2, and verification image 3. According to the corresponding relationship between the operation position data dd1 and the two types of images, it can be determined that page image 1 and verification image 1 have a corresponding relationship, page image 2 and verification image 2 have a corresponding relationship, and page image 3 and verification image 3 have a corresponding relationship.
[0131] Step 416: The server decolors the page images in the page image set and the verification images in the verification image set respectively.
[0132] Specifically, image decolorization means converting a color image into a grayscale image through calculation.
[0133] The three page images in the page image set are decolorized to obtain three decolorized page images (i.e., the grayscale images of the three page images), which are the grayscale page image pp1, the grayscale page image pp2, and the grayscale page image pp3 respectively. The three verification images in the verification image set are decolorized to obtain three decolorized verification images (i.e., the grayscale images of the three verification images), which are the grayscale verification image pp1, the grayscale verification image pp2, and the grayscale verification image pp3 respectively.
[0134] Step 418: The server performs binarization processing on the page image after color removal of the image according to a preset binarization threshold to obtain a binary page image, and performs binarization processing on the verification image after color removal of the image according to the preset binarization threshold to obtain a binary verification image.
[0135] Specifically, binarization processing can be understood as converting the page image after color removal of the image and the verification image after color removal of the image into binary images. Among them, a binary image refers to an image in which there are only two gray levels (such as 0 or 255) in the image.
[0136] Specifically, according to the preset binarization threshold, the gray images of the above 3 page images are binarized to obtain 3 binary page images, which are: binary page image ppp1, binary page image ppp2, and binary page image ppp3. Among them, the binary page image ppp1 is the binarized image of the gray image pp1 of page image 1. And according to the preset binarization threshold, the gray images of the above 3 verification images are binarized to obtain 3 binary verification images, which are: binary verification image ppp1, binary verification image ppp1, and binary verification image ppp3.
[0137] Step 420: The server determines the pixel correspondence between the pixel points in the binary page image and the pixel points in the binary verification image according to the corresponding relationship.
[0138] Based on the corresponding relationship between the page image and the verification image, the server can determine the corresponding relationship between the binary page image and the binary verification image. For example, according to the corresponding relationship between page image 1 and verification image 1, the corresponding relationship between binary page image ppp1 and binary verification image ppp1 can be determined, and further, the pixel correspondence between the binary page image and the binary verification image with the corresponding relationship can be determined.
[0139] Step 422: The server compares the gray values of the pixel points in the binary page image with the gray values of the pixel points in the binary verification image based on the pixel correspondence, and determines the number of pixel points with inconsistent comparison.
[0140] Specifically, comparing the gray values of the pixel points in the binary page image with the gray values of the pixel points in the binary verification image based on the pixel correspondence means comparing the pixel points with pixel correspondence in the two images for consistency.
[0141] Specifically, the binary page image ppp1 and the binary verification image ppp1 have a corresponding relationship, so the pixel points in the binary page image ppp1 and the pixel points in the binary verification image ppp1 have a pixel correspondence relationship. Among them, if the pixel point a in the binary page image ppp1 and the pixel point aa in the binary verification image ppp1 have a corresponding relationship, then the gray values of the pixel point a and the pixel point aa are compared for consistency, and when the comparison is inconsistent, the number of inconsistent pixel points is incremented by one. Suppose that after completing the consistency comparison of the pixel points in the binary page image ppp1 and the pixel points in the binary verification image ppp1, it is determined that the number of inconsistent pixel points is 5.
[0142] Step 424: The server calculates the ratio of the quantity to the total number of pixel points in the verification image, and determines the similarity comparison result based on the ratio.
[0143] Specifically, when the total number of pixel points in the binary verification image ppp1 is 100, the ratio of the number of inconsistent pixel points to the total number of pixel points is 5 / 100 = 0.05. And when the preset ratio threshold is 0.06, since 0.05 is less than 0.06, it is determined that the similarity comparison result of the binary page image ppp1 and the binary verification image ppp1 is similar.
[0144] Using the same comparison method as above, it can be determined that the similarity comparison result of the binary page image ppp2 and the binary verification image ppp2 is similar, and the similarity comparison result of the binary page image ppp3 and the binary verification image ppp3 is also similar. And when the comparison similarity comparison results of the 3 groups of images are all similar, it is determined that the similarity comparison result of the verification images in the verification image set and the page images in the page image set is similar.
[0145] Suppose that the similarity comparison result of any one of the above 3 groups of images is dissimilar, then it is determined that the similarity comparison result of the verification images in the verification image set and the page images in the page image set is dissimilar.
[0146] Step 426: The server determines the detection result of the page to be detected according to the similarity comparison result.
[0147] Continuing with the above example, on the basis of determining that the similarity comparison result of the verification images in the verification image set and the page images in the page image set is similar, it is determined that the detection result of the page to be detected is passed.
[0148] Suppose it is determined that the similarity comparison result of the verification images in the verification image set and the page images in the page image set is dissimilar, then it is determined that the detection result of the page to be detected is not passed.
[0149] Further, in the case where it is determined that the detection result of the page to be detected fails the detection, obtain the contact information of the detector corresponding to the page to be detected; and based on the detection result and the contact information, send a detection failure notice to the detector.
[0150] In summary, the detection method provided by this application obtains a pre-defined operation sequence for the page to be detected, sequentially executes the operation instructions corresponding to the operation position data according to the arrangement order of the operation position data in the operation sequence, then takes a screenshot of the target page after executing the operation instructions to obtain a set of page images to be verified, realizing the simulation operation of the page, taking screenshots of the operation results, and further on this basis, by determining the set of verification images corresponding to the operation sequence and determining the detection result of the page to be detected based on the set of verification images and the set of page images, realizes the verification of the correctness of the operation results through image comparison, that is, detects the page to be detected, avoiding the consumption of manpower to detect the page to be detected, improving the detection efficiency, and improving the detection accuracy.
[0151] Figure 5 The flowchart of a detection method provided by an embodiment of this application is shown, specifically including the following steps:
[0152] Step 502: The server defines monitoring information and sends the monitoring information to the client.
[0153] Specifically, the monitoring information may include: a click queue (which can be understood as a form of the above operation sequence, consisting of a series of screen coordinates. In addition, the monitoring information may also include the detection time, verification screenshots (which can be understood as the verification images in the above embodiments), etc., without limitation here.
[0154] Step 504: When the detection time arrives, the client performs click operations on the page to be detected according to the screen coordinates in the click queue in the monitoring information, calls the activity interfaces that need to be verified through the clicks, and takes screenshots of these activity interfaces to obtain a set of page images to be verified.
[0155] In practical applications, the client sends the obtained set of page images to the server, and the server executes the following step 506. In addition, in the case where the verification screenshots are included in the above monitoring information, the client may also execute the following step 506.
[0156] Step 506: Perform image verification on the page images through the pre-stored verification screenshots to obtain the detection result of the page to be detected.
[0157] Step 508: Determine whether the detection result fails the detection;
[0158] If so, it indicates that the page to be detected needs to be repaired, and the following step 510 is executed;
[0159] If not, it indicates that the page to be detected runs normally and no operation is required.
[0160] Step 510: Send an alarm notification to the developer.
[0161] Specifically, the purpose of sending an alarm notification to the developer is to enable the developer to understand the details of the detection failure so as to repair the page to be detected as soon as possible.
[0162] In summary, the detection method provided in this application predefines monitoring information, performs click operations on the page to be detected based on the screen coordinates in the click queue in the monitoring information, and takes screenshots of the operation results to obtain a set of page images to be verified. Then, the pre-stored verification screenshots are used to verify the page images in the set of page images, realizing the verification of the correctness of the operation results through image comparison, that is, detecting the page to be detected, avoiding the consumption of manpower to detect the page to be detected, improving the detection efficiency, and improving the detection accuracy.
[0163] Corresponding to the above method embodiment, this application also provides a detection device embodiment. Figure 6 The structural schematic diagram of a detection device provided by an embodiment of this application is shown. As Figure 6 shown, the device includes:
[0164] An acquisition module 602, configured to acquire an operation sequence predefined for the page to be detected;
[0165] An execution module 604, configured to sequentially execute the operation instructions corresponding to the operation position data in the arrangement order of the operation position data in the operation sequence, and take a screenshot of the target page after executing the operation instructions to obtain a set of page images to be verified;
[0166] A determination module 606, configured to determine a set of verification images corresponding to the operation sequence, and determine the detection result of the page to be detected based on the set of verification images and the set of page images.
[0167] Optionally, the determination module 606 is further configured to:
[0168] A determination structure sub-module, configured to determine a detection data structure corresponding to the operation sequence;
[0169] An extraction sub-module, configured to extract a set of verification images composed of the verification images corresponding to the operation position data in the operation sequence from the detection data structure;
[0170] A relationship determination sub-module, configured to determine the corresponding relationship between the verification images in the verification image set and the page images in the page image set according to the operation position data;
[0171] A comparison sub-module, configured to compare the similarity between the verification images in the verification image set and the page images in the page image set based on the corresponding relationship;
[0172] A determination result sub-module, configured to determine the detection result of the page to be detected according to the similarity comparison result.
[0173] Optionally, the comparison sub-module is further configured to:
[0174] A decoloring unit, configured to perform image decoloring on the page images in the page image set and the verification images in the verification image set respectively;
[0175] A binarization unit, configured to process the decolorized page images into binary page images according to a preset binarization threshold, and process the decolorized verification images into binary verification images;
[0176] A comparison unit, configured to compare the similarity between the binary page images corresponding to the page images in the page image set and the binary verification images corresponding to the verification images in the verification image set.
[0177] Optionally, the comparison unit is further configured to:
[0178] Determine the corresponding relationship between the pixel points in the binary page image and the pixel points in the binary verification image;
[0179] Based on the corresponding relationship, compare the gray values of the pixel points in the binary page image with the gray values of the pixel points in the binary verification image, and determine the number of pixel points with inconsistent comparison;
[0180] Calculate the ratio of the number to the total number of pixel points in the verification image, and determine the similarity comparison result based on the ratio.
[0181] Optionally, the binarization threshold is determined by the following method:
[0182] Determine the total number of pixel points in the verification image and the pixel value of each pixel point;
[0183] Based on the pixel value and the total number, calculate the average pixel value of the pixel points in the verification image, and use the average pixel value as the binarization threshold.
[0184] Optionally, the execution module 604 is further configured to:
[0185] Determine an operation instruction sequence corresponding to each operation position data in the operation sequence;
[0186] In the order of arrangement of the operation position data in the operation sequence, sequentially execute the operation instructions in the operation instruction sequence corresponding to each operation position data, and capture a screenshot of the target page after executing the operation instructions.
[0187] Optionally, the determination result sub-module is further configured to:
[0188] When it is determined that the detection result of the page to be detected fails the detection, obtain the contact information of the detecting party corresponding to the page to be detected;
[0189] Based on the detection result and the contact information, send a detection failure notice to the detecting party.
[0190] Optionally, the detection device further includes:
[0191] A determination data module, configured to determine the position data of each operation control in the page to be detected;
[0192] A generation module, configured to use the position data as operation position data, and splice the operation position data according to a preset operation order for the operation control to generate an operation sequence.
[0193] Optionally, the detection device further includes:
[0194] A display module, configured to display the page to be detected when it is detected that the target service to which the page to be detected belongs meets a preset detection trigger condition.
[0195] In summary, the detection device provided in this application obtains a pre-defined operation sequence for the page to be detected, sequentially executes the operation instructions corresponding to the operation position data in the order of arrangement of the operation position data in the operation sequence, and then captures a screenshot of the target page after executing the operation instructions to obtain a set of page images to be verified, 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 through image comparison, that is, detecting the page to be detected, avoiding the consumption of manpower to detect the page to be detected, improving the detection efficiency, and improving the detection accuracy.
[0196] The above is a schematic solution of a detection device according to this embodiment. It should be noted that the technical solution of this detection device and the technical solution of the above detection method belong to the same concept. For the details not described in the technical solution of the detection device, reference can be made to the description of the technical solution of the above detection method.
[0197] Figure 7 FIG. 4 shows a structural block diagram of a computing device 700 provided according to an embodiment of this specification. The components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 through a bus 730, and a database 750 is used to store data.
[0198] The computing device 700 further includes an access device 740, and the access device 740 enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include a 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. The access device 740 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Card (NIC)), 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 on.
[0199] In an embodiment of this specification, the above components of the computing device 700 and Figure 7 other components not shown in FIG. 4 may also be connected to each other, for example, through a bus. It should be understood that Figure 7 the structural block diagram of the computing device shown in FIG. 4 is only for illustrative purposes and is not a limitation on the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0200] The computing device 700 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.) or other types of mobile devices, or a stationary computing device such as a desktop computer or a PC. The computing device 700 can also be a mobile or stationary server.
[0201] Wherein, the processor 720 is used to implement the steps of the above detection method when executing the computer instructions.
[0202] The above is a schematic solution of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above detection method belong to the same concept. For the details not described in detail in the technical solution of the computing device, reference can be made to the description of the technical solution of the above detection method.
[0203] An embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the steps of the detection method described above are implemented.
[0204] The above is a schematic solution of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the above detection method belong to the same concept. For the details not described in detail in the technical solution of the storage medium, reference can be made to the description of the technical solution of the above detection method.
[0205] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended 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 the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0206] The computer instructions include computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0207] It should be noted that, for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0208] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0209] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The alternative embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principle and practical application of the present application, so that those skilled in the art can well understand and utilize the present application. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A detection method, characterized in that, Including: Obtain an operation sequence predefined for the page to be detected; Sequentially execute the operation instructions corresponding to the operation position data in the order of arrangement of the operation position data in the operation sequence, and take a screenshot of the target page after executing the operation instructions to obtain a set of page images to be verified; Determine a set of verification images corresponding to the operation sequence, and determine the detection result of the page to be detected based on the set of verification images and the set of page images; Among them, the determining the set of verification images corresponding to the operation sequence, and determining the detection result of the page to be detected based on the set of verification images and the set of page images includes: Determine the detection data structure corresponding to the operation sequence; Extract from the detection data structure a set of verification images composed of the verification images corresponding to the operation position data in the operation sequence; According to the operation position data, determine the corresponding relationship between the verification images in the set of verification images and the page images in the set of page images; Based on the corresponding relationship, compare the similarity between the verification images in the set of verification images and the page images in the set of page images; According to the similarity comparison result, determine the detection result of the page to be detected.
2. The detection method according to claim 1, wherein The comparing the similarity between the verification images in the set of verification images and the page images in the set of page images includes: Perform image desaturation on the page images in the set of page images and the verification images in the set of verification images respectively; Process the page images after image desaturation into binary page images according to a preset binarization threshold, and process the verification images after image desaturation into binary verification images; Compare the similarity between the binary page images corresponding to the page images in the set of page images and the binary verification images corresponding to the verification images in the set of verification images.
3. The detection method according to claim 2, wherein The comparing the similarity between the binary page images in the set of page images and the binary verification images in the set of verification images includes: Determine the pixel correspondence between the pixel points in the binary page image and the pixel points in the binary verification image; Based on the pixel correspondence, compare the gray values of the pixel points in the binary page image with the gray values of the pixel points in the binary verification image, and determine the number of pixel points with inconsistent comparison; Calculate the ratio of the number to the total number of pixel points in the verification image, and determine the similarity comparison result based on the ratio.
4. The detection method according to claim 2, characterized in that, The binarization threshold is determined by the following method: Determine the total number of pixel points in the verification image and the pixel value of each pixel point; Based on the pixel value and the total number, calculate the average pixel value of the pixel points in the verification image, and use the average pixel value as the binarization threshold.
5. The detection method according to any one of claims 1-4, characterized in that, The sequentially executing the operation instructions corresponding to the operation position data in the order of arrangement of the operation position data in the operation sequence, and taking a screenshot of the target page after executing the operation instructions includes: Determine the operation instruction sequence corresponding to each operation position data in the operation sequence; Execute the operation instructions in the operation instruction sequence corresponding to each operation position data in the order of arrangement of the operation position data in the said operation sequence, and take a screenshot of the target page after executing the said operation instructions.
6. The detection method according to any one of claims 1-4, characterized in that After determining the detection result of the page to be detected, it further includes: When it is determined that the detection result of the page to be detected fails the detection, obtain the contact information of the detecting party corresponding to the page to be detected; Based on the detection result and the contact information, send a detection failure notice to the detecting party.
7. The detection method according to any one of claims 1-4, characterized in that, Before obtaining the operation sequence predefined for the page to be detected, it further includes: Determine the position data of each operation control in the page to be detected; Take the said position data as operation position data, and splice each operation position data according to the preset operation order for the operation control to generate an operation sequence.
8. The detection method according to any one of claims 1-4, characterized in that, Before obtaining the operation sequence predefined for the page to be detected, it further includes: When it is detected that the target service to which the page to be detected belongs meets the preset detection trigger condition, display the page to be detected.
9. A detection device, characterized in that, It includes: An acquisition module, configured to acquire the operation sequence predefined for the page to be detected; An execution module, configured to execute the operation instructions corresponding to the operation position data in the order of arrangement of the operation position data in the said operation sequence, and take a screenshot of the target page after executing the operation instructions to obtain a set of page images to be verified; A determination module, configured to determine the verification image set corresponding to the operation sequence, and determine the detection result of the page to be detected based on the verification image set and the set of page images; The determination module is further configured to: Determine the detection data structure corresponding to the operation sequence; Extract from the detection data structure the verification image set composed of the verification images corresponding to the operation position data in the operation sequence; According to the operation position data, determine the corresponding relationship between the verification images in the verification image set and the page images in the set of page images; Based on the corresponding relationship, compare the similarity between the verification images in the verification image set and the page images in the set of page images; According to the similarity comparison result, determine the detection result of the page to be detected.
10. A computing device, comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, characterized in that, When the processor executes the computer instructions, it implements the steps of the method according to any one of claims 1-8.
11. A computer-readable storage medium storing computer instructions, characterized in that, When the computer instructions are executed by the processor, it implements the steps of the method according to any one of claims 1-8.
12. A computer program product, the computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, it implements the steps of the method according to any one of claims 1-8.
Citation Information
Patent Citations
Page comparing method and page comparing device
CN104077119A
Page display speed testing method and device and electronic device
CN109446095A
Adaptation test method and apparatus, and electronic device
CN112446850A