Image analysis method, device, computer equipment and storage medium

By analyzing image controls in the target application through the Flutter performance debugger, image information is obtained and analyzed. This solves the memory pressure problem caused by the inability to effectively analyze image scenes in existing technologies, enables the adjustment of unreasonable images, and reduces the memory usage of terminal devices.

CN114706581BActive Publication Date: 2026-02-13DOUYIN VISION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210357014.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-06
Publication Date
2026-02-13
Estimated Expiration
2042-04-06

AI Technical Summary

Technical Problem

The existing application development process cannot effectively analyze image scenes, resulting in high memory pressure and failing to guide developers to adjust unreasonable image scenes.

Method used

The Flutter performance debugger obtains the view control attribute information of the target page, identifies the target view control containing the image, generates an image acquisition request, the terminal device returns the control image and information, performs image analysis, and generates image analysis results.

Benefits of technology

It reduces the impact of image loading on the display performance of terminal devices and reduces the memory pressure on target applications during use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114706581B_ABST
    Figure CN114706581B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image analysis method and device, computer equipment and a storage medium, wherein the method comprises: in response to an image analysis instruction for a target page in a target application, obtaining control attribute information of each view control of the target page; determining a target view control among the each view control based on the control attribute information, wherein the target view control is an image control containing an image; generating an image acquisition request based on the target view control, and sending the image acquisition request to a terminal device; the image acquisition request is used to instruct the terminal device to acquire a control image and image information of the target view control; acquiring the control image and image information contained in the target view control returned by the terminal device based on the image acquisition request, and performing image analysis on the control image based on the image information to obtain an image analysis result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and in particular, to an image analysis method and device, a computer device and a storage medium. BACKGROUND

[0002] With the increasing diversification of the forms of display interfaces of application programs, it is more and more common to embed images in interface components of application programs. However, since image loading has a great impact on the display performance of terminal devices, for example, network image acquisition consumes a lot of traffic and images consume a lot of memory and CPU.

[0003] However, in the existing development process of application programs, images in the application programs cannot be analyzed, so that unreasonable image scenarios cannot be determined, and developers cannot be guided to adjust the unreasonable image scenarios, which often leads to great memory pressure in the use of the application programs. SUMMARY

[0004] The present disclosure provides at least an image analysis method and device, a computer device and a storage medium.

[0005] In a first aspect, the present disclosure provides an image analysis method applied to a Flutter performance debugging program, comprising:

[0006] In response to an image analysis instruction for a target page in a target application, control attribute information of each view control of the target page is obtained.

[0007] A target view control is determined in the each view control based on the control attribute information, wherein the target view control is an image control containing an image.

[0008] An image acquisition request is generated based on the target view control, and the image acquisition request is sent to a terminal device; the image acquisition request is used to instruct the terminal device to acquire a control image and image information of the target view control.

[0009] The control image and image information contained in the target view control returned by the terminal device based on the image acquisition request are obtained, and the control image is analyzed based on the image information to obtain an image analysis result.

[0010] In an optional implementation, the target view control is determined in the each view control based on the control attribute information, comprising:

[0011] obtain a control structure tree of the plurality of view controls, and determine a main view control corresponding to a root node of the control structure tree; the control structure tree comprises a plurality of nodes and a hierarchical relationship between the nodes, and each node corresponds to a view control in the target page;

[0012] perform traversal on the control structure tree based on the main view control, and obtain the target view control through the traversal.

[0013] In an optional implementation, the performing traversal on the control structure tree based on the main view control, and obtaining the target view control through the traversal comprises:

[0014] taking the main view control as a starting view control, performing traversal on control attribute information of each view control in the control structure tree, and obtaining an attribute traversal result;

[0015] determining a view control containing an image attribute in the attribute traversal result as the target view control.

[0016] In an optional implementation, the method further comprises:

[0017] after performing image analysis on the control image based on the image information, and obtaining an image analysis result, creating a display list based on the image analysis result; the display list comprises a plurality of display areas, and each display area corresponds to display of related information of a target view control;

[0018] displaying the related information of the target view control in a corresponding display area of the display list; wherein the related information comprises at least one of the following: a control image, image information, and an image analysis result.

[0019] In an optional implementation, the related information comprises the image analysis result, and the displaying the related information of the target view control in the corresponding display area of the display list comprises:

[0020] in a case where it is determined that the control image contains an abnormal control image based on the image analysis result, determining abnormal marker information of the abnormal control image;

[0021] displaying the abnormal control image in the corresponding display area of the display list according to the abnormal marker information.

[0022] In an optional implementation, the performing image analysis on the control image based on the image information, and obtaining an image analysis result comprises:

[0023] obtaining a current image size of the control image and an original image size of the control image in the image information;

[0024] comparing the current image size with the original image size to obtain a comparison result;

[0025] in a case where it is determined based on the comparison result that the original image size is greater than the current image size, determining that the control image is the abnormal control image.

[0026] In an optional implementation, the image information includes at least one of the following: a current image size of the control image, a size of memory occupied by the control image in the terminal device, an original image size of the control image, and an image source of the control image.

[0027] In an optional implementation, the obtaining of the control image and the image information of the target view control returned by the terminal device based on the image acquisition request includes:

[0028] obtaining control image data returned by the terminal device based on the image acquisition request;

[0029] performing format conversion on the control image data in a preset data format to obtain the control image and the image information of the target view control, wherein the preset data format is a data format matched with the Flutter performance debugging program.

[0030] In a second aspect, the embodiments of the present disclosure further provide an image analysis method, applied to a terminal device running a target application, and including:

[0031] receiving an image acquisition request sent by a Flutter performance debugging program, and determining a target view control corresponding to the image acquisition request;

[0032] obtaining a control image and image information of the target view control, and returning the control image and the image information to the Flutter performance debugging program.

[0033] In an optional implementation, the determining of the target view control corresponding to the image acquisition request includes:

[0034] determining view control information included in the image acquisition request;

[0035] determining a view control corresponding to the view control information as the target view control.

[0036] In an optional implementation, the obtaining of the control image and the image information of the target view control includes:

[0037] obtaining control attribute information of the target view control;

[0038] perform a loading operation on the control image of the target view control in the control attribute information based on a loading parameter, obtain a loading result, and determine a current image size of the control image based on the loading result, wherein the loading result is used to indicate a rendering effect of the control image, and the loading parameter includes at least one of the following: an original image size of the control image, a memory size occupied by the control image, and an image source of the control image.

[0039] determine the control image and the image information of the target view control according to the loading result and the loading parameter.

[0040] In an optional implementation, after the control image and the image information of the target view control are obtained, the method further includes:

[0041] determining a preset data format matched with the Flutter performance debugging program;

[0042] performing data format conversion on the control image and the image information of the target view control according to the preset data format, to obtain control image data of the target view control;

[0043] transmitting the control image data of the target view control to the Flutter performance debugging program for processing through a debugging extension application of the Flutter application.

[0044] In a third aspect, the embodiments of the present disclosure further provide an image analysis apparatus arranged in a Flutter performance debugging program, including:

[0045] a first obtaining unit configured to obtain control attribute information of each view control of a target page in a target application in response to an image analysis instruction for the target page;

[0046] a determining unit configured to determine a target view control from the view controls based on the control attribute information, wherein the target view control is an image control containing an image;

[0047] a generating unit configured to generate an image acquisition request based on the target view control, and send the image acquisition request to a terminal device, wherein the image acquisition request is used to instruct the terminal device to acquire a control image and image information of the target view control;

[0048] a second obtaining unit configured to obtain the control image and the image information contained in the target view control returned by the terminal device based on the image acquisition request, and perform image analysis on the control image based on the image information, to obtain an image analysis result.

[0049] Fourthly, embodiments of this disclosure also provide an image analysis apparatus, disposed in a terminal device running a target application, comprising:

[0050] The receiving unit is used to receive an image acquisition request sent by the Flutter performance debugging program and determine the target view control corresponding to the image acquisition request;

[0051] The third acquisition unit is used to acquire the control image and image information of the target view control, and return the control image and image information to the Flutter performance debugging program.

[0052] Fifthly, embodiments of this disclosure also provide a computer device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps in any of the possible implementations of the first to second aspects described above are performed.

[0053] Sixthly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps in any of the possible implementations of the first to second aspects described above.

[0054] The image analysis method, apparatus, computer device, and storage medium provided in this disclosure can identify target view controls containing images in a target application, and analyze the image information by obtaining the image information of the control image in the target view control, thereby obtaining the analysis result of the control image. This allows developers to identify unreasonable control images based on the analysis result and adjust the control images, thereby reducing the impact of image loading on the display performance of the terminal device and reducing the memory pressure of the target application during use.

[0055] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0056] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0057] Figure 1 A flow chart of an image analysis method provided by an embodiment of the present disclosure is shown;

[0058] Figure 2 A schematic diagram of part of a control structure tree provided by an embodiment of the present disclosure is shown;

[0059] Figure 3 A schematic diagram of a display list provided by an embodiment of the present disclosure is shown;

[0060] Figure 4 A flow chart of another image analysis method provided by an embodiment of the present disclosure is shown;

[0061] Figure 5 A schematic diagram of an image analysis device provided by an embodiment of the present disclosure is shown;

[0062] Figure 6 A schematic diagram of another image analysis device provided by an embodiment of the present disclosure is shown;

[0063] Figure 7 A schematic diagram of a computer device provided by an embodiment of the present disclosure is shown;

[0064] Figure 8 A schematic diagram of another computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0065] In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure clearer, the following will be combined with the accompanying drawings for the embodiments of the present disclosure to clearly and completely describe the technical solutions of the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. The components of the embodiments of the present disclosure described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed present disclosure, but only represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present disclosure.

[0066] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0067] The term "and / or", merely describes an associated relationship, which means that there can be three relationships, for example, A and / or B, which means that A exists alone, A and B exist together, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, and C, which means including any one or more elements selected from the set consisting of A, B, and C.

[0068] It is found through research that in the existing application development process, the images in the application cannot be analyzed, so that unreasonable image scenarios cannot be determined, and developers cannot be guided to adjust unreasonable image scenarios, which often leads to a large memory pressure of the application in use.

[0069] Based on the above research, the present disclosure provides an image analysis method, device, computer equipment and storage medium. In the embodiment of the present disclosure, the target view control containing the image in the target application can be determined, and the image information of the control image in the target view control is obtained to analyze the image information, so as to obtain the analysis result of the control image, so that the developer can determine the unreasonable control image according to the analysis result and adjust the control image, reduce the influence of image loading on the display performance of the terminal equipment, and reduce the memory pressure of the target application in use.

[0070] In order to facilitate the understanding of the present embodiment, first, a kind of image analysis method disclosed in the embodiment of the present disclosure is introduced in detail, and the execution subject of the image analysis method provided by the embodiment of the present disclosure is generally computer equipment with certain computing power. In some possible implementation ways, the image analysis method can be realized by the way that the processor calls the computer readable instructions stored in the memory.

[0071] Referring to Figure 1 As shown in the flowchart of the image analysis method provided by the embodiment of the present disclosure, the method is applied to Flutter performance debugging program, and the method comprises steps S101-S107, wherein:

[0072] S101: in response to the image analysis instruction for the target page in the target application, the control attribute information of each view control of the target page is obtained.

[0073] In the embodiment of the present disclosure, first, the communication connection between the Flutter performance debugging program and the target application is established, then the Flutter performance debugging program can send a request to the target application after detecting the image analysis instruction for the target page in the target application, wherein the request contains the page identifier of the target page in the target application.

[0074] Next, the target application can determine the target page corresponding to the acquisition request based on the page identifier carried by the acquisition request. After determining the target page, the view control in the target page can be determined, where the view control is a basic element constituting the target page, such as a button, a password box, a list box, an avatar box, etc. Then, the control attribute information of each view control of the target page can be returned to the Flutter performance debugging program through the above communication connection.

[0075] Here, the above control attribute information can be used to indicate the control type of the corresponding view control.

[0076] S103: determining a target view control in the view controls based on the control attribute information, where the target view control is an image control containing an image.

[0077] In the embodiments of the present disclosure, since the functions implemented by the above view controls in the target page are not the same, the content contained in each view control can also be different.

[0078] Here, the control attribute information of each view control can be obtained first, and the filling information contained in the control attribute information can be determined, so as to filter the view controls based on the filling information to obtain the image control containing an image, and the image control is determined as the target view control, where the filling information is used to represent the content contained in the corresponding view control. It should be noted that when the above view control is an image control containing an image, the filling information of the view control can be Image (image).

[0079] S105: generating an image acquisition request based on the target view control, and sending the image acquisition request to the terminal device; the image acquisition request is used to instruct the terminal device to acquire the control image and image information of the target view control.

[0080] In the embodiments of the present disclosure, after the target view control is determined, the control identifier of the target view control can be obtained, such as the control id. Then, the image acquisition request of the target view control is generated based on the control identifier, where the image acquisition request is used to instruct the terminal device to load the control image contained in the target view control, so as to obtain the image resource of the control image (ui.image) of the target view control, and determine the control image and the image information corresponding to the control image of the target view control based on the image resource.

[0081] S107: Obtain the control image and image information contained in the target view control returned by the terminal device based on the image acquisition request, and perform image analysis on the control image based on the image information to obtain an image analysis result.

[0082] In the embodiment of the present disclosure, after obtaining the control image and image information returned by the terminal device, the image analysis result can be obtained by analyzing the control image based on the image information. Specifically, in the process of analyzing the control image information, it can be analyzed whether the control image has a loading exception.

[0083] For example, the image information contains the memory occupation information of the control image, and the image analysis operation can determine whether the memory occupation of the control image is reasonable, such as excessive memory occupation. When the memory occupation of the control image does not meet the memory requirement, it can be determined that the image analysis result for representing that the memory occupation of the control image is unreasonable.

[0084] As described above, in the embodiment of the present disclosure, the target view control containing an image in the target application can be determined, and the image information of the control image in the target view control can be obtained to analyze the image information, so as to obtain the analysis result of the control image. The developer can determine the unreasonable control image according to the analysis result, and adjust the control image to reduce the influence of image loading on the display performance of the terminal device and reduce the memory pressure of the target application in use.

[0085] In an optional implementation, the step S103 of determining the target view control based on the control attribute information in the view controls includes the following process:

[0086] S1031: Obtain a control structure tree of the view controls, and determine a main view control corresponding to a root node of the control structure tree; the control structure tree contains multiple nodes and hierarchical relationships between the nodes, and each node corresponds to a view control in the target page.

[0087] S1032: Traverse the control structure tree based on the main view control, and obtain the target view control through traversal.

[0088] In the embodiment of the present disclosure, the control structure tree of the target page can be used to indicate the control structure information of the view controls of the target page, that is, the hierarchical relationships between the view controls.

[0089] Here, the control structure tree contains multiple nodes, each corresponding to a view control on the target page. This control structure tree indicates the hierarchical relationship between the view controls. This hierarchical relationship can include the stacking relationship and the order in which the view controls are arranged.

[0090] like Figure 2 The diagram shown is a partial representation of some nodes in the control structure tree described above. Figure 2 As can be seen, the stacking relationship described above can be used to indicate the containment relationship between multiple nodes. For example, image control A contains button control 1 and button control 2. The arrangement order described above can be used to indicate the layout position of multiple view controls on the target page. For example, if image control A is located above image control B on the target page, then in the control structure tree, the arrangement order of image control A can be before image control B.

[0091] Therefore, after obtaining the control structure tree of multiple view controls, it is necessary to determine the root node of the control structure tree so that the control attribute information of the view controls in the control structure tree can be traversed starting from the main view control corresponding to the root node, thereby obtaining the target view control. Here, the main view control corresponding to the root node of the control structure tree can be understood as a view control that is not contained within another view control, for example, such as... Figure 2 As shown, the main view control can be the page frame control of the target page.

[0092] In this embodiment of the disclosure, after obtaining the control structure tree of multiple view controls of the target page, the control structure tree can be traversed based on the main view space corresponding to the root node in the control structure tree to obtain the target view control, thereby improving the efficiency of determining the target view control.

[0093] In an optional implementation, step S1032 above, which involves traversing the control structure tree based on the main view control to obtain the target view control, specifically includes the following process:

[0094] (1) Using the main view control as the starting view control, traverse the control attribute information of each view control in the control structure tree to obtain the attribute traversal result;

[0095] (2) The view control containing image attributes in the attribute traversal result is determined as the target view control.

[0096] In the embodiments of the present disclosure, the determined main view control can be taken as a starting view control, and then the traversal order can be determined based on the node arrangement structure in the control structure tree. Here, the traversal order can start from the main view control corresponding to the main node of the control structure tree, and then each view control corresponding to each branch node can be traversed one by one.

[0097] Specifically, taking part of the nodes in the control structure tree shown in Figure 2 as an example, the traversal order indicated by the part of nodes can be picture control A, button control 1, button control 2, and picture control B.

[0098] In the process of traversing the control attribute information of each view control in the control structure tree according to the determined traversal order, the filling information in the control attribute information of each view control can be read, and it is determined whether the read filling information is the Image. Thus, the attribute traversal result is obtained. In the case where the read filling information is the Image, it is determined that the view control with the Image filling information contains an image attribute, and then the view control can be determined as the target view control.

[0099] In the embodiments of the present disclosure, the main view control is taken as the starting view control, the control attribute information of each view control in the control structure tree is traversed, and the target view control is determined according to the attribute traversal result. Thus, the efficiency of determining the target view control is further improved.

[0100] In an optional implementation, the step S107 of obtaining the control image and the image information contained in the target view control returned by the terminal device based on the image acquisition request comprises:

[0101] (1) obtaining control image data returned by the terminal device based on the image acquisition request;

[0102] (2) performing format conversion on the control image data according to a preset data format to obtain the control image and the image information of the target view control; and the preset data format is a data format matched with the Flutter performance debugging program.

[0103] In the embodiments of the present disclosure, the target application includes a debugging extension application, a communication connection between the target application and the Flutter performance debugging program can be established based on the debugging extension application, so as to obtain the control image data returned by the terminal device to which the target application belongs based on the communication connection, wherein the debugging extension application can perform data transmission between the Flutter performance debugging program and the Flutter application based on a WebSocket communication connection, and in addition, the debugging extension application can be an extension.

[0104] Here, the debugging extension application has a requirement on the format of the transmission data, wherein the transmission data format that can be transmitted by the debugging extension application is a data format of VMService. Therefore, the terminal device first converts the determined control image and image information into control image data in the VMService format, so as to send the control image data to the Flutter performance debugging program through the debugging extension application.

[0105] After receiving the control image data, the Flutter performance debugging program can convert the control image data in the VMService format into a preset data format, so as to obtain the control image and image information contained in the control image data.

[0106] In the embodiments of the present disclosure, in the process of performing data transmission between the target application and the Flutter performance debugging program, the control image data containing the control image and image information can be determined first, and then data transmission is performed, thereby improving the confidentiality of data transmission between the target application and the Flutter performance debugging program to a certain extent.

[0107] In an optional implementation, the image information includes at least one of the following: a current image size of the control image, a size of memory occupied by the control image in the terminal device, an original image size of the control image, and an image source of the control image.

[0108] Specifically, the current image size of the control image can be an image size of the control image in the target view control described by a user. The size of memory occupied by the control image in the terminal device can be used to represent the size of the memory of the terminal device occupied by the control image after the control image is loaded in the terminal device.

[0109] It should be understood that when the control image is loaded, the image resource of the control image needs to be obtained from the image source of the control image, and the control image is loaded according to the image resource. Then, the image source of the control image includes a network picture and a local cache picture, wherein the network picture is a picture that needs to be downloaded from the network when the control image is loaded, and the local cache picture is a picture that is directly loaded from the cache of the terminal device; the original image size of the control image is the size of the image resource of the control image at the image source. For example, when the image source of the control image is a local cache picture, the original image size of the control image is the size of the image resource of the control image in the local cache.

[0110] As can be seen from the above description, the image information includes at least one of the current image size of the control image, the size of the memory occupied by the control image in the terminal device, the original image size of the control image, and the image source of the control image. Therefore, obtaining the image information of the control image of the target view control provides technical support for the image analysis of the control image.

[0111] In an optional embodiment, the step S107 of performing image analysis on the control image based on the image information to obtain an image analysis result specifically includes the following process:

[0112] (1) obtaining the current image size of the control image and the original image size of the control image in the image information;

[0113] (2) comparing the current image size and the original image size to obtain a comparison result;

[0114] (3) in the case where it is determined based on the comparison result that the original image size is greater than the current image size, determining that the control image is the abnormal control image.

[0115] In the embodiments of the present disclosure, after obtaining the image information of the control image, the current image size of the control image and the original image size of the control image can be obtained in the image information. Then, the current image size and the original image size can be compared to obtain a comparison result.

[0116] It should be understood that in a normal case, since the image source of the control image is difficult to control, the original image size of the control image may be too large and the memory occupied may be too much. Based on this, in the process of constructing the target view control, the current image size of the control image in the target view control should be smaller than the original image size of the control image, so as to ensure that the control image does not occupy too much memory in the loading process.

[0117] Therefore, it is necessary to determine the control image with the original image size greater than the current image size in the above comparison result, and determine the determined control image as an abnormal control image, so as to perform further abnormality confirmation based on the abnormal control image, and guide the developer to adjust the abnormal control image in the case that the abnormal control image needs to be adjusted.

[0118] In a specific implementation, a size of the abnormal control image in the image information occupying the memory in the terminal device can be acquired, and whether the abnormal control image occupies the memory in the terminal device to meet the occupation requirement can be analyzed, where the occupation requirement can be a memory occupation threshold. In a case that the abnormal control image occupies the memory in the terminal device greater than the memory occupation threshold, it is determined that the abnormal control image needs to be adjusted.

[0119] In the embodiments of the present disclosure, after the current image size and the original image size of the control image are acquired, the current image size and the original image size can be compared, and the control image with the original image size greater than the current image size is determined as an abnormal control image, so as to ensure that the control image in the target view control does not occupy too much memory, so as to avoid affecting the loading speed of the terminal device to load the control image, and improve the user experience.

[0120] In an optional implementation, the above method further includes the following process:

[0121] (1) After the image analysis on the control image based on the image information is performed to obtain an image analysis result, a display list is created based on the image analysis result. The display list includes a plurality of display areas, and each display area corresponds to display related information of a target view control.

[0122] (2) The related information of the target view control is displayed in the corresponding display area of the display list. The related information includes at least one of the following: control image, image information, and image analysis result.

[0123] In the embodiments of the present disclosure, after the image analysis result is determined, the display list can also be created through the state management control in the Flutter performance debugging program. As shown in the following figure, the display list includes a plurality of display areas, and each display area corresponds to display related information of a target view control. Figure 3

[0124] ​Here, the user can also filter the relevant information displayed in the display area by filtering identification. For example, in the default display case, the relevant information displayed in the display area can be control images, image information, and image analysis results. In addition, corresponding filtering buttons can also be set for control images, image information, and image analysis results, respectively. The user can trigger the filtering button to make the display area display only the relevant information corresponding to the filtering button.

[0125] For example, after detecting the triggering operation of the user on the filtering buttons corresponding to the control images and the image information, the control images and the image information of each target view control can be displayed in the display area.

[0126] In an optional implementation, in the case where the relevant information includes image analysis results, the display of the relevant information of the target view control in the corresponding display area of the display list includes the following process:

[0127] (1) In the case where it is determined based on the image analysis results that the control images include abnormal control images, determining abnormal marking information of the abnormal control images.

[0128] (2) Displaying the abnormal control images in the corresponding display area of the display list according to the abnormal marking information.

[0129] In the embodiments of the present disclosure, in the case where it is determined that the control images include abnormal control images, the abnormal control images can be marked by abnormal marking information. For example, as shown in Figure 3 , the determined abnormal control images are control images 4 in Figure 3 , which can be marked by abnormal marking information (i.e., the “WARNING” mark in Figure 3 ) on the control images 4, so that the developer adjusts the abnormal control images, thereby reducing the impact of image loading on the display performance of the terminal device.

[0130] Referring to Figure 4 , it is a flowchart of another image analysis method provided by the embodiments of the present disclosure, applied to a terminal device running a target application, and the method includes steps S401-S403, wherein:

[0131] S401: receiving an image acquisition request sent by a Flutter performance debugging program and determining a target view control corresponding to the image acquisition request.

[0132] In the embodiments of the present disclosure, after the image acquisition request sent by the Flutter performance debugger is acquired, the control identifier carried in the image acquisition request can be acquired, and the target view control corresponding to the control identifier is determined. The control identifier can be a control id.

[0133] S403: The control image and the image information of the target view control are acquired, and the control image and the image information are returned to the Flutter performance debugger.

[0134] In the embodiments of the present disclosure, after the target view controls contained in the target page are determined, the control image and the image information corresponding to each target view control can be acquired respectively.

[0135] Here, since the communication connection between the target application and the Flutter performance debugger is established based on the debugging extension application, and the format requirement of the debugging extension application for the transmission data is the VMService data format. Therefore, the acquired control image and image information need to be converted into control image data in the VMService format, so as to return the control image data to the Flutter performance debugger.

[0136] As can be known from the above description, in the embodiments of the present disclosure, the target view control contained in the target application can be determined in response to the image acquisition request sent by the Flutter performance debugger, the control image and the image information of the target view control are acquired, and the control image and the image information are returned to the Flutter performance debugger. The Flutter performance debugger can analyze the control image based on the image information, so as to obtain the analysis result of the control image. The developer can determine the unreasonable control image according to the analysis result, and adjust the control image, so as to reduce the influence of image loading on the display performance of the terminal device, and reduce the memory pressure of the target application in use.

[0137] In an optional implementation, the step S401 of determining the target view control corresponding to the image acquisition request specifically includes the following steps:

[0138] S4011: The view control information contained in the image acquisition request is determined.

[0139] S4012: The view control corresponding to the view control information is determined as the target view control.

[0140] In the embodiments of the present disclosure, the view control information can include the control identifier, and after the view control information included in the image acquisition request is acquired, the view controls included in the target page of the target application can be traversed, so that the view control that hits the view control information is determined, and the determined view control is determined as the target view control.

[0141] In the embodiments of the present disclosure, the image acquisition request can include the view control information, so that the target application determines the corresponding target view control according to the view control information, thereby improving the accuracy of determining the target view control.

[0142] In an optional implementation, the step S403 of acquiring the control image and the image information of the target view control specifically includes the following process:

[0143] S4031: acquiring control attribute information of the target view control;

[0144] S4032: performing a loading operation on the control image of the target view control in the control attribute information based on a loading parameter to obtain a loading result, and determining a current image size of the control image based on the loading result, wherein the loading result is used to indicate a rendering effect of the control image, and the loading parameter includes at least one of the following: an original image size of the control image, a memory size occupied by the control image, and an image source of the control image.

[0145] S4033: determining the control image and the image information of the target view control according to the loading result and the loading parameter.

[0146] In the embodiments of the present disclosure, the control attribute information can include the control image of the target view control and the loading parameter corresponding to the control image. The loading operation can be performed on the control image based on the loading parameter of the control image, so as to obtain a loading result.

[0147] Specifically, first, the control image and the corresponding loading address required by the loading operation can be determined based on the image source of the control image in the loading parameter, and then the content of the control image required by the loading operation can be determined based on the original image size of the control image and the memory size occupied by the control image in the loading parameter. At this time, the loading operation can be performed on the control image based on the determined loading address and the content of the control image, so as to obtain the loading result.

[0148] In the embodiments of the present disclosure, first, the control attribute information of the target view control is needed to be acquired, and a loading operation is performed on the control image in the control attribute information based on the loading parameter to obtain a loading result, so that the control image and the image information of the target view control can be determined based on the loading result and the control attribute information, and the content of the obtained image information is enriched.

[0149] In an optional implementation, after the control image and the image information of the target view control are acquired, the method further includes the following process:

[0150] (1) determining a preset data format matched with the Flutter performance debugging program;

[0151] (2) performing data format conversion on the control image and the image information of the target view control according to the preset data format to obtain control image data of the target view control;

[0152] (3) transmitting the control image data of the target view control to the Flutter performance debugging program for processing through the debugging extension application of the target application.

[0153] In the embodiments of the present disclosure, the preset data format matched with the Flutter performance debugging program can be a transmission data format corresponding to the debugging extension application in the target application, for example, the VMService format. In specific implementation, after the control image and the image information of the target view control are determined, data format conversion can be performed on the control image and the image information to convert them into control image data in the VMService format, so that the control image data can be sent to the Flutter performance debugging program through the debugging extension application.

[0154] In the embodiments of the present disclosure, in the process of data transmission between the target application and the Flutter performance debugging program, data format conversion can be first performed on the control image and the image information to obtain control image data of the target view control, so that the confidentiality of data transmission between the target application and the Flutter performance debugging program is improved to a certain extent.

[0155] In summary, in the embodiments of the present disclosure, the target view control containing an image in the target application can be determined, and the image information of the control image in the target view control is acquired to analyze the image information, so that the analysis result of the control image is obtained, so that the developer can determine the unreasonable control image according to the analysis result and adjust the control image, thereby reducing the influence of image loading on the display performance of the terminal device and reducing the memory pressure of the target application in use.

[0156] Those skilled in the art can understand that the sequence of writing each step in the above method of the specific embodiment does not mean a strict execution sequence and constitutes any limitation on the implementation process. The specific execution sequence of each step should be determined by its function and possible internal logic.

[0157] Based on the same inventive concept, the image analysis device corresponding to the image analysis method is also provided in the embodiments of the disclosure. Since the principle of solving problems of the device in the embodiments of the disclosure is similar to the above-mentioned image analysis method, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described here.

[0158] Referring to Figure 5 FIG. 1 shows a schematic diagram of an image analysis device provided by the embodiments of the disclosure, which is arranged in a Flutter performance debugging program. The device comprises a first acquisition unit 51, a determination unit 52, a generation unit 53, and a second acquisition unit 54.

[0159] The first acquisition unit 51 is configured to acquire control attribute information of each view control of a target page in response to an image analysis instruction for the target page in a target application.

[0160] The determination unit 52 is configured to determine a target view control among the view controls based on the control attribute information, wherein the target view control is an image control containing an image.

[0161] The generation unit 53 is configured to generate an image acquisition request based on the target view control and send the image acquisition request to a terminal device. The image acquisition request is used to instruct the terminal device to acquire a control image and image information of the target view control.

[0162] The second acquisition unit 54 is configured to acquire the control image and image information contained in the target view control returned by the terminal device based on the image acquisition request, and perform image analysis on the control image based on the image information to obtain an image analysis result.

[0163] In the embodiments of the disclosure, the target view control containing an image in the target application can be determined, and the image information of the control image in the target view control is acquired to analyze the image information, so as to obtain an analysis result of the control image. The developer can determine the unreasonable control image according to the analysis result, and adjust the control image to reduce the influence of image loading on the display performance of the terminal device and reduce the memory pressure of the target application in use.

[0164] In a possible implementation, the determination unit 52 is further configured to:

[0165] obtain a control structure tree of the plurality of view controls, and determine a main view control corresponding to a root node of the control structure tree; the control structure tree comprises a plurality of nodes and a hierarchical relationship between the nodes, and each node corresponds to a view control in the target page;

[0166] based on the main view control, traverse the control structure tree to obtain the target view control.

[0167] In a possible implementation, the determining unit 52 is further configured to:

[0168] take the main view control as a starting view control, traverse control attribute information of each view control in the control structure tree to obtain an attribute traversal result;

[0169] determine a view control including an image attribute in the attribute traversal result as the target view control.

[0170] In a possible implementation, the apparatus is further configured to:

[0171] after image analysis is performed on the control image based on the image information to obtain an image analysis result, create a display list based on the image analysis result; the display list comprises a plurality of display areas, and each display area corresponds to display of related information of a target view control;

[0172] display the related information of the target view control in the corresponding display area of the display list; wherein the related information comprises at least one of the following: the control image, the image information, and the image analysis result.

[0173] In a possible implementation, in a case where the related information comprises the image analysis result, the apparatus is further configured to:

[0174] in a case where it is determined that the control image comprises an abnormal control image based on the image analysis result, determine abnormal marker information of the abnormal control image;

[0175] display the abnormal control image in the corresponding display area of the display list according to the abnormal marker information.

[0176] In a possible implementation, the second obtaining unit 54 is further configured to:

[0177] obtain a current image size of the control image and an original image size of the control image in the image information;

[0178] compare the current image size and the original image size to obtain a comparison result;

[0179] In a case where it is determined, based on the comparison result, that the original image size is greater than the current image size, the control image is determined as the abnormal control image.

[0180] In a possible implementation, the image information includes at least one of the following: a current image size of the control image, a size of memory occupied by the control image in the terminal device, an original image size of the control image, and an image source of the control image.

[0181] In a possible implementation, the second obtaining unit 54 is further configured to:

[0182] obtain control image data returned by the terminal device based on the image obtaining request;

[0183] perform format conversion on the control image data in a preset data format, to obtain the control image of the target view control and the image information; the preset data format is a data format matched with the Flutter performance debugging program.

[0184] Referring to Figure 6 FIG. 2 shows a schematic diagram of another image analysis apparatus provided by an embodiment of the present disclosure, which is arranged in a terminal device running a target application, and includes a receiving unit 61 and a third obtaining unit 62; wherein

[0185] The receiving unit 61 is configured to receive an image obtaining request sent by a Flutter performance debugging program, and determine a target view control corresponding to the image obtaining request.

[0186] The third obtaining unit 62 is configured to obtain a control image of the target view control and image information, and return the control image and the image information to the Flutter performance debugging program.

[0187] In the embodiment of the present disclosure, a target view control containing an image in a target application can be determined, and the image information of the control image in the target view control is obtained, so that the image information is analyzed to obtain an analysis result of the control image, so that a developer can determine an unreasonable control image according to the analysis result, and adjust the control image, thereby reducing the influence of image loading on the display performance of the terminal device and reducing the memory pressure of the target application in use.

[0188] In a possible implementation, the receiving unit 61 is further configured to:

[0189] determine view control information contained in the image obtaining request;

[0190] determine a view control corresponding to the view control information as the target view control.

[0191] In a possible implementation, the third obtaining unit 62 is further configured to:

[0192] determine the view control information contained in the image obtaining request;

[0193] obtain the control attribute information of the target view control;

[0194] perform a loading operation on the control image of the target view control in the control attribute information based on a loading parameter, obtain a loading result, and determine a current image size of the control image based on the loading result, wherein the loading result is used to indicate a rendering effect of the control image, and the loading parameter includes at least one of the following: an original image size of the control image, a memory size occupied by the control image, and an image source of the control image;

[0195] determine the control image and the image information of the target view control according to the loading result and the loading parameter.

[0196] In a possible implementation, the third obtaining unit 62 is further configured to:

[0197] determine a preset data format matched with the Flutter performance debugging program;

[0198] perform data format conversion on the control image and the image information of the target view control according to the preset data format, to obtain control image data of the target view control;

[0199] transmit the control image data of the target view control to the Flutter performance debugging program for processing through the debugging extension application of the Flutter application.

[0200] The description of the processing procedure of each unit in the device and the interaction procedure between the units can refer to the related description in the foregoing method embodiments, and will not be described in detail here.

[0201] Corresponding to the image analysis method in Figure 1 , the embodiments of the present disclosure further provide a computer device 700, as shown in Figure 7 , a structural schematic diagram of the computer device 700 provided by the embodiments of the present disclosure, which includes:

[0202] The processor 71, the memory 72, and the bus 73; the memory 72 is used for storing execution instructions, including the internal memory 721 and the external memory 722; the internal memory 721 here is also called the internal memory, used for temporarily storing operation data in the processor 71 and data exchanged with the external memory 722 such as a hard disk, the processor 71 exchanges data with the external memory 722 through the internal memory 721, when the computer equipment 700 runs, the processor 71 and the memory 72 communicate through the bus 73, so that the processor 71 executes the following instructions:

[0203] In response to the image analysis instruction for the target page in the target application, the control attribute information of each view control of the target page is acquired;

[0204] Based on the control attribute information, a target view control is determined in the each view control, wherein the target view control is an image control containing an image;

[0205] Based on the target view control, an image acquisition request is generated, and the image acquisition request is sent to a terminal device; the image acquisition request is used to instruct the terminal device to acquire the control image and image information of the target view control;

[0206] The control image and image information contained in the target view control returned by the terminal device based on the image acquisition request are acquired, and the image analysis of the control image is performed based on the image information, to obtain an image analysis result.

[0207] Corresponding to the image analysis method in Figure 4 , the present disclosure also provides another computer equipment 800, as shown in Figure 8 , a structural schematic diagram of the computer equipment 800 provided by the present disclosure, comprising:

[0208] The processor 81, the memory 82, and the bus 83; the memory 82 is used for storing execution instructions, including the internal memory 821 and the external memory 822; the internal memory 821 here is also called the internal memory, used for temporarily storing operation data in the processor 81 and data exchanged with the external memory 822 such as a hard disk, the processor 81 exchanges data with the external memory 822 through the internal memory 821, when the computer equipment 800 runs, the processor 81 and the memory 82 communicate through the bus 83, so that the processor 81 executes the following instructions:

[0209] Receive the image acquisition request sent by the Flutter performance debugging program, and determine the target view control corresponding to the image acquisition request;

[0210] Obtain a control image and image information of the target view control, and return the control image and image information to the Flutter performance debugging program.

[0211] The embodiments of the present disclosure further provide a computer-readable storage medium, which stores a computer program. When the computer program is run by a processor, the steps of the image analysis method described in the above method embodiments are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0212] The embodiments of the present disclosure further provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the image analysis method described in the above method embodiments. For details, refer to the above method embodiments, which will not be described here.

[0213] The computer program product can be specifically implemented by hardware, software or a combination thereof. In an optional embodiment, the computer program product is specifically embodied as a computer storage medium. In another optional embodiment, the computer program product is specifically embodied as a software product, such as a software development kit (SDK) and the like.

[0214] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system and device can refer to the corresponding process in the foregoing method embodiments, which will not be described here. In several embodiments provided by the present disclosure, it should be understood that the disclosed system, device and method can be implemented by other ways. The device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there can be another division way in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interface, device or unit, which can be electrical, mechanical or other forms.

[0215] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., they can be located in one place, or distributed on multiple network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the present embodiment.

[0216] In addition, each function unit in various embodiments of the present disclosure can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.

[0217] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a nonvolatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present disclosure essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0218] Finally, it should be noted that: the above-described embodiments are merely specific embodiments of the present disclosure, used to illustrate the technical solutions of the present disclosure, rather than limit them. The protection scope of the present disclosure is not limited thereto, although the present disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any skilled person familiar with the technical field can modify or easily think of changes to the technical solutions described in the foregoing embodiments within the technical range disclosed by the present disclosure, or make equivalent replacements to some technical features; and these modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims

1. An image analysis method characterized by, The application is applied to a Flutter performance debugging program, and includes: In response to an image analysis instruction for a target page in a target application, control attribute information of each view control of the target page is acquired; Based on the control attribute information, a target view control is determined in the each view control, wherein the target view control is an image control containing an image; Based on the target view control, an image acquisition request is generated and sent to a terminal device; the image acquisition request is used to instruct the terminal device to acquire a control image and image information of the target view control; The control image and image information contained in the target view control returned by the terminal device based on the image acquisition request are acquired, and image analysis is performed on the control image based on the image information to obtain an image analysis result; The acquisition of the control image and image information contained in the target view control returned by the terminal device based on the image acquisition request includes: Control image data returned by the terminal device based on the image acquisition request is acquired; The control image data is format-converted according to a preset data format to obtain the control image and image information of the target view control; the preset data format is a data format matched with the Flutter performance debugging program.

2. The method of claim 1, wherein, The determination of the target view control based on the control attribute information in the each view control includes: A control structure tree of the multiple view controls is acquired, and a main view control corresponding to a root node of the control structure tree is determined; the control structure tree contains multiple nodes and hierarchical relationships between the nodes, and each node corresponds to a view control in the target page; Based on the main view control, the control structure tree is traversed to obtain the target view control.

3. The method of claim 2, wherein, The traversal of the control structure tree based on the main view control to obtain the target view control includes: The main view control is taken as a starting view control, the control attribute information of each view control in the control structure tree is traversed to obtain an attribute traversal result; A view control containing an image attribute in the attribute traversal result is determined as the target view control.

4. The method of claim 1, wherein, The method further includes: After the image analysis of the control image based on the image information to obtain an image analysis result, a display list is created based on the image analysis result; the display list contains multiple display areas, and each display area corresponds to display of related information of a target view control; The related information of the target view control is displayed in the corresponding display area of the display list; wherein the related information includes at least one of the following: a control image, image information, and an image analysis result.

5. The method of claim 4, wherein, The related information includes the image analysis result, and the display of the related information of the target view control in the corresponding display area of the display list includes: In a case where it is determined that the control image contains an abnormal control image based on the image analysis result, abnormal marker information of the abnormal control image is determined; According to the abnormal mark information, the abnormal control image is displayed in a corresponding display area of the display list.

6. The method of claim 1, wherein, The image information is analyzed to obtain an image analysis result, including: In the image information, the current image size of the control image and the original image size of the control image are obtained; The current image size and the original image size are compared to obtain a comparison result; In a case where it is determined based on the comparison result that the original image size is greater than the current image size, the control image is determined as an abnormal control image.

7. The method of claim 1, wherein, The image information includes at least one of the following: the current image size of the control image, the size of the memory occupied by the control image in the terminal device, the original image size of the control image, and the image source of the control image.

8. An image analysis method characterized by, Applied to a terminal device running a target application, including: Receiving an image acquisition request sent by a Flutter performance debugging program, and determining a target view control corresponding to the image acquisition request; Obtaining the control image and image information of the target view control, and returning the control image and image information to the Flutter performance debugging program; Wherein, after obtaining the control image and image information of the target view control, the image analysis method further includes: Determine a preset data format matched with the Flutter performance debugging program; According to the preset data format, the control image data of the target view control is obtained by performing data format conversion on the control image and image information of the target view control. The control image data of the target view control is transmitted to the Flutter performance debugging program for processing through the debugging extension application of the Flutter application.

9. The method of claim 8, wherein, The determination of the target view control corresponding to the image acquisition request includes: Determine the view control information contained in the image acquisition request; The view control corresponding to the view control information is determined as the target view control.

10. The method of claim 8, wherein, The obtaining of the control image and image information of the target view control includes: Obtain the control attribute information of the target view control; Based on the loading parameter, the loading operation is performed on the control image of the target view control in the control attribute information to obtain a loading result, and the current image size of the control image is determined based on the loading result; wherein, the loading result is used to indicate the rendering effect of the control image, and the loading parameter includes at least one of the following: the original image size of the control image, the memory size occupied by the control image, and the image source of the control image; The control image and image information of the target view control are determined according to the loading result and the loading parameter.

11. An image analysis apparatus characterized by comprising: Set in the Flutter performance debugging program, including: The first acquisition unit is configured to, in response to an image analysis instruction for a target page in a target application, obtain control attribute information of each view control of the target page; A determining unit is configured to determine a target view control from the view controls based on the control attribute information, wherein the target view control is an image control containing an image; A generating unit is configured to generate an image acquisition request based on the target view control and send the image acquisition request to a terminal device, wherein the image acquisition request is used to instruct the terminal device to acquire a control image and image information of the target view control; A second acquiring unit is configured to acquire the control image and image information of the target view control returned by the terminal device based on the image acquisition request, and perform image analysis on the control image based on the image information to obtain an image analysis result. The second acquiring unit is further configured to acquire control image data returned by the terminal device based on the image acquisition request, and perform format conversion on the control image data in a preset data format to obtain the control image and image information of the target view control, wherein the preset data format is a data format matched with the Flutter performance debugging program.

12. An image analysis apparatus characterized by comprising: The method is arranged in a terminal device running a target application and includes the following steps: A receiving unit is configured to receive an image acquisition request sent by a Flutter performance debugging program and determine a target view control corresponding to the image acquisition request; A third acquiring unit is configured to acquire a control image and image information of the target view control and return the control image and image information to the Flutter performance debugging program; The third acquiring unit is further configured to determine a preset data format matched with the Flutter performance debugging program, perform data format conversion on the control image and image information of the target view control in the preset data format to obtain control image data of the target view control, and transmit the control image data of the target view control to the Flutter performance debugging program for processing through a debugging extension application of the Flutter application.

13. A computer device, comprising: The method includes the following steps: A processor, a memory and a bus, the memory stores machine readable instructions executable by the processor, when the computer device is running, the processor and the memory communicate through the bus, the machine readable instructions are executed by the processor to execute the steps of the image analysis method in any one of claims 1 to 10.

14. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, when the computer program is executed by the processor, the steps of the image analysis method in any one of claims 1 to 10 are executed.

Citation Information

Patent Citations

  • Picture processing method, apparatus and device, and storage medium

    CN110658969A

  • Page view control detection method and device

    CN113032264A