WO2023193633A1 - 图像分析方法、装置、计算机设备以及存储介质 - Google Patents

图像分析方法、装置、计算机设备以及存储介质 Download PDF

Info

Publication number
WO2023193633A1
WO2023193633A1 PCT/CN2023/084326 CN2023084326W WO2023193633A1 WO 2023193633 A1 WO2023193633 A1 WO 2023193633A1 CN 2023084326 W CN2023084326 W CN 2023084326W WO 2023193633 A1 WO2023193633 A1 WO 2023193633A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
control
information
target
view control
Prior art date
Application number
PCT/CN2023/084326
Other languages
English (en)
French (fr)
Inventor
王李坤
Original Assignee
北京字节跳动网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2023193633A1 publication Critical patent/WO2023193633A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04812Interaction techniques based on cursor appearance or behaviour, e.g. being affected by the presence of displayed objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0482Interaction with lists of selectable items, e.g. menus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure relates to the field of computer technology, and specifically, to an image analysis method, device, computer equipment and storage medium.
  • Embodiments of the present disclosure provide at least an image analysis method, device, computer equipment, and storage medium.
  • embodiments of the present disclosure provide an image analysis method applied to Flutter performance debugging program, including:
  • the image acquisition request is used to instruct the terminal device to acquire the control image and image information of the target view control;
  • determining a target view control in each view control based on the control property information includes:
  • control structure tree of multiple view controls, and determine the main view control corresponding to the root node of the control structure tree;
  • the control structure tree includes multiple nodes and hierarchical relationships between each node.
  • Each node Corresponding to a view control in the target page;
  • control structure tree is traversed to obtain the target view control.
  • control structure tree is traversed based on the main view control, and the target view control is obtained by traversing, including:
  • the main view control is used as the starting view control, and the control attribute information of each view control in the control structure tree is traversed according to the traversal order to obtain the attribute traversal result.
  • the traversal order is based on the starting view control and all The control structure tree is determined;
  • the view control containing the image attribute in the attribute traversal result is determined as the target view control.
  • the method further includes:
  • a display list is created based on the image analysis result; the display list contains multiple display areas, and each display area corresponds to a display Information about a target view control;
  • the relevant information of the target view control is displayed in the corresponding display area of the display list; wherein the relevant information includes at least one of the following: control image, image information and image analysis result.
  • the relevant information includes the image analysis results
  • displaying the relevant information of the target view control in the corresponding display area of the display list includes:
  • the abnormal control image is displayed in the corresponding display area of the display list according to the abnormal mark information.
  • the image analysis is performed on the control image based on the image information to obtain image analysis results, including:
  • the control image is determined to be the abnormal control image.
  • 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, the size of the control image. Image source.
  • obtaining the control image and image information contained in the target view control returned by the terminal device based on the image acquisition request includes:
  • the control image data is formatted according to 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 that matches the Flutter performance debugging program.
  • embodiments of the present disclosure also provide an image analysis method, applied to a terminal device running a target application, including:
  • determining the target view control corresponding to the image acquisition request includes:
  • the view control corresponding to the view control information is determined as the target view control.
  • obtaining the control image and image information of the target view control includes:
  • the loading result is used Indicates the rendering effect of the control image
  • the loading parameters include 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 parameters.
  • the method further includes:
  • 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.
  • embodiments of the present disclosure also provide an image analysis device, which is provided in the Flutter performance debugging program, including:
  • a first acquisition unit configured to acquire control attribute information of each view control of the target page in response to an image analysis instruction for a target page in the target application
  • a determining unit configured to determine a target view control in each of the view controls based on the control attribute information, where the target view control is an image control containing an image;
  • 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; the image acquisition request is used to instruct the terminal device to acquire the control image and image information of the target view control. ;
  • the second acquisition unit is used 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 Image analysis results.
  • embodiments of the present disclosure also provide an image analysis device, which is provided in a terminal device running a target application, including:
  • a receiving unit configured 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;
  • 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.
  • embodiments of the present disclosure further provide a computer device, including: a processor, a memory, and a bus.
  • the memory stores machine-readable instructions executable by the processor.
  • the processing The processor communicates with the memory through a bus, and when the machine-readable instructions are executed by the processor, the steps in any one of the possible implementations of the first aspect to the second aspect are performed.
  • embodiments of the present disclosure also provide a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computer program executes any one of the above-mentioned first to second aspects when run by a processor. steps in possible implementations.
  • the image analysis method, device, computer equipment and storage medium provided by the embodiments of the present disclosure can determine the target view control containing the image in the target application, and obtain the image information of the control image in the target view control. Perform analysis to obtain the analysis results of the control image, so that developers can determine unreasonable control images based on the analysis results, and adjust the control image to reduce the impact of image loading on the display performance of the terminal device and reduce the target application Memory pressure during use.
  • Figure 1 shows a flow chart of an image analysis method provided by an embodiment of the present disclosure
  • Figure 2 shows a schematic diagram of some nodes in the control structure tree provided by the embodiment of the present disclosure
  • Figure 3 shows a schematic diagram of a display list provided by an embodiment of the present disclosure
  • Figure 4 shows a flow chart of another image analysis method provided by an embodiment of the present disclosure
  • Figure 5 shows a schematic diagram of an image analysis device provided by an embodiment of the present disclosure
  • Figure 6 shows a schematic diagram of another image analysis device provided by an embodiment of the present disclosure.
  • Figure 7 shows a schematic diagram of a computer device provided by an embodiment of the present disclosure
  • FIG. 8 shows a schematic diagram of another computer device provided by an embodiment of the present disclosure.
  • a and/or B can mean: A alone exists, A and B exist simultaneously, and B alone exists. situation.
  • 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 can mean including from A, Any one or more elements selected from the set composed of B and C.
  • the present disclosure provides an image analysis method, device, computer equipment and storage medium.
  • the target view control containing the image in the target application can be determined, and by obtaining the control in the target view control
  • the image information of the image is analyzed to obtain the analysis result of the control image, so that the developer can determine the unreasonable control image based on the analysis result, and adjust the control image to reduce image loading. Impact on the display performance of terminal devices and reduce memory pressure on target applications during use.
  • the execution subject of the image analysis method provided by the embodiment of the disclosure is generally a computer device with certain computing capabilities.
  • the image analysis method can be implemented by a processor calling computer-readable instructions stored in a memory.
  • a flow chart of an image analysis method provided by an embodiment of the present disclosure is applied to the Flutter performance debugging program.
  • the method includes steps S101 to S107, where:
  • the communication connection between the above-mentioned Flutter performance debugging program and the target application is first established. Then, after the Flutter performance debugging program detects the image analysis instruction for the target page in the target application, it can send a request to the target application.
  • the target application sends a fetch request, where the fetch request includes the page identifier of the target page in the target application.
  • the target application can determine the target page corresponding to the acquisition request based on the page identifier carried in the acquisition request.
  • the control attribute information of each view control of the target page can be returned to the Flutter performance debugger through the above communication connection.
  • control attribute information can be used to indicate the control type of the corresponding view control.
  • S103 Determine a target view control in each view control based on the control attribute information, where the target view control is an image control containing an image.
  • each of the above view controls in the target page since the functions implemented by each of the above view controls in the target page are different, the content contained in each view control may also be different.
  • the fill information of the view control may be Image.
  • S105 Generate an image acquisition request based on the target view control, and send 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.
  • the control identification of the target view control for example, the control id
  • the control identification can be obtained.
  • the image acquisition request is used to instruct the terminal device to load the control image contained in the target view control, thereby obtaining the image resource of the control image of the target view control (wherein, the control image can also be recorded as ui.image), and Based on the image resource, determine the control image of the target view control and the image information corresponding to the control image.
  • 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.
  • the control image after obtaining the control image and image information returned by the terminal device, the control image can be analyzed based on the image information, thereby obtaining the image analysis result. Specifically, during the process of analyzing the image information of the control, it may be analyzed whether there is a loading abnormality in the image of the control.
  • the above image information includes the memory usage information of the control image.
  • image analysis operations it can be determined whether the memory usage of the control image is reasonable. For example, if the memory usage is too large, the memory usage of the control image does not meet the memory requirements. When requested, image analysis results can be used to determine that the memory usage used to characterize the control's image is unreasonable.
  • the target view control containing the image in the target application can be determined, and the image information can be analyzed by obtaining the image information of the control image in the target view control, thereby obtaining the image information.
  • the analysis results of the control image allow developers to determine unreasonable control images based on the analysis results and adjust the control image to reduce the impact of image loading on the display performance of the terminal device and reduce the memory of the target application during use. pressure.
  • step S103 determines a target view control in each view control based on the control attribute information, specifically including the following process:
  • S1031 Obtain control structure trees of multiple view controls, and determine the main view control corresponding to the root node of the control structure tree; the control structure tree includes multiple nodes and hierarchical relationships between each node. Each node corresponds to a view control in the target page;
  • S1032 Based on the main view control, traverse the control structure tree to obtain the target view control.
  • control structure tree of the target page can be used to indicate the control structure information of each view control of the target page, that is, the hierarchical relationship between each view control.
  • control structure tree contains multiple nodes, each node corresponding to a view control in the target page.
  • the control structure tree is used to indicate the hierarchical relationship between view controls.
  • the hierarchical relationship between the above view controls may include the stacking relationship and arrangement order between the view controls.
  • Figure 2 shows a schematic diagram of some nodes in the control structure tree.
  • the above stacking relationship can be used to indicate the inclusion relationship between multiple nodes.
  • picture control A contains button control 1 and button control 2.
  • the above arrangement order can be used to indicate the arrangement position of multiple view controls on the target page.
  • picture control A is located above picture control B.
  • the arrangement of picture control A The order can be before picture control B.
  • the main view control corresponding to the root node of the control structure tree can be understood as a view control that has no included relationship.
  • the main view control can be the target page page frame control.
  • the control structure tree 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 control 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.
  • step S1032 traverses the control structure tree based on the main view control to obtain the target view control, which specifically includes the following process:
  • the determined main view control can be used as the starting view control, and then the traversal order can be determined based on the node arrangement structure in the control structure tree.
  • the traversal order can be based on Starting from the main view control corresponding to the main node of the control structure tree, the view controls corresponding to each branch node are traversed one by one.
  • the traversal order indicated by these nodes may be picture control A, button control 1, button control 2, and picture control B.
  • the filling information in the control property information of each view control can be read, and the read filling information can be determined. Whether the information is the above Image, thereby obtaining the above attribute traversal result.
  • the read information is an Image
  • the main view control is used 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, thereby further improving the determination The efficiency of the target view control.
  • step S107 obtaining the control image and image information contained in the target view control returned by the terminal device based on the image acquisition request, includes:
  • the above-mentioned target application includes a debugging extension application, and a communication connection between the target application and the Flutter performance debugger can be established based on the debugging extension application, so as to obtain the data returned by the terminal device to which the target application belongs based on the communication connection.
  • Control image data where the debugging extension application can perform data transmission between the Flutter performance debugger and the Flutter application based on the WebSocket communication connection.
  • the debugging extension application can be an extension.
  • the transmission data format that the debugging extension application can transmit is the data format of VMService. Therefore, the above-mentioned terminal device first converts the determined control image and image information 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.
  • the Flutter performance debugger can convert the control image data in the VMService format into the preset data format to obtain the control image and image information contained in the control image data.
  • control image data including the control image and image information can be determined first, and then the data is transmitted, so that to a certain extent Improved the confidentiality of data transmission between the target application and the Flutter performance debugger.
  • the above 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, the image of the control image source.
  • the current image size of the control image can be described by the user as the image size of the control image in the target view control.
  • the size of the memory occupied by the control image in the terminal device can be used to represent the size of the memory occupied by the control image in the terminal device after the control image is loaded in the terminal device.
  • the image sources of the above control images include: network images and local cached images.
  • the network images are the images that need to be downloaded from the network when loading the control image, and the local cached images are directly loaded from the cache of the terminal device when loading.
  • Picture; the original image size of the above control image is the size of the image resource of the control image when it is at the image source.
  • the image source of the control image is a local cached image
  • the original image size of the control image is the size of the control image. The size of the image's image resource in the local cache.
  • the above 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. Therefore, Obtaining the image information of the control image of the target view control provides technical support for the following image analysis of the control image.
  • step S107 performs image analysis on the control image based on the image information to obtain an image analysis result, which specifically includes the following process:
  • the current image size of the control image and the original image size of the control image can be obtained in the image information.
  • the current image size can be Compare with the original image size to get the comparison result.
  • 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 to ensure that the control image does not occupy too much during the loading process. of memory.
  • the size of the memory occupied by the abnormal control image in the image information in the terminal device can be obtained, and it can be analyzed whether the memory occupied by the abnormal control image in the terminal device meets the occupancy requirements, where the occupancy requirements can be memory occupancy Threshold, when the memory occupied by the abnormal control image in the terminal device is greater than the memory occupation threshold, it is determined that the abnormal control image needs to be adjusted.
  • the occupancy requirements can be memory occupancy Threshold
  • the current image size and the original image size of the control image can be compared, and the control image whose original image size is larger than the current image size is determined to be abnormal. Control image, thereby ensuring that the control image in the target view control does not occupy too much memory, so as not to affect the loading speed of the terminal device loading the control image, and improve the user experience.
  • the above method also includes the following process:
  • the display list contains multiple display areas, each of which The display area corresponds to displaying relevant information of a target view control;
  • a display list can also be created through the state management control in the Flutter performance debugging program.
  • the display list is as shown in Figure 3.
  • the display list includes multiple display areas, and each display area corresponds to displaying relevant information of a target view control.
  • the user can also filter the relevant information displayed in the display area through the filtering identifier.
  • the relevant information displayed in the display area can be control images, image information and image analysis results.
  • corresponding filter buttons can be set for the control image, image information, and image analysis results respectively. The user can trigger the filter button so that the above display area only displays relevant information corresponding to the filter button.
  • control image and image information of each target view control can be displayed in the above display area.
  • the above-mentioned display of the relevant information of the target view control in the corresponding display area of the display list specifically includes the following process:
  • the abnormal control image when it is determined that the control image contains an abnormal control image, the abnormal control image can be marked by the abnormal marking information.
  • the determined abnormal control image is control image 4 in Figure 3
  • the control image 4 can be marked with exception mark information (the exception mark information is the "WARNING" in Figure 3 ” logo), so that developers can adjust the abnormal control image, thereby reducing the impact of image loading on the display performance of the terminal device.
  • a flow chart of another image analysis method provided by an embodiment of the present disclosure is applied to a terminal device running a target application.
  • the method includes steps S401 to S403, wherein:
  • S401 Receive the image acquisition request sent by the Flutter performance debugger, and determine the target of the image acquisition request. The corresponding target view control.
  • the control identifier carried in the image acquisition request can be obtained, and the target view control corresponding to the control identifier can be determined, where the The control identifier can be the control id.
  • the corresponding control images and image information in each target view control can be obtained respectively.
  • the communication connection between the target application and the Flutter performance debugger is established based on the debugging extension application, and the debugging extension application requires the format of the transmitted data to be the VMService data format. Therefore, it is necessary to convert the obtained control image and image information into control image data in VMService format so that the control image data can be returned to the Flutter performance debugging program.
  • the target view control included in the target application in response to the image acquisition request sent by the Flutter performance debugging program, the target view control included in the target application can be determined, and the control image and image information of the target view control can be obtained. And return the control image and image information to the Flutter performance debugger, so that the Flutter performance debugger can analyze the control image based on the image information, thereby obtaining the analysis result of the control image, so that developers can analyze the control image based on the analysis result. Identify the unreasonable control image and adjust the control image to reduce the impact of image loading on the display performance of the terminal device and reduce the memory pressure of the target application during use.
  • step S401 determines the target view control corresponding to the image acquisition request, specifically including the following:
  • S4011 Determine the view control information contained in the image acquisition request
  • S4012 Determine the view control corresponding to the view control information as the target view control.
  • the above view control information may include the above control identifier.
  • the above image acquisition request may include view control information, so that the target application determines the corresponding target view control based on the view control information, thereby improving the accuracy of determining the target view control.
  • step S403 obtaining the control image and image information of the target view control, specifically includes the following process:
  • S4032 Perform a loading operation on the control image of the target view control in the control attribute information based on the loading parameters, obtain a loading result, and determine the current image size of the control image based on the loading result; wherein, the loading result Used to indicate the rendering effect of the control image, the loading parameters include 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;
  • S4033 Determine the control image and image information of the target view control according to the loading result and the loading parameters.
  • control attribute information may include the control image of the target view control, and the Loading parameters corresponding to the control image. You can perform a loading operation on the control image based on the loading parameters of the control image to obtain the loading result.
  • the control image that needs to be loaded and the corresponding loading address for the loading operation can be determined based on the image source of the control image in the loading parameter. Then, the control image can be determined based on the original image size of the control image in the loading parameter and the location of the control image. The memory size occupied determines the content of the control image that needs to be loaded for the loading operation. At this time, the control image can be loaded based on the determined loading address and the content of the control image, thereby obtaining the loading result.
  • control attribute information of the target view control it is first necessary to obtain the control attribute information of the target view control, and perform a loading operation on the control image in the control attribute information based on the loading parameters to obtain the loading result, so that the target can be determined based on the loading result and the control attribute information.
  • the control image and image information of the view control enrich the content of the obtained image information.
  • the above method further includes the following process:
  • the preset data format matching the Flutter performance debugging program may be the transmission data format corresponding to the debugging extension application in the target application, for example, the above-mentioned VMService format.
  • the data format of the control image and image information can be transformed into control image data in VMService format, so that the control image and image information can be converted through the debugging extension application.
  • the control image data is sent to the Flutter performance debugger.
  • control image and image information can be first transformed into a data format to obtain the control image data of the target view control, so that in To a certain extent, the confidentiality of data transmission between the target application and the Flutter performance debugger is improved.
  • the target view control containing an image in the target application can be determined, and the image information can be analyzed by obtaining the image information of the control image in the target view control, thereby obtaining the control image.
  • the analysis results allow developers to determine unreasonable control images based on the analysis results and adjust the control images to reduce the impact of image loading on the display performance of the terminal device and reduce the memory pressure of the target application during use.
  • the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possible The internal logic is determined.
  • the embodiments of the disclosure also provide an image analysis device corresponding to the image analysis method. Since the principle of solving the problem of the device in the embodiment of the disclosure is similar to the above-mentioned image analysis method in the embodiment of the disclosure, the implementation of the device Please refer to the implementation of the method, and the repeated parts will not be repeated.
  • the device includes: a first acquisition unit 51, a determination unit 52, a generation unit 53, and a second acquisition unit 54; wherein,
  • the first acquisition unit 51 is configured to acquire the control attribute information of each view control of the target page in response to the image analysis instruction for the target page in the target application;
  • Determining unit 52 configured to determine a target view control in each of the view controls based on the control attribute information, where the target view control is an image control containing an image;
  • Generating unit 53 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 the control image and image of the target view control information;
  • the second acquisition unit 54 is used 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, Get image analysis results.
  • a target view control containing an image in the target application can be determined, and the image information can be analyzed by obtaining the image information of the control image in the target view control, thereby obtaining the analysis result of the control image.
  • the determining unit 52 is also used to:
  • control structure tree of multiple view controls, and determine the main view control corresponding to the root node of the control structure tree;
  • the control structure tree includes multiple nodes and hierarchical relationships between each node.
  • Each node Corresponding to a view control in the target page;
  • control structure tree is traversed to obtain the target view control.
  • the determining unit 52 is also used to:
  • the view control containing the image attribute in the attribute traversal result is determined as the target view control.
  • the device is also used for:
  • a display list is created based on the image analysis result; the display list contains multiple display areas, and each display area corresponds to a display Information about a target view control;
  • the relevant information of the target view control is displayed in the corresponding display area of the display list; wherein the relevant information includes at least one of the following: control image, image information and image analysis result.
  • the device when the relevant information includes the image analysis result, the device is also used to:
  • the abnormal control image is displayed in the corresponding display area of the display list according to the abnormal mark information.
  • the second acquisition unit 54 is also used to:
  • the control image is determined to be the abnormal control image.
  • 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, the image of the control image source.
  • the second acquisition unit 54 is also used to:
  • the control image data is formatted according to 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 that matches the Flutter performance debugging program.
  • FIG. 6 a schematic diagram of another image analysis device provided by an embodiment of the present disclosure is provided in a terminal device running a target application.
  • the device includes: a receiving unit 61 and a third acquisition unit 62; wherein,
  • the receiving unit 61 is used to receive the image acquisition request sent by the Flutter performance debugging program, and determine the target view control corresponding to the image acquisition request;
  • the third acquisition unit 62 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.
  • a target view control containing an image in the target application can be determined, and the image information can be analyzed by obtaining the image information of the control image in the target view control, thereby obtaining the analysis result of the control image.
  • the receiving unit 61 is also used to:
  • the view control corresponding to the view control information is determined as the target view control.
  • the third acquisition unit 62 is also used to:
  • the loading result is used Indicates the rendering effect of the control image
  • the loading parameters include 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 parameters.
  • the third acquisition unit 62 is also used to:
  • 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.
  • an embodiment of the present disclosure also provides a computer device 700.
  • a schematic structural diagram of the computer device 700 provided by an embodiment of the present disclosure includes:
  • Processor 71 memory 72, and bus 73; memory 72 is used to store execution instructions, including memory 721 and external memory 722; memory 721 here is also called internal memory, and is used to temporarily store operation data in processor 71, and with The processor 71 exchanges data with the external memory 722 such as a hard disk through the memory 721 and the external memory 722.
  • the processor 71 and the memory 72 communicate through the bus 73, so that The processor 71 executes the following instructions:
  • the image acquisition request is used to instruct the terminal device to acquire the control image and image information of the target view control;
  • the embodiment of the present disclosure also provides another computer device 800.
  • Figure 8 which is a schematic structural diagram of the computer device 800 provided by the embodiment of the present disclosure, it includes:
  • the processor 81 and the memory 82 communicate through the bus 83, so that The processor 81 executes the following instructions:
  • Embodiments of the present disclosure also provide a computer-readable storage medium.
  • the computer-readable storage medium 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 embodiment are executed.
  • the storage medium may be a volatile or non-volatile computer-readable storage medium.
  • Embodiments of the present disclosure also provide a computer program product.
  • the computer program product carries 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 embodiment. For details, please refer to the above method. The embodiments will not be described again here.
  • the above-mentioned computer program product can be specifically implemented by hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium.
  • Computer program products are embodied in software products, such as software development kits (Software Development Kit, SDK) and so on.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in various embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor.
  • the technical solution of the present disclosure is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本公开提供了一种图像分析方法、装置、计算机设备以及存储介质,其中,该方法包括:响应于针对目标应用中目标页面的图像分析指令,获取所述目标页面的各个视图控件的控件属性信息;基于所述控件属性信息在所述各个视图控件中确定目标视图控件,其中,所述目标视图控件为包含图像的图像控件;基于所述目标视图控件生成图像获取请求,并将所述图像获取请求发送至终端设备;所述图像获取请求用于指示终端设备获取所述目标视图控件的控件图像以及图像信息;获取所述终端设备基于所述图像获取请求返回的所述目标视图控件所包含的控件图像和图像信息,并基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果。

Description

图像分析方法、装置、计算机设备以及存储介质
本公开要求于2022年04月06日提交中国专利局、申请号为202210357014.3、申请名称为“图像分析方法、装置、计算机设备以及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开涉及计算机技术领域,具体而言,涉及一种图像分析方法、装置、计算机设备以及存储介质。
背景技术
随着应用程序的显示界面的形式越来越多样化,在应用程序的界面组件中嵌入图像的方式也越来越普遍,然而,由于图像加载对终端设备的显示性能影响较大,例如,网络图像获取对流量的消耗以及图像对内存和CPU(Central Processing Unit,中央处理器)的消耗。
但是,在现有的应用程序的开发过程中,往往无法对应用程序内的图像进行分析,从而无法确定出不合理的图像场景,也就无法指导开发人员对不合理的图像场景进行调整,往往会导致应用程序在使用过程中产生较大的内存压力。
发明内容
本公开实施例至少提供一种图像分析方法、装置、计算机设备以及存储介质。
第一方面,本公开实施例提供了一种图像分析方法,应用于Flutter性能调试程序,包括:
响应于针对目标应用中目标页面的图像分析指令,获取所述目标页面的各个视图控件的控件属性信息;
基于所述控件属性信息在所述各个视图控件中确定目标视图控件,其中,所述目标视图控件为包含图像的图像控件;
基于所述目标视图控件生成图像获取请求,并将所述图像获取请求发送至终端设备;所述图像获取请求用于指示终端设备获取所述目标视图控件的控件图像以及图像信息;
获取所述终端设备基于所述图像获取请求返回的所述目标视图控件所包含的控件图像和图像信息,并基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果。
一种可选的实施方式中,所述基于所述控件属性信息在所述各个视图控件中确定目标视图控件,包括:
获取多个所述视图控件的控件结构树,并确定所述控件结构树的根节点所对应的主视图控件;所述控件结构树包含多个节点和各个节点之间的层级关系,每个节点对应所述目标页面中的一个视图控件;
基于所述主视图控件,对所述控件结构树进行遍历,遍历得到所述目标视图控件。
一种可选的实施方式中,所述基于所述主视图控件,对所述控件结构树进行遍历,遍历得到所述目标视图控件,包括:
将所述主视图控件作为起始视图控件,按照遍历顺序对所述控件结构树中各个视图控件的控件属性信息进行遍历,得到属性遍历结果,所述遍历顺序基于所述起始视图控件和所述控件结构树确定;
将所述属性遍历结果中包含图像属性的视图控件确定为所述目标视图控件。
一种可选的实施方式中,所述方法还包括:
在基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果之后,基于所述图像分析结果创建展示列表;所述展示列表中包含多个展示区域,每个所述展示区域对应展示一个目标视图控件的相关信息;
将所述目标视图控件的相关信息展示在所述展示列表的对应展示区域;其中,所述相关信息包括以下至少之一:控件图像、图像信息和图像分析结果。
一种可选的实施方式中,所述相关信息包括所述图像分析结果,所述将所述目标视图控件的相关信息展示在所述展示列表的对应展示区域,包括:
在基于所述图像分析结果确定出所述控件图像中包含异常控件图像的情况下,确定所述异常控件图像的异常标记信息;
按照所述异常标记信息在所述展示列表的对应展示区域中对所述异常控件图像进行展示。
一种可选的实施方式中,所述基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果,包括:
在所述图像信息中获取所述控件图像的当前图像尺寸和该控件图像的原始图像尺寸;
将所述当前图像尺寸和所述原始图像尺寸进行对比,得到对比结果;
在基于所述对比结果确定所述原始图像尺寸大于所述当前图像尺寸的情况下,确定所述控件图像为所述异常控件图像。
一种可选的实施方式中,所述图像信息包括以下至少之一:控件图像的当前图像尺寸,控件图像在所述终端设备中所占用内存的大小,控件图像的原始图像尺寸,控件图像的图像来源。
一种可选的实施方式中,所述获取所述终端设备基于所述图像获取请求返回的所述目标视图控件所包含的控件图像和图像信息,包括:
获取所述终端设备基于所述图像获取请求返回的控件图像数据;
按照预设数据格式对所述控件图像数据进行格式变换,得到所述目标视图控件的控件图像以及图像信息;其中,所述预设数据格式为与所述Flutter性能调试程序相匹配的数据格式。
第二方面,本公开实施例还提供一种图像分析方法,应用于运行有目标应用的终端设备,包括:
接收Flutter性能调试程序发送的图像获取请求,并确定所述图像获取请求所对应的目标视图控件;
获取所述目标视图控件的控件图像以及图像信息,并将所述控件图像以及图像信息返回至所述Flutter性能调试程序。
一种可选的实施方式中,所述确定所述图像获取请求所对应的目标视图控件,包括:
确定所述图像获取请求中所包含的视图控件信息;
将所述视图控件信息所对应的视图控件确定为所述目标视图控件。
一种可选的实施方式中,所述获取所述目标视图控件的控件图像以及图像信息,包括:
获取所述目标视图控件的控件属性信息;
基于加载参数对所述控件属性信息中所述目标视图控件的控件图像执行加载操作,得到加载结果,并基于所述加载结果确定所述控件图像的当前图像尺寸;其中,所述加载结果用于指示所述控件图像的渲染效果,所述加载参数包括以下至少之一:控件图像的原始图像尺寸,控件图像所占用内存大小,控件图像的图像来源;
根据所述加载结果和所述加载参数确定所述目标视图控件的控件图像以及图像信息。
一种可选的实施方式中,在获取所述目标视图控件的控件图像以及图像信息之后,所述方法还包括:
确定与所述Flutter性能调试程序相匹配的预设数据格式;
按照所述预设数据格式对所述目标视图控件的控件图像以及图像信息进行数据格式变换,得到所述目标视图控件的控件图像数据;
通过所述Flutter应用的调试扩展应用将所述目标视图控件的控件图像数据传输至Flutter性能调试程序中进行处理。
第三方面,本公开实施例还提供一种图像分析装置,设置在Flutter性能调试程序中,包括:
第一获取单元,用于响应于针对目标应用中目标页面的图像分析指令,获取所述目标页面的各个视图控件的控件属性信息;
确定单元,用于基于所述控件属性信息在所述各个视图控件中确定目标视图控件,其中,所述目标视图控件为包含图像的图像控件;
生成单元,用于基于所述目标视图控件生成图像获取请求,并将所述图像获取请求发送至终端设备;所述图像获取请求用于指示终端设备获取所述目标视图控件的控件图像以及图像信息;
第二获取单元,用于获取所述终端设备基于所述图像获取请求返回的所述目标视图控件所包含的控件图像和图像信息,并基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果。
第四方面,本公开实施例还提供一种图像分析装置,设置在运行有目标应用的终端设备中,包括:
接收单元,用于接收Flutter性能调试程序发送的图像获取请求,并确定所述图像获取请求所对应的目标视图控件;
第三获取单元,用于获取所述目标视图控件的控件图像以及图像信息,并将所述控件图像以及图像信息返回至所述Flutter性能调试程序。
第五方面,本公开实施例还提供一种计算机设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行上述第一方面至第二方面中任一种可能的实施方式中的步骤。
第六方面,本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述第一方面至第二方面中任一种可能的实施方式中的步骤。
本公开实施例提供的图像分析方法、装置、计算机设备以及存储介质,可以确定目标应用中包含图像的目标视图控件,并通过获取该目标视图控件中控件图像的图像信息的方式,对该图像信息进行分析,从而得到该控件图像的分析结果,以使开发人员根据该分析结果确定出不合理的控件图像,并对该控件图像进行调整,降低图像加载对终端设备显示性能的影响,减少目标应用在使用过程中的内存压力。
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。
附图说明
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。
图1示出了本公开实施例所提供的一种图像分析方法的流程图;
图2示出了本公开实施例所提供的控件结构树中部分节点的示意图;
图3示出了本公开实施例所提供的展示列表的示意图;
图4示出了本公开实施例所提供的另一种图像分析方法的流程图;
图5示出了本公开实施例所提供的一种图像分析装置的示意图;
图6示出了本公开实施例所提供的另一种图像分析装置的示意图;
图7示出了本公开实施例所提供的一种计算机设备的示意图;
图8示出了本公开实施例所提供的另一种计算机设备的示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。
本文中术语“和/或”,仅仅是描述一种关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。
经研究发现,在现有的应用程序的开发过程中,往往无法对应用程序内的图像进行分析,从而无法确定出不合理的图像场景,也就无法指导开发人员对不合理的图像场景进行 调整,往往会导致应用程序在使用过程中产生较大的内存压力。
基于上述研究,本公开提供了一种图像分析方法、装置、计算机设备以及存储介质,在本公开实施例中,可以确定目标应用中包含图像的目标视图控件,并通过获取该目标视图控件中控件图像的图像信息的方式,对该图像信息进行分析,从而得到该控件图像的分析结果,以使开发人员根据该分析结果确定出不合理的控件图像,并对该控件图像进行调整,降低图像加载对终端设备显示性能的影响,减少目标应用在使用过程中的内存压力。
为便于对本实施例进行理解,首先对本公开实施例所公开的一种图像分析方法进行详细介绍,本公开实施例所提供的图像分析方法的执行主体一般为具有一定计算能力的计算机设备。在一些可能的实现方式中,该图像分析方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。
参见图1所示,为本公开实施例提供的一种图像分析方法的流程图,应用于Flutter性能调试程序,所述方法包括步骤S101~S107,其中:
S101:响应于针对目标应用中目标页面的图像分析指令,获取所述目标页面的各个视图控件的控件属性信息。
在本公开实施例中,首先建立上述Flutter性能调试程序和目标应用之间的通信连接,然后,Flutter性能调试程序在检测到针对该目标应用中的目标页面的图像分析指令之后,就可以向该目标应用发送获取请求,其中,该获取请求包含目标应用中目标页面的页面标识。
接下来,目标应用就可以基于该获取请求携带的页面标识,确定该获取请求所对应的目标页面。在确定出目标页面之后,就可以确定该目标页面中的视图控件,其中,视图控件为组成该目标页面的基本元素,例如,按钮,密码框,列表框,头像框等。然后,就可以通过上述通信连接,将该目标页面的各个视图控件的控件属性信息返回至Flutter性能调试程序。
这里,上述控件属性信息可以用于指示对应的视图控件的控件类型。
S103:基于所述控件属性信息在所述各个视图控件中确定目标视图控件,其中,所述目标视图控件为包含图像的图像控件。
在本公开实施例中,由于上述各个视图控件在目标页面中所实现的功能是不尽相同的,因此,每个视图控件中所包含的内容也可以是不同的。
这里,首先可以分别获取每个视图控件的控件属性信息,并确定该控件属性信息中所包含的填充信息,从而基于该填充信息对各个视图控件进行筛选,得到包含图像的图像控件,并将该图像控件确定为目标视图控件,其中,该填充信息用于表征对应的视图控件中所包含的内容。需要说明的是,在上述视图控件为包含图像的图像控件时,该视图控件的填充信息可以为Image(图像)。
S105:基于所述目标视图控件生成图像获取请求,并将所述图像获取请求发送至终端设备;所述图像获取请求用于指示终端设备获取所述目标视图控件的控件图像以及图像信息。
在本公开实施例中,在确定出上述目标视图控件之后,就可以获取该目标视图控件的控件标识,例如,控件id。然后,基于该控件标识生成该目标视图控件的图像获取请求, 其中,该图像获取请求用于指示终端设备加载该目标视图控件中所包含的控件图像,从而得到目标视图控件的控件图像(其中,该控件图像也可记为ui.image)的图像资源,并基于该图像资源,确定该目标视图控件的控件图像的以及该控件图像对应的图像信息。
S107:获取所述终端设备基于所述图像获取请求返回的所述目标视图控件所包含的控件图像和图像信息,并基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果。
在本公开实施例中,在获取到终端设备返回的控件图像和图像信息之后,就可以基于该图像信息对控件图像进行分析,从而得到图像分析结果。具体的,在针对该控件图像信息进行分析的过程中,可以分析该控件图像是否存在加载异常的情况。
举例来说,上述图像信息中包含该控件图像的内存占用信息,通过图像分析操作可以确定该控件图像的内存占用是否合理,如内存占用过大,其中,在该控件图像的内存占用不符合内存要求时,就可以确定该用于表征该控件图像的内存占用不合理的图像分析结果。
通过上述描述可知,在本公开实施例中,可以确定目标应用中包含图像的目标视图控件,并通过获取该目标视图控件中控件图像的图像信息的方式,对该图像信息进行分析,从而得到该控件图像的分析结果,以使开发人员根据该分析结果确定出不合理的控件图像,并对该控件图像进行调整,降低图像加载对终端设备显示性能的影响,减少目标应用在使用过程中的内存压力。
在一个可选的实施方式中,上述步骤S103,基于所述控件属性信息在所述各个视图控件中确定目标视图控件,具体包括如下过程:
S1031:获取多个所述视图控件的控件结构树,并确定所述控件结构树的根节点所对应的主视图控件;所述控件结构树包含多个节点和各个节点之间的层级关系,每个节点对应所述目标页面中的一个视图控件;
S1032:基于所述主视图控件,对所述控件结构树进行遍历,遍历得到所述目标视图控件。
在本公开实施例中,目标页面的控件结构树可以用于指示该目标页面的各个视图控件的控件结构信息,即各个视图控件之间的层级关系。
这里,控件结构树中包含多个节点,每个节点对应目标页面中的一个视图控件。该控件结构树中用于指示各视图控件之间的层级关系。这里,上述各视图控件之间层级关系可以包含各视图控件之间的堆叠关系以及排列顺序。
如图2所示为上述控件结构树中部分节点的示意图,由图2可知,上述堆叠关系可以用于指示多个节点之间的包含关系,例如,图片控件A中包含按钮控件1以及按钮控件2。上述排列顺序可以用于指示多个视图控件在目标页面上的排布位置,例如,在目标页面中,图片控件A位于图片控件B的上方,那么,在控件结构树中,图片控件A的排列顺序可以位于图片控件B之前。
因此,在获取到多个所述视图控件的控件结构树之后,就需要确定该控件结构树的根节点,以便从该根节点所对应的主视图控件开始对该控件结构树中的视图控件的控件属性信息进行遍历,从而得到目标视图控件。这里,控件结构树的根节点所对应的主视图控件可以理解为没有被包含关系的视图控件,例如,如图2所示,该主视图控件可以为目标页 面的页面框架控件。
在本公开实施例中,在获取到目标页面的多个视图控件的控件结构树后,就可以基于该控件结构树中的根节点所对应的主视图控件对该控件结构树进行遍历,得到目标视图控件,从而提高了确定目标视图控件的效率。
在一个可选的实施方式中,上述步骤S1032,基于所述主视图控件,对所述控件结构树进行遍历,遍历得到所述目标视图控件,具体包括如下过程:
(1)、将所述主视图控件作为起始视图控件,对所述控件结构树中各个视图控件的控件属性信息进行遍历,得到属性遍历结果;
(2)、将所述属性遍历结果中包含图像属性的视图控件确定为所述目标视图控件。
在本公开实施例中,可以将确定出的主视图控件作为起始视图控件,然后,就可以基于上述控件结构树的内的节点排列结构,确定出遍历顺序,这里,该遍历顺序可以为基于控件结构树的主节点所对应的主视图控件开始,对各分支节点所对应的视图控件进行逐一遍历。
具体的,以图2中所示的控件结构树中的部分节点为例,这部分节点所指示的遍历顺序可以为图片控件A、按钮控件1、按钮控件2、图片控件B。
在根据确定出的上述遍历顺序对控件结构树中各个视图控件的控件属性信息进行遍历的过程中,可以对各个视图控件的控件属性信息中的填充信息进行读取,并确定读取到的填充信息是否为上述Image,从而得到上述属性遍历结果。在确定读取到的充信息为Image的情况下,就可以确定该充信息为Image的视图控件包含图像属性,然后,就可以将该视图控件确定为目标视图控件。
在本公开实施例中,以主视图控件作为起始视图控件,对所述控件结构树中各个视图控件的控件属性信息进行遍历,并根据属性遍历结果确定出目标视图控件,从而进一步提高了确定目标视图控件的效率。
在一个可选的实施方式中,上述步骤S107,获取所述终端设备基于所述图像获取请求返回的所述目标视图控件所包含的控件图像和图像信息,包括:
(1)、获取所述终端设备基于所述图像获取请求返回的控件图像数据;
(2)、按照预设数据格式对所述控件图像数据进行格式变换,得到所述目标视图控件的控件图像以及图像信息;其中,所述预设数据格式为与所述Flutter性能调试程序相匹配的数据格式。
在本公开实施例中,上述目标应用中包括调试扩展应用,可以基于该调试扩展应用建立目标应用和Flutter性能调试程序之间的通信连接,以便基于该通信连接获取目标应用所属的终端设备返回的控件图像数据,其中,该调试扩展应用可以基于WebSocket通信连接,进行Flutter性能调试程序和Flutter应用之间的数据传输,另外,该调试扩展应用可以为extension。
这里,由于上述调试扩展应用对传输数据的格式有要求,其中,该调试扩展应用可以传输的传输数据格式为VMService的数据格式。因此,上述终端设备首先将确定出的控件图像以及图像信息装换为VMService格式的控件图像数据,以便通过调试扩展应用将该控件图像数据发送至Flutter性能调试程序中。
Flutter性能调试程序在接收到该控件图像数据后,就可以将该VMService格式的控件图像数据转换为预设数据格式,以便得到该控件图像数据中包含的控件图像以及图像信息。
在本公开实施例中,在进行上述目标应用和Flutter性能调试程序之间的数据传输的过程中,可以首先确定出包含控件图像以及图像信息的控件图像数据,再进行数据传输,从而在一定程度上提高了目标应用和Flutter性能调试程序之间的数据传输的保密性。
在一个可选的实施方式中,上述图像信息包括以下至少之一:控件图像的当前图像尺寸,控件图像在所述终端设备中所占用内存的大小,控件图像的原始图像尺寸,控件图像的图像来源。
具体的,上述控件图像的当前图像尺寸可以用户描述该控件图像在目标视图控件中的图像尺寸。上述控件图像在所述终端设备中所占用内存的大小可以用于表征该控件图像在终端设备中加载结束后,所占用的终端设备的内存的大小。
应理解的是,在加载上述控件图像时,需要从该控件图像的图像来源处获取该控件的图像资源,并根据该图像资源加载该控件图片。那么,上述控件图像的图像来源包括:网络图片以及本地缓存图片,其中,网络图片为加载该控件图像时需要从网络上下载的图片,本地缓存图片为加载时直接从终端设备的缓存中加载的图片;上述控件图像的原始图像尺寸为该控件图像的图像资源在图像来源处时的尺寸,例如,在该控件图像的图像来源为本地缓存图片时,该,控件图像的原始图像尺寸为该控件图像的图像资源在本地缓存中的尺寸。
通过上述描述可知,上述图像信息包括以下至少之一:控件图像的当前图像尺寸,控件图像在所述终端设备中所占用内存的大小,控件图像的原始图像尺寸,控件图像的图像来源,因此,获取目标视图控件的控件图像的图像信息为下述针对控件图像进行图像分析提供了技术支持。
在一个可选的实施方式中,上述步骤S107,基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果,具体包括如下过程:
(1)、在所述图像信息中获取所述控件图像的当前图像尺寸和该控件图像的原始图像尺寸;
(2)、将所述当前图像尺寸和所述原始图像尺寸进行对比,得到对比结果;
(3)、在基于所述对比结果确定所述原始图像尺寸大于所述当前图像尺寸的情况下,确定所述控件图像为所述异常控件图像。
在本公开实施例中,在获取到控件图像的图像信息后,就可以在该图像信息中获取该控件图像的当前图像尺寸和该控件图像的原始图像尺寸,接下来,就可以将当前图像尺寸和原始图像尺寸进行对比,得到对比结果。
应理解的是,在正常的情况下,由于上述控件图像的图像来源很难把控,因此,有可能出现控件图像的原始图像尺寸过大,占用的内存过多的情况。基于此,在构建上述目标视图控件的过程中,该目标视图控件中的控件图像的当前图像尺寸应小于该控件图像的原始图像尺寸,以保证该控件图像在加载的过程中不会占用过多的内存。
因此,需要确定上述对比结果中原始图像尺寸大于当前图像尺寸的控件图像,并将确定出的控件图像确定为异常控件图像,以便基于该异常控件图像进行进一步异常确认,并 在该异常控件图像需要进行调整的情况下,指导开发人员对该异常控件图像进行调整。
具体实施时,可以获取图像信息中的异常控件图像在终端设备中所占用内存的大小,并分析该异常控件图像在终端设备中所占用内存是否满足占用要求,其中,该占用要求可以为内存占用阈值,在该异常控件图像在终端设备中所占用内存大于该内存占用阈值的情况下,确定该异常控件图像需要进行调整。
在本公开实施例中,在获取到控件图像的当前图像尺寸和原始图像尺寸后,就可以将当前图像尺寸和原始图像尺寸进行对比,并将原始图像尺寸大于当前图像尺寸的控件图像确定为异常控件图像,从而确保目标视图控件中的控件图像不至于占用过多内存,以免影响终端设备加载该控件图像的加载速度,提高了用户的使用体验。
在一个可选的实施方式中,上述方法还包括如下过程:
(1)、在基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果之后,基于所述图像分析结果创建展示列表;所述展示列表中包含多个展示区域,每个所述展示区域对应展示一个目标视图控件的相关信息;
(2)、将所述目标视图控件的相关信息展示在所述展示列表的对应展示区域;其中,所述相关信息包括以下至少之一:控件图像、图像信息和图像分析结果。
在本公开实施例中,在确定出上述图像分析结果之后,还可以通过Flutter性能调试程序中的状态管理控件创建展示列表。这里,该展示列表如图3所示,在该展示列表中包含多个展示区域,每个展示区域对应展示一个目标视图控件的相关信息。
这里,用户还可以通过筛选标识对展示区域展示的相关信息进行筛选,例如,在默认展示情况下,该展示区域展示的相关信息可以为控件图像、图像信息和图像分析结果。另外的,还可以分别为控件图像、图像信息以及图像分析结果设置对应的筛选按钮,用户可以通过触发该筛选按钮的方式,使得上述展示区域仅展示该筛选按钮所对应的相关信息。
举例来说,在检测到用户针对控件图像以及图像信息所对应的筛选按钮的触发操作后,就可以在上述展示区域展示每个目标视图控件的控件图像以及图像信息。
在一个可选的实施方式中,在上述相关信息包括图像分析结果的情况下,上述将所述目标视图控件的相关信息展示在所述展示列表的对应展示区域,具体包括如下过程:
(1)、在基于所述图像分析结果确定出所述控件图像中包含异常控件图像的情况下,确定所述异常控件图像的异常标记信息;
(2)、按照所述异常标记信息在所述展示列表的对应展示区域中对所述异常控件图像进行展示。
在本公开实施例中,在确定出控件图像中包含异常控件图像的情况下,就可以通过异常标记信息对该异常控件图像进行标记。举例来说,如图3所示,确定出的异常控件图像为图3中的控件图像4,可以在该控件图像4上通过异常标记信息进行标记(该异常标记信息即图3中的“WARNING”标识),以使开发人员针对该异常控件图像进行调整,从而降低图像加载对终端设备显示性能的影响。
参见图4所示,为本公开实施例提供的另一种图像分析方法的流程图,应用于运行有目标应用的终端设备,所述方法包括步骤S401~S403,其中:
S401:接收Flutter性能调试程序发送的图像获取请求,并确定所述图像获取请求所对 应的目标视图控件。
在本公开实施例中,在获取到Flutter性能调试程序发送的图像获取请求之后,就可以获取该图像获取请求中所携带的控件标识,并确定该控件标识所对应的目标视图控件,其中,该控件标识可以为控件id。
S403:获取所述目标视图控件的控件图像以及图像信息,并将所述控件图像以及图像信息返回至所述Flutter性能调试程序。
在本公开实施例中,在确定出上述目标页面中所包含的目标视图控件之后,就可以分别获取各个目标视图控件中所对应的控件图像以及图像信息。
这里,由于目标应用和Flutter性能调试程序之间的通信连接是基于调试扩展应用建立的,且该调试扩展应用对传输数据的格式要求为VMService数据格式。因此,需要将获取到的控件图像以及图像信息装换为VMService格式的控件图像数据,以便将该控件图像数据返回至Flutter性能调试程序。
通过上述描述可知,在本公开实施例中,可以响应于Flutter性能调试程序发送的图像获取请求,确定出目标应用中所包含的目标视图控件,并获取该目标视图控件的控件图像以及图像信息,并将该控件图像以及图像信息返回至Flutter性能调试程序,以使该Flutter性能调试程序能够基于该图像信息对控件图像进行分析,从而得到该控件图像的分析结果,以使开发人员根据该分析结果确定出不合理的控件图像,并对该控件图像进行调整,降低图像加载对终端设备显示性能的影响,减少目标应用在使用过程中的内存压力。
在一个可选的实施方式中,上述步骤S401,确定所述图像获取请求所对应的目标视图控件,具体包括如下包括:
S4011:确定所述图像获取请求中所包含的视图控件信息;
S4012:将所述视图控件信息所对应的视图控件确定为所述目标视图控件。
在本公开实施例中,上述视图控件信息可以包含上述控件指标识,在获取到图像获取请求中包含的视图控件信息后,就可以对目标应用的目标页面中所包含的视图控件进行遍历,从而确定出命中该视图控件信息的视图控件,并将确定出的视图控件确定为目标视图控件。
在本公开实施例中,上述图像获取请求中可以包含视图控件信息,以便目标应用根据该视图控件信息确定出对应的目标视图控件,从而提高确定目标视图控件的准确性。
在一个可选的实施方式中,上述步骤S403,获取所述目标视图控件的控件图像以及图像信息,具体包括如下过程:
S4031:获取所述目标视图控件的控件属性信息;
S4032:基于加载参数对所述控件属性信息中所述目标视图控件的控件图像执行加载操作,得到加载结果,并基于所述加载结果确定所述控件图像的当前图像尺寸;其中,所述加载结果用于指示所述控件图像的渲染效果,所述加载参数包括以下至少之一:控件图像的原始图像尺寸,控件图像所占用内存大小,控件图像的图像来源;
S4033:根据所述加载结果和所述加载参数确定所述目标视图控件的控件图像以及图像信息。
在本公开实施例中,上述控件属性信息中可以包含目标视图控件的控件图像,以及该 控件图像所对应的加载参数。可以基于该控件图像的加载参数对该控件图像执行加载操作,从而得到加载结果。
具体实施时,首先可以基于加载参数中的控件图像的图像来源确定加载操作所需要加载的控件图像以及对应的加载地址,然后,就可以基于加载参数中的控件图像的原始图像尺寸以及控件图像所占用内存大小,确定加载操作所需要加载的控件图像的内容。此时,就可以基于确定出的加载地址以及控件图像的内容对该控件图像进行加载操作,从而得到加载结果。
在本公开实施例中,首先需要获取目标视图控件的控件属性信息,并基于加载参数对控件属性信息中的控件图像执行加载操作,得到加载结果,从而能够基于该加载结果以及控件属性信息确定目标视图控件的控件图像以及图像信息,丰富了得到的图像信息的内容。
在一个可选的实施方式中,在获取所述目标视图控件的控件图像以及图像信息之后,上述方法还包括如下过程:
(1)、确定与所述Flutter性能调试程序相匹配的预设数据格式;
(2)、按照所述预设数据格式对所述目标视图控件的控件图像以及图像信息进行数据格式变换,得到所述目标视图控件的控件图像数据;
(3)、通过所述目标应用的调试扩展应用将所述目标视图控件的控件图像数据传输至Flutter性能调试程序中进行处理。
在本公开实施例中,与Flutter性能调试程序相匹配的预设数据格式可以为上述目标应用中的调试扩展应用对应的的传输数据格式,例如,上述VMService格式。具体实施时,在确定出上述目标视图控件的控件图像以及图像信息后,就可以对该控件图像以及图像信息进行数据格式变换,转换为VMService格式的控件图像数据,以便能够通过调试扩展应用将该控件图像数据发送至Flutter性能调试程序中。
在本公开实施例中,在进行上述目标应用和Flutter性能调试程序之间的数据传输的过程中,可以首先对控件图像以及图像信息进行数据格式变换,得到目标视图控件的控件图像数据,从而在一定程度上提高了目标应用和Flutter性能调试程序之间的数据传输的保密性。
综上,在本公开实施例中,可以确定目标应用中包含图像的目标视图控件,并通过获取该目标视图控件中控件图像的图像信息的方式,对该图像信息进行分析,从而得到该控件图像的分析结果,以使开发人员根据该分析结果确定出不合理的控件图像,并对该控件图像进行调整,降低图像加载对终端设备显示性能的影响,减少目标应用在使用过程中的内存压力。
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
基于同一发明构思,本公开实施例中还提供了与图像分析方法对应的图像分析装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述图像分析方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。
参照图5所示,为本公开实施例提供的一种图像分析装置的示意图,设置在Flutter性 能调试程序中,所述装置包括:第一获取单元51、确定单元52、生成单元53、第二获取单元54;其中,
第一获取单元51,用于响应于针对目标应用中目标页面的图像分析指令,获取所述目标页面的各个视图控件的控件属性信息;
确定单元52,用于基于所述控件属性信息在所述各个视图控件中确定目标视图控件,其中,所述目标视图控件为包含图像的图像控件;
生成单元53,用于基于所述目标视图控件生成图像获取请求,并将所述图像获取请求发送至终端设备;所述图像获取请求用于指示终端设备获取所述目标视图控件的控件图像以及图像信息;
第二获取单元54,用于获取所述终端设备基于所述图像获取请求返回的所述目标视图控件所包含的控件图像和图像信息,并基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果。
在本公开实施例中,可以确定目标应用中包含图像的目标视图控件,并通过获取该目标视图控件中控件图像的图像信息的方式,对该图像信息进行分析,从而得到该控件图像的分析结果,以使开发人员根据该分析结果确定出不合理的控件图像,并对该控件图像进行调整,降低图像加载对终端设备显示性能的影响,减少目标应用在使用过程中的内存压力。
一种可能的实施方式中,确定单元52,还用于:
获取多个所述视图控件的控件结构树,并确定所述控件结构树的根节点所对应的主视图控件;所述控件结构树包含多个节点和各个节点之间的层级关系,每个节点对应所述目标页面中的一个视图控件;
基于所述主视图控件,对所述控件结构树进行遍历,遍历得到所述目标视图控件。
一种可能的实施方式中,确定单元52,还用于:
将所述主视图控件作为起始视图控件,对所述控件结构树中各个视图控件的控件属性信息进行遍历,得到属性遍历结果;
将所述属性遍历结果中包含图像属性的视图控件确定为所述目标视图控件。
一种可能的实施方式中,该装置还用于:
在基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果之后,基于所述图像分析结果创建展示列表;所述展示列表中包含多个展示区域,每个所述展示区域对应展示一个目标视图控件的相关信息;
将所述目标视图控件的相关信息展示在所述展示列表的对应展示区域;其中,所述相关信息包括以下至少之一:控件图像、图像信息和图像分析结果。
一种可能的实施方式中,在相关信息包括所述图像分析结果的情况下,该装置还用于:
在基于所述图像分析结果确定出所述控件图像中包含异常控件图像的情况下,确定所述异常控件图像的异常标记信息;
按照所述异常标记信息在所述展示列表的对应展示区域中对所述异常控件图像进行展示。
一种可能的实施方式中,第二获取单元54,还用于:
在所述图像信息中获取所述控件图像的当前图像尺寸和该控件图像的原始图像尺寸;
将所述当前图像尺寸和所述原始图像尺寸进行对比,得到对比结果;
在基于所述对比结果确定所述原始图像尺寸大于所述当前图像尺寸的情况下,确定所述控件图像为所述异常控件图像。
一种可能的实施方式中,所述图像信息包括以下至少之一:控件图像的当前图像尺寸,控件图像在所述终端设备中所占用内存的大小,控件图像的原始图像尺寸,控件图像的图像来源。
一种可能的实施方式中,第二获取单元54,还用于:
获取所述终端设备基于所述图像获取请求返回的控件图像数据;
按照预设数据格式对所述控件图像数据进行格式变换,得到所述目标视图控件的控件图像以及图像信息;其中,所述预设数据格式为与所述Flutter性能调试程序相匹配的数据格式。
参照图6所示,为本公开实施例提供的另一种图像分析装置的示意图,设置在运行有目标应用的终端设备中,所述装置包括:接收单元61、第三获取单元62;其中,
接收单元61,用于接收Flutter性能调试程序发送的图像获取请求,并确定所述图像获取请求所对应的目标视图控件;
第三获取单元62,用于获取所述目标视图控件的控件图像以及图像信息,并将所述控件图像以及图像信息返回至所述Flutter性能调试程序。
在本公开实施例中,可以确定目标应用中包含图像的目标视图控件,并通过获取该目标视图控件中控件图像的图像信息的方式,对该图像信息进行分析,从而得到该控件图像的分析结果,以使开发人员根据该分析结果确定出不合理的控件图像,并对该控件图像进行调整,降低图像加载对终端设备显示性能的影响,减少目标应用在使用过程中的内存压力。
一种可能的实施方式中,接收单元61,还用于:
确定所述图像获取请求中所包含的视图控件信息;
将所述视图控件信息所对应的视图控件确定为所述目标视图控件。
一种可能的实施方式中,第三获取单元62,还用于:
确定所述图像获取请求中所包含的视图控件信息;
获取所述目标视图控件的控件属性信息;
基于加载参数对所述控件属性信息中所述目标视图控件的控件图像执行加载操作,得到加载结果,并基于所述加载结果确定所述控件图像的当前图像尺寸;其中,所述加载结果用于指示所述控件图像的渲染效果,所述加载参数包括以下至少之一:控件图像的原始图像尺寸,控件图像所占用内存大小,控件图像的图像来源;
根据所述加载结果和所述加载参数确定所述目标视图控件的控件图像以及图像信息。
一种可能的实施方式中,第三获取单元62,还用于:
确定与所述Flutter性能调试程序相匹配的预设数据格式;
按照所述预设数据格式对所述目标视图控件的控件图像以及图像信息进行数据格式变换,得到所述目标视图控件的控件图像数据;
通过所述Flutter应用的调试扩展应用将所述目标视图控件的控件图像数据传输至Flutter性能调试程序中进行处理。
关于装置中的各单元的处理流程、以及各单元之间的交互流程的描述可以参照上述方法实施例中的相关说明,这里不再详述。
对应于图1中的图像分析方法,本公开实施例还提供了一种计算机设备700,如图7所示,为本公开实施例提供的计算机设备700结构示意图,包括:
处理器71、存储器72、和总线73;存储器72用于存储执行指令,包括内存721和外部存储器722;这里的内存721也称内存储器,用于暂时存放处理器71中的运算数据,以及与硬盘等外部存储器722交换的数据,处理器71通过内存721与外部存储器722进行数据交换,当所述计算机设备700运行时,所述处理器71与所述存储器72之间通过总线73通信,使得所述处理器71执行以下指令:
响应于针对目标应用中目标页面的图像分析指令,获取所述目标页面的各个视图控件的控件属性信息;
基于所述控件属性信息在所述各个视图控件中确定目标视图控件,其中,所述目标视图控件为包含图像的图像控件;
基于所述目标视图控件生成图像获取请求,并将所述图像获取请求发送至终端设备;所述图像获取请求用于指示终端设备获取所述目标视图控件的控件图像以及图像信息;
获取所述终端设备基于所述图像获取请求返回的所述目标视图控件所包含的控件图像和图像信息,并基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果。
对应于图4中的图像分析方法,本公开实施例还提供了另一种计算机设备800,如图8所示,为本公开实施例提供的计算机设备800结构示意图,包括:
处理器81、存储器82、和总线83;存储器82用于存储执行指令,包括内存821和外部存储器822;这里的内存821也称内存储器,用于暂时存放处理器81中的运算数据,以及与硬盘等外部存储器822交换的数据,处理器81通过内存821与外部存储器822进行数据交换,当所述计算机设备800运行时,所述处理器81与所述存储器82之间通过总线83通信,使得所述处理器81执行以下指令:
接收Flutter性能调试程序发送的图像获取请求,并确定所述图像获取请求所对应的目标视图控件;
获取所述目标视图控件的控件图像以及图像信息,并将所述控件图像以及图像信息返回至所述Flutter性能调试程序。
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的图像分析方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。
本公开实施例还提供一种计算机程序产品,该计算机程序产品承载有程序代码,所述程序代码包括的指令可用于执行上述方法实施例中所述的图像分析方法的步骤,具体可参见上述方法实施例,在此不再赘述。
其中,上述计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中, 计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。

Claims (17)

  1. 一种图像分析方法,包括:
    响应于针对目标应用中目标页面的图像分析指令,获取所述目标页面的各个视图控件的控件属性信息;
    基于所述控件属性信息在所述各个视图控件中确定目标视图控件,其中,所述目标视图控件为包含图像的图像控件;
    基于所述目标视图控件生成图像获取请求,并将所述图像获取请求发送至终端设备;所述图像获取请求用于指示终端设备获取所述目标视图控件的控件图像以及图像信息;
    获取所述终端设备基于所述图像获取请求返回的所述目标视图控件所包含的控件图像和图像信息,并基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果。
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述控件属性信息在所述各个视图控件中确定目标视图控件,包括:
    获取多个所述视图控件的控件结构树,并确定所述控件结构树的根节点所对应的主视图控件;所述控件结构树包含多个节点和各个节点之间的层级关系,每个节点对应所述目标页面中的一个视图控件;
    基于所述主视图控件,对所述控件结构树进行遍历,遍历得到所述目标视图控件。
  3. 根据权利要求2所述的方法,其特征在于,所述基于所述主视图控件,对所述控件结构树进行遍历,遍历得到所述目标视图控件,包括:
    将所述主视图控件作为起始视图控件,对所述控件结构树中各个视图控件的控件属性信息进行遍历,得到属性遍历结果;
    将所述属性遍历结果中包含图像属性的视图控件确定为所述目标视图控件。
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果之后,基于所述图像分析结果创建展示列表;所述展示列表中包含多个展示区域,每个所述展示区域对应展示一个目标视图控件的相关信息;
    将所述目标视图控件的相关信息展示在所述展示列表的对应展示区域;其中,所述相关信息包括以下至少之一:控件图像、图像信息和图像分析结果。
  5. 根据权利要求4所述的方法,其特征在于,所述相关信息包括所述图像分析结果,所述将所述目标视图控件的相关信息展示在所述展示列表的对应展示区域,包括:
    在基于所述图像分析结果确定出所述控件图像中包含异常控件图像的情况下,确定所述异常控件图像的异常标记信息;
    按照所述异常标记信息在所述展示列表的对应展示区域中对所述异常控件图像进行展示。
  6. 根据权利要求1所述的方法,其特征在于,所述基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果,包括:
    在所述图像信息中获取所述控件图像的当前图像尺寸和该控件图像的原始图像尺寸;
    将所述当前图像尺寸和所述原始图像尺寸进行对比,得到对比结果;
    在基于所述对比结果确定所述原始图像尺寸大于所述当前图像尺寸的情况下,确定所 述控件图像为异常控件图像。
  7. 根据权利要求1所述的方法,其特征在于,所述图像信息包括以下至少之一:控件图像的当前图像尺寸,控件图像在所述终端设备中所占用内存的大小,控件图像的原始图像尺寸,控件图像的图像来源。
  8. 根据权利要求1所述的方法,其特征在于,所述获取所述终端设备基于所述图像获取请求返回的所述目标视图控件所包含的控件图像和图像信息,包括:
    获取所述终端设备基于所述图像获取请求返回的控件图像数据;
    按照预设数据格式对所述控件图像数据进行格式变换,得到所述目标视图控件的控件图像以及图像信息;其中,所述预设数据格式为与所述Flutter性能调试程序相匹配的数据格式。
  9. 一种图像分析方法,其特征在于,应用于运行有目标应用的终端设备,包括:
    接收Flutter性能调试程序发送的图像获取请求,并确定所述图像获取请求所对应的目标视图控件;
    获取所述目标视图控件的控件图像以及图像信息,并将所述控件图像以及图像信息返回至所述Flutter性能调试程序。
  10. 根据权利要求9所述的方法,其特征在于,所述确定所述图像获取请求所对应的目标视图控件,包括:
    确定所述图像获取请求中所包含的视图控件信息;
    将所述视图控件信息所对应的视图控件确定为所述目标视图控件。
  11. 根据权利要求9所述的方法,其特征在于,所述获取所述目标视图控件的控件图像以及图像信息,包括:
    获取所述目标视图控件的控件属性信息;
    基于加载参数对所述控件属性信息中所述目标视图控件的控件图像执行加载操作,得到加载结果,并基于所述加载结果确定所述控件图像的当前图像尺寸;其中,所述加载结果用于指示所述控件图像的渲染效果,所述加载参数包括以下至少之一:控件图像的原始图像尺寸,控件图像所占用内存大小,控件图像的图像来源;
    根据所述加载结果和所述加载参数确定所述目标视图控件的控件图像以及图像信息。
  12. 根据权利要求9所述的方法,其特征在于,在获取所述目标视图控件的控件图像以及图像信息之后,所述方法还包括:
    确定与所述Flutter性能调试程序相匹配的预设数据格式;
    按照所述预设数据格式对所述目标视图控件的控件图像以及图像信息进行数据格式变换,得到所述目标视图控件的控件图像数据;
    通过所述Flutter应用的调试扩展应用将所述目标视图控件的控件图像数据传输至Flutter性能调试程序中进行处理。
  13. 一种图像分析装置,其特征在于,设置在Flutter性能调试程序中,包括:
    第一获取单元,用于响应于针对目标应用中目标页面的图像分析指令,获取所述目标页面的各个视图控件的控件属性信息;
    确定单元,用于基于所述控件属性信息在所述各个视图控件中确定目标视图控件,其 中,所述目标视图控件为包含图像的图像控件;
    生成单元,用于基于所述目标视图控件生成图像获取请求,并将所述图像获取请求发送至终端设备;所述图像获取请求用于指示终端设备获取所述目标视图控件的控件图像以及图像信息;
    第二获取单元,用于获取所述终端设备基于所述图像获取请求返回的所述目标视图控件所包含的控件图像和图像信息,并基于所述图像信息对所述控件图像进行图像分析,得到图像分析结果。
  14. 一种图像分析装置,其特征在于,设置在运行有目标应用的终端设备中,包括:
    接收单元,用于接收Flutter性能调试程序发送的图像获取请求,并确定所述图像获取请求所对应的目标视图控件;
    第三获取单元,用于获取所述目标视图控件的控件图像以及图像信息,并将所述控件图像以及图像信息返回至所述Flutter性能调试程序。
  15. 一种计算机设备,其特征在于,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如权利要求1至12任意一项所述的图像分析方法的步骤。
  16. 一种计算机可读存储介质,其特征在于,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求1至12任意一项所述的图像分析方法的步骤。
  17. 一种计算机程序产品,其特征在于,所述计算机程序产品在设备上运行时,使得所述设备执行如权利要求1至12任意一项所述的图像分析方法的步骤。
PCT/CN2023/084326 2022-04-06 2023-03-28 图像分析方法、装置、计算机设备以及存储介质 WO2023193633A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210357014.3 2022-04-06
CN202210357014.3A CN114706581A (zh) 2022-04-06 2022-04-06 图像分析方法、装置、计算机设备以及存储介质

Publications (1)

Publication Number Publication Date
WO2023193633A1 true WO2023193633A1 (zh) 2023-10-12

Family

ID=82172745

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/084326 WO2023193633A1 (zh) 2022-04-06 2023-03-28 图像分析方法、装置、计算机设备以及存储介质

Country Status (2)

Country Link
CN (1) CN114706581A (zh)
WO (1) WO2023193633A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114706581A (zh) * 2022-04-06 2022-07-05 北京字节跳动网络技术有限公司 图像分析方法、装置、计算机设备以及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111158619A (zh) * 2019-12-25 2020-05-15 珠海格力电器股份有限公司 一种图片处理方法及装置
CN111324352A (zh) * 2020-02-27 2020-06-23 中国平安人寿保险股份有限公司 一种应用页面的代码生成方法及相关设备
US20200380277A1 (en) * 2016-11-25 2020-12-03 Hangzhou Hikvision Digital Technology Co., Ltd. Image analysis method and device
CN113986426A (zh) * 2021-10-26 2022-01-28 腾讯科技(深圳)有限公司 图像检测方法、装置、可读介质及电子设备
CN114706581A (zh) * 2022-04-06 2022-07-05 北京字节跳动网络技术有限公司 图像分析方法、装置、计算机设备以及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200380277A1 (en) * 2016-11-25 2020-12-03 Hangzhou Hikvision Digital Technology Co., Ltd. Image analysis method and device
CN111158619A (zh) * 2019-12-25 2020-05-15 珠海格力电器股份有限公司 一种图片处理方法及装置
CN111324352A (zh) * 2020-02-27 2020-06-23 中国平安人寿保险股份有限公司 一种应用页面的代码生成方法及相关设备
CN113986426A (zh) * 2021-10-26 2022-01-28 腾讯科技(深圳)有限公司 图像检测方法、装置、可读介质及电子设备
CN114706581A (zh) * 2022-04-06 2022-07-05 北京字节跳动网络技术有限公司 图像分析方法、装置、计算机设备以及存储介质

Also Published As

Publication number Publication date
CN114706581A (zh) 2022-07-05

Similar Documents

Publication Publication Date Title
US9864672B2 (en) Module specific tracing in a shared module environment
CN109885311B (zh) 一种应用程序的生成方法及设备
CN110928772B (zh) 一种测试方法及装置
CN109918055B (zh) 一种应用程序的生成方法及设备
CN106030546B (zh) 计算机程序的方法
US9311213B2 (en) Module database with tracing options
US20150067654A1 (en) Tracing System for Application and Module Tracing
CN109634718B (zh) 云平台创建镜像的方法及系统
JP2008538642A5 (zh)
US20090089805A1 (en) Profiling techniques and systems for computer programs
CN108287708A (zh) 一种数据处理方法、装置、服务器及计算机可读存储介质
WO2023193633A1 (zh) 图像分析方法、装置、计算机设备以及存储介质
US20060188174A1 (en) Quantitative measure of a video interface
US8745537B1 (en) Graphical interface for managing and monitoring the status of a graphical model
US9317553B2 (en) Declarative partitioning for data collection queries
CN116820527B (zh) 程序升级方法、装置、计算机设备和存储介质
WO2023143545A1 (zh) 资源处理方法、装置、电子设备及计算机可读存储介质
JP2019523470A (ja) データを処理するための方法及び装置
US10684896B2 (en) Method for processing asynchronous event by checking device and checking device
US9189299B2 (en) Framework for system communication for handling data
US11023479B2 (en) Managing asynchronous analytics operation based on communication exchange
US20140026139A1 (en) Information processing apparatus and analysis method
WO2018233365A1 (zh) 一种信息查询方法、终端、设备以及存储介质
CN111258628A (zh) 一种规则文件比对方法、装置、可读存储介质及终端设备
US20180088991A1 (en) Methods, systems, and computer program products for selecting a resource based on a measure of a processing cost

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23784197

Country of ref document: EP

Kind code of ref document: A1