Information acquisition method, device, terminal and medium

By obtaining the target interface image of the application and using the contour recognition algorithm to identify the target area and obtaining resource distribution information, the problem of unreliable resource distribution information caused by differences between different terminals is solved, and higher reliability and flexibility in information acquisition are achieved.

CN110533673BActive Publication Date: 2025-01-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201910782491.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-22
Publication Date
2025-01-10
Estimated Expiration
2039-11-19

AI Technical Summary

Technical Problem

When acquiring resource distribution information, due to differences between different terminals, the acquired resource distribution information is unreliable, which affects the reliability of processing operations.

Method used

By obtaining the target interface image of the application, identifying the target area using the contour recognition algorithm, and obtaining the resource distribution information of multiple resources in the area, improving the reliability of the resource distribution information.

Benefits of technology

This method improves the reliability of resource distribution information and is suitable for various terminals. It has strong flexibility and can effectively improve the accuracy of the acquired resource distribution information and the reliability of processing operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110533673B_ABST
    Figure CN110533673B_ABST
Patent Text Reader

Abstract

The present application discloses an information acquisition method, device, terminal and medium, wherein the method comprises: acquiring a target interface image of an application, wherein the target interface image includes multiple resources; identifying a target area in the target interface image according to a contour recognition algorithm, wherein the target area is the minimum image area in the target interface image that includes all resources; and acquiring resource distribution information of the multiple resources in the target area. By adopting the embodiments of the present application, resource distribution information can be acquired based on the target area identified by image processing, which helps to improve the reliability of the acquired resource distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to an information acquisition method, device, terminal and medium. Background Art

[0002] For resource applications, it is often necessary to obtain resource distribution information in order to perform processing operations such as resource elimination or application testing based on the obtained resource distribution information. When obtaining resource distribution information, the terminal generally obtains the resource distribution information directly from the application configuration file, and different terminals obtain the same resource distribution information. However, due to differences between different terminals, there may be a deviation between the obtained resource distribution information and the actual resource distribution of the resources in the application interface, resulting in unreliable resource distribution information, and low reliability or even errors in processing operations based on resource distribution information. Therefore, how to obtain resource distribution to improve the reliability of the obtained resource distribution information becomes the key. Summary of the invention

[0003] The embodiments of the present application provide an information acquisition method, device, terminal and medium, which help to improve the reliability of acquired resource distribution information.

[0004] On the one hand, an embodiment of the present application provides an information acquisition method, including:

[0005] Acquire a target interface image of the application, wherein the target interface image includes multiple resources;

[0006] Identify a target area in the target interface image according to a contour recognition algorithm, wherein the target area is a minimum image area including all resources in the target interface image;

[0007] Resource distribution information of the multiple resources in the target area is obtained.

[0008] On the other hand, an embodiment of the present application provides an information acquisition device, including:

[0009] An acquisition unit, configured to acquire a target interface image of an application, wherein the target interface image includes a plurality of resources;

[0010] An identification unit, used to identify a target area in the target interface image according to a contour recognition algorithm, wherein the target area is a minimum image area including all resources in the target interface image;

[0011] The acquisition unit is further used to acquire resource distribution information of the multiple resources in the target area.

[0012] In another aspect, an embodiment of the present invention provides a terminal, the terminal including an input device and an output device, the terminal further including:

[0013] a processor adapted to implement one or more instructions; and,

[0014] A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the above method.

[0015] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the above method; or, the computer-readable storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by the processor and executing the above method.

[0016] In an embodiment of the present application, the terminal can obtain the target interface image of the application, identify the target area including multiple resources in the target interface image according to a preset contour recognition algorithm, and obtain resource distribution information of the multiple resources in the target area, that is, it can determine the resource distribution information based on the identified operable area. This information acquisition method based on image processing can be applied to various terminals, has strong flexibility, and helps to improve the reliability of the obtained resource distribution information. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings in the description of the embodiments are briefly introduced below.

[0018] Figure 1a This is a resource distribution diagram provided by an embodiment of the present application;

[0019] Figure 1b This is another resource distribution diagram provided in an embodiment of the present application;

[0020] Figure 1c This is another resource distribution diagram provided in an embodiment of the present application;

[0021] Figure 1d This is another resource distribution diagram provided in an embodiment of the present application;

[0022] Figure 2 It is a flowchart of an information acquisition method provided in an embodiment of the present application;

[0023] Figure 3 is a flow chart of a method for determining a target area provided in an embodiment of the present application;

[0024] Figure 4a It is a schematic diagram of the architecture of a method for identifying a target area provided in an embodiment of the present application;

[0025] Figure 4b It is a schematic diagram of the architecture of another method for identifying a target area provided in an embodiment of the present application;

[0026] Figure 5a It is a schematic diagram of an architecture of a method for determining a resource movement strategy provided by an embodiment of the present application;

[0027] Figure 5b It is a schematic diagram of the architecture of another method for determining a resource movement strategy provided by an embodiment of the present application;

[0028] Figure 6a It is a flowchart of another information acquisition method provided in an embodiment of the present application;

[0029] Figure 6b It is a flowchart of another information acquisition method provided in an embodiment of the present application;

[0030] Figure 7 is a schematic diagram of a target interface image after grayscale processing provided in an embodiment of the present application;

[0031] Figure 8 is a schematic diagram of a contour recognition result image provided by an embodiment of the present application;

[0032] Fig. 9 is a schematic diagram of a regional image provided in an embodiment of the present application;

[0033] Fig.10 It is a schematic diagram of separating resources provided in an embodiment of the present application;

[0034] Fig.11a is a schematic diagram of a resource classification result provided in an embodiment of the present application;

[0035] Fig.11b is a schematic diagram of a resource classification result provided in an embodiment of the present application;

[0036] Fig.12 is a structural schematic diagram of an information acquisition device provided in an embodiment of the present application;

[0037] Fig.13 It is a structural diagram of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] In an embodiment of the present application, for a resource-based application, the interface image of the application may include multiple resources. For example, the resource-based application involved in the present application may refer to a three-in-one (elimination type) application. Among them, the resource can be represented by various shapes, such as a rectangle, a circle, a five-pointed star, etc.; and / or, the resource can include multiple colors, such as red, blue, green, etc.; and / or, the resource can include various features, such as different patterns. The shapes of any two of the multiple resources may be the same or different, the colors included in any two resources may be the same or different, and the features included in any two resources may be the same or different. Optionally, the shape of the resource can be determined based on a contour recognition algorithm, the color of the resource can be determined based on a color recognition algorithm such as a color mean recognition algorithm, the feature of the resource can be determined by a preset feature algorithm, and so on, which is not limited in the present application.

[0039] For example, in one embodiment, the resources can be represented by the same shape, such as a rectangle, and can be distinguished by color. Resources with the same color belong to the same category. That is, if two resources have the same color, the two resources belong to the same category; if the two resources have different colors, the two resources belong to different categories. Figure 1a As shown, the image includes red (the mark "R" in the figure represents the red) resources, yellow (the mark "Y" in the figure represents the yellow) resources and blue (the mark "B" in the figure represents the blue) resources, then the red resources belong to the same category, the yellow resources belong to the same category, and the blue resources belong to the same category.

[0040] For another example, in one embodiment, the resource can be represented by different shapes and can be distinguished by color, and resources with the same shape and color belong to the same category. That is, if two resources have the same shape and color, the two resources belong to the same category; if the two resources have different shapes or different colors, the two resources belong to different categories. Figure 1b As shown, the image includes circular resources and rectangular resources, and the resources are divided into yellow (Y) and blue (B). Then, the yellow circular resources belong to the same category, the blue circular resources belong to the same category, the yellow rectangular resources belong to the same category, and the blue rectangular resources belong to the same category.

[0041] For another example, in one embodiment, the resources can be represented by the same shape, such as a rectangle, and can be distinguished by color and features. Resources with the same color and features belong to the same category. That is, if the colors and features of two resources are the same, the two resources belong to the same category; if the colors or features of the two resources are different, the two resources belong to different categories. Figure 1cAs shown, the image includes red (R) resources and blue (B) resources, and the resource images are divided into those with stars and those without stars. Then, the red star resources belong to the same category, the blue star resources belong to the same category, the red starless resources belong to the same category, and the blue starless resources belong to the same category. Possible resource representation methods are not listed here one by one.

[0042] In the embodiment of the present application, for resource applications, the operable area of ​​the application interface can be identified based on image processing such as a preset contour recognition algorithm, as described above. Figures 1a to 1c , and then the distribution information of the resources in the operable area can be obtained based on the operable area. Furthermore, after the resource distribution information is obtained, a preset processing operation can be performed based on the resource distribution information. For example, automatic testing of the application can be implemented based on the resource distribution information, including determining a resource movement strategy based on resource distribution information such as the location information of the resource and the category to which the resource belongs, and performing resource elimination processing based on the resource movement strategy to implement automatic application testing; the application testing method based on image processing helps to improve the test effect and has strong test flexibility. For another example, resource elimination processing can be performed based on the resource distribution information and the user's operation instruction to move the resource, including receiving an operation instruction input by the user for any resource, and performing resource elimination processing based on the resource movement direction carried by the operation instruction, the resource distribution information such as the location information of the resource and the category to which the resource belongs, so as to improve the reliability of the elimination processing. For another example, after performing resource elimination processing based on the resource distribution information, new resources can be generated based on the resource distribution information after the elimination processing (for example, new resources can be generated based on the level of the checkpoint; the higher the level of the checkpoint, the higher the difficulty of the elimination processing operation based on the resource distribution after the new resources are generated; conversely, the lower the level of the checkpoint, the lower the difficulty of the elimination processing operation based on the resource distribution after the new resources are generated) to enhance the flexibility of resource generation, etc.

[0043] In one embodiment, when the resource distribution in the target area changes, the resource distribution information in the target area may be updated to obtain new resource distribution information, and then a preset processing operation may be performed based on the new resource distribution information.

[0044] In one embodiment, resource elimination processing may refer to moving a resource (which may refer to exchanging the position of the resource with the resource at the moved position), and then eliminating multiple resources (such as resources adjacent to the moved resource and having the same attributes, such as Figure 1a As shown, by moving the second resource in the fourth row to the left or the first resource in the fourth row to the right, the second to fifth resources in the first column can be eliminated; it is also possible to eliminate 0 resources, such as Figure 1aAs shown, after moving the fourth resource in the first row to the left or the third resource in the first row to the right, 0 resources can be eliminated), and the resources associated with the eliminated resources can be moved according to the position of the eliminated resources, and new resources can be generated according to the number of resources eliminated by the resource elimination process. At this time, the resource distribution in the target area changes, and new resource distribution information can be obtained, such as updating the resource distribution information in the target area according to the moved resources and the new resources, and re-obtaining the distribution information of all resources in the target area to perform resource elimination based on the new resource distribution information. For example, the associated resources can be resources adjacent to the position of the eliminated resources, such as Figure 1a As shown, after moving the second resource in the fourth row to the left or the first resource in the fourth row to the right to eliminate the four resources in the first column, the associated resource may refer to the first resource in the original first row, and then the resource may be moved to the position of the first resource in the fifth row, and the first three resource positions in the original first column may generate new resources, such as Figure 1d As shown, assuming that the newly generated resources are blue resources, yellow resources, red resources and blue resources from the first to the fourth in the first column, the resource distribution changes.

[0045] In one embodiment, the terminal can perform application testing based on the resource distribution information. When performing application testing based on the resource distribution information, the application on the terminal can also be tested in combination with the test pile test method to improve the test reliability. For example, during application development, the test pile can be pre-deployed, the test pile can be reserved in the test version, the test script written according to the test pile can be obtained, and the attribute information of the resource such as coordinates can be obtained from the configuration file, and the resource movement scheme can be determined according to the attribute information of the resource and the test script, so that the automatic test of the application can be quickly realized based on the test pile. However, for the application testing method based on the test pile, it is necessary to deploy all the test pile schemes in the early stage of development, and the cost of adding test piles later is high. If all the test piles are not deployed in the early stage of development, the test effect will be poor, and even the automated test cannot be completed; and because the test piles are deployed, it is easy to be attacked by plug-ins after the application is released, and the security is poor. Therefore, when conducting application testing, the terminal can also test the application in combination with the above-mentioned image processing-based application testing method and the test pile testing method. For example, when the test effect is not good (such as due to failure to deploy all test pile solutions in the early stage of development), the image processing-based testing method can be used for application testing. Because it does not need to be deployed in the early stage of development, it helps to prevent external attacks, has better security, and has higher testing flexibility, thereby improving the test effect. For example, the terminal can respectively use the image processing-based testing method and the test pile testing method to perform application testing, which helps to ensure the reliability of the test results from multiple dimensions and further improve the test effect.

[0046] In one embodiment, the terminal can perform application testing based on the resource distribution information. When performing application testing based on the resource distribution information, the application can also be tested in combination with a fixed resource arrangement method to improve the flexibility of the test. For example, when developing an application, the arrangement order of the test resources can be fixed, and the order in which new resources are generated can be fixed, so that test cases can be generated according to a fixed algorithm to achieve automatic testing, and the test complexity is low. However, the test method based on the fixed arrangement of resources cannot be tested for scenarios in which new resources are randomly generated, and the test effect is poor for applications in which resources are randomly generated; moreover, the resolutions of different terminals may be different, and different resolutions may cause resource distribution information in the fixed algorithm, such as coordinate offset, resulting in unreliable coordinates determined based on the fixed algorithm, and poor test reliability. Therefore, when performing application testing, the terminal can also test the application in combination with the above-mentioned image processing-based application testing method and the fixed resource arrangement method, such as determining the test method by detecting the type of application, such as whether the resources are randomly generated or fixedly arranged and generated, thereby improving the flexibility of the test. For example, for applications with fixed resource arrangement and new resources generated in a fixed order, the application test can be performed through the fixed resource arrangement method to reduce the test overhead; for another example, for applications with randomly generated resources, the application test can be performed through the image processing test method, which can automatically test the randomly generated resources, and obtain the resource distribution information of the operable area such as the resource location after determining the operable area based on image processing for testing, so that the determined resource distribution information is more reliable, and even for terminals or interfaces with different resolutions, effective resource distribution information can be determined, which helps the reliability of application testing. Alternatively, the terminal can use the image processing-based test method and the fixed resource arrangement method to perform application testing, which helps to ensure the reliability of the test results from multiple dimensions and further improve the test effect.

[0047] It is understandable that in other embodiments, the resource may also be called other names, such as object, resource block, element, etc., which is not limited in this application.

[0048] The technical solution of the present application can be applied to a terminal or other test equipment to implement the testing of applications such as three-elimination applications. The terminal may include a mobile phone, a tablet computer, a computer, etc., which is not limited in the present application. It is understood that in other embodiments, the terminal may also be called other names, such as a smart terminal, a user device, a user terminal, etc., which are not listed here one by one.

[0049] See also Figure 2 is a flow chart of an information acquisition method according to an embodiment of the present application. For example, the information acquisition method can be applied to the above-mentioned terminal. Figure 2As shown, the information acquisition method of this embodiment includes the following steps:

[0050] 201. Obtain a target interface image of an application, where the target interface image includes multiple resources.

[0051] Among them, the target interface image can be an interface image including multiple resources displayed after the application is started, that is, an initial interface image, such as an interface image after the game starts; or, it can also be an interface image obtained after image preprocessing of the initial interface image.

[0052] For example, the image preprocessing may include grayscale processing; after the application is started and enters the initial interface including multiple resources, the terminal may capture the interface image of the application, that is, capture the initial interface image, and grayscale the captured interface image to obtain the grayscaled interface image, and use the grayscaled interface image as the target interface image. In order to determine the operable area in the interface image based on the recognition of the grayscaled interface image, this helps to reduce the complexity of image recognition, improve the efficiency of image recognition, and further improve the efficiency of preset processing operations such as application testing efficiency.

[0053] For another example, the image preprocessing may include grayscale processing and binarization processing; after capturing the initial interface image, the terminal may grayscale the captured interface image to obtain a grayscaled interface image, and binarize the grayscaled interface image to use the binarized interface image as the target interface image. In order to determine the operable area in the interface image based on the recognition of the grayscaled and binarized interface image, compared with only grayscaled interface image, the combination of binarization further reduces the amount of data in the image to highlight the outline of the target, which can further reduce the complexity of image recognition, and further improve the efficiency of preset processing operations such as application testing efficiency.

[0054] 202. Identify a target area in the target interface image according to a contour recognition algorithm. The target area may be an image area including all resources in the target interface image, such as a minimum image area.

[0055] Among them, the contour recognition algorithm can be used to identify the operable area in the interface image, or called the effective operation area, etc., that is, the target area. The target area can also refer to the area of ​​the largest preset shape in the target interface image except the image boundary, such as the largest rectangular area. Optionally, the contour recognition algorithm can be an edge detection algorithm, or can include edge detection and Hough line detection, that is, the contour recognition algorithm can be a set of algorithms encapsulated based on the edge detection algorithm and the Hough line detection algorithm.

[0056] For example, the contour recognition algorithm includes edge detection and Hough line detection. Figure 3 As shown, step 202 may include: 301, respectively using the threshold values ​​in the preset threshold set to perform edge detection on the target interface image to obtain multiple first images; 302, respectively using the threshold values ​​in the preset threshold set to perform Hough line detection on the target interface image after edge detection to obtain multiple second images; 303, determining the image to be identified whose image information meets the preset conditions from the multiple second images, and determining the target area from the image to be identified.

[0057] Among them, the preset threshold set may include multiple thresholds, which can be pre-set for edge detection and Hough line detection, and the threshold may be composed of one or more parameters. For example, the edge detection can be implemented by the Canny algorithm, which uses a dual threshold algorithm to detect and connect edges. The threshold included in the threshold set may refer to a dual threshold, that is, composed of two parameters, such as a threshold / parameter for regulating edge connection (recorded as T1, which can be called a low threshold) and a threshold / parameter for detecting obvious edges (i.e., controlling the initial segmentation of strong edges, the detected edges may be intermittent) (recorded as T2, which can be called a high threshold). In other words, T2 can be used to distinguish the area to be extracted from the background, just like the parameters of threshold segmentation, which can determine the contrast between the target and the background; T1 can be used to smooth the edge contour. If T2 is set too large, the edge contour may be discontinuous or not smooth enough. T1 can be used to connect the discontinuous parts or achieve a smooth contour line. Optionally, multiple threshold sets can be pre-set, such as setting the multiple threshold sets based on the characteristic information of the terminal, including setting the multiple threshold sets according to the model of the terminal, each threshold set can correspond to one or more models; and / or, setting the multiple threshold sets according to the operating system used by the terminal, each threshold set can correspond to one or more operating systems; and / or, setting the multiple threshold sets according to the resolution of the terminal, each threshold set can correspond to one or more resolutions; and / or, setting the multiple threshold sets according to the screen size of the terminal, etc., each threshold set can correspond to one or more screen sizes. Therefore, when performing contour recognition, after determining the threshold set based on the characteristic information of the terminal running the application to be tested, contour recognition can be performed based on the determined threshold set, which helps to improve the reliability of image recognition, improve the reliability of preset processing operations on the terminal such as application testing, and help to quickly identify the target area, thereby improving test efficiency.

[0058] The image information meeting the preset condition may include: the image includes a first preset shape and a plurality of second preset shapes, the shapes corresponding to the first preset shape and the second preset shape may be the same or different (such as the first preset shape and the second preset shape are both rectangles; such as the first preset shape is a rectangle and the second preset shape is a circle, etc.), the plurality of second preset shapes are distributed within the region of the first preset shape, and the first preset shape may be the shape corresponding to the smallest image region including the plurality of second preset shapes; further, the sizes of the plurality of second preset shapes match (such as the same size or the size difference is within the preset size threshold range), and the spacings between adjacent second preset shapes match (such as the same spacing or the spacing difference is within the preset spacing threshold range); wherein the adjacent may include upper and lower adjacent and left and right adjacent, and the spacings between adjacent second preset shapes match may include the spacings between upper and lower adjacent second preset shapes match and / or the spacings between left and right adjacent second preset shapes match. If the above conditions are met and a plurality of second images are screened out, the image information meeting the preset condition may also include: the number of the second preset shapes is the largest among the plurality of second images, that is, the image with the largest number of second preset shapes among the screened out second images is used as the image to be identified. Then the target area may refer to the area corresponding to the first preset shape, or the first preset shape is the shape corresponding to the target area, and the resource may be represented by the second preset shape. For example, the first preset shape and the second preset shape are both rectangles, that is, the image includes a first rectangle (a rectangle excluding the image boundary) and a plurality of second rectangles, the plurality of second rectangles are distributed within the region of the first rectangle, the sizes of the plurality of second rectangles match (such as the same length value and the same width value, or the difference between the length values ​​is within the preset length threshold range and the difference between the width values ​​is within the preset width threshold range, or the perimeter is the same, or the difference between the perimeters is within the preset difference range, etc., not listed here one by one), and the spacing between adjacent second rectangles (such as the distance between the center points of the rectangles) matches; further, the number of the second rectangles is the largest in the plurality of second images; then the target area may refer to the area corresponding to the first rectangle, and the resource may be represented by the second rectangle.

[0059] In one embodiment, if the image includes multiple first rectangles (the multiple first rectangles have different sizes), the multiple second rectangles are all distributed within the range of the multiple first rectangles, that is, when there are multiple large rectangles including the multiple second rectangles, the area corresponding to the rectangle with the smallest size among the multiple first rectangles can be used as the target area to ensure that the acquired target area is the minimum rectangular area including all resources. Optionally, the terminal can determine the target threshold corresponding to the image to be identified (including the threshold corresponding to edge detection and the threshold corresponding to Hough line detection), and can adjust the target threshold according to the preset amplitude, and then can perform edge detection and Hough line detection on the target interface image according to the adjusted target threshold, for example, the preset amplitude can be increased or decreased on the target threshold in turn according to the preset amplitude, and edge detection and Hough line detection are performed according to the target threshold with the increased or decreased preset amplitude, until the image corresponding to the detection result includes only one first rectangle and the multiple second rectangles, that is, only the second rectangle and the minimum rectangle containing the second rectangle (that is, the area corresponding to the first rectangle is used as the minimum image area including all resources in the target interface image), and no other rectangles exist. Then, the target area can be determined from the image corresponding to the detection result, so as to determine the resource distribution information based on the target area to implement a preset processing operation such as application testing. For another example, the preset amplitude can be increased or decreased on the target threshold according to the preset amplitude and the preset number, and the preset number of detection results after the threshold is adjusted is obtained, and the image including the smallest first rectangle (that is, the area corresponding to the smallest first rectangle in the preset number of detection results is used as the smallest image area including all resources) is determined from the preset number of detection results, and then the target area can be determined from the image, so as to determine the resource distribution information based on the target area to implement a preset processing operation such as application testing.

[0060] In one embodiment, before determining the image whose image information meets the preset condition from the multiple second images, the method may further include: respectively obtaining the size information of each of the second images, and comparing the size indicated by the size information of each of the second images with the preset size threshold; if there is a second image whose size is lower than the preset size threshold, deleting the second image whose size is lower than the preset size threshold; and then determining the image to be identified whose image information meets the preset condition from the second images after deleting the second image whose size is lower than the preset size threshold from the multiple second images. For example, if the target area is a rectangle, then the size information of each second image, such as the length value and the width value, may be obtained respectively, and when the length value of a second image is lower than the preset length threshold and / or the width value is lower than the preset width threshold, the second image may be deleted, and then the image to be identified may be determined from the remaining second images. In other words, the image data with obviously incorrect size may be deleted before determining the image to be identified, thereby helping to reduce the overhead of image recognition.

[0061] Optionally, when performing contour recognition, a distributed recognition method may be used, including a contour recognition method based on multithreading and a contour recognition method based on a distributed server system. Thus, the distributed recognition method can improve computing efficiency, image recognition efficiency, and thus test efficiency.

[0062] For example, in one embodiment, contour recognition can be performed in a multi-threaded manner. The terminal can create multiple threads, for example, create the multiple threads according to the number of thresholds in the threshold set, and then the terminal can run the multiple threads, and use the thresholds included in the preset threshold set to perform edge detection and Hough line detection on the target interface image. Among them, the threads for edge detection and Hough line detection can be the same or different. For example, a thread can be called to perform edge detection according to a corresponding threshold (which can be one or more), and after obtaining the first image, the thread performs Hough line detection on the first image based on all the thresholds included in the threshold set to obtain multiple second images; for example, a thread can be called to perform edge detection according to a certain threshold, and after obtaining the first image, other threads can be called to perform Hough line detection on the first image based on all the thresholds included in the threshold set to obtain multiple second images; for example, a thread can be called to perform edge detection according to a corresponding threshold, and after obtaining the first image, the thread can be called to perform Hough line detection on the first image based on the corresponding threshold to obtain the second image, and so on. Examples are not listed here one by one. Figure 4a As shown, assuming that the threshold in the preset threshold set is canny(T1, T2), the values ​​of T1 and T2 can be 0 to n, then the threshold set includes (n*n) thresholds, such as n can be 250. Therefore, the terminal can create and run (n*n) threads, and perform edge detection such as canny edge detection (Cv2.canny(T1, T2) can be (0,0) to (n, n)) and Hough line detection such as HoughLinesP (statistical Hough transform, Cv2.HoughLinesP(T1, T2) can be (0,0) to (n, n)) based on each thread, and then obtain multiple detection results, namely the above-mentioned second images. Then, the target area can be determined from the multiple second images.

[0063] For example, in one embodiment, contour recognition can also be performed based on multiple servers in a distributed server system. For example, after the terminal obtains the target interface image, the target interface image can be sent to the multiple servers, so that the multiple servers respectively use the thresholds in the preset threshold set to perform edge detection on the target interface image to obtain multiple first images, and respectively use the thresholds in the preset threshold set to perform Hough line detection on the target interface image after edge detection to obtain multiple second images, and can determine the image to be identified whose image information meets the preset conditions from the multiple second images, and then send the image to be identified to the terminal, and the terminal can determine the target area from the image to be identified; or, after the server determines the target area from the image to be identified, it can send the regional image containing the target area to the terminal, so that the terminal can determine the target area according to the received regional image. The servers for edge detection and Hough line detection may be the same or different. For example, each server may perform edge detection according to a corresponding threshold value, and after obtaining a first image, perform Hough line detection on the first image based on all threshold values ​​included in the threshold set to obtain a plurality of second images, and screen out one or more images whose image information meets a preset condition (if there is no image that meets the preset condition, the screening result may be empty), and then, for the second images corresponding to all servers, the image to be identified may be determined from the images that meet the preset condition screened out by each server (for example, the images that meet the preset condition screened out by each server are sent to any server in the distributed server system for identification). The image to be identified can be determined by sending it to a terminal for determination, or it can be sent to other devices for determination); or, a server can perform edge detection according to a corresponding threshold, obtain a first image, and then send it to another server to perform Hough line detection on the first image based on a corresponding threshold to obtain a second image, and then determine the image to be identified from each obtained second image (for example, each second image is sent to any server in the distributed server system to determine the image to be identified, or it can be sent to a terminal for determination, or it can be sent to other devices for determination. Before sending, second images with a size smaller than a pre-configured size value can also be filtered out to reduce system overhead). For example, Figure 4bAs shown, assuming that the threshold in the preset threshold set is canny(T1, T2), the values ​​of T1 and T2 can be 0 to n, then the threshold set includes (n*n) thresholds. After the terminal sends the target interface image to each server, such as (n*n) servers, each server can perform edge detection such as canny edge detection and Hough line detection such as HoughLinesP on the target interface image according to the corresponding threshold. The threshold and the server correspond one to one. The server can send the detection result such as the obtained second image to the terminal, or can send the detection result such as the image to be identified to the terminal, or can send the detection result such as the area image corresponding to the target area to the terminal, and then the terminal receives the detection result and can determine the target area according to the detection result.

[0064] In other optional embodiments, the contour recognition algorithm may be a dot matrix recognition or line recognition algorithm, so that the target area can be identified by the dot matrix recognition or line recognition algorithm, so as to determine the distribution information of each resource such as location information and classification information from the target area. Alternatively, the dot matrix recognition or line recognition algorithm may be further combined to perform area recognition to improve the reliability of area recognition, thereby improving the reliability of the test.

[0065] 203. Obtain resource distribution information of the multiple resources in the target area.

[0066] The resource distribution information may include the location information of the resource and the category to which the resource belongs.

[0067] After identifying the target area, the terminal can obtain resource distribution information of the multiple resources in the target area according to the information of the target area, such as the location information of each resource in the multiple resources and the category to which each resource belongs, etc. The location information of the resource may include any one or more of the following: the coordinates of the resource, the row and column number of the target area, the row and column number where the resource is located, the identifier of the location of the resource, etc.

[0068] In one embodiment, when the terminal obtains the resource distribution information such as the position information of the multiple resources in the target area, it can obtain the size information of each resource in the multiple resources and the size information of the target area respectively, calculate the size mean of the multiple resources according to the size information of each resource, and determine the number of rows and columns of the resources included in the target area according to the size information of the target area and the size mean. Further, the terminal can also determine the position information such as the coordinates of each resource in the target area according to the number of rows, the number of columns, and the size mean. For example, the shapes corresponding to the target area and the resources are both rectangular; then the terminal can obtain the length and width values ​​of each resource respectively, and the length and width values ​​of the target area, and calculate the length mean of the multiple resources according to the length value of each resource, and calculate the width mean of the multiple resources according to the width value of each resource, and then determine the number of rows and columns of the resources included in the target area according to the length and width value of the target area, the length mean and the width mean, and determine the coordinate information of each resource in the target area according to the number of rows and columns, the length mean and the width mean.

[0069] In one embodiment, when the terminal obtains the resource distribution information of the multiple resources in the target area, such as the classification to which the resources belong, the terminal may use a preset clustering algorithm to cluster the multiple resources to obtain the classification to which each of the multiple resources belongs. The preset clustering algorithm may include any one or more of the following: a color recognition algorithm, a contour recognition algorithm, a feature recognition algorithm, or other clustering algorithms.

[0070] Among them, the color recognition algorithm may refer to determining the classification of resources according to the color corresponding to the resources, such as calculating the color of the second rectangle (such as the RGB mean) of the resource such as the above through the color mean algorithm, and determining the resources with the same color as the same category. The contour recognition algorithm may refer to determining the classification of resources according to the shape corresponding to the resource, and determining the resources with the same shape as the same category. The feature recognition algorithm may refer to determining the classification of resources according to the color corresponding to the resource, and determining the resources with the same features such as patterns as the same category, which will not be repeated here. Therefore, a preset clustering algorithm can be used to obtain the feature information of each resource, such as color, shape, feature pattern, etc., and the multiple resources are clustered based on the feature information to determine the classification of each resource.

[0071] In one embodiment, a clustering algorithm can be selected for an application based on the feature information of the application. For example, a correspondence between the application feature and the type of clustering algorithm can be pre-set, so that the clustering algorithm corresponding to the application can be used to classify resources based on the correspondence to improve the efficiency and reliability of resource classification and help reduce classification overhead. Optionally, the execution order of multiple clustering algorithms can be pre-set, and the number of resource classifications corresponding to the application can be pre-set. For example, the execution order is set from first to last: color recognition algorithm, contour recognition algorithm, feature recognition algorithm. Then the terminal can first perform clustering processing on the multiple resources based on the color recognition algorithm to determine the classification of the multiple resources. If the number of classifications obtained based on the color recognition algorithm is the same as the pre-set number of resource classifications, the remaining clustering algorithms can no longer be executed. If the number of classifications obtained is less than the pre-set number of resource classifications, the next clustering algorithm such as the contour recognition algorithm can be used to perform clustering processing on the multiple resources, and the classification of the multiple resources can be determined by combining the color recognition algorithm and the contour recognition algorithm. If the number of classifications obtained based on the color recognition algorithm and the contour recognition algorithm is the same as the preset number of resource classifications, the remaining clustering algorithms may no longer be executed; if the number of classifications obtained is less than the preset number of resource classifications, the next clustering algorithm such as a feature recognition algorithm may be used to cluster the multiple resources, and so on, so as to determine the classification of each resource. In this way, the clustering processing overhead can be reduced while determining the resource classification, and the power consumption of the terminal can be reduced. Optionally, for different applications, the execution order of the clustering algorithms set may be different, and the types of clustering algorithms involved may also be different. For example, the correspondence between the application characteristics and the execution order may be preset, and the correspondence between the application characteristics, the execution order and the type of clustering algorithm may be preset, and so on, so as to enhance the flexibility of determining resource classification.

[0072] In one embodiment, when clustering is performed, it can be implemented in a distributed manner, such as using multiple threads to use a preset clustering algorithm to perform clustering on corresponding resources (such as one thread corresponding to one resource, or one thread corresponding to a row of resources, or one thread corresponding to a column of resources, etc.) to obtain feature information of the corresponding resources; or using multiple servers to use a preset clustering algorithm to perform clustering on corresponding resources (such as one server corresponding to one resource, or one server corresponding to a row of resources, or one server corresponding to a column of resources, etc.) to obtain feature information of the corresponding resources, and then the classification of each resource can be determined according to each feature information. Thus, the efficiency of resource classification can be improved through this distributed processing method.

[0073] In one embodiment, before using a preset clustering algorithm to perform clustering processing on the multiple resources, the terminal may also intercept the target area from the interface image of the application (such as the initial interface image mentioned above) to obtain the original area image, i.e., the target area image, and may perform stroke processing on the multiple resources in the target area image, such as using a preset marking line to implement the stroke processing, and the stroke processing may be used to separate each of the resources so as to better distinguish each resource. Further, when the terminal uses a preset clustering algorithm to perform clustering processing on the multiple resources after the stroke processing in the target area image, the preset clustering algorithm may be used to perform clustering processing on the multiple resources. Optionally, when performing the stroke processing, the position of the stroke may be determined based on the location information of each resource, such as the coordinates, and the size information of the resource, such as the side length information of the small rectangle (such as the length value and the width value), so as to implement the stroke processing. Thus, the clustering effect can be enhanced in combination with the stroke processing, which helps to improve the efficiency of determining resource classification.

[0074] In one embodiment, after acquiring the resource distribution information, the terminal may also determine a resource movement strategy according to the location information of the resource and the category to which the resource belongs, and perform resource elimination processing according to the resource movement strategy to implement testing of the application.

[0075] Among them, the resource movement strategy can be used to indicate information such as the resources to be moved, the direction of movement of the resources (left, right, up, down, etc.). Then, the terminal can move resources according to the determined resource movement strategy to implement application testing. It can be understood that the resource movement strategy generally refers to a movement plan that can obtain virtual resource volume (or so-called benefits, etc.), such as a movement plan that obtains the largest amount of virtual resources. For example, when determining the resource movement strategy, the amount of virtual resources obtained by moving each resource can be calculated separately, and then the movement plan that obtains the largest amount of virtual resources is used as the resource movement strategy. The virtual resource volume can be a score, a level, or other virtual volume. Optionally, when calculating the amount of virtual resources obtained by moving a resource, the amount of virtual resources obtained by moving the resource in each movable direction can be calculated separately. When calculating the amount of virtual resources obtained by moving each resource separately, distributed computing can be performed in a distributed manner, including using multiple threads to separately calculate the amount of virtual resources obtained by moving the corresponding resources, for example, Figure 5a As shown, one thread corresponds to one resource (where (x, y) indicates the location of the resource, such as the resource at the (x+1)th column (col) and the (y+1)th row (row)); or, the amount of virtual resources obtained by moving the corresponding resources is calculated by multiple servers respectively, and the calculation results can be returned to the terminal, for example, Figure 5bAs shown, one server corresponds to one resource. The resource movement scheme for obtaining the maximum virtual resource amount is determined by calculating the virtual resource amount obtained by moving each resource through each thread or each server as the resource movement strategy. Therefore, the efficiency of determining the resource movement strategy can be improved in a distributed manner, thereby improving the test efficiency.

[0076] In one embodiment, after obtaining the resource distribution information of the multiple resources in the target area, the terminal may also establish a resource matrix according to the resource distribution information. For example, the location information in the resource distribution information may include coordinates, and the resource matrix may be a two-dimensional array including the coordinates of each resource and the category to which each resource belongs. Furthermore, when the terminal determines the resource movement strategy according to the resource distribution information, it may determine the resource movement strategy according to the resource matrix. Thus, the application test is implemented in combination with the created resource matrix, which helps to improve the efficiency of determining the resource movement strategy, thereby improving the efficiency of application testing.

[0077] In one embodiment, after moving resources according to the resource movement strategy, multiple resources may be eliminated, such as 3-5 resources, and new resources may be randomly generated. Then, a new interface image may be acquired again (the resource distribution in the new interface image may have changed) to perform application testing based on the new interface image, such as repeating steps 201-203, or repeating step 203 to obtain new resource distribution information, and determining a resource movement strategy based on the new resource distribution information, and performing resource elimination processing according to the resource movement strategy to complete the application test.

[0078] In one embodiment, after obtaining the resource distribution information, the terminal can also receive an operation instruction input by the user for any resource, and the operation instruction carries the resource movement direction, and then can perform resource elimination processing based on the resource movement direction, the resource distribution information such as the location information of the resource and the category to which the resource belongs.

[0079] In an embodiment of the present application, the terminal can obtain the target interface image of the application, identify the target area including multiple resources in the target interface image according to a preset contour recognition algorithm, and obtain resource distribution information of the multiple resources in the target area, that is, it can determine the resource distribution information based on the identified operable area. This information acquisition method based on image processing can be applied to various terminals, has strong flexibility, and helps to improve the reliability of the obtained resource distribution information.

[0080] The following uses a match-3 game application (hereinafter referred to as the game application) as an example to test the game application and describes the information acquisition method of the present application in detail. Figure 6a As shown, the information acquisition method includes:

[0081] 6101. Start the game application and enter the game interface.

[0082] If multiple paths to enter the game interface are pre-set for the game application, when testing the game application, the terminal can select the shortest path to enter the game interface, that is, enter the game interface with the least steps. This can reduce the application startup time and help improve testing efficiency.

[0083] In this embodiment, it is assumed that the number of rows and columns of resources is 10*10, including red star resources, green star resources, yellow star resources, blue star resources, and pink star resources. The operable area, i.e., the target area, is a rectangle, and each resource is a rectangle.

[0084] 6102. Take a screenshot of the interface image to obtain the interface image.

[0085] After starting the game application, you can capture the interface image after the startup is completed, for example, by calling the terminal screenshot interface to take a screenshot. When taking a screenshot, you can call the corresponding graphics processing function to achieve the screenshot, such as the window_capture() function, get_screenshot_as_file() (the function screenshots the current page and saves it to the specified path), etc.

[0086] 6103. Grayscale the interface image to obtain a target interface image.

[0087] A grayscale image is an image in which the three-channel values ​​of R, G, and B are the same, that is, after the interface image is grayed (ashed), the pixels of the grayed interface image have the same R, G, and B values. For each pixel, the same value can be called a grayscale value, and the grayscale value can be any component of the pixel (R or G or B), or the largest one of the R, G, and B components of the pixel can be used as the grayscale value, or the average value of the R, G, and B of the pixel can be used as the grayscale value of the pixel, or the grayscale value can be obtained by weighted summation, etc., which are not listed here one by one. When graying an image, the grayscale processing can be implemented by calling the corresponding graphics processing function, such as taking the average value as a function of the grayscale value, taking the maximum value as a function of the grayscale value, and so on. For example, in this embodiment, the target interface image after graying can be as follows Figure 7 shown.

[0088] 6104. Perform distributed contour recognition according to the thresholds in the preset threshold set and record the results.

[0089] An initial threshold and a range of thresholds can be set as dynamic thresholds, that is, a threshold set can be set. For example, the threshold set includes (0,0) to (n,n). For example, (0,0) can be used as the initial threshold to perform contour recognition, such as canny edge detection and Hough line detection, and a loop detection can be performed from (0,0) to (n,n) until contour recognition is completed based on the maximum value of the threshold (n,n), and a recognition / detection result is obtained, such as the second image mentioned above, and the result can be recorded. Figure 8 The figure is a schematic diagram of a contour recognition result image provided by an embodiment of the present application, that is, a schematic diagram of a second image. After obtaining the result, a preliminary screening can be performed to delete data with a length or width that is too small (such as less than the corresponding threshold), remove non-compliant rectangles (such as rectangles that are not fully enclosed) and straight lines (such as straight lines that are discontinuous), and save fully enclosed rectangles.

[0090] 6105. Determine a target area from the result, where the target area is a large rectangle including a plurality of small rectangles that are evenly distributed.

[0091] After obtaining the result, the target area can be determined from the result. Specifically, it is possible to analyze whether there is a large rectangle including multiple small rectangles (of the same size) arranged evenly (such as the same spacing between rectangles) in all the results. If so, the area where the large rectangle includes multiple small rectangles arranged evenly can be extracted from the result, that is, the target area. If there are multiple results in which a large rectangle includes multiple small rectangles arranged evenly, the result with the most small rectangles can be determined, and the target area can be extracted from the result. Then, the image corresponding to the target area can be obtained, that is, the regional image. Fig. 9 Shown is a schematic diagram of a regional image provided in an embodiment of the present application.

[0092] Furthermore, the threshold corresponding to the image where the target area is located can be recorded, such as edge detection (45, 89) and Hough line detection (12, 76). Optionally, fine-tuning can be performed based on the threshold, and then a contour recognition algorithm is used based on the fine-tuned threshold to determine the target area from the obtained results, so as to improve the reliability of the determined target area. For example, when it is detected that there are other rectangles in the image besides the large rectangle and the small rectangle, or there are other rectangles in the large rectangle besides the small rectangle, fine-tuning can be performed based on the threshold, such as increasing or decreasing the threshold in sequence according to a preset amplitude such as 0.1, such as adjusting to (45.1, 89.1), (12.1, 76.1), or adjusting to (44.9, 88.9), (11.9, 75.9), or adjusting to (45.1, 89.0), (12.1, 76), or adjusting to (45.0, 89.1), (12, 76.1), etc., and edge detection and Hough line detection are performed on the image based on the adjusted threshold until the other rectangles do not exist in the acquired image, that is, ensuring that the target area is the minimum rectangular area containing all resources in the target interface image. In order to filter out the large rectangle containing small rectangles with equal width, height and basically equal spacing to complete the establishment of the resource matrix.

[0093] In one embodiment, when determining the small rectangle, clustering can be performed based on the perimeter of the rectangle to determine different rectangles. Each type of rectangle corresponds to a perimeter interval. The small rectangle is the rectangle of the cluster with the largest number, and the average perimeter corresponding to the rectangles of the cluster with the largest number, that is, the perimeter mean, can be used as the perimeter of the small rectangle, the length mean corresponding to the rectangles of the cluster with the largest number can be used as the length of the small rectangle, the width mean corresponding to the rectangles of the cluster with the largest number can be used as the width of the small rectangle, and so on.

[0094] 6106. Establish a two-dimensional resource matrix.

[0095] When establishing a two-dimensional resource matrix, an empty two-dimensional array can be created; and all small rectangles can be traversed to calculate the mean length and width of the small rectangles, and based on the mean length and width of the small rectangles, as well as the length and width of the target area, i.e., the large rectangle, the number of rows and columns of the small rectangles in the large rectangle, i.e., the number of rows and columns of the resources, can be obtained; the center point of each small rectangle can also be calculated, such as by establishing a coordinate system with the lower left corner vertex of the target area as the origin (or other points can be used as the origin to establish a coordinate system, which is not limited in this application), based on the length and width of the target area, as well as the mean length and width of the small rectangles, the center point coordinates of each small rectangle, the row and column information, etc., can be determined, i.e., the location of the resource can be determined; and then the calculated results, such as the row and column information and coordinate information, can be filled into the two-dimensional array to complete the establishment of the resource matrix.

[0096] For example, suppose the resource matrix is ​​established as:

[0097] map=[

[0098] [{“1”:(025,035)},{“2”:(095,035)},{“3”:(165,035)},{“4”:(235,035)},

[0099] “5”:(305,035)},{“6”:(375,035)},{“7”:(445,035)},{“8”:(515,035)},{“9”:(585,035)},{“10”:(655,035)}]

[0100] [{“1”:(025,105)},{“2”:(095,105)},{“3”:(165,105)},{“4”:(235,105)},

[0101] “5”:(305,105)},{“6”:(375,105)},{“7”:(445,105)},{“8”:(515,105)},{“9”:(585,105)},{“10”:(655,105)}]

[0102] [{“1”:(025,175)},{“2”:(095,175)},{“3”:(165,175)},{“4”:(235,175)},

[0103] “5”:(305,175)},{“6”:(375,175)},{“7”:(445,175)},{“8”:(515,175)},{“9”:(585,175)},{“10”:(655,175)}]

[0104] [{“1”:(025,245)},{“2”:(095,245)},{“3”:(165,245)},{“4”:(235,245)},

[0105] “5”:(305,245)},{“6”:(375,245)},{“7”:(445,245)},{“8”:(515,245)},{“9”:(585,245)},{“10”:(655,245)}]

[0106] [{“1”:(025,315)},{“2”:(095,315)},{“3”:(165,315)},{“4”:(235,315)},

[0107] “5”:(305,315)},{“6”:(375,315)},{“7”:(445,315)},{“8”:(515,315)},{“9”:(585,315)},{“10”:(655,315)}]

[0108] [{“1”:(025,385)},{“2”:(095,385)},{“3”:(165,385)},{“4”:(235,385)},

[0109] “5”:(305,385)},{“6”:(375,385)},{“7”:(445,385)},{“8”:(515,385)},{“9”:(585,385)},{“10”:(655,385)}]

[0110] [{“1”:(025,455)},{“2”:(095,455)},{“3”:(165,455)},{“4”:(235,455)},

[0111] “5”:(305,455)},{“6”:(375,455)},{“7”:(445,455)},{“8”:(515,455)},{“9”:(585,455)},{“10”:(655,455)}]

[0112] [{“1”:(025,525)},{“2”:(095,525)},{“3”:(165,525)},{“4”:(235,525)},

[0113] “5”:(305,525)},{“6”:(375,525)},{“7”:(445,525)},{“8”:(515,525)},{“9”:(585,525)},{“10”:(655,525)}]

[0114] [{“1”:(025,595)},{“2”:(095,595)},{“3”:(165,595)},{“4”:(235,595)},

[0115] “5”:(305,595)},{“6”:(375,595)},{“7”:(445,595)},{“8”:(515,595)},{“9”:(585,595)},{“10”:(655,595)}]

[0116] [{“1”:(025,665)},{“2”:(095,665)},{“3”:(165,665)},{“4”:(235,665)},

[0117] “5”:(305,665)},{“6”:(375,665)},{“7”:(445,665)},{“8”:(515,665)},{“9”:(585,665)},{“10”:(655,665)}] ]

[0119] 6107. Capture an interface image corresponding to the target area according to the information of the target area.

[0120] After determining the target area, the interface image corresponding to the target area, i.e., the target area image, can be intercepted from the initial interface image according to the target information, i.e., the original color image can be intercepted according to the range of the target area, so as to determine the resource distribution such as resource classification according to the color image of the target area, thereby helping to improve the reliability of the determined resource distribution. Alternatively, the target area in the initial interface image can be masked to obtain the original color image corresponding to the target area.

[0121] In an optional embodiment, the resource distribution can also be determined based on the above-mentioned regional image, or the image corresponding to the target area can be captured from the grayscaled target interface image to determine the resource distribution. For example, when the colors corresponding to each resource are the same, there is no need to extract the color image corresponding to the target area to reduce terminal overhead.

[0122] 6108. Draw white marking lines on the interface image to separate the resources.

[0123] Optionally, after the original color image corresponding to the target area is intercepted, a white rectangular border can be drawn on the color image, that is, a white marker line is used to stroke the resource, that is, the small rectangle, to separate the color pattern corresponding to the resource. When performing the stroke processing, each small rectangle can be stroked according to the coordinate information of each small rectangle and the side length information of each small rectangle. For example, Fig.10 FIG. 1 is a schematic diagram of separating resources provided in an embodiment of the present application. Fig.10 The color of the color image is not shown in FIG. 1 , and a grayscale image is used for illustration.

[0124] 6109. Cluster resources based on color mean recognition algorithm, contour recognition algorithm, and feature recognition algorithm.

[0125] Furthermore, the terminal can cluster the multiple resources based on a preset clustering algorithm such as a color mean recognition algorithm, a contour recognition algorithm, and a feature recognition algorithm to determine the classification of the resources. In this embodiment, the resources can be divided into five categories: red star resources, green rectangular star resources, yellow rectangular star resources, blue rectangular star resources, and pink rectangular star resources, and the resources of each category only differ in color.

[0126] 6110. Obtain resource classification and update the two-dimensional resource matrix.

[0127] After obtaining resource distribution information such as the resource classification described above, the established resource matrix can be updated based on the classification result. Alternatively, in other optional embodiments, the terminal can establish the resource matrix after determining the resource classification.

[0128] For example, the updated resource matrix is:

[0129] map=[

[0130] [{“R”:(025,035)},{“G”:(095,035)},{“Y”:(165,035)},{“B”:(235,035)},

[0131] "G":(305,035)},{"B":(375,035)},{"Y":(445,035)},{"Y":(515,035)},{"G":(585,035)},{"G":(655,035)}]

[0132] [{“Y”:(025,105)},{“R”:(095,105)},{“P”:(165,105)},{“Y”:(235,105)},

[0133] "R":(305,105)},{"R":(375,105)},{"G":(445,105)},{"P":(515,105)},{"B":(585,105)},{"P":(655,105)}]

[0134] [{"P":(025,175)},{"B":(095,175)},{"Y":(165,175)},{"Y":(235,175)},

[0135] "Y":(305,175)},{"R":(375,175)},{"G":(445,175)},{"P":(515,175)},{"Y":(585,175)},{"R":(655,175)}]

[0136] [{“Y”:(025,245)},{“B”:(095,245)},{“P”:(165,245)},{“G”:(235,245)},

[0137] “Y”:(305,245)},{“R”:(375,245)},{“B”:(445,245)},{“B”:(515,245)},{“Y”:(585,245)},{“P”:(655,245)}]

[0138] [{“Y”:(025,315)},{“G”:(095,315)},{“B”:(165,315)},{“R”:(235,315)},

[0139] “Y”:(305,315)},{“Y”:(375,315)},{“P”:(445,315)},{“P”:(515,315)},{“B”:(585,315)},{“R”:(655,315)}]

[0140] [{“Y”:(025,385)},{“B”:(095,385)},{“R”:(165,385)},{“G”:(235,385)},

[0141] “P”:(305,385)},{“R”:(375,385)},{“G”:(445,385)},{“G”:(515,385)},{“Y”:(585,385)},{“Y”:(655,385)}]

[0142] [{“B”:(025,455)},{“R”:(095,455)},{“Y”:(165,455)},{“B”:(235,455)},

[0143] “P”:(305,455)},{“Y”:(375,455)},{“B”:(445,455)},{“G”:(515,455)},{“Y”:(585,455)},{“Y”:(655,455)}]

[0144] [{“G”:(025,525)},{“B”:(095,525)},{“P”:(165,525)},{“B”:(235,525)},

[0145] "R":(305,525)},{"P":(375,525)},{"P":(445,525)},{"R":(515,525)},{"R":(585,525)},{"Y":(655,525)}]

[0146] [{"R":(025,595)},{"R":(095,595)},{"P":(165,595)},{"B":(235,595)},

[0147] "P":(305,595)},{"Y":(375,595)},{"B":(445,595)},{"R":(515,595)},{"G":(585,595)},{"G":(655,595)}]

[0148] [{"P":(025,665)},{"P":(095,665)},{"R":(165,665)},{"G":(235,665)},

[0149] "B":(305,665)},{"Y":(375,665)},{"R":(445,665)},{"P":(515,665)},{"B":(585,665)},{"R":(655,665)}] ]

[0151] Among them, "R" stands for red, "G" stands for green, "Y" stands for yellow, "B" stands for blue, and "P" stands for pink. Fig.11a and 11b FIG. 1 is a schematic diagram of a resource classification result provided in an embodiment of the present application, in which a classification result for color is obtained. Fig.11a and 11b Displays the distribution of resources of each color (for ease of viewing, the resources of corresponding colors are circled with black boxes in the figure).

[0152] 6111. Calculate the maximum benefit and determine the corresponding resource movement strategy.

[0153] 6112. Move resources according to the resource movement strategy.

[0154] After obtaining the resource matrix, an algorithm can be used to determine how to move one step to maximize the benefit for the current screen. The maximum amount of virtual resources obtained by moving resources can be calculated based on the resource matrix to obtain the resource movement strategy corresponding to the maximum benefit. That is, the benefit obtained by moving resources according to the resource movement strategy is the largest compared to moving other resources, such as the largest increase in score.

[0155] For example, the terminal can determine whether there are two resources of the same color in each row through a loop, and record them in the list that can be eliminated, and determine whether there are two resources of the same color in each column through a loop, and record them in the list that can be eliminated. Then, the list that can be eliminated can be traversed to determine whether there are resources of the same color separated by one other color resource, and record them in the advanced list that can be eliminated. Then, the advanced list that can be eliminated can be traversed to determine whether there are resources of the same color in the upper and lower rows or left and right columns, and move resources according to the optimal solution, that is, perform elimination operations to obtain maximum benefits.

[0156] 6113. Determine whether the current game is over. If so, execute step 6114; otherwise, execute step 6102 to obtain a new interface image and continue testing, or execute step 6109 to test based on the new resource distribution.

[0157] 6114. Determine whether to end the test. If yes, execute step 6115 to end the test of the game application; otherwise, execute step 6101 to continue the test based on the new game interface.

[0158] 6115. End of test.

[0159] If the current game is completed, it can be determined whether the test is over. If it is, the test is over, otherwise it can automatically enter the next game. If the game fails, the current game can be restarted and steps 6102-6113 can be re-executed, or steps 6109-6113 can be re-executed to reduce the test overhead.

[0160] In an embodiment of the present application, the terminal can obtain a target interface image of the application to be tested, and identify a target area in the target interface image that includes a large rectangle and multiple small rectangles that are evenly distributed based on a dynamic threshold and using edge detection and Hough line detection, and then obtain distribution information of the multiple small rectangles in the target area, so as to determine a resource movement strategy based on the distribution information to implement application testing, thereby helping to improve the application testing effect.

[0161] The following takes the application as a game application and running the game application as an example to describe the information acquisition method of the present application in detail. Figure 6b As shown, the information acquisition method includes:

[0162] 6201. Start the game application and enter the game interface.

[0163] 6202. Take a screenshot of the interface image to obtain the interface image.

[0164] 6203. Grayscale the interface image to obtain a target interface image.

[0165] 6204. Perform distributed contour recognition according to the thresholds in the preset threshold set and record the results.

[0166] 6205. Determine a target area from the result, where the target area is a large rectangle including a plurality of small rectangles that are evenly distributed.

[0167] Optionally, the description of steps 6201-6205 can refer to the above Figure 6a The relevant descriptions of 6101-6105 in the illustrated embodiment are not repeated here.

[0168] 6206. Capture an interface image corresponding to the target area according to the information of the target area.

[0169] 6207. Draw white marking lines on the interface image to separate the resources.

[0170] 6208. Clustering resources based on color mean recognition algorithm, contour recognition algorithm, and feature recognition algorithm.

[0171] Optionally, the description of steps 6206-6208 can refer to the above Figure 6a The description of 6107-6109 in the illustrated embodiment is not repeated here. Further, optionally, a resource matrix can be established based on the resource distribution to perform elimination processing based on the resource matrix, which is not repeated here.

[0172] 6209. Receive an operation instruction, and perform resource elimination processing according to the resources and resource movement direction corresponding to the operation instruction.

[0173] When receiving an operation instruction from the user for a certain resource, the terminal may move the resource according to the resource moving direction corresponding to the operation instruction to implement resource elimination processing (possibly eliminating 0 or more resources).

[0174] 6210. Determine whether the current game is over. If so, execute step 6211; otherwise, execute step 6202 to obtain a new interface image to continue testing, or execute step 6208 to implement resource elimination processing based on the new resource distribution.

[0175] 6211. Determine whether an exit instruction is received. If yes, execute step 6212 to exit the game; otherwise, execute step 6201 to continue the game based on the new game interface.

[0176] 6212. Exit the game.

[0177] In an embodiment of the present application, the terminal can obtain the target interface image of the application to be tested, and identify the target area in the target interface image including a large rectangle and multiple small rectangles arranged evenly distributed according to a dynamic threshold and using edge detection and Hough line detection, and then obtain the distribution information of the multiple small rectangles in the target area, so as to perform resource elimination processing according to the distribution information and the user's operation instructions for moving resources, which helps to improve the reliability of the elimination processing and improve the gaming effect.

[0178] Based on the description of the above information acquisition method embodiment, the embodiment of the present invention also discloses an information acquisition device, which can be a computer program (including program code / program instructions) running in a terminal. For example, the information acquisition device can execute Figure 2 , Figure 3 , Figure 6a or Figure 6b See the method shown in Fig.12 , the information acquisition device 1200 can run the following units:

[0179] An acquisition unit 1201 is used to acquire a target interface image of an application, wherein the target interface image includes multiple resources;

[0180] The recognition unit 1202 is used to recognize a target area in the target interface image according to a contour recognition algorithm, wherein the target area is a minimum image area including all resources in the target interface image;

[0181] The acquisition unit 1201 is further configured to acquire resource distribution information of the multiple resources in the target area.

[0182] In one embodiment, the resource distribution information includes location information of the resource and the category to which the resource belongs; the apparatus may further include: a processing unit 1203;

[0183] The processing unit 1203 is used to determine a resource movement strategy according to the location information of the resource and the category to which the resource belongs, and perform resource elimination processing according to the resource movement strategy.

[0184] In one embodiment, the resource distribution information includes location information of the resource and the category to which the resource belongs; the apparatus may further include: a processing unit 1203;

[0185] The acquisition unit 1201 is further configured to receive an operation instruction input by a user for any resource, wherein the operation instruction carries a resource moving direction;

[0186] The processing unit 1203 is used to perform resource elimination processing according to the moving direction of the resource, the location information of the resource and the category to which the resource belongs.

[0187] In one embodiment, the contour recognition algorithm includes edge detection and Hough line detection; when the recognition unit 1202 identifies the target area in the target interface image according to the contour recognition algorithm, it can be specifically used to: respectively use the threshold values ​​in the preset threshold set to perform edge detection on the target interface image to obtain multiple first images, and the preset threshold set includes multiple thresholds; respectively use the threshold values ​​in the preset threshold set to perform Hough line detection on the target interface image after edge detection to obtain multiple second images; determine the image to be recognized whose image information meets the preset conditions from the multiple second images, and determine the target area from the image to be recognized.

[0188] In one embodiment, the image information satisfies preset conditions including: the image includes a first rectangle and multiple second rectangles, the multiple second rectangles are distributed within the area of ​​the first rectangle, the sizes of the multiple second rectangles match, and the spacing between adjacent second rectangles matches, and the number of the second rectangles is the largest in the multiple second images; wherein the target area is the area of ​​the first rectangle, and the resource is represented by the second rectangle.

[0189] In one embodiment, the apparatus may further include a processing unit 1203;

[0190] The acquiring unit 1201 may also be configured to respectively acquire size information of each of the second images, and compare a size indicated by the size information of each of the second images with a preset size threshold;

[0191] The processing unit 1203 is configured to delete the second image whose size is smaller than the preset size threshold when there is a second image whose size is smaller than the preset size threshold;

[0192] When the recognition unit 1202 determines an image to be recognized whose image information meets a preset condition from the multiple second images, it can be specifically used to: determine an image to be recognized whose image information meets the preset condition from the second images after deleting the second image whose size is lower than a preset size threshold from the multiple second images.

[0193] In one embodiment, when acquiring the resource distribution information of the multiple resources in the target area, the acquisition unit 1201 can be specifically used to: respectively acquire the size information of each of the multiple resources and the size information of the target area; calculate the size mean of the multiple resources based on the size information of each resource; determine the number of rows and columns of the resources included in the target area based on the size information of the target area and the size mean; determine the location information of each resource in the target area based on the number of rows, the number of columns and the size mean.

[0194] In one embodiment, when acquiring the resource distribution information of the multiple resources in the target area, the acquisition unit 1201 can be specifically used to: use a preset clustering algorithm to cluster the multiple resources to obtain the classification to which each resource in the multiple resources belongs, and the preset clustering algorithm includes any one or more of the following: color recognition algorithm, contour recognition algorithm, feature recognition algorithm.

[0195] In one embodiment, the apparatus may include a processing unit 1203;

[0196] The acquisition unit 1201 may also be used to capture the target area from the interface image of the application to obtain a target area image;

[0197] The processing unit 1203 may be configured to perform a stroke process on the multiple resources in the target area image using a preset marking line, wherein the stroke process is used to separate each of the resources;

[0198] When the acquisition unit 1201 uses a preset clustering algorithm to perform clustering processing on the multiple resources, it can be specifically used to: use the preset clustering algorithm to perform clustering processing on the multiple resources that have been stroked in the target area image.

[0199] In one embodiment, the location information may include coordinates; the apparatus may include a processing unit 1203;

[0200] The processing unit 1203 may also be used to establish a resource matrix according to the resource distribution information, wherein the resource matrix is ​​a two-dimensional array including the coordinates of each resource and the category to which each resource belongs;

[0201] When determining the resource movement strategy according to the resource distribution information, the processing unit 1203 may be specifically configured to: determine the resource movement strategy according to the resource matrix.

[0202] In one embodiment, when acquiring the target interface image of the application, the acquisition unit 1201 can be specifically used to: capture the interface image of the application, wherein the interface image includes multiple resources; grayscale the captured interface image to obtain a grayscaled interface image, and use the grayscaled interface image as the target interface image.

[0203] According to one embodiment of the present application, Figure 2 , Figure 3 , Figure 6a or Figure 6b Each step involved in the method shown can be performed by Fig.12 The information acquisition device shown in the figure is executed by each unit. For example, Figure 2 Steps 201 and 203 shown in FIG. 1 can be performed by Fig.12 The acquisition unit 1201 shown in FIG. 1 is executed, and step 202 can be performed by Fig.12 The identification unit shown is used to perform; for example, Figure 3 Steps 301 to 303 shown can be performed by Fig.12 The identification unit shown is used to perform the operation and will not be described in detail here.

[0204] According to another embodiment of the present application, Fig.12 The various units in the information acquisition device shown can be separately or completely combined into one or several other units to constitute, or one (some) of the units can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, other units can also be included based on the information acquisition device. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0205] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 , Figure 3 , Figure 6a or Figure 6b A computer program (including program code / program instructions) for each step involved in the corresponding method shown in Fig.12 The information acquisition device shown in and the information acquisition method of the embodiment of the present application are implemented. The computer program can be recorded on, for example, a computer readable recording medium, and loaded into the above-mentioned computing device through the computer readable recording medium, and run therein.

[0206] Based on the description of the above method embodiment and device embodiment, the present application embodiment also provides a terminal. Fig.13 The terminal at least includes a processor 1301, an input device 1302, an output device 1303, and a computer (readable) storage medium 1304. The processor 1301, the input device 1302, the output device 1303, and the computer storage medium 1304 in the terminal may be connected via a bus or other means.

[0207] The computer storage medium 1304 can be stored in the memory of the terminal, and the computer storage medium 1304 is used to store a computer program, and the computer program includes program instructions, and the processor 1301 is used to execute the program instructions stored in the computer storage medium 1304. The processor 1301 (or CPU (Central Processing Unit)) is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function; in one embodiment, the processor 1301 described in the embodiment of the present application can be used to perform a series of information acquisition processing, including: obtaining the target interface image of the application; identifying the target area in the target interface image according to the contour recognition algorithm, the target area is the minimum image area in the target interface image that includes all resources; obtaining resource distribution information of multiple resources in the target area, and so on.

[0208] The input device 1302 may include one or more of a keyboard, a touch screen, a radio frequency receiver or other input devices; the output device 1303 may include one or more of a speaker, a display, a radio frequency transmitter or other output devices. Optionally, the terminal may also include a memory module, a power module, an application client, and the like.

[0209] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in the terminal for storing programs and data. It is understandable that the computer storage medium here can include both the built-in storage medium in the terminal and the extended storage medium supported by the terminal. The computer storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor 1301 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.

[0210] In one embodiment, the processor 1301 can load and execute one or more instructions stored in a computer storage medium to implement the corresponding steps of the method in the above-mentioned information acquisition embodiment; in a specific implementation, one or more instructions in the computer storage medium are loaded by the processor 1301 and execute the following steps: obtaining a target interface image of the application, the target interface image including multiple resources; identifying a target area in the target interface image based on a contour recognition algorithm, the target area being the minimum image area in the target interface image that includes all resources; and obtaining resource distribution information of the multiple resources in the target area.

[0211] In one embodiment, the resource distribution information includes the location information of the resources and the category to which the resources belong; the one or more instructions can also be loaded and specifically executed by the processor 1301: determine the resource movement strategy based on the location information of the resources and the category to which the resources belong, and perform resource elimination processing based on the resource movement strategy.

[0212] In one embodiment, the resource distribution information includes the location information of the resource and the category to which the resource belongs; the one or more instructions can also be loaded and specifically executed by the processor 1301: receiving an operation instruction input by a user for any resource, the operation instruction carrying the direction of resource movement; performing resource elimination processing according to the direction of resource movement, the location information of the resource and the category to which the resource belongs.

[0213] In one embodiment, the contour recognition algorithm includes edge detection and Hough line detection; when the target area in the target interface image is identified according to the contour recognition algorithm, the one or more instructions can also be loaded and specifically executed by the processor 1301: edge detection is performed on the target interface image using thresholds in a preset threshold set to obtain multiple first images, and the preset threshold set includes multiple thresholds; Hough line detection is performed on the target interface image after edge detection using thresholds in the preset threshold set to obtain multiple second images; an image to be identified whose image information meets preset conditions is determined from the multiple second images, and the target area is determined from the image to be identified.

[0214] In one embodiment, the image information satisfies preset conditions including: the image includes a first rectangle and multiple second rectangles, the multiple second rectangles are distributed within the area of ​​the first rectangle, the sizes of the multiple second rectangles match, and the spacing between adjacent second rectangles matches, and the number of the second rectangles is the largest in the multiple second images; wherein the target area is the area of ​​the first rectangle, and the resource is represented by the second rectangle.

[0215] In one embodiment, before determining the image to be identified whose image information meets the preset condition from the multiple second images, the one or more instructions may also be loaded and specifically executed by the processor 1301: respectively obtaining the size information of each second image, and comparing the size indicated by the size information of each second image with a preset size threshold; if there is a second image whose size is lower than the preset size threshold, deleting the second image whose size is lower than the preset size threshold;

[0216] When an image to be identified whose image information meets a preset condition is determined from the multiple second images, the one or more instructions may also be loaded and specifically executed by the processor 1301: an image to be identified whose image information meets the preset condition is determined from the second images after deleting the second image whose size is lower than a preset size threshold from the multiple second images.

[0217] In one embodiment, when obtaining resource distribution information of the multiple resources in the target area, the one or more instructions can also be loaded and specifically executed by the processor 1301: respectively obtaining size information of each of the multiple resources and the size information of the target area; calculating the size mean of the multiple resources based on the size information of each resource; determining the number of rows and columns of the resources included in the target area based on the size information of the target area and the size mean; determining the location information of each resource in the target area based on the number of rows, the number of columns and the size mean.

[0218] In one embodiment, when obtaining the resource distribution information of the multiple resources in the target area, the one or more instructions can also be loaded and specifically executed by the processor 1301: clustering the multiple resources using a preset clustering algorithm to obtain the classification to which each resource in the multiple resources belongs, and the preset clustering algorithm includes any one or more of the following: color recognition algorithm, contour recognition algorithm, feature recognition algorithm.

[0219] In one embodiment, after identifying the target area in the target interface image and before clustering the multiple resources using a preset clustering algorithm, the one or more instructions may also be loaded and specifically executed by the processor 1301: intercepting the target area from the interface image of the application to obtain a target area image; performing a stroke process on the multiple resources in the target area image using a preset marking line, wherein the stroke process is used to separate each of the resources;

[0220] When clustering the multiple resources using a preset clustering algorithm, the one or more instructions may also be loaded and specifically executed by the processor 1301: clustering the multiple resources after the stroke processing in the target area image using a preset clustering algorithm.

[0221] In one embodiment, the location information includes coordinates; after obtaining resource distribution information of the multiple resources in the target area, the one or more instructions may also be loaded and specifically executed by the processor 1301: establishing a resource matrix according to the resource distribution information, the resource matrix being a two-dimensional array including the coordinates of each resource and the category to which each resource belongs;

[0222] When determining a resource movement strategy according to the resource distribution information, the one or more instructions may also be loaded and specifically executed by the processor 1301: determining a resource movement strategy according to the resource matrix.

[0223] In one embodiment, when obtaining the target interface image of the application, the one or more instructions can also be loaded and specifically executed by the processor 1301: intercepting the interface image of the application, the interface image including multiple resources; gray-scaling the intercepted interface image to obtain a gray-scaled interface image, and using the gray-scaled interface image as the target interface image.

[0224] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A method for obtaining information, characterized in that: include: Acquire a target interface image of the application to be tested, wherein the target interface image includes multiple resources; Identify a target area in the target interface image according to a contour recognition algorithm, wherein the target area is a minimum image area including all resources in the target interface image; Acquire resource distribution information of the plurality of resources in the target area, the resource distribution information including location information of the resources and the categories to which the resources belong; Performing distributed computing processing on resource distribution information of the multiple resources to obtain a virtual resource amount corresponding to moving each resource in the multiple resources; The mobile solution with the largest amount of corresponding virtual resources is used as the resource mobile strategy, and resource elimination processing is performed according to the resource mobile strategy.

2. The method according to claim 1, characterized in that The method further comprises: Receiving an operation instruction input by a user for any resource, wherein the operation instruction carries a resource moving direction; Resource elimination processing is performed according to the moving direction of the resource, the location information of the resource and the category to which the resource belongs.

3. The method according to claim 1, characterized in that The contour recognition algorithm includes edge detection and Hough line detection; the target area in the target interface image is identified according to the contour recognition algorithm, including: Using thresholds in a preset threshold set to perform edge detection on the target interface image respectively to obtain a plurality of first images, wherein the preset threshold set includes a plurality of thresholds; Using the thresholds in the preset threshold set to perform Hough line detection on the target interface image after edge detection to obtain a plurality of second images; An image to be identified whose image information meets a preset condition is determined from the plurality of second images, and the target area is determined from the image to be identified.

4. The method according to claim 3, characterized in that The image information satisfies the preset condition including: the image includes a first rectangle and a plurality of second rectangles, the plurality of second rectangles are distributed within the region of the first rectangle, the sizes of the plurality of second rectangles match, the spacings between adjacent second rectangles match, and the number of the second rectangles is the largest among the plurality of second images; The target area is the area of ​​the first rectangle, and the resource is represented by the second rectangle.

5. The method according to claim 3, characterized in that: Before determining, from the plurality of second images, an image to be identified whose image information meets a preset condition, the method further includes: Respectively acquiring size information of each second image, and comparing a size indicated by the size information of each second image with a preset size threshold; If there is a second image whose size is lower than the preset size threshold, deleting the second image whose size is lower than the preset size threshold; The step of determining, from the plurality of second images, an image to be identified whose image information satisfies a preset condition comprises: An image to be identified whose image information meets a preset condition is determined from the second images after deleting the second image whose size is lower than a preset size threshold from the plurality of second images.

6. The method according to any one of claims 1 to 5, characterized in that: The resource distribution information includes location information of resources; and obtaining the resource distribution information of the plurality of resources in the target area includes: Respectively obtain the size information of each resource in the multiple resources and the size information of the target area; Calculate the size average of the multiple resources according to the size information of each resource; Determine the number of rows and columns of resources included in the target area according to the size information of the target area and the size mean; The location information of each resource in the target area is determined according to the number of rows, the number of columns, and the size average.

7. The method according to any one of claims 1 to 5, characterized in that: The resource distribution information includes the category to which the resources belong; and obtaining the resource distribution information of the plurality of resources in the target area includes: The multiple resources are clustered using a preset clustering algorithm to obtain a classification to which each of the multiple resources belongs. The preset clustering algorithm includes any one or more of the following: a color recognition algorithm, a contour recognition algorithm, and a feature recognition algorithm.

8. The method according to claim 7, characterized in that After identifying the target area in the target interface image and before clustering the multiple resources using a preset clustering algorithm, the method further includes: intercepting the target area from the interface image of the application to obtain a target area image; Performing a stroke process on the multiple resources in the target area image by using a preset marking line, wherein the stroke process is used to separate each of the resources; The clustering process of the plurality of resources using a preset clustering algorithm includes: A preset clustering algorithm is used to perform clustering processing on multiple resources after the stroke processing in the target area image.

9. The method according to claim 1, characterized in that: The location information includes coordinates; after acquiring resource distribution information of the multiple resources in the target area, the method further includes: Establishing a resource matrix according to the resource distribution information, wherein the resource matrix is ​​a two-dimensional array including the coordinates of each resource and the category to which each resource belongs; The performing distributed computing processing on the resource distribution information of the multiple resources to obtain the amount of virtual resources corresponding to moving each resource in the multiple resources includes: Distributed computing is performed on the resource matrix to obtain a virtual resource amount corresponding to moving each resource among the multiple resources.

10. The method according to any one of claims 1 to 5, characterized in that: The step of obtaining the target interface image of the application includes: Capturing an interface image of an application, wherein the interface image includes a plurality of resources; The captured interface image is grayed to obtain a grayed interface image, and the grayed interface image is used as the target interface image.

11. An information acquisition device, characterized in that: include: An acquisition unit, configured to acquire a target interface image of the application to be tested, wherein the target interface image includes a plurality of resources; An identification unit, used to identify a target area in the target interface image according to a contour recognition algorithm, wherein the target area is a minimum image area including all resources in the target interface image; The acquisition unit is further used to acquire resource distribution information of the multiple resources in the target area, wherein the resource distribution information includes location information of the resources and the category to which the resources belong; A processing unit, configured to perform distributed computing processing on the resource distribution information of the plurality of resources to obtain a virtual resource amount corresponding to moving each resource in the plurality of resources; The processing unit is further configured to use the mobile solution with the largest amount of virtual resources obtained as a resource mobile strategy, and perform resource elimination processing according to the resource mobile strategy.

12. A terminal comprising an input device and an output device, characterized in that: Also includes: a processor adapted to implement one or more instructions; as well as, A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executing the method according to any one of claims 1-10.

Citation Information

Patent Citations

  • Information processing method, device and terminal

    CN108126342A