Page white screen detection method and device, terminal equipment and computer storage medium
By converting the page display time into a black-and-white binary image and performing dilation processing during page white screen detection, the problem of insufficient detection accuracy caused by the "false positive" phenomenon in the existing technology is solved, and higher detection accuracy is achieved.
Patent Information
- Application Number
- CN202211069828.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-01
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-09-01
AI Technical Summary
Existing methods for detecting blank screens on a page are not accurate enough when faced with "false positives" and cannot effectively detect whether a page is blank, especially when there are large icons on the page but the icons account for a small percentage of pixels.
The image data of the page to be detected is determined based on the preset page display time, converted into a black and white binary image and dilated to make the black images interconnected. Then, the similarity is compared with the preset all-white image to determine whether the page is a white screen.
It improves the accuracy of detecting blank screens on web pages, effectively identifies "false positives," and greatly enhances the accuracy of detection.
Smart Images

Figure CN115359033B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a page white screen detection method and device, a terminal device and a computer storage medium. BACKGROUND
[0002] At present, white screen management is one of the performance breakthroughs in many application software. Before white screen management is performed in software development, how to accurately find the page white screen is also an important link.
[0003] Nowadays, the detection of the page white screen phenomenon mainly adopts a data analysis method, or the existing method of comparing the similarity between the page image and the pure white page to detect whether the page is white. However, the existing method of data analysis or similarity comparison can only detect whether the page is white in the case that the page is almost white or almost full of elements, but cannot accurately detect whether the page is white for some "false positive" phenomenon (false positive phenomenon refers to that the main framework or the page has a large icon, and the icon can be visually recognized as having elements, but the icon pixels account for a small proportion of the overall page pixels from the data perspective).
[0004] In summary, the accuracy of the existing method of detecting the page white screen phenomenon still needs to be improved. SUMMARY
[0005] The main purpose of the present application is to provide a page white screen detection method, device, terminal device and computer storage medium, which aims to improve the accuracy of detecting the page white screen phenomenon.
[0006] To achieve the above purpose, the present application provides a page white screen detection method, which comprises:
[0007] determining the page image data of the page to be detected according to the preset page performance time;
[0008] converting the page image data into a black and white binary image, and performing inflation processing on the black image in the black and white binary image to obtain a processed black and white image, wherein the black images in the black and white image are connected to each other;
[0009] comparing the similarity between the black and white image and the preset all-white image to determine whether the page to be detected is white.
[0010] Optionally, before the step of determining the page image data of the page to be detected according to the preset page performance time, the method further comprises:
[0011] According to an application programming interface corresponding to the page to be detected, a page performance time of the page to be detected is obtained.
[0012] Optionally, the page image data is binary stream data, and the step of determining the page image data of the page to be detected according to the preset page performance time comprises:
[0013] According to the page performance time, one or more page snapshots of the page to be detected are captured.
[0014] The one or more page snapshots are converted into binary stream data as the page image data of the page to be detected.
[0015] Optionally, the method further comprises:
[0016] The page image data is converted into binary stream data.
[0017] The step of converting the page image data into a black-and-white binary image and dilating black images in the black-and-white binary image to obtain a processed black-and-white image comprises:
[0018] The page image data is converted into a black-and-white binary image by calling the image processing library after the conversion and compilation, and black images in the black-and-white binary image are dilated to obtain a processed black-and-white image.
[0019] Optionally, after the step of converting the page image data into a black-and-white binary image, the method further comprises:
[0020] The black-and-white binary image is compared with a preset all-white image to obtain a preliminary detection result, and whether the page to be detected is a white screen is determined according to the preliminary detection result.
[0021] The step of dilating black images in the black-and-white binary image to obtain a processed black-and-white image comprises:
[0022] If it is determined according to the preliminary detection result that the page to be detected is not a white screen, black images in the black-and-white binary image are dilated to obtain a processed black-and-white image.
[0023] Optionally, after the step of dilating black images in the black-and-white binary image to obtain a processed black-and-white image, the method further comprises:
[0024] It is determined whether to perform a filling process on a connected region of the black images in the black-and-white image.
[0025] If yes, the connected region is filled, and similarity comparison is performed between the filled black-and-white image and a preset all-white image to determine whether the page to be detected is a white screen.
[0026] Optionally, the method further comprises:
[0027] constructing one or more slave threads, wherein the one or more slave threads are independent of a master thread loading the page to be detected;
[0028] performing, by the one or more slave threads, the steps of determining the page image data of the page to be detected according to the preset page display time, converting the page image data into a black-and-white binary image, performing dilation processing on the black image in the black-and-white binary image to obtain a processed black-and-white image, and performing similarity comparison between the black-and-white image and a preset all-white image to determine whether the page to be detected is a white screen.
[0029] In addition, to achieve the above object, the present application further provides a page white screen detection device, which comprises:
[0030] a determination module configured to determine page image data of a page to be detected according to a preset page display time;
[0031] an image processing module configured to convert the page image data into a black-and-white binary image, and perform dilation processing on the black image in the black-and-white binary image to obtain a processed black-and-white image, wherein the black images in the black-and-white image are connected to each other;
[0032] a white screen detection module configured to perform similarity comparison between the black-and-white image and a preset all-white image to determine whether the page to be detected is a white screen.
[0033] In the present application, each functional module of the page white screen detection device realizes the steps of the page white screen detection method as described above.
[0034] In addition, to achieve the above object, the present application further provides a terminal device, which comprises a memory, a processor, and a page white screen detection program stored in the memory and executable on the processor, wherein the page white screen detection program realizes the steps of the page white screen detection method as described above when executed by the processor.
[0035] In addition, to achieve the above object, the present application further provides a computer storage medium, wherein a page white screen detection program is stored on the computer storage medium, and the page white screen detection program realizes the steps of the page white screen detection method as described above when executed by a processor.
[0036] In addition, to achieve the above object, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the page white screen detection method as described above.
[0037] The present application provides a page white screen detection method, device, terminal equipment, computer storage medium and computer program product. First, the page image data of a to-be-detected page is determined according to a preset page performance time. Then, the page image data is converted into a black-and-white binary image, and the black image in the black-and-white binary image is dilated to obtain a processed black-and-white image, wherein the black images in the black-and-white image are connected to each other. Finally, the similarity of the black-and-white image and a preset all-white image is compared to determine whether the to-be-detected page is a white screen.
[0038] In the process of detecting the page white screen phenomenon, the present application determines the page image data of a to-be-detected page which needs to be detected for a white screen according to a page performance time. Then, the page image data is binarized to convert it into a black-and-white binary image, and the black-and-white binary image is further dilated to obtain a black-and-white image in which the black images are connected to each other. Finally, the similarity of the black image and a preset all-white image is compared to determine whether the to-be-detected page is a white screen.
[0039] Compared with the traditional white screen detection method, the present application further dilates the black-and-white binary image after binarization to obtain a black-and-white image in which the black images are connected to each other, and then compares the similarity of the black image and a preset all-white image to determine whether the to-be-detected page is a white screen. In this way, the technical solution of the present application can effectively and accurately detect the white screen for the "false positive" phenomenon, greatly improving the accuracy of detecting the page white screen. BRIEF DESCRIPTION OF DRAWINGS
[0040] Figure 1 The device structure diagram of the hardware running environment of the terminal equipment related to the embodiment of the present application;
[0041] Figure 2 The flowchart of the first embodiment of the page white screen detection method of the present application;
[0042] Figure 3 The application flowchart related to an embodiment of the page white screen detection method of the present application;
[0043] Figure 4 Another application flowchart related to an embodiment of the page white screen detection method of the present application;
[0044] Figure 5This is a schematic diagram of the functional modules of an embodiment of the white screen detection device of the present invention.
[0045] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0046] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0047] Reference Figure 1 , Figure 1 This is a schematic diagram of the hardware operating environment of the terminal device involved in the embodiments of the present invention.
[0048] The terminal device in this invention embodiment can be a smartphone, PC (Personal Computer), tablet computer, portable computer, etc.
[0049] like Figure 1 As shown, the terminal device may include: a processor 1001, such as a CPU; a communication bus 1002; a user interface 1003; a network interface 1004; and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0050] Those skilled in the art will understand that Figure 1 The terminal device structure shown does not constitute a limitation on the terminal device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0051] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a program for detecting blank screens.
[0052] exist Figure 1In the terminal shown, the network interface 1004 is mainly used for connecting a background server and communicating data with the background server; the user interface 1003 is mainly used for connecting a client and communicating data with the client; and the processor 1001 can be used for calling a detection program of a page white screen stored in the storage 1005 and performing the following operation steps:
[0053] determining page image data of the page to be detected according to a preset page display time;
[0054] converting the page image data into a black-and-white binary image, and performing inflation processing on black images in the black-and-white binary image to obtain a processed black-and-white image, wherein the black images in the black-and-white image are connected to each other;
[0055] comparing the black-and-white image with a preset all-white image in similarity to determine whether the page to be detected is a white screen.
[0056] Further, the processor 1001 can also be used for calling a detection program of a page white screen stored in the storage 1005, and before performing the step of determining page image data of the page to be detected according to a preset page display time, the following operation steps are further performed:
[0057] obtaining the page display time of the page to be detected according to an application programming interface corresponding to the page to be detected.
[0058] Further, the page image data is binary stream data, and the processor 1001 can also be used for calling a detection program of a page white screen stored in the storage 1005 and performing the following operation steps:
[0059] performing one or more page snapshot captures on the page to be detected according to the page display time;
[0060] converting one or more page snapshots captured into binary stream data as the page image data of the page to be detected.
[0061] Further, the processor 1001 can also be used for calling a detection program of a page white screen stored in the storage 1005 and performing the following operation steps:
[0062] performing conversion and compilation for a preset image processing library;
[0063] The processor 1001 can also be used for calling a detection program of a page white screen stored in the storage 1005 and performing the following operation steps:
[0064] The converted image processing library is called to convert the page image data into a black-and-white binary image, and the black image in the black-and-white binary image is dilated to obtain a processed black-and-white image.
[0065] Further, the processor 1001 can also be configured to call the page white screen detection program stored in the memory 1005, and after the step of converting the page image data into a black-and-white binary image, the processor 1001 further performs the following operation steps:
[0066] The black-and-white binary image is compared with a preset all-white image to obtain a preliminary detection result, and whether the page to be detected is a white screen is determined according to the preliminary detection result.
[0067] The processor 1001 can also be configured to call the page white screen detection program stored in the memory 1005, and perform the following operation steps:
[0068] If it is determined according to the preliminary detection result that the page to be detected is not a white screen, the black image in the black-and-white binary image is dilated to obtain a processed black-and-white image.
[0069] Further, the processor 1001 can also be configured to call the page white screen detection program stored in the memory 1005, and after the step of dilating the black image in the black-and-white binary image to obtain a processed black-and-white image, the processor 1001 further performs the following operation steps:
[0070] It is determined whether to perform filling processing on the connected region of the black image in the black-and-white image.
[0071] If so, the connected region is filled, and the black-and-white image after filling processing is compared with a preset all-white image to determine whether the page to be detected is a white screen.
[0072] Further, the processor 1001 can also be configured to call the page white screen detection program stored in the memory 1005, and further perform the following operation steps:
[0073] One or more slave threads are constructed, wherein the one or more slave threads are independent of a master thread for loading the page to be detected.
[0074] The steps of determining the page image data of the page to be detected according to the preset page display time, converting the page image data into a black-and-white binary image, dilating the black image in the black-and-white binary image to obtain a processed black-and-white image, and comparing the black-and-white image with a preset all-white image to determine whether the page to be detected is a white screen are performed by the one or more slave threads.
[0075] Based on the above hardware structure, embodiments of the page white screen detection method of the application are proposed.
[0076] It should be noted that at present, white screen management has always been one of the performance breakthroughs in many application software. Before white screen management is carried out in software development, how to accurately find the page white screen is also an important link.
[0077] Nowadays, the detection of the white screen phenomenon of the page mainly adopts the data analysis method, or the existing method of comparing the similarity between the page image and the pure white page to detect whether the page is white. However, whether the existing method adopts data analysis or similarity comparison, it can only detect whether the page is white in the case that the page is almost white or almost full of elements, but it cannot accurately detect whether the page is white for some "false positive" phenomenon (false positive phenomenon refers to that there are large icons in the main framework or the page, and the icons can be visually recognized as having elements, but the proportion of the icon pixels in the overall pixels of the page is not large from the data perspective).
[0078] In summary, the accuracy of the existing method for detecting the white screen phenomenon of the page still needs to be improved.
[0079] In view of the above phenomenon, the application provides a page white screen detection method, which first determines the page image data of the page to be detected according to the preset page performance time; then converts the page image data into a black and white binary image, and performs inflation processing on the black image in the black and white binary image to obtain a processed black and white image, wherein the black images in the black and white image are connected to each other; finally, the similarity between the black and white image and the preset all-white image is compared to determine whether the page to be detected is white.
[0080] That is, in the process of detecting the white screen phenomenon of the page, the application determines the page image data of the page to be detected which needs to be detected by the white screen performance time, then performs binaryzation processing on the page image data to convert it into a black and white binary image, and further performs inflation processing on the black and white binary image to obtain a black and white image in which the black images are connected to each other, and finally, the similarity between the black and white image and the preset all-white image is compared to determine whether the page to be detected is white.
[0081] Compared with the traditional white screen detection method, the application further performs inflation processing on the black and white binary image after binaryzation processing to obtain a black and white image in which the black images are connected to each other, and then compares the similarity between the black and white image and the preset all-white image to determine whether the page to be detected is white. In this way, the technical scheme of the application can accurately detect the white screen for the "false positive" phenomenon, and greatly improves the accuracy of detecting the white screen of the page.
[0082] Referring to Figure 2 , Figure 2 is a flowchart of a first embodiment of the page white screen detection method of the present application. It should be noted that although a logical sequence is shown in the flowchart, the steps shown or described herein can be performed in a different sequence than shown in some cases.
[0083] In this embodiment, the page white screen detection method of the present application is applied to the terminal device described above. The page white screen detection method of the present application comprises:
[0084] Step S10, determining the page image data of the page to be detected according to the preset page performance time;
[0085] It should be noted that in this embodiment, the preset page performance time is the dynamic display time of a human-computer interaction page such as a function page or a web page in the target application program in which the terminal device currently performs page white screen detection.
[0086] In this embodiment, in the process of detecting the page white screen phenomenon, the terminal device first determines the page performance time corresponding to the page to be detected, and then determines the page image data of the page to be detected which needs to be detected for the white screen phenomenon according to the page performance time.
[0087] Further, in a feasible embodiment, before the step S10 of determining the page image data of the page to be detected according to the preset page performance time, the page white screen detection method of the present application further comprises:
[0088] Step A, obtaining the page performance time of the page to be detected according to the application programming interface corresponding to the page to be detected.
[0089] In this embodiment, the terminal device can specifically obtain the page performance time of the page to be detected which needs to be detected for the page white screen detection by the target application program or the web client currently performing page white screen detection, facing the application programming interface (such as the performance API provided by HTML5) provided by the terminal device or other databases loaded with the program or client.
[0090] Further, in a feasible embodiment, the page image data of the page to be detected which needs to be detected for the white screen phenomenon is binary stream data. The step S10 of determining the page image data of the page to be detected according to the preset page performance time can comprise:
[0091] Step S101, according to the page performance time, the page snapshot of the page to be detected is taken once or multiple times;
[0092] Step S102, the page snapshot taken once or multiple times is converted into binary stream data as the page image data of the page to be detected.
[0093] In this embodiment, after the terminal device obtains the page image data of the page to be detected, the terminal device further takes the page snapshot once or multiple times according to the page performance time and the DOM node generation of the page to be detected.
[0094] Then, the terminal device further converts the binary data of the page snapshot taken once or multiple times into binary stream data, and finally, the terminal device takes the page snapshot converted into binary stream data as the page image data for which the white screen detection is needed.
[0095] As shown in the application flow, Figure 3 the terminal device can obtain the page performance time of the page snapshot by using the performance API provided by HTML5, and then take the page snapshot according to the page performance time to obtain one or multiple page snapshots. Then, the terminal device further converts the one or multiple page snapshots into binary stream data based on the getImageDate attribute of the page snapshot by using Html2Canvas (a page snapshot data processing tool), and finally, the terminal device takes the one or multiple page snapshots converted into binary stream data as the page image data for which the white screen detection is needed to perform the subsequent image processing of the image processing algorithm and index.
[0096] Step S20, the page image data is converted into a black and white binary image, and the black image in the black and white binary image is dilated to obtain a processed black and white image, wherein the black images in the black and white image are connected to each other.
[0097] In this embodiment, after the terminal device determines the page image data of the page to be detected for which the white screen detection is needed, the terminal device further performs the black and white binary processing on the page image data to convert the page image data into a binary image, and the terminal device further dilates the black image in the binary image after the conversion to obtain a black and white image in which the processed black images are connected to each other.
[0098] Further, in a possible implementation, the method for detecting the white screen of the page can further include:
[0099] Step B, conversion and compilation for the preset image processing library.
[0100] In this embodiment, the terminal device can perform the black and white binarization processing on the page image data determined to need the white screen detection through the image processing library determined in advance. However, the most widely used image processing library (such as opencv, a cross-platform computer vision and machine learning software library based on Apache2.0 license (open source)) is more applied to the underlying development language, and needs to be converted into the javascript high-level assembly language to perform the binarization processing on the page image data, and thus needs to be converted and compiled.
[0101] Therefore, the terminal device converts and compiles the image processing library (such as opencv) determined in advance for the binarization processing on the page image data through WebAssembly (also known as wasm, which is a high-efficiency and low-level programming language), to convert and compile the image processing library into the javascript high-level assembly language.
[0102] It should be noted that in this embodiment, WebAssembly supports the code implemented by C / C++ / Go / Rust and the like to be compiled into the machine code executable by the browser, so as to support the browser to run the related application with the performance close to the native application.
[0103] Further, in this embodiment, the step S20 of “converting the page image data into a black and white binary image, and performing inflation processing on the black image in the black and white binary image to obtain a processed black and white image” can include:
[0104] Step S201, calling the image processing library after conversion and compilation to convert the page image data into a black and white binary image, and performing inflation processing on the black image in the black and white binary image to obtain a processed black and white image.
[0105] In this embodiment, after the terminal device converts and compiles the image processing library, the terminal device performs the black and white binarization processing on the page image data for detecting the white screen phenomenon through the image processing library after conversion and compilation, so as to convert the page image data into a black and white binary image. Then, the terminal device further performs inflation processing on the black image in the black and white binary image, so as to obtain a black and white image in which the black images are connected to each other.
[0106] Step S30, similarity comparison is performed between the black-and-white image and a preset all-white image to determine whether the page to be detected is a white screen.
[0107] In this embodiment, after the terminal device obtains the black-and-white image in which the black images are connected to each other, the terminal device immediately performs similarity comparison calculation between the black-and-white image and a preset all-white image, so as to determine, based on the similarity between the black-and-white image and the preset all-white image, whether the page to be detected corresponding to the black-and-white image has a white screen phenomenon.
[0108] For example, as shown in the application flow, Figure 3 the terminal device specifically adopts a hash algorithm (generating a hash value for each picture, and finally comparing the hash values of two pictures, the closer the result, the more similar the pictures) to calculate the similarity between the black-and-white image in which the black images are connected to each other and the preset all-white image in the operation of "image processing algorithm and index", so as to determine that the page to be detected currently performing white screen detection has a white screen when the similarity is higher than an expected value, and determine that the page to be detected currently performing white screen detection does not have a white screen and is in a normal page loading state when the similarity is lower than the expected value.
[0109] It should be understood that, in this embodiment, the expected value of the similarity between the black-and-white image and the preset all-white image can be set to different sizes based on different design needs of actual applications, and the page white screen detection method of the present application is not limited to the specific size of the expected value.
[0110] In this embodiment, the page white screen detection method provided by the embodiment of the present application first determines the page performance time corresponding to the page to be detected by the terminal device during the detection of the page white screen phenomenon, and then determines the page image data of the page to be detected currently requiring white screen phenomenon detection according to the page performance time. After the terminal device determines the page image data of the page to be detected currently requiring white screen phenomenon detection, the terminal device further performs black-and-white binarization processing on the page image data, so as to convert the page image data into a binary image, and the terminal device further performs dilation processing on the black images in the converted binary image, so as to obtain a black-and-white image in which the black images are connected to each other. After the terminal device obtains the black-and-white image in which the black images are connected to each other, the terminal device immediately performs similarity comparison calculation between the black-and-white image and a preset all-white image, so as to determine, based on the similarity between the black-and-white image and the preset all-white image, whether the page to be detected corresponding to the black-and-white image has a white screen phenomenon.
[0111] Thus, compared with the traditional white screen detection manner, the black and white image obtained by further performing the expansion processing on the black and white binary image after the binarization processing is performed, and the similarity comparison between the black image and the preset all-white image is performed to determine whether the page to be detected is a white screen. Thus, the technical scheme of the present application can effectively and accurately detect the white screen for the "false positive" phenomenon, and greatly improve the accuracy of detecting the white screen of the page.
[0112] Further, based on the first embodiment of the page white screen detection method of the present application, a second embodiment of the page white screen detection method of the present application is proposed.
[0113] In this embodiment, after the step of "converting the page image data into a black and white binary image" described in the first embodiment of the page white screen detection method of the present application, the page white screen detection method of the present application can further include:
[0114] Step C, performing similarity comparison between the black and white binary image and the preset all-white image to obtain a preliminary detection result, and determining whether the page to be detected is a white screen according to the preliminary detection result;
[0115] In this embodiment, considering that in some special cases, the black and white binary image obtained by performing the black and white binarization processing on the page image data described above may not actually have the problem of "false positive" and thus can immediately and accurately detect the white screen, and in order to further save the computing resources of the terminal device and improve the performance of the terminal, after the black and white binary image obtained by performing the black and white binarization processing on the page image data described above, the terminal device can first perform similarity comparison between the black and white binary image and the preset all-white image, thereby obtaining a preliminary detection result indicating the similarity between the black and white binary image and the preset all-white image.
[0116] Further, the terminal device can determine whether the page currently being detected for white screen has the white screen phenomenon at the current time based on the similarity between the black and white binary image and the preset all-white image indicated by the preliminary detection result. That is, if the similarity is higher than an expected value, it is determined that the page currently being detected for white screen has the white screen, and if the similarity is lower than the expected value, it is determined that the page currently being detected for white screen does not have the white screen and is in a normal page loading state.
[0117] Further, in this embodiment, the step of "performing expansion processing on the black image in the black and white binary image to obtain a processed black and white image" described in the first embodiment of the page white screen detection method of the present application can include:
[0118] If it is determined according to the preliminary detection result that the page to be detected is not a white screen, the black image in the black-and-white binary image is dilated to obtain a processed black-and-white image.
[0119] In the embodiment, the terminal device determines the similarity between the black-and-white binary image identified based on the preliminary detection result and the preset all-white image. When it is determined that the page to be detected does not have a white screen at the current time, in order to further determine that the page to be detected is not detected to have no white screen due to "false positive", the terminal device continues to dilate the black image in the black-and-white binary image to obtain a black-and-white image in which the black images are connected, and continues to perform the process of comparing the similarity between the black-and-white image and the preset all-white image, so as to accurately detect whether the page to be detected has a white screen.
[0120] It should be noted that, in the embodiment, the dilating process of the black image in the black-and-white binary image is to connect the black regions in the black-and-white binary image that are close but not connected. Specifically, the terminal device can use any existing mature image processing technology to dilate the black image in the black-and-white binary image. The page white screen detection method of the present application does not limit the specific type of the image processing technology and the specific process of dilating the black image.
[0121] Further, in a feasible embodiment, after the step of "dilating the black image in the black-and-white binary image to obtain a processed black-and-white image", the page white screen detection method of the present application can further include:
[0122] Step D, determining whether to perform filling processing on the connected region of the black image in the black-and-white image;
[0123] In the embodiment, as shown in the application flow, Figure 4 After dilating the black image in the black-and-white binary image to obtain a black-and-white image in which the black images are connected, the terminal device further selects the connected region of the black image in the black-and-white image by establishing the minimum circumscribed matrix of the black image in the black-and-white image, and determines whether to perform filling processing on the connected region by judging the proportion of black in the connected region.
[0124] It should be noted that, in the embodiment, the terminal device can also determine whether to perform filling processing on the connected region by using an algorithm of weighted calculation on the connected region or by obtaining the maximum blank matrix proportion of the connected region.
[0125] If yes, the terminal device performs a filling process on the connected region, and compares the similarity between the black-and-white image after the filling process and the preset all-white image to determine whether the page to be detected is white.
[0126] In the present embodiment, as shown in the application flow, Figure 4 When the terminal device determines that the connected region of the black image in the black-and-white image needs to be filled (for example, the proportion of black is less than 50%), the terminal device performs a blacking process on the connected region, thereby obtaining a black-and-white image after the filling process on the connected region. Subsequently, the terminal device compares the similarity between the black-and-white image after the filling process on the connected region (the new black-and-white binary image shown in the figure) and the preset all-white image, and determines whether the page to be detected currently being subjected to white screen detection has a white screen phenomenon based on the similarity between the black-and-white image and the preset all-white image.
[0127] In the present embodiment, considering that the black-and-white binary image obtained by performing a black-and-white binaryzation process on the page image data may not actually have a "false positive" problem and thus can be accurately subjected to white screen detection, and in order to further save the computing resources of the terminal device and improve the performance of the terminal, the terminal device can first compare the similarity between the black-and-white binary image and the preset all-white image after performing a black-and-white binaryzation process on the page image data, thereby obtaining a preliminary detection result indicating the similarity between the black-and-white binary image and the preset all-white image. Then, the terminal device can determine whether the page to be detected currently being subjected to white screen detection has a white screen phenomenon based on the similarity between the black-and-white binary image and the preset all-white image indicated by the preliminary detection result. That is, if the similarity is higher than an expected value, it is determined that the page to be detected currently being subjected to white screen detection has a white screen, and if the similarity is lower than the expected value, it is determined that the page to be detected currently being subjected to white screen detection does not have a white screen, and is in a normal page loading state.
[0128] In addition, the terminal device further determines whether the connected region of the black image in the black-and-white image needs to be filled, and calculates the similarity between the overall black-and-white image and the all-white image after filling the connected region when it is detected that the proportion of black in the connected region is low, to determine whether the page to be detected is white. In this way, the influence of "false positive" on page white screen detection is effectively avoided, and the accuracy of page white screen detection is improved.
[0129] Further, based on the first and second embodiments of the page white screen detection method of the present application, a third embodiment of the page white screen detection method of the present application is proposed.
[0130] In the embodiment, the method for detecting page white screen of the present application can further include:
[0131] constructing one or more slave threads, wherein the one or more slave threads are independent of a main thread for loading the page to be detected;
[0132] performing the steps of determining the page image data of the page to be detected according to the preset page display time, converting the page image data into a black-and-white binary image, and performing dilation processing on the black image in the black-and-white binary image to obtain a processed black-and-white image, and comparing the black-and-white image with a preset all-white image to determine whether the page to be detected is a white screen, by the one or more slave threads.
[0133] In the embodiment, in order to further ensure that the operation of the terminal device for detecting the white screen of the page to be detected does not affect the normal loading process of the terminal device for the page to be detected, the terminal device can construct one or more slave threads independent of the main thread for loading the page to be detected when starting to detect the white screen of the page to be detected, and perform the page white screen detection operation based on the one or more slave threads, according to the first embodiment and / or the second embodiment of the method for detecting the page white screen of the present application.
[0134] In addition, in another possible embodiment, after the terminal device performs the page white screen detection on the page to be detected according to the above process and obtains the detection result of whether the page to be detected appears a white screen, the terminal device can further generate corresponding log data based on the detection result or even the entire process of detecting the white screen of the page to be detected, and report the log data to the background of the application corresponding to the page to be detected, so that the program development personnel of the application can perform corresponding program operation and maintenance based on the log data.
[0135] Further, the present application also provides a detection device for page white screen, please refer to Figure 5 , Figure 5 for the function module schematic diagram of an embodiment of the detection device for page white screen of the present application.
[0136] As Figure 5 shown, the detection device for page white screen of the present application includes:
[0137] a determination module 10 for determining the page image data of the page to be detected according to a preset page display time;
[0138] The image processing module 20 is configured to convert the page image data into a black-and-white binary image, and to perform inflation processing on black images in the black-and-white binary image to obtain a processed black-and-white image, wherein the black images in the black-and-white image are connected to each other.
[0139] The white screen detection module 30 is configured to compare the black-and-white image with a preset all-white image in terms of similarity to determine whether the page to be detected is a white screen.
[0140] Further, the page white screen detection device further comprises:
[0141] The acquisition module is configured to acquire a page performance time of the page to be detected according to an application programming interface of an application program corresponding to the page to be detected.
[0142] Further, the page image data is binary stream data, and the determination module 10 comprises:
[0143] The snapshot interception unit is configured to perform one or more times of page snapshot interception on the page to be detected according to the page performance time.
[0144] The conversion unit is configured to convert one or more page snapshots obtained by the page snapshot interception into binary stream data as the page image data of the page to be detected.
[0145] Further, the page white screen detection device further comprises:
[0146] The image processing library conversion module is configured to perform conversion and compilation on a preset image processing library.
[0147] The image processing module 20 is further configured to call the image processing library after the conversion and compilation to convert the page image data into a black-and-white binary image, and to perform inflation processing on black images in the black-and-white binary image to obtain a processed black-and-white image.
[0148] Further, the white screen detection module 30 is further configured to compare the black-and-white binary image with a preset all-white image in terms of similarity to obtain a preliminary detection result, and to determine whether the page to be detected is a white screen according to the preliminary detection result, and if it is determined that the page to be detected is not a white screen according to the preliminary detection result, to perform inflation processing on black images in the black-and-white binary image to obtain a processed black-and-white image.
[0149] Further, the page white screen detection device further comprises:
[0150] The connected domain processing module is configured to determine whether to perform filling processing on a connected domain of the black images in the black-and-white image, and to perform filling processing on the connected domain.
[0151] The white screen detection module 30 is further configured to compare the black-and-white image after the filling processing with a preset all-white image to determine whether the page to be detected is a white screen.
[0152] Further, the page white screen detection device further comprises:
[0153] The thread construction module is configured to construct one or more slave threads, wherein the one or more slave threads are independent of a master thread loading the page to be detected; and perform the steps of determining the page image data of the page to be detected according to the preset page display time, converting the page image data into a black-and-white binary image, performing the dilation processing on the black image in the black-and-white binary image to obtain the processed black-and-white image, and comparing the black-and-white image with a preset all-white image to determine whether the page to be detected is a white screen through the one or more slave threads.
[0154] The functions of the modules in the page white screen detection device correspond to the steps in the page white screen detection method, and thus the functions and implementation processes of the modules are not described herein.
[0155] The present application further provides a computer storage medium, which stores a page white screen detection program, and the page white screen detection program, when executed by a processor, implements the steps of the page white screen detection method according to any one of the above embodiments.
[0156] The computer storage medium according to the embodiment of the present application is basically the same as the page white screen detection method, and thus is not described herein.
[0157] The present application further provides a computer program product, which comprises a computer program, and the computer program, when executed by a processor, implements the steps of the page white screen detection method according to any one of the above embodiments.
[0158] The computer storage medium according to the embodiment of the present application is basically the same as the page white screen detection method, and thus is not described herein.
[0159] It should be noted that, in the present document, the terms “comprising”, “including”, or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles, or systems including a series of elements not only include those elements, but also include other elements not explicitly listed, or further include elements inherent to such processes, methods, articles, or systems. Without more limitations, the element defined by the phrase “comprising a” does not exclude the presence of additional identical elements in the process, method, article, or system including the element.
[0160] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0161] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and the necessary general hardware platform, of course, they can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) as described above, and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application.
[0162] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, which is made by using the content of the specification and drawings of the present application, is also included in the patent protection scope of the present application.
Claims
1. A method for detecting a blank screen, characterized in that, The method for detecting a blank screen includes: The page image data of the page to be detected is determined based on the preset page display time. The page image data is converted into a black and white binary image, and the black images in the black and white binary image are dilated to obtain a processed black and white image, wherein the black images in the black and white image are interconnected. The similarity between the black and white image and a preset all-white image is compared to determine whether the page to be detected is a white screen.
2. The method for detecting blank screen on a webpage as described in claim 1, characterized in that, Before the step of determining the page image data of the page to be detected based on a preset page display time, the method further includes: The page display time of the page to be tested is obtained according to the application programming interface corresponding to the page to be tested.
3. The method for detecting blank screen on a webpage as described in claim 1 or 2, characterized in that, The page image data is binary stream data. The step of determining the page image data of the page to be detected based on a preset page display time includes: Based on the page display time, take one or more page snapshots of the page to be detected; One or more page snapshots captured during the page snapshot process are converted into binary stream data and used as the page image data of the page to be detected.
4. The method for detecting a blank screen as described in any one of claims 1, characterized in that, The method further includes: Transform and compile the preset image processing library; The step of converting the page image data into a black-and-white binary image and dilating the black image in the black-and-white binary image to obtain a processed black-and-white image includes: The image processing library, after conversion and compilation, is called to convert the page image data into a black and white binary image, and the black image in the black and white binary image is dilated to obtain the processed black and white image.
5. The method for detecting blank screen on a webpage as described in claim 1, characterized in that, After the step of converting the page image data into a black-and-white binary image, the method further includes: A preliminary detection result is obtained by comparing the similarity between the black-and-white binary image and a preset all-white image, and it is determined whether the page to be detected is a white screen based on the preliminary detection result; The step of dilating the black image in the black-and-white binary image to obtain the processed black-and-white image includes: If the preliminary inspection results determine that the page to be inspected is not a blank screen, then the black image in the black-and-white binary image is dilated to obtain the processed black-and-white image.
6. The method for detecting blank screen on a webpage as described in claim 1 or 5, characterized in that, After the step of dilating the black image in the black-and-white binary image to obtain the processed black-and-white image, the method further includes: Determine whether to perform fill processing on the connected regions of the black image in the black and white image; If so, the connected region is filled, and the similarity between the filled black and white image and the preset all-white image is compared to determine whether the page to be detected is a white screen.
7. The method for detecting blank screen on a webpage as described in claim 1, characterized in that, The method further includes: Construct one or more slave threads, wherein one or more slave threads are independent of the main thread that loads the page to be detected; The steps of determining the page image data of the page to be detected based on a preset page display time are executed by one or more slave threads, including converting the page image data into a black and white binary image, dilating the black image in the black and white binary image to obtain a processed black and white image, and comparing the similarity between the black and white image and a preset all-white image to determine whether the page to be detected is a white screen.
8. A device for detecting blank screen on a webpage, characterized in that, The device for detecting blank screens includes: The determination module is used to determine the page image data of the page to be detected based on the preset page display time. The image processing module is used to convert the page image data into a black and white binary image, and to dilate the black images in the black and white binary image to obtain a processed black and white image, wherein the black images in the black and white image are interconnected. The white screen detection module is used to compare the similarity between the black and white image and a preset all-white image to determine whether the page to be detected is a white screen.
9. A terminal device, characterized in that, The terminal device includes: a memory, a processor, and a page white screen detection program stored in the memory and executable on the processor. When the page white screen detection program is executed by the processor, it implements the steps of the page white screen detection method as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that, The computer storage medium stores a white screen detection program, and when the white screen detection program is executed by the processor, it implements the steps of the white screen detection method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Specific color human body detection method oriented to surveillance videos
CN104732220A
White screen detection method
CN111881998A