Black and white screen anomaly detection method and device, equipment and storage medium
By dividing the detection area and calculating the color value of the pixel center point, the problems of low efficiency and poor accuracy of abnormal detection of black and white screens in the prior art are solved, and more efficient and accurate detection is achieved, improving user experience.
Patent Information
- Application Number
- CN202411051164.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, black and white screen abnormal detection efficiency is low and the accuracy is poor, which affects the user experience.
By periodically obtaining the game page diagram, dividing it into preset number of detection areas, determining the coordinates of the pixel center point of each detection area, and calculating the color value based on the color value calculation function of the pixel center point, comparing the color value consistency to determine the Page type, determine whether the screen is white, black or non-black and white.
It improves the efficiency and accuracy of abnormal detection of black and white screens, avoids the calculation and comparison of color values of each pixel point, reduces detection time, and ensures timely handling of abnormal situations.
Smart Images

Figure CN119236391A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, device, equipment and storage medium for detecting anomalies of black and white screens. Background Art
[0002] With the development of game development technology, users have higher and higher requirements for game experience. Therefore, developers continue to enrich game scenes during the game development process, such as adding competition factors, increasing the difficulty of actions, and adding storylines, so as to improve the fun of the game. However, as the volume of development programs increases, resource loading anomalies or game plug-in anomalies may occur during the game loading process, resulting in a white or black screen on the game terminal, that is, the page appears completely white or completely black during loading or running, and no content is displayed, affecting the user experience.
[0003] In the prior art, a screenshot is usually taken of a preset area, and each pixel in the screenshot is extracted, and whether a black screen or a white screen occurs is determined based on the color value of the pixel. However, detection based only on the color value of the pixel in the screenshot cannot guarantee the accuracy of the detection, and the color value of each pixel in the screenshot is extracted and detected, and the detection efficiency is low, which is not conducive to timely handling of abnormal situations such as black screen or white screen, affecting the user experience. Summary of the invention
[0004] The embodiments of the present application provide a black-and-white screen abnormality detection method, device, equipment and storage medium, which solve the problems of low detection efficiency and poor detection accuracy of abnormal conditions such as black-and-white screens, and improve the efficiency and accuracy of black-and-white screen abnormality detection.
[0005] In a first aspect, an embodiment of the present application provides a method for detecting anomalies of a black-and-white screen, comprising:
[0006] Periodically acquiring a game page map, dividing the game page map into a preset number of detection areas, and determining the coordinates of a pixel center point of each detection area;
[0007] Calculate the color value of the center point of the pixel according to the coordinates of the center point of the pixel and a color value calculation function;
[0008] Comparing whether the color values of the center points of each pixel are consistent, and if the color values are consistent, comparing the color values with the black value and the white value to determine the page type, wherein the page type includes a white page type, a black page type, or a non-black and white page type;
[0009] When the page type is a white page type or a black page type, the monitoring result is determined to be a screen abnormality, and when the page type is a non-black and white page type, the monitoring result is determined to be a screen normal.
[0010] Optionally, dividing the game page image into a preset number of detection areas and determining the pixel center point coordinates of each detection area includes:
[0011] The game page map is evenly divided into a corresponding number of detection areas according to the game state, and the vertex coordinates of the designated detection areas are determined, and the pixel center point coordinates of the designated detection areas are calculated according to the vertex coordinates.
[0012] Optionally, evenly dividing the game page graph into a corresponding number of detection areas according to the game state, and determining vertex coordinates of the designated detection areas, includes:
[0013] When the game state is loading, the game page is divided into three detection areas of upper, middle and lower parts in equal proportion, and the vertex coordinates of the middle detection area are obtained;
[0014] Correspondingly, calculating the pixel center point coordinates of the detection area according to the vertex coordinates includes:
[0015] The regional pixel center coordinates of the middle detection area are calculated according to the vertex coordinates of the middle detection area, wherein the number of the regional pixel center coordinates is multiple and the number of the regional pixel center coordinates is determined according to the length and position of the game loading progress bar.
[0016] Optionally, comparing whether the color values of the center points of each pixel are consistent includes:
[0017] The color value of the first pixel center point is compared with the color value of the last pixel center point. If the color values are consistent, the color value of the first pixel center point is compared with the color values of the remaining pixel center points to determine whether the color values of the pixel center points are consistent.
[0018] Optionally, evenly dividing the game page graph into a corresponding number of detection areas according to the game state, and determining vertex coordinates of the designated detection areas, includes:
[0019] When the game state is in the game process, the game page is divided into nine-square grid areas, and the vertex coordinates of each detection area are obtained;
[0020] Correspondingly, calculating the pixel center point coordinates of the detection area according to the vertex coordinates includes:
[0021] The pixel center point coordinates of each detection area are calculated according to the vertex coordinates of each detection area, wherein the number of the pixel center point of each detection area is one.
[0022] Optionally, comparing whether the color values of the center points of each pixel are consistent includes:
[0023] Compare the first color values of the pixel center points on the first diagonal line of the nine-square grid area. When the first color values are consistent, compare the second color values of the pixel center points on the second diagonal line of the nine-square grid area. When the second color values are consistent, compare the first color value or the second color value with the third color value of the pixel center points on the non-diagonal line of the nine-square grid area to determine whether the first color value or the second color value is consistent with the third color value.
[0024] Optionally, after determining that the detection result is a screen abnormality, the method further includes:
[0025] The abnormal time of the screen abnormality is calculated according to the detection results of the preset period. When the abnormal time exceeds the abnormal time threshold, a screen abnormality prompt is given, and the game is restarted based on the confirmation instruction.
[0026] In a second aspect, an embodiment of the present application provides a black and white screen abnormality detection device, comprising:
[0027] An area division module, used for periodically acquiring a game page map and dividing the game page map into a preset number of detection areas;
[0028] A coordinate determination module, used to determine the coordinates of the pixel center point of each detection area;
[0029] A color value calculation module, used to calculate the color value of the pixel center point according to the coordinates of the pixel center point and a color value calculation function;
[0030] Page type determination, used to compare whether the color values of the center points of each pixel are consistent. If the color values are consistent, the color values are compared with the black value and the white value to determine the page type, which includes a white page type, a black page type, or a non-black and white page type;
[0031] The screen status determination module is used to determine that the monitoring result is an abnormal screen when the page type is a white page type or a black page type, and to determine that the monitoring result is a normal screen when the page type is a non-black and white page type.
[0032] In a third aspect, an embodiment of the present application provides a black and white screen abnormality detection device, the device comprising: one or more processors; a storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the black and white screen abnormality detection method described in the first aspect.
[0033] In a fourth aspect, an embodiment of the present application provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the black and white screen anomaly detection method as described in the first aspect.
[0034] The embodiment of the present application periodically obtains the game page map, divides the game page map into a preset number of detection areas, and determines the coordinates of the pixel center point of each detection area; calculates the color value of the pixel center point according to the coordinates of the pixel center point and the color value calculation function; compares whether the color values of the pixel center points are consistent, and when the color values are consistent, compares the color values with the black value and the white value to determine the page type, and the page type includes a white page type, a black page type, or a non-black and white page type; when the page type is a white page type or a black page type, the monitoring result is determined to be a screen abnormality, and when the page type is a non-black and white page type, the monitoring result is determined to be a normal screen. By dividing the detection area and obtaining the coordinates of the pixel center point of each area, the color value of each area in the page can be uniformly obtained, and the type of the page can be determined based on the color value of the pixel center point of each detection area, which can ensure the accuracy of black and white screen detection and improve the detection efficiency, avoiding the calculation and comparison of the color value of each pixel point in the page, which affects the detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a flow chart of a black and white screen abnormality detection method provided in an embodiment of the present application;
[0036] Figure 2 is a flow chart of a method for calculating the coordinates of a regional pixel center provided in an embodiment of the present application;
[0037] Figure 3 is a schematic diagram of a game loading page provided in an embodiment of the present application;
[0038] Figure 4 is a flow chart of a method for calculating pixel center point coordinates provided in an embodiment of the present application;
[0039] Figure 5 is a schematic diagram of a nine-square grid area provided in an embodiment of the present application;
[0040] Figure 6 It is a structural schematic diagram of a black and white screen abnormality detection device provided in an embodiment of the present application;
[0041] Figure 7 It is a structural schematic diagram of a black and white screen abnormality detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0043] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0044] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0045] The following, in conjunction with the accompanying drawings, describes in detail the data transmission method, apparatus, device and medium provided in the embodiments of the present application through specific embodiments and their application scenarios.
[0046] The embodiments of the present application can be used in scenarios where the screen is black or white, or other abnormal conditions are detected during the loading process before the game starts or during the game, and can also be applied to black and white screen detection scenarios of other types of pages. Based on the above usage scenarios, it can be understood that the executor of this solution can be a server, and the device for black and white screen abnormality detection can be implemented by software and / or hardware. The device for black and white screen abnormality detection can be composed of two or more physical entities, or it can be composed of one physical entity. Generally speaking, the device for black and white screen abnormality detection can be a computer, a mobile phone, a tablet, etc.
[0047] Figure 1 is a flow chart of a black and white screen abnormality detection method provided in an embodiment of the present application, such as Figure 1 As shown, including:
[0048] Step S101: periodically obtain a game page map, divide the game page map into a preset number of detection areas, and determine the coordinates of the pixel center point of each detection area.
[0049] In one embodiment, the game page image is a page image displayed in the current terminal device. If the current game is in a loading state, the page image is a screenshot of the current game loading page. If the game is currently in the process of playing the game, the page image is a screenshot of the page during the current game process. The detection area is a partial area obtained by dividing the page image, and the detection area is composed of multiple pixels. During the black and white abnormal screen detection process, each detection area can be used as a unit for detection. The pixel point is the smallest unit of a digital image, which can represent an image unit with a fixed position and a specific color or brightness value. The more pixels there are, the finer the details represented, the higher the resolution of the picture, and the more delicate and realistic the image. The coordinates of the pixel center point of each detection area are used to represent the position of the pixel point of the center point of each detection area, such as (u0, v0), which represents the pixel point of the u0th column and the v0th row.
[0050] In one embodiment, before performing black and white screen abnormality detection, a detection cycle of an abnormal screen is pre-set, such as 5s. The server obtains the game page map at the current moment every 5s, and divides the game page map into a corresponding number of detection areas according to the detection accuracy requirements. If the detection accuracy requirements are higher, the number of divided detection areas is greater. For example, the game page map can be divided into 4*4 or 5*5 detection areas, and the coordinates of the pixel center points of each detection area are calculated according to the length and width of each detection area. Exemplarily, the length of the first detection area is 100 pixels and the width is 50 pixels. The pixel point of the 50th column and the 25th row is the pixel center point of the area, and the coordinates of the pixel center point are (50,25). When calculating the coordinates of the pixel center point of the second detection area, since each detection area is obtained by evenly dividing the game page map, the size of each detection area is the same, so the coordinates of the pixel center point of the second detection area can be calculated according to the coordinates of the pixel center point of the first detection area (50,25) and the positional relationship relative to the first detection area. Exemplarily, if the second detection area is an adjacent area of the first detection area and is on the right side of the first detection area, the coordinates of the pixel center point of the second detection area can be calculated as (150,25); if the second detection area is an adjacent area of the first detection area and is below the first detection area, the coordinates of the pixel center point of the second detection area can be calculated as (50,75).
[0051] In one embodiment, dividing the game page image into a preset number of detection areas and determining the pixel center point coordinates of each detection area includes:
[0052] The game page map is evenly divided into a corresponding number of detection areas according to the game state, and the vertex coordinates of the designated detection areas are determined, and the pixel center point coordinates of the designated detection areas are calculated according to the vertex coordinates.
[0053] The game status may include the status of loading the game, during the game, and when the game is over. Usually, when the game status is loading the game or when the game is over, the central area of the game page image will display a loading progress bar or a prompt message when the game is over, and the rest of the area will be a solid color background. Therefore, a smaller number of detection areas can be divided when the game is loading or when the game is over. When the game status is in the game, due to the diversity of page styles and complexity of scenes during the game, a larger number of detection areas need to be divided during the game. When calculating the coordinates of the center pixel point of each inspection area, calculations can also be performed based on the vertex coordinates of each detection area.
[0054] In the above, the game page map is evenly divided into a corresponding number of detection areas according to the game state, and the vertex coordinates of the designated detection area are determined, and the pixel center coordinates of the designated detection area are calculated according to the vertex coordinates. The detection area can be divided according to the characteristics of the current game page type, and the detection accuracy can be guaranteed while reducing the detection area and improving the detection efficiency.
[0055] Step S102: Calculate the color value of the pixel center point according to the coordinates of the pixel center point and a color value calculation function.
[0056] The color value calculation function can be an impixel function, which can return the color value of a selected pixel or pixel set. The color value corresponding to the pixel point can be obtained by directly using the pixel coordinates as the input parameter of the function, or by selecting the pixel by the mouse, and inputting the coordinates of the selected pixel as the input parameter into the function. The color value is the RGB value, which represents the brightness intensity of the three colors of red, green and blue. It is the abbreviation of the three English words red (red), green (green) and blue (blue). These three colors are the three primary colors in the additive color mode. Through the different intensity combinations of these three colors, almost all colors that can be perceived by human vision can be formed. In the RGB color mode, the brightness intensity of each primary color can be represented by an integer between 0 and 255, where 255 represents the maximum brightness of the color, and 0 represents the absence of the color. Such as pink (255, 192, 203). In one embodiment, the coordinates of the pixel center points of each detection area calculated are input into the impixel function to directly output the color value of each pixel center point.
[0057] Step S103, comparing whether the color values of the center points of each pixel are consistent. If the color values are consistent, comparing the color values with the black value and the white value respectively to determine the page type, which includes a white page type, a black page type or a non-black and white page type.
[0058] The black value is a color value used to represent black, that is, (0,0,0). The white value is a color value used to represent white, that is, (255,255,255). The white page type can represent a page type in which the entire screen is white, and the black page type represents a page type in which the entire screen is black. The non-black and white page type can represent a color page type, or a black and white page type, where a black and white page refers to a page that only contains black and white, and does not contain pages of other colors. In one embodiment, the color values of the pixel center points of each detection area calculated are compared to determine whether the color values of the pixel center points are consistent. Exemplarily, if the number of detection areas is 4, they are the first detection area, the second detection area, the third detection area, and the fourth detection area. According to the color value calculation function, the color values of the pixel center points of each detection area are calculated to be (128,128,128), (255,255,0), (255,215,0) and (0,0,0), respectively. By comparing the color value (128,128,128) of the pixel center point of the first detection area with the color value (255,255,0) of the pixel center point of the second detection area, it can be seen that the coordinates of the pixel center points of the above two areas are inconsistent, and the page type can be directly determined to be a non-black and white page. If the color value of the pixel center point of the first detection area is consistent with the color value of the pixel center point of the second detection area, then continue to compare with the color value of the pixel center point of the third detection area, otherwise, directly determine that the page type is a non-black and white page. If the color values of the pixel center points in the four detection areas are consistent, the color value of the pixel center point in any detection area is compared with the black value. If it is consistent with the black value, the page type is determined to be a black page type. If it is inconsistent with the black value, it is compared with the white value. If it is consistent with the white value, the page type is determined to be a white page type. If it is inconsistent with the white value, the page type is determined to be a non-black and white page type. The comparison order with the black value and the white value can be swapped, which is not limited here.
[0059] Step S104: when the page type is a white page type or a black page type, determine that the monitoring result is that the screen is abnormal; when the page type is a non-black and white page type, determine that the monitoring result is that the screen is normal.
[0060] Screen abnormality refers to abnormal conditions that occur during the game or when loading before the game starts due to problems such as the game driver not being updated in time or being incompatible. When the page type is determined to be a white page type or a black page type, it can be determined that the current game page has an abnormal black or white screen due to incompatibility or unupdated versions, and cannot be used normally. When the page type is determined to be a non-black and white page type, it can be determined that the current game page is in a normal state.
[0061] In the above, by periodically acquiring the game page map, the game page map is divided into a preset number of detection areas, and the coordinates of the pixel center points of each detection area are determined; the color value of the pixel center point is calculated according to the coordinates of the pixel center point and the color value calculation function; the color values of the pixel center points are compared to see if they are consistent, and when the color values are consistent, the color values are compared with the black value and the white value to determine the page type, and the page type includes a white page type, a black page type, or a non-black and white page type; when the page type is a white page type or a black page type, the monitoring result is determined to be an abnormal screen, and when the page type is a non-black and white page type, the monitoring result is determined to be a normal screen. By dividing the detection area and acquiring the coordinates of the pixel center points of each area, the color values of each area in the page can be uniformly acquired, and the type of the page can be determined based on the color values of the pixel center points of each detection area, which can ensure the accuracy of black and white screen detection and improve the detection efficiency, avoiding the calculation and comparison of the color value of each pixel point in the page, which affects the detection efficiency.
[0062] In one embodiment, after determining that the detection result is a screen abnormality, the method further includes:
[0063] The abnormal time of the screen abnormality is calculated according to the detection results of the preset period. When the abnormal time exceeds the abnormal time threshold, a screen abnormality prompt is given, and the game is restarted based on the confirmation instruction.
[0064] The preset period is pre-set according to the set detection period, and is used to indicate the duration of the screen abnormality. For example, if the detection period is 5s, the preset period can be set to three periods. The abnormal time threshold is calculated based on the detection period and the preset period. If the detection period is 5s and the preset period is three periods, the abnormal time threshold is 15s. The screen abnormality prompt is a prompt used to prompt the user that the screen is currently abnormal. The screen abnormality prompt can be displayed on the screen of the game terminal in the form of a dialog box. The dialog box can include specific prompt content, such as "The current page is abnormal, do you want to restart?", and can also include "Confirm" and "Wait" options.
[0065] Exemplarily, if the detection cycle is 5s, the preset cycle is three cycles, and the abnormal time threshold is 15s, then after determining that the monitoring result is a screen abnormality, the second cycle detection is performed according to the detection cycle. When the detection result of the second cycle is abnormal, the third cycle detection is performed, and the abnormal time of the screen abnormality at this time is determined to be 5S. When the detection result of the third cycle is a screen abnormality, the fourth cycle detection is performed, and the abnormal time of the screen abnormality at this time is determined to be 10s. When the detection result of the fourth cycle is a screen abnormality, the abnormal time of the screen abnormality at this time is determined to be 15s. An abnormal prompt message can be sent to the screen of the game terminal to remind the user that the current page is abnormal, and the prompt words "Current page abnormality, do you want to restart?" and the "Confirm" and "Wait" options are displayed in the dialog box. When the user clicks the "Confirm" option, the game is restarted. When the user clicks the "Wait" option, the abnormal detection continues until the preset number of detection cycles is reached or the screen is normal.
[0066] As mentioned above, the abnormal time of the screen abnormality is calculated based on the detection results of the preset period. When the abnormal time exceeds the abnormal time threshold, a screen abnormality prompt is given, and the game is restarted based on the confirmation instruction. It can prompt the screen abnormality within a reasonable time, avoiding the prompt of the short black or white screen phenomenon caused by page jumps that affects the normal use of users, and can also avoid the long-term failure to remind the screen abnormality and affect the user experience.
[0067] Figure 2 is a flow chart of a method for calculating the coordinates of a regional pixel center provided in an embodiment of the present application. Figure 2 As shown, including:
[0068] Step S201: When the game status is loading, the game page is divided into three detection areas of upper, middle and lower parts in equal proportion, and the vertex coordinates of the middle detection area are obtained.
[0069] In one embodiment, since when the game status is loading, only the middle area may have a loading progress bar, the game page is divided into three detection areas of equal proportion: upper, middle and lower. Figure 3 is a schematic diagram of a game loading page provided in an embodiment of the present application, such as Figure 3 As shown, by inputting the game page image into the pixel point coordinate system, the coordinates of each vertex in the middle area are determined.
[0070] Step S202, calculating the regional pixel center coordinates of the middle detection area according to the vertex coordinates of the middle detection area, wherein the number of the regional pixel center coordinates is multiple and the number of the regional pixel center coordinates is determined according to the length and position of the game loading progress bar.
[0071] The regional pixel center coordinates may be the coordinates of multiple pixel points at the center position of the middle area. Since the middle area is the middle area of the entire game page map, the regional pixel center coordinates may also be the coordinates of multiple pixel points at the center position of the entire game page map. The number of regional pixel center coordinates is determined according to the position and length of the game loading progress condition, where the position of the loading progress bar is at the center position of the game page. Exemplarily, if the length of the loading progress bar is 4 cm, corresponding to 200 pixels, the coordinates of the 4 regional pixel center points can be calculated. For example, if the vertex coordinates of the middle area are (0,30), (0,60), (300,30), (300,60), respectively, it can be known from the vertex coordinates that the number of columns in the middle detection area is 300 and the number of rows is 30. Then the coordinates of the center points of the pixels of the four regions are determined on the 15th row, and there are 200 pixels on the 15th row as the pixels of the loading progress bar, and the remaining 100 pixels are pixels of the non-loading progress bar. Since the loading progress bar is at the center of the page image, the pixel point of the 15th row and the 50th column can be determined as the starting point of the loading progress bar, and the pixel point of the 15th row and the 250th column can be determined as the end point of the loading progress bar. Therefore, the center coordinates of the regional pixels can be determined to be (50,15), (100,15), (150,15), and (200,15). After determining the center coordinates of the regional pixels, the color values of the corresponding pixels are calculated according to the color value calculation function.
[0072] In the above, when the game state is loading, the game page is divided into three detection areas of upper, middle and lower in equal proportion, and the vertex coordinates of the middle detection area are obtained, and the regional pixel center coordinates of the middle detection area are calculated according to the vertex coordinates of the middle detection area, wherein the number of the regional pixel center coordinates is multiple, and the number of the regional pixel center coordinates is determined according to the length and position of the game loading progress bar. The color value of the pixel to be detected can be obtained at a position where there may be a color difference with other detection areas, avoiding unnecessary pixel extraction and detection in other detection areas, and improving detection efficiency.
[0073] In one embodiment, the color value of the first pixel center point is compared with the color value of the last pixel center point. If the color values are consistent, the color value of the first pixel center point is compared with the color values of the remaining pixel center points to determine whether the color values of the pixel center points are consistent.
[0074] The color value of the center of the first pixel is the color value of the pixel at the starting position of the loading progress bar, and the color value of the center of the last pixel is the color value of the pixel at the end position of the loading progress bar. Since the loading progress bar changes over time, when the loading starts, the color values of the pixels at the starting position of the loading progress bar are inconsistent with those at the end position. At this time, it can be determined that the game is loading and the screen is normal. If the color values of the pixels at the starting position are consistent with those of the pixels at the end position, it can be preliminarily determined that the game is not loaded at this time, and there may be a black screen abnormality or a white screen abnormality. In order to improve the accuracy of the detection, when the color values of the pixels are consistent, the color value is compared with the color values of the remaining pixels that have not been compared to determine whether the color values of the center points of each pixel are consistent. If consistent, the color value is compared with the black value and the white value to determine whether the current screen is abnormal or the screen is normal. For specific comparison methods, please refer to steps S103-S104.
[0075] Figure 4 is a flowchart of a method for calculating pixel center coordinates provided in an embodiment of the present application. Figure 4 As shown, including:
[0076] Step S401: when the game state is in the game process, the game page is divided into nine-square grid areas, and the vertex coordinates of each detection area are obtained.
[0077] In one embodiment, due to the diversity and complexity of the game scenes when the game state is in the game process, the game page is divided into nine-square grid areas. Figure 5 is a schematic diagram of a nine-square grid area provided in an embodiment of the present application, such as Figure 5 As shown, by inputting the game page image into the pixel point coordinate system, the coordinates of each vertex in the middle area are determined.
[0078] Step S402: Calculate the coordinates of the pixel center points of each detection area according to the vertex coordinates of each detection area, wherein the number of the pixel center point of each detection area is one.
[0079] For example, if the vertex coordinates of the first detection area are (0,0), (0,50), (70,0), (70,50), then the horizontal coordinate of the pixel center point of the first detection area is (70-0) / 2=35, the vertical coordinate is (50-0) / 2=25, and the pixel center point coordinate of the first detection area is (35,25). This calculation method is used to calculate the pixel center point coordinates of each detection area in the nine-square grid area. And the pixel center point coordinates are input into the impixel function to calculate the color value of each pixel center point.
[0080] In the above, when the game state is in the game process, the game page is divided into nine-square grid areas, and the vertex coordinates of each detection area are obtained, and the pixel center coordinates of each detection area are calculated according to the vertex coordinates of each detection area, wherein the number of pixel center points of each detection area is one. The game page map can be divided according to the complexity of the game scene, and the detection range of the game page can be fully covered without increasing the number of pixels to be detected, thereby improving the accuracy and efficiency of detection.
[0081] In one embodiment, the first color values of the pixel center points on the first diagonal line of the nine-grid area are compared. When the first color values are consistent, the second color values of the pixel center points on the second diagonal line of the nine-grid area are compared. When the second color values are consistent, the first color value or the second color value is compared with the third color value of the pixel center points on the non-diagonal line of the nine-grid area to determine whether the first color value or the second color value is consistent with the third color value.
[0082] The first color value includes the color values of the three pixel center points on the first diagonal line, the second color value includes the color values of the three pixel center points on the second diagonal line, and the third color value is the color value of the fourth pixel center point on the non-diagonal line. Figure 5 As shown, the first diagonal is a diagonal line that is diagonally upward in the nine-square grid area, and the second diagonal line is a diagonal line that is diagonally downward in the nine-square grid area. Since the spanning distance of the three pixel center points on the diagonal is relatively large, the probability of color difference is relatively high. Therefore, after calculating the color value of each pixel center point, the color value of the pixel center point on the diagonal is preferentially compared, wherein the comparison order of each color value on the first object line and the second diagonal is not limited here. When the color values of the three pixel points on the first diagonal or the second diagonal are inconsistent, that is, the three color values included in the first color value are inconsistent or the three color values included in the second color value are inconsistent, it can be directly determined that the current page type is a non-black and white page type, and the screen is normal. If the three pixel values on the first diagonal are the same as the three pixel values on the second diagonal, the first color value or the second color value is compared with the color values of the four pixel center points on the non-diagonal line. If they are consistent, the first color value, the second color value or the third color value is compared with the black value and the white value, then the page type is considered to be a black type or a white type, and the screen is abnormal. If they are inconsistent, it is considered that the page type is not black and white and the screen is normal.
[0083] In the above, by comparing the first color values of the pixel center points on the first diagonal of the nine-grid area, when the first color values are consistent, the second color values of the pixel center points on the second diagonal of the nine-grid area are compared, and when the second color values are consistent, the first color value or the second color value is compared with the third color value of the pixel center points on the non-diagonal lines of the nine-grid area to determine whether the first color value or the second color value is consistent with the third color value. The coordinates of the pixel center points with large color differences can be compared first, and inconsistent colors can be quickly determined, thereby improving the efficiency of screen abnormality detection.
[0084] Figure 6 is a schematic diagram of the structure of a black and white screen abnormality detection device provided in an embodiment of the present application, such as Figure 6 As shown, including:
[0085] The area division module 61 is used to periodically obtain a game page map and divide the game page map into a preset number of detection areas;
[0086] A coordinate determination module 62, used to determine the coordinates of the pixel center point of each detection area;
[0087] A color value calculation module 63, used to calculate the color value of the pixel center point according to the coordinates of the pixel center point and a color value calculation function;
[0088] Page type determination 64, used to compare whether the color values of the center points of each pixel are consistent. If the color values are consistent, the color values are compared with the black value and the white value to determine the page type, and the page type includes a white page type, a black page type or a non-black and white page type;
[0089] The screen status determination module 65 is used to determine that the monitoring result is that the screen is abnormal when the page type is a white page type or a black page type, and to determine that the monitoring result is that the screen is normal when the page type is a non-black and white page type.
[0090] The embodiment of the present application periodically obtains the game page map, divides the game page map into a preset number of detection areas, and determines the coordinates of the pixel center point of each detection area; calculates the color value of the pixel center point according to the coordinates of the pixel center point and the color value calculation function; compares whether the color values of the pixel center points are consistent, and when the color values are consistent, compares the color values with the black value and the white value to determine the page type, and the page type includes a white page type, a black page type, or a non-black and white page type; when the page type is a white page type or a black page type, the monitoring result is determined to be a screen abnormality, and when the page type is a non-black and white page type, the monitoring result is determined to be a normal screen. By dividing the detection area and obtaining the coordinates of the pixel center point of each area, the color value of each area in the page can be uniformly obtained, and the type of the page can be determined based on the color value of the pixel center point of each detection area, which can ensure the accuracy of black and white screen detection and improve the detection efficiency, avoiding the calculation and comparison of the color value of each pixel point in the page, which affects the detection efficiency.
[0091] In a possible embodiment, the area division module 61 is used to evenly divide the game page map into a corresponding number of detection areas according to the game state;
[0092] The coordinate determination module 62 is used to determine the vertex coordinates of the designated detection area, and calculate the pixel center point coordinates of the designated detection area according to the vertex coordinates.
[0093] In a possible embodiment, the coordinate determination module 62 is specifically used to divide the game page into three detection areas of upper, middle and lower parts in equal proportion when the game state is that the game is loading, and obtain the vertex coordinates of the middle detection area;
[0094] The regional pixel center coordinates of the middle detection area are calculated according to the vertex coordinates of the middle detection area, wherein the number of the regional pixel center coordinates is multiple and the number of the regional pixel center coordinates is determined according to the length and position of the game loading progress bar.
[0095] In one possible embodiment, the page type determination 64 is specifically used to compare the color value of the first pixel center point with the color value of the last pixel center point. When the color values are consistent, the color value of the first pixel center point is compared with the color values of the remaining pixel center points to determine whether the color values of the pixel center points are consistent.
[0096] In a possible embodiment, the coordinate determination module 62 is specifically used to divide the game page into nine-grid areas and obtain the vertex coordinates of each detection area when the game state is in the game process;
[0097] The pixel center point coordinates of each detection area are calculated according to the vertex coordinates of each detection area, wherein the number of the pixel center point of each detection area is one.
[0098] In one possible embodiment, the page type determination 64 is specifically used to compare the first color values of the pixel center points on the first diagonal line of the nine-square grid area. When the first color values are consistent, the second color values of the pixel center points on the second diagonal line of the nine-square grid area are compared. When the second color values are consistent, the first color value or the second color value is compared with the third color value of the pixel center points on the non-diagonal line of the nine-square grid area to determine whether the first color value or the second color value is consistent with the third color value.
[0099] The embodiment of the present application also provides a black-and-white screen abnormality detection device, which can be integrated with a black-and-white screen abnormality detection device provided in the embodiment of the present application. Figure 7 Schematic diagram of a black and white screen abnormality detection device provided in an embodiment of the present application. Figure 7 The black-and-white screen abnormality detection device includes: an input device 73, an output device 74, a memory 72, and one or more processors 71; the memory 72 is used to store one or more programs; when one or more programs are executed by one or more processors 71, the one or more processors 71 implement the black-and-white screen abnormality detection method provided in the above embodiment. The input device 73, the output device 74, the memory 72, and the processor 71 can be connected by a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0100] The memory 72, as a computing device readable storage medium, can be used to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the black and white screen abnormality detection method provided in any embodiment of the present application. The memory 72 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the device, etc. In addition, the memory 72 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 72 may further include a memory remotely arranged relative to the processor 71, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0101] The input device 73 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 74 may include a display device such as a display screen.
[0102] The processor 71 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 72, that is, implements the above-mentioned black and white screen abnormality detection method.
[0103] The black and white screen anomaly detection device, equipment and computer provided above can be used to execute the black and white screen anomaly detection method provided by any of the above embodiments, and have corresponding functions and beneficial effects.
[0104] The embodiment of the present application further provides a storage medium storing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are used to execute the black-and-white screen abnormality detection method provided in the above embodiment. The black-and-white screen abnormality detection method includes:
[0105] Periodically acquiring a game page map, dividing the game page map into a preset number of detection areas, and determining the coordinates of a pixel center point of each detection area;
[0106] Calculate the color value of the center point of the pixel according to the coordinates of the center point of the pixel and a color value calculation function;
[0107] Comparing whether the color values of the center points of each pixel are consistent, and if the color values are consistent, comparing the color values with the black value and the white value to determine the page type, wherein the page type includes a white page type, a black page type, or a non-black and white page type;
[0108] When the page type is a white page type or a black page type, the monitoring result is determined to be a screen abnormality, and when the page type is a non-black and white page type, the monitoring result is determined to be a screen normal.
[0109] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.
[0110] Of course, the storage medium containing computer executable instructions provided in an embodiment of the present application is not limited to the black and white screen abnormality detection method described above, and can also execute related operations in the black and white screen abnormality detection method provided in any embodiment of the present application.
[0111] The black and white screen abnormality detection device, equipment and storage medium provided in the above embodiments can execute the black and white screen abnormality detection method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the black and white screen abnormality detection method provided in any embodiment of the present application.
[0112] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A black and white screen abnormality detection method, characterized in that: include: Periodically acquiring a game page map, dividing the game page map into a preset number of detection areas, and determining the coordinates of a pixel center point of each detection area; Calculate the color value of the center point of the pixel according to the coordinates of the center point of the pixel and a color value calculation function; Comparing whether the color values of the center points of each pixel are consistent, and if the color values are consistent, comparing the color values with the black value and the white value to determine the page type, wherein the page type includes a white page type, a black page type, or a non-black and white page type; When the page type is a white page type or a black page type, the monitoring result is determined to be a screen abnormality, and when the page type is a non-black and white page type, the monitoring result is determined to be a screen normal.
2. The black and white screen abnormality detection method according to claim 1, characterized in that: The step of dividing the game page image into a preset number of detection areas and determining the pixel center point coordinates of each detection area includes: The game page map is evenly divided into a corresponding number of detection areas according to the game state, and the vertex coordinates of the designated detection areas are determined, and the pixel center point coordinates of the designated detection areas are calculated according to the vertex coordinates.
3. The black and white screen abnormality detection method according to claim 2 is characterized in that: The step of evenly dividing the game page graph into a corresponding number of detection areas according to the game state and determining vertex coordinates of the designated detection areas includes: When the game state is loading, the game page is divided into three detection areas of upper, middle and lower parts in equal proportion, and the vertex coordinates of the middle detection area are obtained; Correspondingly, calculating the pixel center point coordinates of the detection area according to the vertex coordinates includes: The regional pixel center coordinates of the middle detection area are calculated according to the vertex coordinates of the middle detection area, wherein the number of the regional pixel center coordinates is multiple and the number of the regional pixel center coordinates is determined according to the length and position of the game loading progress bar.
4. The black and white screen abnormality detection method according to claim 3 is characterized in that: The comparing whether the color values of the center points of each pixel are consistent includes: The color value of the first pixel center point is compared with the color value of the last pixel center point. If the color values are consistent, the color value of the first pixel center point is compared with the color values of the remaining pixel center points to determine whether the color values of the pixel center points are consistent.
5. The black and white screen abnormality detection method according to claim 2, characterized in that: The step of evenly dividing the game page graph into a corresponding number of detection areas according to the game state and determining vertex coordinates of the designated detection areas includes: When the game state is in the game process, the game page is divided into nine-square grid areas, and the vertex coordinates of each detection area are obtained; Correspondingly, calculating the pixel center point coordinates of the detection area according to the vertex coordinates includes: The pixel center point coordinates of each detection area are calculated according to the vertex coordinates of each detection area, wherein the number of the pixel center point of each detection area is one.
6. The black and white screen abnormality detection method according to claim 5, characterized in that: The comparing whether the color values of the center points of each pixel are consistent includes: Compare the first color values of the pixel center points on the first diagonal line of the nine-square grid area. When the first color values are consistent, compare the second color values of the pixel center points on the second diagonal line of the nine-square grid area. When the second color values are consistent, compare the first color value or the second color value with the third color value of the pixel center points on the non-diagonal line of the nine-square grid area to determine whether the first color value or the second color value is consistent with the third color value.
7. The black and white screen abnormality detection method according to claim 1, characterized in that: After determining that the detection result is a screen abnormality, the method further includes: The abnormal time of the screen abnormality is calculated according to the detection results of the preset period. When the abnormal time exceeds the abnormal time threshold, a screen abnormality prompt is given, and the game is restarted based on the confirmation instruction.
8. A black and white screen abnormality detection device, characterized in that: include: An area division module, used for periodically acquiring a game page map and dividing the game page map into a preset number of detection areas; A coordinate determination module, used to determine the coordinates of the pixel center point of each detection area; A color value calculation module, used to calculate the color value of the pixel center point according to the coordinates of the pixel center point and a color value calculation function; Page type determination, used to compare whether the color values of the center points of each pixel are consistent. If the color values are consistent, the color values are compared with the black value and the white value to determine the page type, which includes a white page type, a black page type, or a non-black and white page type; The screen status determination module is used to determine that the monitoring result is an abnormal screen when the page type is a white page type or a black page type, and to determine that the monitoring result is a normal screen when the page type is a non-black and white page type.
9. A black and white screen abnormality detection device, the device comprising: one or more processors; A storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the black and white screen abnormality detection method as described in any one of claims 1-7.
10. A storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the black-and-white screen abnormality detection method according to any one of claims 1 to 7 when executed by a computer processor.
Citation Information
Cited By
VDI (Virtual Desktop Infrastructure) picture anomaly identification method, system and equipment and computer storage medium
CN121437957A