WO2023093390A1 - Layout method, readable medium and electronic device - Google Patents

Layout method, readable medium and electronic device Download PDF

Info

Publication number
WO2023093390A1
WO2023093390A1 PCT/CN2022/126443 CN2022126443W WO2023093390A1 WO 2023093390 A1 WO2023093390 A1 WO 2023093390A1 CN 2022126443 W CN2022126443 W CN 2022126443W WO 2023093390 A1 WO2023093390 A1 WO 2023093390A1
Authority
WO
WIPO (PCT)
Prior art keywords
layout
laid out
elements
distance
color
Prior art date
Application number
PCT/CN2022/126443
Other languages
French (fr)
Chinese (zh)
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 WO2023093390A1 publication Critical patent/WO2023093390A1/en

Links

Images

Classifications

    • 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/04817Interaction 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 using icons
    • 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
    • G06T11/002D [Two Dimensional] image generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • 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
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Definitions

  • the present application relates to the field of electronic technology, in particular to a layout method, a readable medium and electronic equipment.
  • Electronic devices usually display multiple display elements on the same interface, for example, displaying icons of multiple application programs on the desktop or menu bar of the electronic device.
  • the user In order to improve the aesthetics of the interface, reduce the visual complexity of the interface, etc., the user usually manually arranges multiple display elements in a certain order, for example, according to the similarity of colors and the category of each display element.
  • the embodiments of the present application provide a layout method, a readable medium and an electronic device.
  • obtaining the layout features of the elements to be laid out determine the distance between the layout features of the elements to be laid out, and according to the similarity between the layout feature distance and the space distance between the two elements to be laid out layout.
  • the electronic device can automatically layout the layout elements, and the interface after layout has low visual complexity and high simplicity, which improves user experience.
  • the embodiment of the present application provides a layout method, which is applied to electronic devices, and the method includes: obtaining the layout features of multiple elements to be laid out; The layout feature distance between the elements to be laid out, wherein the higher the similarity of the layout features between the elements to be laid out, the smaller the layout feature distance between the elements to be laid out; According to the similarity between the two spatial distances, the layout scheme is determined; according to the determined layout scheme, the position of each element to be laid out is adjusted.
  • the electronic device may automatically layout the elements to be laid out according to at least one layout feature among the elements to be laid out, which improves user experience.
  • the interface after layout according to the layout scheme reflects the above-mentioned Gestalt theory. The consistency of similarity principle and proximity principle is high, which makes the visual complexity of the interface after the layout low and the interface simple, which improves the user experience.
  • the foregoing layout features include at least one of the following features: color features and semantic features.
  • the above-mentioned determination of the layout feature distance between each element to be laid out includes: according to the layout feature of each element to be laid out, determine the The characteristic color of the layout element; the color distance between the characteristic colors of each element to be laid out is determined as the layout characteristic distance between the two elements to be laid out; wherein, when the main color of the element to be laid out is a single In this case, the characteristic color of the element to be laid out is the main color of the element to be laid out; when there are multiple main colors of the element to be laid out, the characteristic color of the element to be laid out is the average value of the main colors of the elements to be laid out.
  • the layout characteristic distance is the color distance between two characteristic colors of the elements to be laid out.
  • the color distance may be calculated according to the color distance calculation method mentioned below, or other methods may be used for calculation.
  • the color distance between the feature colors of the above-mentioned elements to be laid out includes any one of the following distances: Euclidean distance, Manhattan distance, Chebyshev distance, Minkowski distance, normalized Euclidean distance, Mahalanobis distance, angle cosine, Hamming distance.
  • the above-mentioned determination of the layout feature distance between each element to be laid out includes: according to the layout feature of each element to be laid out, determine the The characteristic color of the layout element; determine the layout characteristic distance between each pair of layout elements whose characteristic color belongs to the same hue as 0, and determine the layout characteristic distance between each pair of layout elements whose characteristic color belongs to different hues as 1;
  • the feature color of the element to be laid out is the main color of the element to be laid out; in the case of multiple main colors of the element to be laid out; in the case of multiple main colors of the element to be laid out, the feature color of the element to be laid out is The average of multiple dominant colors for the element to be laid out. .
  • the layout feature distance between two elements to be laid out can be determined according to the hue of the characteristic color of each element to be laid out, that is, the distance between two elements to be laid out whose feature color belongs to the same hue
  • the layout feature distance is determined to be 0, and the layout feature distance between two to-be-layout elements whose feature colors belong to different hues is determined to be 1.
  • the calculation amount of the electronic device in the process of determining the layout scheme based on the similarity between the layout feature distance between the two elements to be laid out and the space distance between the two elements to be laid out can be reduced, and the layout speed can be improved.
  • the above-mentioned determination of the layout scheme based on the similarity between the layout feature distance between each pair of elements to be laid out and the spatial distance between each pair of elements to be laid out includes: The layout scheme with the largest similarity between the layout feature distance between two elements to be laid out and the space distance between two elements to be laid out.
  • the above-mentioned determination of the layout scheme based on the similarity between the layout feature distance between each pair of elements to be laid out and the spatial distance between each pair of elements to be laid out includes: A layout scheme in which the similarity between the layout feature distance between the elements to be laid out and the space distance between the elements to be laid out is greater than the similarity threshold.
  • the layout between two elements to be laid out is determined by the correlation coefficient between the layout characteristic distance between two elements to be laid out and the space distance between two elements to be laid out The similarity between the feature distance and the spatial distance between each element to be laid out.
  • the similarity between the layout feature distance between two elements to be laid out and the space distance between each element to be laid out is based on the layout feature distance between two elements to be laid out and each The correlation coefficient between the spatial distances between two layout elements is determined, and the larger the correlation coefficient, the higher the similarity.
  • the correlation coefficient includes any one of the following correlation coefficients: Pearson correlation coefficient, Spearman correlation coefficient, and Kendall correlation coefficient.
  • the foregoing elements to be laid out include any one of the following elements: icons, pictures, and service cards.
  • the elements to be laid out may include icons, pictures, service cards, and the like.
  • the application icon on the desktop of the electronic device, the icon in the pull-down menu of the electronic device, the service card of the application program on the desktop of the electronic device, etc. are not limited here.
  • the electronic device acquires layout features of multiple elements to be laid out when detecting a layout instruction input by a user on the electronic device.
  • the above first aspect and various possible implementations of the above first aspect provide The layout method automatically layouts display elements in an electronic device.
  • the embodiment of the present application provides a readable medium, on which instructions are stored, and when the instructions are executed on the electronic device, the electronic device realizes the above-mentioned first aspect and various possible implementations of the above-mentioned first aspect provide Any one of the layout methods.
  • an embodiment of the present application provides an electronic device, which includes: a memory for storing instructions executed by one or more processors of the electronic device; and a processor, which is one of the processors of the electronic device , for executing the instructions stored in the memory to implement the above first aspect and any one of the layout methods provided by various possible implementations of the above first aspect.
  • Fig. 1 shows a schematic diagram of a layout of application program icons according to some embodiments of the present application
  • FIGS. 2A to 2F are schematic diagrams showing different basic principles of Gestalt theory according to some embodiments of the present application.
  • 3A and 3B are schematic diagrams showing icons arranged in different orders according to some embodiments of the present application.
  • Fig. 3C is a schematic diagram showing a visual complexity comparison of the icons arranged in Fig. 3A and Fig. 3B according to some embodiments of the present application;
  • FIGS. 4A to 4D show schematic diagrams of four different color spaces according to some embodiments of the present application.
  • Fig. 5 shows a schematic flowchart of a layout method according to some embodiments of the present application
  • 6A to 6C show a schematic diagram of a display interface of the mobile phone 100 during a process in which the user triggers the layout command of the mobile phone 100 according to some embodiments of the present application;
  • Fig. 7 shows a schematic diagram of the color distance of each icon in the display interface shown in Fig. 1 (A) according to some embodiments of the present application;
  • FIG. 8A and FIG. 8B are schematic diagrams showing spatial distances between different icons according to some embodiments of the present application.
  • Fig. 9 shows a schematic diagram of the spatial distance of each icon in the display interface shown in Fig. 1 (A) according to some embodiments of the present application;
  • Fig. 10A shows a schematic diagram of a layout scheme expressed in matrix form according to some embodiments of the present application
  • Fig. 10B shows a schematic diagram of layout positions in the display interface shown in Fig. 1 (A) according to some embodiments of the present application;
  • Fig. 11 shows a schematic diagram of a drop-down menu interface of a mobile phone 100 according to some embodiments of the present application
  • Fig. 12 shows a schematic flowchart of a layout method according to some embodiments of the present application.
  • Fig. 13 shows a schematic diagram of the display interface of the smart icon layout function of the pull-down menu interface of the account opening mobile phone 100 according to some embodiments of the present application;
  • Fig. 14 shows a schematic diagram of a semantic clustering result of icons in the drop-down menu interface shown in Fig. 11 according to some embodiments of the present application;
  • Fig. 15 shows a schematic diagram of the effect of rearranging the icons in the pull-down menu interface shown in Fig. 11 according to some embodiments of the present application;
  • Fig. 16 shows a schematic flowchart of a layout evaluation method according to some embodiments of the present application
  • Fig. 17 shows a schematic diagram of a layout evaluation scene according to some embodiments of the present application.
  • Fig. 18 shows a schematic diagram of evaluation results of a variety of different layouts according to some embodiments of the present application.
  • Fig. 19 shows a schematic structural diagram of a mobile phone 100 according to some embodiments of the present application.
  • Fig. 20 shows a schematic structural diagram of a mobile phone 100 according to some embodiments of the present application.
  • Illustrative embodiments of the present application include, but are not limited to, layout methods, readable media, and electronic devices.
  • FIG. 2A shows a schematic diagram of a proximity principle.
  • multiple circles in the rectangular area 10 are close to each other.
  • the white circles in the rectangular area 10 can be considered as a group, square
  • the white circles in area 11 form a group, and the white circles in square area 13 form a group.
  • FIG. 2B shows a schematic diagram of a similarity principle. Referring to FIG. 2B , based on the similarity principle, it can be considered that a row with all white circles is a group, and a row with all black circles is a group.
  • Fig. 2C shows a schematic diagram of a principle of closure.
  • the illustrated multi-segment arc is a part of the circle 14, and it can be considered that the illustrated three-segment arc is a group, similarly, a plurality of line segments All of the polylines/polylines are part of the rectangle 15, so the five line segments/polylines in the illustration can be considered as a group.
  • FIG. 2D shows a schematic diagram of a symmetry principle.
  • "[" and “]” in the figure are a group
  • " ⁇ " and “ ⁇ ” are a group
  • FIG. 2E shows a schematic diagram of a common fate principle.
  • the objects in the illustrated area 16 have the same movement tendency, such as moving to the left, and the objects in other parts have different movement patterns, then The objects in the area 16 can be considered as a group.
  • Fig. 2F shows a schematic diagram of a continuity principle, with reference to Fig. 2F, although the middle part of the key pattern 18 in the figure is blocked by the key pattern 17, it is still considered that the key pattern 18 is a complete key pattern, rather than In the middle, there is a lack of patterns covered by the key pattern 17 .
  • Interface simplicity means that the interface can be perceived by users as visual complexity. The higher the visual complexity, the lower the interface simplicity. Visual complexity is affected by the amount of information, the quality of information, and the organization of information (eg, the way elements are laid out in an interface). The amount of information and the quality of information are usually fixed in an interface, and the visual complexity can be optimized by adjusting the interface organization, such as adjusting the position of each layout element in the interface, so as to improve the simplicity of the interface.
  • the layout of the interface often embodies multiple principles of the above-mentioned Gestalt theory.
  • the visual complexity of the interface will be low; conversely, when the consistency among multiple principles embodied in the interface is low, the visual complexity of the interface will be high.
  • the icons in Figure 3A are randomly arranged, the color distribution is messy, the consistency of the proximity principle and the similarity principle is low, the visual complexity is high, and the interface simplicity is low;
  • the icons in Figure 3B are laid out according to the proximity of their colors. Icons with similar distances have similar colors. The consistency between the proximity principle and the similarity principle is high, the visual complexity is low, and the interface is simple.
  • a color space is an abstract mathematical model that describes the way a color is represented using a set of values (usually using three or four values or color components).
  • Common color spaces include but are not limited to RGB color space, HSV color space, CIE (International Commission on Illumination, CIE for short)-XYZ color space, CIE-Lab color space, etc.
  • FIG. 4A to FIG. 4D show schematic diagrams of four common color spaces.
  • the RGB color space uses three values R, G, and B to represent a color, where R represents the intensity of red (Red) in a color, G (Green) represents the intensity of green in a color, and B (Blue) Represents the intensity of blue in a color.
  • R represents the intensity of red (Red) in a color
  • G Green
  • B represents the intensity of green in a color
  • B Blue
  • 0 to 255 can be used to represent the intensity of R, G, and B in a color.
  • (0, 0, 255) represents blue
  • (255, 255, 255) represents white.
  • (0, 255, 0) means green
  • (255, 0, 0) means red.
  • the HSV color space uses three values H, S, and V to represent a color, where H (Hue, hue) is measured by angle, and the value range is 0° to 360°, starting from red in a counterclockwise direction
  • H Hue, hue
  • S saturated, saturation
  • the larger the proportion of spectral color the higher the degree of color close to spectral color, and the higher the saturation of color.
  • the saturation is high, and the color is deep and vivid.
  • the white light component of the spectral color is 0, and the saturation reaches the highest.
  • the value ranges from 0 to 1, the larger the value, the more saturated the color;
  • V (Value, lightness) indicates the degree of brightness of the color, for the light source color, the lightness value is related to the brightness of the illuminant; for the object color, this value and
  • the transmittance or reflectance of the object is related.
  • values range from 0 (black) to 1 (white). For example, (-, 0, 1) represents white, (-, 0, 0) represents black, and (0°, 1, 1) represents red.
  • Figure 4C shows the projection of the chromaticity diagram of the CIE-XYZ color space on the XY plane. Similar to the RGB color space, CIE-XYZ also uses three values X, Y, and Z to represent a color, which represents a color in red The proportion of primary colors, Y indicates the proportion of green primary color in a color, and Z indicates the proportion of blue primary color in a color.
  • Figure 4D shows a schematic diagram of the CIE-Lab color space.
  • CIE-Lab uses three values L, a, and b to represent a color.
  • L represents brightness
  • the positive extreme value of a represents red
  • the negative extreme value represents Green
  • the positive extreme value of b represents yellow
  • the negative extreme value represents blue.
  • the value range of L is 0 ⁇ 100
  • the value range of a is -128 ⁇ 127
  • the value range of b is -128 ⁇ 127.
  • (100, -, -) means white
  • ( 0, -, -) means black.
  • the color distance (that is, the color difference) is used to characterize the degree of difference between two colors, and the color difference can be calculated by the Euclidean distance in the color space.
  • formulas (1) to formulas (4) show Figure 4A
  • the color distance ⁇ E between two colors (R 1 , G 1 , B 1 ) and (R 2 , G 2 , B 2 ) in the RGB color space can be determined by the following formula (1):
  • the color distance ⁇ E between two colors (H 1 , S 1 , V 1 ) and (H 2 , S 2 , V 2 ) in the HSV color space can be determined by the following formula (2):
  • r is the radius of the base of the cone in the HSV color space
  • h is the height of the cone in the HSV color space.
  • the color distance ⁇ E between two colors (X 1 , Y 1 , Z 1 ) and (X 2 , Y 2 , Z 2 ) in the CIE-XYZ color space can be determined by the following formula (3):
  • the color distance ⁇ E between two colors (L 1 , a 1 , b 1 ) and (L 2 , a 2 , b 2 ) in the CIE-Lab color space can be determined by the following formula (4):
  • the color distance between two colors (L 1 , a 1 , b 1 ) and (L 2 , a 2 , b 2 ) in the CIE-Lab color space can also be calculated in other ways.
  • the color distance ⁇ E 94 of the two colors can be determined based on the CIE 94 color distance calculation formula (5) proposed by CIE.
  • the color distance ⁇ E CMC (I:c) between the two colors can also be calculated based on the CMC (I:c) color distance calculation formula (6) proposed by the Society's Color Measurement Committee ( CMC):
  • ⁇ L, ⁇ C ab , ⁇ H ab are defined the same as in the aforementioned formula (5), and will not be repeated here, and:
  • the color distance can also be calculated based on other distances in the two color color spaces, such as Manhattan distance, Chebyshev distance, Minkowski distance, standardized Euclidean distance, Mahalanobis distance, angle cosine, Hamming
  • Manhattan distance Chebyshev distance
  • Minkowski distance standardized Euclidean distance
  • Mahalanobis distance angle cosine
  • Hamming The distance and the like are not limited here.
  • the two colors can be converted into the same color space before calculation.
  • the user in order to improve the aesthetics of the interface displayed by the electronic device, reduce the visual complexity of the interface, etc., the user usually manually arranges multiple display elements in a certain order, such as according to the similarity of colors, the category of each display element, etc. etc., but it is cumbersome for users to manually arrange multiple display elements, which affects user experience.
  • the electronic device can obtain the layout features between the elements to be laid out in the interface, such as color features, semantic features, etc., and determine the layout feature distance between the elements to be laid out, such as color distance, semantic distance, etc., and then determine the layout scheme that makes the spatial distance between the elements to be laid out and the layout feature distance between the elements to be laid out have the highest similarity based on the layout feature distance between the elements to be laid out, and according to the determined
  • the layout scheme of is used to automatically layout the elements to be laid out. In this way, the electronic device can automatically layout the elements to be laid out according to the layout characteristics among the elements to be laid out, which improves the user experience.
  • the layout interface embodied according to the layout scheme is reflected in the aforementioned Gestalt theory.
  • the principle of similarity and proximity is highly consistent, which makes the visual complexity of the interface after the layout low and the interface simple, which further improves the user experience.
  • the electronic device 100 can obtain the main colors of each icon, and determine the color distance between the main colors of each icon, and then use an optimization algorithm, such as a genetic algorithm, to determine the color distance between the main colors of each icon.
  • the layout scheme with the highest similarity between the color distance between the main colors and the space distance between each icon and automatically adjust the position of each icon according to the determined layout scheme.
  • the electronic device 100 can automatically arrange the icons in the electronic device 100 according to the main color of each icon, which improves the user's experience of adjusting the interface layout of the electronic device 100 .
  • the main color of the icon is the main color of the icon, for example, the main color of the icon may be the most used color of the icon, or the average value of the most used color of a category.
  • the electronic device 100 can obtain the color values (such as RGB values) of each pixel of the icon, use a clustering method, such as a spectral clustering algorithm, to group pixels with similar color values into the same class, and use The color corresponding to the average value of the color values of the pixels of the category with the largest number of pixels is used as the main color of the icon.
  • the average value of the multiple main colors can be calculated as the color distance from the main colors of other icons as the color distance between the icon and other icons.
  • the electronic device 100 to which the embodiment of the present application is applicable includes, but is not limited to, a mobile phone, a laptop computer, a smart TV, a tablet computer, a server, a head-mounted display, a mobile email device, a portable game console, a portable music player,
  • the reader device and the like are not limited in this embodiment of the application.
  • the electronic device 100 is the mobile phone 100, combined with the scene shown in FIG. 1, taking the icon in the display interface of the mobile phone 100 as the element to be laid out, and the layout feature as the color feature as an example, the technical solution of the embodiment of the present application is introduced in detail.
  • FIG. 5 shows a schematic flowchart of a layout method according to some embodiments of the present application.
  • the subject of execution of the method is the mobile phone 100, as shown in Figure 5, the process includes the following steps:
  • S501 A layout instruction is detected. That is, when the mobile phone 100 detects the user's layout instruction, it automatically layouts the icons in the display interface of the mobile phone 100 through the layout method provided by the embodiment of the present application.
  • the user can enter the desktop layout adjustment interface as shown in FIG. 6B after performing the pinching operation on the touch screen of the mobile phone 100 as shown in FIG. 61 Enter the desktop setting interface shown in FIG. 6C and open the "Smart Arrange Icons" control 62.
  • the mobile phone 100 After the mobile phone 100 detects that the user has opened the "Smart Arrange Icons” control 62, the mobile phone 100 can be arranged according to the layout method provided by the embodiment of the present application. The icons in the display interface are automatically laid out.
  • the user can also shake the mobile phone 100 in the layout adjustment interface shown in FIG. 6B .
  • the mobile phone 100 After the mobile phone 100 detects the user's shaking operation, it can display the interface on the mobile phone 100 according to the layout method provided by the embodiment of the present application.
  • the user's layout instruction detected by the mobile phone 100 may also be other instructions, such as voice instructions, etc., which is not limited here.
  • S502 Obtain color data of icons to be laid out, and determine a color distance between icons to be laid out based on the color data. That is, the mobile phone 100 obtains the color data of the icons to be laid out in the display interface, such as the main color of the icons to be laid out, and determines the color distance between two icons to be laid out based on the color data of the icons to be laid out.
  • the mobile phone 100 can extract the color data of each icon to be laid out, and determine the color distance between the icons to be laid out according to any color distance calculation method shown in the aforementioned formula (1) to formula (6) .
  • the distance between the main colors of each icon can be calculated by the aforementioned formula (1), and the size shown in Figure 7 is
  • the 17 ⁇ 17 color distance matrix represents the color distance between icons.
  • the color distance between the "Gallery Icon” and the "Sports Health” icon is the value corresponding to the 4th row, 11th column or the 11th row, 4th column in the matrix shown in Figure 7, which is 31;
  • the "Music” icon and the " The color distance between the "Smart Life” icons is the value corresponding to row 8, column 14 or row 14, column 8 in the matrix shown in Figure 7, which is 4.
  • the color distance between the icon and itself is 0.
  • the elements located on the diagonal of the matrix that is, the values corresponding to the elements with the same row and column values are the color distance between the icon and itself.
  • the value of the second row and the second column of the matrix in FIG. 7 corresponds to the color distance between the "clock" icon and itself, which is 0.
  • the average value of the multiple main colors can be calculated as the color distance from the main colors of other icons as the color distance between the icon and other icons.
  • the mobile phone 100 can determine the color distance between the icons to be laid out based on the method shown in any one of the foregoing formulas (1) to formulas (6); in other embodiments, it can also use Computing in other ways, such as dividing the hue into multiple regions, the color distance between colors belonging to the same hue is 0, and the color distance between colors belonging to different hues is 1, which is not limited here.
  • the average value of the multiple main colors can be calculated, and the color between the icon and other icons can be determined according to the hue of the color corresponding to the average value distance.
  • S503 Determine a layout scheme that maximizes the similarity between the spatial distance and the color distance between the icons to be laid out. That is, the mobile phone 100 simulates and adjusts the positions of the icons to be laid out, and determines a layout scheme that maximizes the similarity of the spatial distance and the color distance between the icons to be laid out.
  • the determined layout scheme that maximizes the similarity of the spatial distance and color distance between the icons to be laid out makes the interface after the layout more consistent with the principle of similarity and proximity in the aforementioned Gestalt theory, As a result, the visual complexity of the interface after the layout is lower, and the interface is more concise.
  • the spatial distance between the icons to be laid out can be determined in the following manner: the interface to be laid out is divided into a plurality of grids, each grid is a step size D, and the grid spaced between two icons The product of the grid number and the step size D is used as the spatial distance between the two icons.
  • the space distance between the "Smooth Call” icon and the "Clock” icon and “File Management” icon is D
  • the space distance between the "Smooth Call” icon and the "Calendar” icon and "Huawei Video” icon is 2D. .
  • the spatial distance between the icons to be laid out may also be the actual distance between the centers of the icons to be laid out, such as the actual pixel distance of the icons to be laid out on the display screen 194 of the mobile phone 100, etc., for example, refer to FIG. 8B , the space distance between the "Smooth Call” icon and the "Clock” icon is 416 pixels, and the space distance between the "Smooth Call” icon and the "Browser” icon is 1096 pixels. It can be understood that, in some other embodiments, the spatial distance between the icons to be laid out may also be determined in other ways, which is not limited here.
  • the spatial distance between the icons to be laid out may be represented by a matrix, so as to determine the similarity between the space distance and the color distance between the icons to be laid out.
  • a spatial distance matrix with a size of 17 ⁇ 17 may be used to represent the spatial distance between icons in the scene shown in (A) of FIG. 1 .
  • the spatial distance between the icon of "Smooth Call” and the icon of "Calculator” is the value corresponding to row 1, column 9 or row 9, column 1 of the matrix shown in Figure 9, which is 826 pixels; another example, " The spatial distance between the “Memo” icon and the “Recorder” icon is the value corresponding to row 5, column 16 or row 16, column 5 in the matrix shown in FIG. 9 , that is, 1109 pixels.
  • the spatial distance between the icon and itself is 0.
  • the elements located on the diagonal of the matrix that is, the values corresponding to the elements with the same row and column values are the spatial distance between the icon and itself.
  • the value in the twelfth row and the twelfth column in the matrix shown in FIG. 9 corresponds to the distance between the "weather" icon and itself, which is 0.
  • the similarity between the spatial distance and the color distance between the icons to be laid out may be determined by the correlation coefficient of the space distance matrix and the color distance matrix between the icons to be laid out.
  • the Pearson correlation coefficient of the spatial distance matrix and the color distance matrix between the icons to be laid out can be calculated by formula (7) to determine the similarity of the space distance and the color distance between the icons to be laid out:
  • A is the space distance matrix between the icons to be laid out
  • B is the color distance matrix between the icons to be laid out
  • Cov(A, B) is the covariance of A and B
  • B is the average value of A
  • B is the average value of B.
  • R(A,B) represents the similarity of the spatial distance and color distance between the icons to be laid out, and the larger the absolute value of R(A,B), the greater the spatial distance and the color distance between the icons to be laid out. The higher the similarity.
  • the color distance matrix between the icons to be laid out is shown in Figure 7, and the space distance matrix is shown in Figure 9, then it can be determined from the formula (7) in Figure 1
  • the correlation coefficient between the icons to be laid out in the interface shown in (A) is 0.2078.
  • the correlation coefficient between the spatial distance matrix and the color distance matrix between the icons to be laid out in the layout interface shown in (B) of FIG. 1 is 0.6039.
  • the above-mentioned determination of the similarity of the spatial distance and color distance between the icons to be laid out by the Pearson correlation coefficient is just an example. In other embodiments, it can also be determined by other methods, for example, the Spearman correlation coefficient , Kendall correlation coefficient, etc., are not limited here.
  • the mobile phone 100 determines that the layout scheme that maximizes the similarity between the spatial distance and the color distance between the icons to be laid out can be transformed into an optimization problem, which is solved by linear programming, genetic algorithm, simulated annealing algorithm, etc.
  • An optimization problem, and the solution of the optimization problem is used as the layout scheme that maximizes the similarity between the spatial distance and the color distance between the icons to be laid out, which will be described in detail below, and will not be repeated here.
  • FIG. 10A shows a layout scheme in which the icons in the display interface shown in (A) of FIG. The distribution can refer to Fig. 10B.
  • the value of row i and column j is 1, which means that the i-th icon is laid out at the j-th position in FIG. 10B .
  • the value corresponding to the 5th row and 15th column is 1, it means that the 5th icon ("memo" icon) is laid out at the 15th position shown in Figure B.
  • the determined layout scheme may not be the layout scheme that maximizes the similarity between the spatial distance and the color distance between the layout icons, but the one that maximizes the similarity between the spatial distance and the color distance between the layout icons.
  • Layout schemes greater than the similarity threshold for example, layout schemes with a similarity threshold greater than 0.5, are not limited in this embodiment of the present application.
  • the mobile phone 100 adjusts the positions of the icons to be laid out according to the layout scheme determined in step S503 that maximizes the similarity between the spatial distance and the color distance between the icons to be laid out.
  • the mobile phone 100 can rearrange the icons in the display interface of the mobile phone 100 shown in (A) in FIG. 1 according to the layout scheme shown in FIG. 10A to obtain the display interface shown in (B) in FIG. 1 . It can be seen from the display interface shown in (B) in Figure 1 that the icons with similar colors are arranged in similar positions, which makes the similarity principle and proximity principle in the Gestalt theory reflected in this interface relatively consistent. High, reduces the visual complexity of the display interface of the mobile phone 100, and improves the interface simplicity of the display interface of the mobile phone 100.
  • step S503 determine the similarity between the spatial distance and the color distance between the icons to be laid out by converting the layout scheme that determines the maximum similarity between the space distance and the color distance between the icons to be laid out into an optimization problem.
  • the layout scheme with the highest degree of precision is introduced.
  • the mobile phone 100 can number the 17 icons to be laid out in the display interface shown in (A) in FIG. 1 (refer to the matrix shown in FIG.
  • the central coordinates of the icons to be laid out) are marked as the 17 layout positions shown in Figure 10B, so that the layout scheme that determines the maximum similarity between the space distance and the color distance between the icons to be laid out is converted into the maximum position shown in formula (8).
  • x ij , d ijmn and y ijmn are 0 or 1;
  • Constraint 1 indicates that only one icon can be laid out in one layout position
  • the constraint condition 2 indicates that an icon can only be placed in one layout position
  • d ijmn indicates the distance between the i-th icon and the m-th icon when the i-th icon is at the j-th layout position and the m-th icon is at the n-th layout position;
  • z im represents the spatial distance between the i-th icon and the m-th icon, that is, the constraint condition 4 is used to calculate the spatial distance between the j-th icon and the n-th icon;
  • c im represents the color distance between the i-th icon and the m-th icon
  • s im is the absolute value of the difference between the spatial distance and color distance between the i-th icon and the m-th icon (constraint condition 5), which is used to represent the spatial distance and color between icons to be laid out in a layout scheme through ⁇ s im
  • the layout scheme can be represented by a layout matrix, where the row indicates the layout position, and the column indicates the icon to be laid out, and the element in the i-th row and the j-th column in the layout matrix is 1, which means that the i-th icon Layout at the jth layout position.
  • the value of each x ij determined by the foregoing formula (8) is the value of row i and column j in the layout matrix.
  • the mobile phone 100 can automatically arrange the icons to be arranged according to the color characteristics between the icons to be arranged, which improves the user experience.
  • the spatial distance between the icons to be laid out in the determined layout scheme and the color distance between the icons to be laid out have the highest similarity
  • the similarity in the aforementioned Gestalt theory embodied in the interface after layout according to the layout scheme is the highest.
  • the consistency of the principle and the principle of proximity is high, so that the visual complexity of the interface after the layout is low, and the interface is simple, which further improves the user experience.
  • the elements to be laid out can also be semantic features.
  • Semantic features of each icon such as the type of application program/function corresponding to each icon, layout the icons.
  • layout the icons Combining with the scenario shown in FIG. 11 , the technical solutions of the embodiments of the present application are introduced below by taking the elements to be laid out as icons in the drop-down menu interface of the mobile phone 100 and the layout features as semantic features as examples.
  • FIG. 12 shows a schematic flowchart of a layout method according to some embodiments of the present application.
  • the subject of execution of the process is the mobile phone 100, as shown in FIG. 12, the method includes the following steps.
  • S1201 A layout instruction is detected. That is, when the mobile phone 100 detects the user's layout instruction, it automatically layouts the icons in the drop-down menu interface of the mobile phone 100 through the layout method provided by the embodiment of the present application.
  • the user can trigger the “edit menu” 132 of the drop-down menu interface by clicking the “edit control” 131 in the drop-down menu interface of the mobile phone 100, and then trigger the layout by turning on the “smart icon layout” switch 1321 instruction.
  • the mobile phone 100 detects that the user has turned on the "smart icon layout” switch 1321, it can automatically layout the icons in the drop-down menu interface of the mobile phone 100 according to the layout method provided by the embodiment of the present application.
  • the mobile phone 100 triggers the layout method provided in the embodiment of the present application after detecting the automatic layout gesture, operation, etc., which is not limited here.
  • S1202 Acquire semantic data of icons to be laid out, and determine a semantic distance between icons to be laid out based on the semantic data. That is, the mobile phone 100 obtains the semantic data of the icons to be laid out in the drop-down menu interface, such as the type of application/function corresponding to each icon, and determines the semantic distance between two icons to be laid out based on the semantic data.
  • the mobile phone 100 can obtain the type of application/function corresponding to the icon to be laid out from the application market program, and the semantic distance between icons corresponding to the same type of application/function is recorded as 0, and the semantic distance between icons of different types The semantic distance between the icons corresponding to the application program/function is recorded as 1.
  • the mobile phone 100 can also obtain data on icons classified by different users, use neural networks, unsupervised learning and other methods to classify (cluster) the semantics of different icons, and classify icons classified into the same category
  • the semantic distance between icons is recorded as 0, and the semantic distance between different types of icons is recorded as 1.
  • FIG. 14 shows a result of clustering icons in the pull-down menu interface shown in FIG. 11.
  • the horizontal axis represents different icons
  • the vertical axis represents the clustering threshold.
  • the clustering results are cropped according to the preset clustering threshold, and the icons are classified based on the number of cropped classification lines. For example, referring to FIG.
  • the mobile phone 100 can cut the clustering results with a preset clustering threshold of 15, classify icons into five categories, namely categories C1, C2, C3, C4 and C5, and classify icons belonging to the same category
  • the semantic distance between icons is recorded as 0, and the semantic distance between different types of icons is recorded as 1, such as the "WLAN” icon (that is, mywifi and the icon on the left in the figure), the "Bluetooth” icon, the “airplane mode” icon, the "mobile data " icon, "Hotspot” icon, "Huawei Sharing” icon and “5G” icon all belong to category C1, and the semantic distance between the above seven icons is recorded as 0.
  • the semantic distance between icons may also be determined in other ways, which is not limited here.
  • the semantic distance between the icons to be laid out can also be represented by a matrix.
  • the representation of the color distance in the aforementioned step S502 which will not be repeated here.
  • S1203 Determine a layout scheme that maximizes the similarity between the spatial distance and the semantic distance between the icons to be laid out. That is, the mobile phone 100 simulates and adjusts the positions of the icons to be laid out, and generates a layout scheme that maximizes the similarity between the spatial distance and the semantic distance between the icons to be laid out. For example, the mobile phone 100 may determine the similarity between the spatial distance and the semantic distance between the icons to be laid out based on the correlation coefficient of the space distance and the semantic distance between the icons to be laid out. For details, refer to the above step S503, which will not be repeated here.
  • the determined layout scheme may not be the layout scheme that maximizes the similarity between the spatial distance and the semantic distance between the icons to be laid out, but the space distance and the semantic distance between the icons to be laid out
  • FIG. 15 shows a schematic diagram of the interface after the mobile phone 100 adjusts the icons in the drop-down menu interface of the mobile phone 100 shown in FIG.
  • the icons classified into the same category in Figure 14 are arranged in adjacent positions, so that the consistency of the similarity principle and proximity principle in the aforementioned Gestalt theory embodied in this interface is relatively high, reducing the need for mobile phones.
  • the visual complexity of the display drop-down menu interface of 100 improves the interface simplicity of the drop-down menu interface of the mobile phone 100 .
  • the mobile phone 100 can automatically layout the icons to be laid out according to the semantic features between the icons to be laid out, which improves the user experience.
  • the similarity in the aforementioned Gestalt theory reflected in the interface after layout according to the layout plan The consistency of the principle and the principle of proximity is high, so that the visual complexity of the interface after the layout is low, and the interface is simple, which further improves the user experience.
  • the mobile phone 100 can also perform automatic layout based on multiple layout features at the same time.
  • the elements to be laid out are first laid out according to the semantic features, and then the layout elements that belong to the same category semantically are laid out according to the color features;
  • the vector represents the layout feature of an element to be laid out, and the distance between multidimensional vectors corresponding to each element to be laid out, such as Euclidean distance, Manhattan distance, Chebyshev distance, Minkowski distance, standardized Euclidean distance, Mahalanobis distance , included angle cosine, Hamming distance, etc. are the layout feature distances between the elements to be laid out, and then determine the layout scheme that maximizes the similarity between the layout feature distance and the space distance between the elements to be laid out, and treat the layout according to the layout scheme Elements are automatically laid out.
  • the embodiment of the present application also provides a layout evaluation method, which determines the layout feature distance between each layout element, such as color distance, semantic feature, etc.
  • the evaluation value of the layout to be evaluated is determined based on the similarity between the layout feature distance between each layout element and the spatial distance between each layout element.
  • the higher the similarity between the layout feature distance between each layout element and the spatial distance between each layout element the higher the evaluation value, the lower the visual complexity and the higher the interface simplicity of the interface corresponding to the layout to be evaluated.
  • the electronic device can adjust the layout based on the evaluation value of the layout to be evaluated to obtain a layout scheme with a higher evaluation value, that is, a layout scheme with low visual complexity and high simplicity of the interface displayed by the electronic device.
  • Fig. 16 shows a schematic flowchart of a layout evaluation method according to some embodiments of the present application.
  • the subject of execution of the process is the mobile phone 100, as shown in FIG. 16, the method includes the following steps.
  • S1601 Obtain layout features and position data between layout elements in the layout to be evaluated. That is, the mobile phone 100 obtains the layout features of each layout element in the layout to be evaluated, such as the color data, semantic data, etc. of each layout element, and the position data of each layout element, such as the center of each layout element on the display screen Pixel coordinates on 194.
  • the layout elements can be icons in the display interface shown in (A) in Figure 1
  • the layout feature can be the main feature of each icon.
  • the position data of each icon may be the grid position shown in FIG. 8A, or the pixel coordinates shown in FIG. 8B, which is not limited here.
  • the layout elements can be the icons in the drop-down menu interface shown in Figure 11
  • the layout feature can be the semantics of the application/function corresponding to each icon
  • each The location data of the icons may be the pixel coordinates of the center of each icon on the display screen of the mobile phone 100 .
  • the layout to be evaluated is layout A in which grayscale graphics 1 to grayscale graphics 8 are arranged in the order of 1, 2, ..., 7, 8, and the layout elements are graphics 1 to 8 , the layout feature is the gray value of graph 1 to graph 8.
  • S1602 Determine the layout feature distance and spatial distance of each layout element. That is, the mobile phone 100 determines the layout feature distance of each layout element according to the layout feature of each layout element, and determines the spatial distance of each layout element according to the position data of each layout element.
  • the layout feature distance between icons can be the color distance of the main color of each icon.
  • the spatial distance of each icon may be the distance between the pixel coordinates of each icon, for details, refer to the relevant description in FIG. 9 above, and will not be described in detail here.
  • the characteristic distance between the icons may be the semantic distance of each icon, for details, refer to the relevant description in Figure 14 above, which will not be repeated here; each icon The spatial distance between them may be the distance between the pixel coordinates of the center of each icon on the display screen 194 of the mobile phone 100, for details, please refer to the relevant description of the aforementioned step S1203, which will not be repeated here.
  • the layout feature distance of each layout element in layout A can be the absolute value of the gray value difference between the graphics, for example, the gray value of graphic 1 is 0, and the gray value of graphic 2 If the grayscale value is 180, then the layout feature distance between graphic 1 and graphic 2 is 180; the spatial distance of each layout element can be the distance between the graphic sorting numbers, for example, the sorting number of graphic 1 is 1, and the sorting number of graphic 4 number is 4, then the spatial distance between graphic 1 and graphic 4 is 3. It can be understood that, referring to FIG. 17 , in some embodiments, the layout feature distances and spatial distances between two figures 1 to 8 can be represented by a matrix.
  • S1603 Determine the evaluation value of the layout to be evaluated according to the similarity between the layout feature distance and the spatial distance of each layout element. That is, the mobile phone 100 determines the evaluation value of the layout to be evaluated according to the similarity between the layout feature distance and the spatial distance of each layout element in the layout to be evaluated, and the higher the similarity between the layout feature distance and the spatial distance of each layout element, the higher the evaluation value , the lower the visual complexity of the display interface corresponding to the layout to be evaluated, the higher the simplicity of the interface.
  • the correlation coefficient between the layout feature distance and the spatial distance of each layout element can be calculated based on the method in the aforementioned step S503, and the calculated correlation coefficient can be used as the evaluation value of the layout to be evaluated.
  • the evaluation value of the layout may be the correlation coefficient 0.2078 calculated in the foregoing example.
  • the evaluation value of the layout may be the correlation coefficient 0.6039 calculated in the foregoing example.
  • FIG. 18 shows layout A, layout B, layout C, layout D, layout E, and layout F arranged in different order from graph 1 to graph 8 shown in FIG. 17 and the evaluation values corresponding to each layout.
  • the evaluation values of layout A, layout B, layout C, layout D, layout E, and layout F are 0.0658, 0.2632, 0.329, 0.329, 0.5264, and 0.7237, respectively.
  • the similarity between the gray value distance and the spatial distance increases, that is, the higher the evaluation value, the lower the visual complexity and the higher the simplicity of the layout.
  • the mobile phone 100 can evaluate the visual complexity and simplicity of the interface corresponding to the layout to be evaluated, and generate an evaluation value of the layout, so that the mobile phone 100 can adjust the layout based on the evaluation value, A layout scheme with a higher evaluation value is obtained, that is, a layout scheme with low visual complexity and high simplicity of the interface displayed on the mobile phone 100 .
  • Fig. 19 shows a schematic structural diagram of a mobile phone 100 according to some embodiments of the present application.
  • the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, A display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • the sensor module 180 may include a pressure sensor 180A, an acceleration sensor 180E, a fingerprint sensor 180H, a touch sensor 180K, an ambient light sensor 180L and the like.
  • the structure shown in the embodiment of the present application does not constitute a specific limitation on the mobile phone 100 .
  • the mobile phone 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is a cache memory.
  • the memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
  • the processor 110 may call and execute execution instructions of the layout method/layout evaluation method provided by the embodiments of the present application stored in the memory, so as to implement the layout method/layout evaluation method provided by the embodiments of the present application.
  • processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (derail clock line, SCL).
  • processor 110 may include multiple sets of I2C buses.
  • the processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flashlight, the camera 193 and the like through different I2C bus interfaces.
  • the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to realize the touch function of the mobile phone 100 .
  • the I2S interface can be used for audio communication.
  • processor 110 may include multiple sets of I2S buses.
  • the processor 110 may be coupled to the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170 .
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through the Bluetooth headset.
  • the PCM interface can also be used for audio communication, sampling, quantizing and encoding the analog signal.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is generally used to connect the processor 110 and the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI), etc.
  • the processor 110 communicates with the camera 193 through the CSI interface to realize the shooting function of the mobile phone 100 .
  • the processor 110 communicates with the display screen 194 through the DSI interface to realize the display function of the mobile phone 100 .
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193 , the display screen 194 , the wireless communication module 160 , the audio module 170 , the sensor module 180 and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface conforming to the USB standard specification, specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transmit data between the mobile phone 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.
  • the charging management module 140 is configured to receive a charging input from a charger. While the charging management module 140 is charging the battery 142 , it can also supply power to the electronic device through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the wireless communication function of the mobile phone 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the mobile phone 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, convert it into electromagnetic wave and radiate it through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
  • the wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system, etc. applied on the mobile phone 100 (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the mobile phone 100 realizes the display function through the GPU, the display screen 194, and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos and the like.
  • the display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Mini-LED, Micro-LED, Micro-OLED, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
  • the mobile phone 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • Camera 193 is used to capture still images or video.
  • the object generates an optical image through the lens and projects it to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other image signals.
  • the mobile phone 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
  • the internal memory 121 may be used to store computer-executable program codes including instructions.
  • the internal memory 121 may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data (such as audio data, phone book, etc.) created during the use of the mobile phone 100 .
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the processor 110 executes various functional applications of the mobile phone 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor 110 .
  • the mobile phone 100 can realize the audio function through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
  • the audio module 170 may also be used to encode and decode audio signals.
  • Speaker 170A also referred to as a "horn" is used to convert audio electrical signals into sound signals.
  • Receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the microphone 170C also called “microphone” or “microphone”, is used to convert sound signals into electrical signals.
  • the earphone interface 170D is used for connecting wired earphones.
  • the pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal.
  • pressure sensor 180A may be disposed on display screen 194 .
  • pressure sensors 180A such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors.
  • a capacitive pressure sensor may be comprised of at least two parallel plates with conductive material.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation whose intensity is less than the first pressure threshold is applied to the “smart icon layout” switch 1321 shown in FIG. When the touch operation of the pressure threshold is applied to the “smart icon layout” switch 1321 shown in FIG. 13 , the instructions arranged according to the color characteristics are executed.
  • the acceleration sensor 180E can detect the acceleration of the mobile phone 100 in various directions (generally three axes). When the mobile phone 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the ambient light sensor 180L is used for sensing ambient light brightness.
  • the mobile phone 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the mobile phone 100 is in the pocket, so as to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the mobile phone 100 can use the collected fingerprint features to realize fingerprint unlocking, access to the application lock, take pictures with the fingerprint, answer calls with the fingerprint, and the like.
  • the main space and the private space may use different unlocking fingerprints for verification and login, so as to ensure the security of private data in the private space.
  • the user can verify different fingerprints on the mobile phone 100 to enter the main space and the private space respectively.
  • the touch sensor 180K is also called “touch device”.
  • the touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to the touch operation can be provided through the display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the mobile phone 100 , which is different from the position of the display screen 194 .
  • the motor 191 can generate a vibrating reminder.
  • the indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 195 is used for connecting a SIM card.
  • the operating system used by the above-mentioned mobile phone 100 may be one of Android TM , IOS TM (Input Output System) and Harmony OS (Harmony OS), which is not limited here.
  • IOS TM Input Output System
  • Harmony OS Harmony OS
  • Fig. 20 shows a schematic diagram of a software architecture of a mobile phone 100 according to some embodiments of the present application.
  • the software architecture of the mobile phone 100 mainly includes:
  • Application layer 20 may include system applications 21 and extension applications 22 (or third-party applications).
  • the system application 21 may include a desktop 211, a setting 212, and the like.
  • the layout method/layout evaluation method provided by each embodiment of the present application can be executed by the desktop application, that is, the desktop 211 can obtain the layout characteristics of the icons in the display interface of the mobile phone 100 or in the drop-down menu, such as color characteristics and semantics.
  • the desktop 211 can obtain the layout characteristics of the icons in the display interface of the mobile phone 100 or in the drop-down menu, such as color characteristics and semantics.
  • the framework layer 30 provides a multilingual framework for the application layer, including an interface (User Interface, UI) framework 31, a user program framework 32, and a capability framework 33.
  • UI User Interface
  • the UI framework 31 includes a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc., which will not be repeated here.
  • the user program framework 32 and the capability framework 33 can provide application programs with the capabilities of various capability components required by the application, such as computing power (may include CPU computing power, graphics processing unit (Graphics Processing Unit, GPU) computing power, image signal processor (Image Signal Processor, ISP) computing power, etc.), sound pickup capabilities (including microphone pickup capabilities, voice recognition capabilities, etc.), security capabilities in equipment security protection (including trusted operating environment security levels, etc.), display capabilities (can include screen resolution, screen size, etc.), playback capability (including sound amplification capability, stereo effect capability, etc., and storage capability (may include device memory capability, random access memory (RAM) capability, etc.) etc., no limitation here.
  • computing power may include CPU computing power, graphics processing unit (Graphics Processing Unit, GPU) computing power, image signal processor (Image Signal Processor, ISP) computing power, etc.
  • sound pickup capabilities including microphone pickup capabilities, voice recognition capabilities, etc.
  • security capabilities in equipment security protection including trusted operating environment security levels, etc.
  • display capabilities can include screen resolution, screen size, etc.
  • the system service layer 40 is the core of the software system of the mobile phone 100 and can provide services to the application programs of the application layer 20 through the framework layer 30 .
  • the system service layer 40 includes a distributed soft bus 41, a distributed data management module 42, a distributed task scheduling module 43, and the like.
  • the distributed soft bus 41 is used to couple the mobile phone 10 with other electronic devices to form a distributed system;
  • the distributed data management module 42 is based on the distributed soft bus 41 to realize distributed management of application program data and user data.
  • the distributed task scheduling module 43 builds a unified distributed service management (discovery, synchronization, registration, call) mechanism based on technical characteristics such as distributed soft bus and distributed data management, and supports remote startup and remote call of cross-device applications , remote connection, migration and other operations, can select the appropriate device to run tasks according to the capabilities, locations, business operation status, resource usage, and user habits and intentions of different devices.
  • distributed service management discovery, synchronization, registration, call
  • the kernel layer 50 includes a kernel subsystem 51 and a driver subsystem 52 .
  • the kernel subsystem 51 provides basic kernel capabilities to the upper layer by shielding differences between multiple kernels, including process/thread management, memory management, file system, network management, and peripheral management.
  • the driver subsystem 52 includes a hardware driver framework, which can provide the mobile phone 100 with a unified peripheral device access capability and a management framework.
  • the software architecture of the mobile phone 100 shown in FIG. 20 is just an example.
  • the mobile phone 10 may also adopt other software architectures different from the above-mentioned FIG. 20 , which is not limited in this embodiment of the present application.
  • Embodiments of the mechanisms disclosed in this application may be implemented in hardware, software, firmware, or a combination of these implementation methods.
  • Embodiments of the present application may be implemented as a computer program or program code executed on a programmable system comprising at least one processor, a storage system (including volatile and non-volatile memory and/or storage elements) , at least one input device, and at least one output device.
  • Program code can be applied to input instructions to perform the functions described herein and to generate output information.
  • the output information may be applied to one or more output devices in known manner.
  • a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), microcontroller, application specific integrated circuit (ASIC), or microprocessor.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • the program code can be implemented in a high-level procedural language or an object-oriented programming language to communicate with the processing system.
  • Program code can also be implemented in assembly or machine language, if desired.
  • the mechanisms described in this application are not limited in scope to any particular programming language. In either case, the language may be a compiled or interpreted language.
  • the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof.
  • the disclosed embodiments can also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which can be executed by one or more processors read and execute.
  • instructions may be distributed over a network or via other computer-readable media.
  • a machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including, but not limited to, floppy disks, optical disks, optical disks, read-only memories (CD-ROMs), magnetic Optical discs, read-only memory (ROM), random-access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic or optical cards, flash memory, or A tangible, machine-readable memory used to transmit information (eg, carrier waves, infrared signals, digital signals, etc.) by electrical, optical, acoustic, or other forms of propagating signals using the Internet.
  • a machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).
  • each unit/module mentioned in each device embodiment of this application is a logical unit/module.
  • a logical unit/module can be a physical unit/module, or a physical unit/module.
  • a part of the module can also be realized with a combination of multiple physical units/modules, the physical implementation of these logical units/modules is not the most important, the combination of functions realized by these logical units/modules is the solution The key to the technical issues raised.
  • the above-mentioned device embodiments of this application do not introduce units/modules that are not closely related to solving the technical problems proposed by this application, which does not mean that the above-mentioned device embodiments do not exist other units/modules.

Abstract

The present application relates to the technical field of electronics. Disclosed are a layout method, a readable medium and an electronic device. The method comprises: acquiring layout features of a plurality of elements to be laid out; on the basis of the layout features of said elements, determining a layout feature distance between every two of said elements, wherein the higher the similarity between the layout features of said elements, the smaller the layout feature distance between said elements; determining a layout scheme on the basis of the similarity between the layout feature distance between every two of said elements and a spatial distance between every two of said elements; and adjusting the positions of said elements according to the determined layout scheme. The consistency of the principle of similarity and the principle of proximity in Gestalt theory embodied by an interface that has been laid out by means of a layout scheme determined by the method provided in the present application is relatively high, such that the visual complexity of a display interface of an electronic device laid out by means of the layout scheme can be reduced, thereby improving the interface simplicity of the display interface, and improving the user experience.

Description

布局方法、可读介质和电子设备Layout method, readable medium and electronic device
本申请要求于2021年11月24日提交中国专利局、申请号为202111405667.6、申请名称为“布局方法、可读介质和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to a Chinese patent application with application number 202111405667.6 and titled "Layout Method, Readable Medium, and Electronic Device" filed with the China Patent Office on November 24, 2021, the entire contents of which are incorporated herein by reference Applying.
技术领域technical field
本申请涉及电子技术领域,特别涉及一种布局方法、可读介质和电子设备。The present application relates to the field of electronic technology, in particular to a layout method, a readable medium and electronic equipment.
背景技术Background technique
电子设备通常存在同一界面显示多个显示元素的情形,例如在电子设备的桌面或菜单栏显示多个应用程序的图标。为了提高界面的美观程度、降低界面的视觉复杂度等,用户通常手动将多个显示元素按照一定的顺序排列,例如按照颜色的相似度、各显示元素的类别等进行排列。但在显示元素的数量较多的情况下,用户手动对多个显示元素进行排列操作繁锁,影响用户体验。例如,参考图1,用户要将电子设备显示的界面中的多个应用程序图标移动至按照各图标的颜色相似度进行排列,需要逐个移动应用程序图标,操作繁琐,并且不易于确定颜色相似度较高应用程序图标的排列顺序,影响用户体验。Electronic devices usually display multiple display elements on the same interface, for example, displaying icons of multiple application programs on the desktop or menu bar of the electronic device. In order to improve the aesthetics of the interface, reduce the visual complexity of the interface, etc., the user usually manually arranges multiple display elements in a certain order, for example, according to the similarity of colors and the category of each display element. However, in the case of a large number of display elements, it is cumbersome for the user to manually arrange the multiple display elements, which affects user experience. For example, referring to Figure 1, if the user wants to move multiple application program icons in the interface displayed by the electronic device to be arranged according to the color similarity of each icon, it is necessary to move the application program icons one by one, the operation is cumbersome, and it is not easy to determine the color similarity The arrangement order of taller application icons affects user experience.
发明内容Contents of the invention
有鉴于此,本申请实施例提供了一种布局方法、可读介质和电子设备。通过获取待布局元素的布局特征,确定待布局元素的布局特征间的距离,并根据使待布局元素两两间的布局特征距离和两两间的空间距离之间的相似性对待布局元素进行自动布局。如此,电子设备可以自动对待布局元素进行布局,并且布局后的界面视觉复杂度低,界面简洁性高,提升了用户体验。In view of this, the embodiments of the present application provide a layout method, a readable medium and an electronic device. By obtaining the layout features of the elements to be laid out, determine the distance between the layout features of the elements to be laid out, and according to the similarity between the layout feature distance and the space distance between the two elements to be laid out layout. In this way, the electronic device can automatically layout the layout elements, and the interface after layout has low visual complexity and high simplicity, which improves user experience.
第一方面,本申请实施例提供了一种布局方法,应用于电子设备,该方法包括:获取多个待布局元素的布局特征;基于各待布局元素的布局特征,确定各待布局元素两两间的布局特征距离,其中,各待布局元素间的布局特征的相似度越高,待布局元素间的布局特征距离越小;基于各待布局元素两两间布局特征距离与各待布局元素两两间的空间距离之间的相似度,确定布局方案;根据确定出的布局方案调整各待布局元素的位置。In the first aspect, the embodiment of the present application provides a layout method, which is applied to electronic devices, and the method includes: obtaining the layout features of multiple elements to be laid out; The layout feature distance between the elements to be laid out, wherein the higher the similarity of the layout features between the elements to be laid out, the smaller the layout feature distance between the elements to be laid out; According to the similarity between the two spatial distances, the layout scheme is determined; according to the determined layout scheme, the position of each element to be laid out is adjusted.
在本申请实施例中,电子设备可以根据待布局元素间的至少一种布局特征自动对待布局元素进行布局,提升了用户体验。此外,由于确定出的布局方案中各待布局元素间的空间距离与各待布局元素间的布局特征距离的相似度较高,使得根据该布局方案布局后的界面体现的前述格式塔理论中的相似性原则和接近性原则的一致性较高,使得布局后的界面视觉复杂度较低、界面简洁性较高,提升了用户体验。In the embodiment of the present application, the electronic device may automatically layout the elements to be laid out according to at least one layout feature among the elements to be laid out, which improves user experience. In addition, due to the high similarity between the spatial distance between the elements to be laid out in the determined layout scheme and the layout feature distance between the elements to be laid out, the interface after layout according to the layout scheme reflects the above-mentioned Gestalt theory. The consistency of similarity principle and proximity principle is high, which makes the visual complexity of the interface after the layout low and the interface simple, which improves the user experience.
在上述第一方面的一种可能实现中,上述布局特征,包括以下特征中的至少一种:颜色特征、语义特征。In a possible implementation of the foregoing first aspect, the foregoing layout features include at least one of the following features: color features and semantic features.
在上述第一方面的一种可能实现中,在布局特征为颜色特征的情况下,上述确定各待布局元素两两间的布局特征距离,包括:根据各待布局元素的布局特征,确定各待布局元素的特征颜色;将各待布局元素两两间的特征颜色之间的颜色距离,确定为各待布局元素两两间的布局特征距离;其中,在待布局元素的主色为单个的情况下,待布局元素的特征颜色为待布局元素的主色;在待布局元素的主色为多个的情况下,待布局元素的特征颜色为待布局元素的多个主色的平均值。In a possible implementation of the above first aspect, when the layout feature is a color feature, the above-mentioned determination of the layout feature distance between each element to be laid out includes: according to the layout feature of each element to be laid out, determine the The characteristic color of the layout element; the color distance between the characteristic colors of each element to be laid out is determined as the layout characteristic distance between the two elements to be laid out; wherein, when the main color of the element to be laid out is a single In this case, the characteristic color of the element to be laid out is the main color of the element to be laid out; when there are multiple main colors of the element to be laid out, the characteristic color of the element to be laid out is the average value of the main colors of the elements to be laid out.
也即是在本申请实施例中,布局特征距离为待布局元素的特征颜色两两间的颜色距离。其中,颜色距离可以根据下文提及的颜色距离计算方法进行计算,也可以采用其他方法进行计算。That is, in the embodiment of the present application, the layout characteristic distance is the color distance between two characteristic colors of the elements to be laid out. Wherein, the color distance may be calculated according to the color distance calculation method mentioned below, or other methods may be used for calculation.
在上述第一方面的一种可能实现中,上述各待布局元素两两间的特征颜色之间的颜色距离,包括以下距离中的任意一种:欧氏距离、曼哈顿距离、切比雪夫距离、闵可夫斯基距离、标准化欧氏距离、马 氏距离、夹角余弦、汉明距离。In a possible implementation of the above-mentioned first aspect, the color distance between the feature colors of the above-mentioned elements to be laid out includes any one of the following distances: Euclidean distance, Manhattan distance, Chebyshev distance, Minkowski distance, normalized Euclidean distance, Mahalanobis distance, angle cosine, Hamming distance.
在上述第一方面的一种可能实现中,在布局特征为颜色特征的情况下,上述确定各待布局元素两两间的布局特征距离,包括:根据各待布局元素的布局特征,确定各待布局元素的特征颜色;将特征颜色属于同一色相的各待布局元素两两间的布局特征距离确定为0,将特征颜色属于不同色相的各待布局元素两两间的布局特征距离确定为1;其中,在待布局元素的主色为单个的情况下,待布局元素的特征颜色为待布局元素的主色;在待布局元素的主色为多个的情况下,待布局元素的特征颜色为待布局元素的多个主色的平均值。。In a possible implementation of the above first aspect, when the layout feature is a color feature, the above-mentioned determination of the layout feature distance between each element to be laid out includes: according to the layout feature of each element to be laid out, determine the The characteristic color of the layout element; determine the layout characteristic distance between each pair of layout elements whose characteristic color belongs to the same hue as 0, and determine the layout characteristic distance between each pair of layout elements whose characteristic color belongs to different hues as 1; Among them, when the main color of the element to be laid out is single, the feature color of the element to be laid out is the main color of the element to be laid out; in the case of multiple main colors of the element to be laid out, the feature color of the element to be laid out is The average of multiple dominant colors for the element to be laid out. .
在本申请实施例中,各待布局元素两两间的布局特征距离可以是根据各待布局元素的特征颜色的色相来确定,即是将特征颜色属于同一色相的各待布局元素两两间的布局特征距离确定为0,将特征颜色属于不同色相的各待布局元素两两间的布局特征距离确定为1。如此可以减小电子设备在基于各待布局元素两两间布局特征距离与各待布局元素两两间的空间距离之间的相似度确定布局方案过程中的计算量,提高布局的速度。In this embodiment of the application, the layout feature distance between two elements to be laid out can be determined according to the hue of the characteristic color of each element to be laid out, that is, the distance between two elements to be laid out whose feature color belongs to the same hue The layout feature distance is determined to be 0, and the layout feature distance between two to-be-layout elements whose feature colors belong to different hues is determined to be 1. In this way, the calculation amount of the electronic device in the process of determining the layout scheme based on the similarity between the layout feature distance between the two elements to be laid out and the space distance between the two elements to be laid out can be reduced, and the layout speed can be improved.
在上述第一方面的一种可能实现中,在布局特征为语义特征的情况下,上述确定各待布局元素两两间的布局特征距离,包括:根据各待布局元素的语义对各待布局元素进行分类;将分为同一类的各布局元素两两间的布局特征距离确定为0,将不同类的各布局元素两两间的布局特征距离确定为1。In a possible implementation of the first aspect above, when the layout feature is a semantic feature, the above-mentioned determination of the layout feature distance between each element to be laid out includes: according to the semantics of each element to be laid out Classify; determine the layout feature distance between two layout elements classified into the same category as 0, and determine the layout feature distance between two layout elements of different categories as 1.
在上述第一方面的一种可能实现中,上述基于各待布局元素两两间的布局特征距离与各待布局元素两两间的空间距离之间的相似度确定布局方案,包括:确定出使待布局元素两两间的布局特征距离与各待布局元素两两间的空间距离之间的相似度最大的布局方案。In a possible implementation of the above-mentioned first aspect, the above-mentioned determination of the layout scheme based on the similarity between the layout feature distance between each pair of elements to be laid out and the spatial distance between each pair of elements to be laid out includes: The layout scheme with the largest similarity between the layout feature distance between two elements to be laid out and the space distance between two elements to be laid out.
在上述第一方面的一种可能实现中,上述基于各待布局元素两两间的布局特征距离与各待布局元素两两间的空间距离之间的相似度确定布局方案,包括:确定出使待布局元素两两间的布局特征距离与各待布局元素两两间的空间距离之间的相似度大于相似度阈值的布局方案。In a possible implementation of the above-mentioned first aspect, the above-mentioned determination of the layout scheme based on the similarity between the layout feature distance between each pair of elements to be laid out and the spatial distance between each pair of elements to be laid out includes: A layout scheme in which the similarity between the layout feature distance between the elements to be laid out and the space distance between the elements to be laid out is greater than the similarity threshold.
在上述第一方面的一种可能实现中,通过各待布局元素两两间的布局特征距离与各待布局元素两两间的空间距离之间的相关系数,确定待布局元素两两间的布局特征距离与各待布局元素两两间的空间距离之间的相似度。In a possible implementation of the above-mentioned first aspect, the layout between two elements to be laid out is determined by the correlation coefficient between the layout characteristic distance between two elements to be laid out and the space distance between two elements to be laid out The similarity between the feature distance and the spatial distance between each element to be laid out.
即是在本申请实施例中,待布局元素两两间的布局特征距离与各待布局元素两两间的空间距离之间的相似度是基于待布局元素两两间的布局特征距离与各待布局元素两两间的空间距离之间的相关系数确定,相关系数越大,说明相似度越高。That is, in the embodiment of the present application, the similarity between the layout feature distance between two elements to be laid out and the space distance between each element to be laid out is based on the layout feature distance between two elements to be laid out and each The correlation coefficient between the spatial distances between two layout elements is determined, and the larger the correlation coefficient, the higher the similarity.
在上述第一方面的一种可能实现中,上述相关系数,包括以下相关系数中的任意一种:皮尔逊相关系数、斯皮尔曼相关系数、肯德尔相关系数。In a possible implementation of the first aspect above, the correlation coefficient includes any one of the following correlation coefficients: Pearson correlation coefficient, Spearman correlation coefficient, and Kendall correlation coefficient.
在上述第一方面的一种可能实现中,上述待布局元素包括以下元素中的任意一种:图标、图片、服务卡片。In a possible implementation of the foregoing first aspect, the foregoing elements to be laid out include any one of the following elements: icons, pictures, and service cards.
即是在本申请实施例中,待布局元素可以包括图标、图片、服务卡片等。例如,电子设备的桌面中的应用程序图标、电子设备的下拉菜单中的图标,电子设备的桌面中的应用程序的服务卡片等,在此不做限定。That is, in this embodiment of the application, the elements to be laid out may include icons, pictures, service cards, and the like. For example, the application icon on the desktop of the electronic device, the icon in the pull-down menu of the electronic device, the service card of the application program on the desktop of the electronic device, etc., are not limited here.
在上述第一方面的一种可能实现中,电子设备在检测到用户在电子设备上输入的布局指令的情况下,获取多个待布局元素的布局特征。In a possible implementation of the foregoing first aspect, the electronic device acquires layout features of multiple elements to be laid out when detecting a layout instruction input by a user on the electronic device.
例如,电子设备在检测到用户在开启电子设备的自动布局的功能或在电子设备中执行了自动布局的手势、操作的情况下,通过上述第一方面和上述第一方面的各种可能实现提供的布局方法对电子设备中的显示元素进行自动布局。For example, when the electronic device detects that the user is turning on the automatic layout function of the electronic device or performs an automatic layout gesture or operation in the electronic device, the above first aspect and various possible implementations of the above first aspect provide The layout method automatically layouts display elements in an electronic device.
第二方面,本申请实施例提供一种可读介质,该可读介质上存储有指令,指令在电子设备上执行时使电子设备实现上述第一方面和上述第一方面的各种可能实现提供的任意一种布局方法。In the second aspect, the embodiment of the present application provides a readable medium, on which instructions are stored, and when the instructions are executed on the electronic device, the electronic device realizes the above-mentioned first aspect and various possible implementations of the above-mentioned first aspect provide Any one of the layout methods.
第三方面,本申请实施例提供一种电子设备,该电子设备包括:存储器,用于存储由电子设备的一个或多个处理器执行的指令;以及处理器,是电子设备的处理器之一,用于执行存储器中存储的指令以实现上述第一方面和上述第一方面的各种可能实现提供的任意一种布局方法。In a third aspect, an embodiment of the present application provides an electronic device, which includes: a memory for storing instructions executed by one or more processors of the electronic device; and a processor, which is one of the processors of the electronic device , for executing the instructions stored in the memory to implement the above first aspect and any one of the layout methods provided by various possible implementations of the above first aspect.
附图说明Description of drawings
图1根据本申请的一些实施例,示出了一种对应用程序图标进行布局的场景示意图;Fig. 1 shows a schematic diagram of a layout of application program icons according to some embodiments of the present application;
图2A至图2F根据本申请的一些实施例,示出了格式塔理论的不同基本原则的示意图;2A to 2F are schematic diagrams showing different basic principles of Gestalt theory according to some embodiments of the present application;
图3A和图3B根据本申请的一些实施例,示出了采用不同顺序排列的图标的示意图;3A and 3B are schematic diagrams showing icons arranged in different orders according to some embodiments of the present application;
图3C根据本申请的一些实施例,示出了图3A和图3B中排列的图标的视觉复杂度对比示意图;Fig. 3C is a schematic diagram showing a visual complexity comparison of the icons arranged in Fig. 3A and Fig. 3B according to some embodiments of the present application;
图4A至图4D根据本申请的一些实施例,示出了四种不同色彩空间的示意图;4A to 4D show schematic diagrams of four different color spaces according to some embodiments of the present application;
图5根据本申请的一些实施例,示出了一种布局方法的流程示意图;Fig. 5 shows a schematic flowchart of a layout method according to some embodiments of the present application;
图6A至图6C根据本申请的一些实施例,示出了一种用户触发手机100的布局指令的过程中,手机100的显示界面示意图;6A to 6C show a schematic diagram of a display interface of the mobile phone 100 during a process in which the user triggers the layout command of the mobile phone 100 according to some embodiments of the present application;
图7根据本申请的一些实施例,示出了图1中(A)图所示的显示界面中各图标的颜色距离示意图;Fig. 7 shows a schematic diagram of the color distance of each icon in the display interface shown in Fig. 1 (A) according to some embodiments of the present application;
图8A和图8B根据本申请的一些实施例,示出了不同图标间的空间距离示意图;FIG. 8A and FIG. 8B are schematic diagrams showing spatial distances between different icons according to some embodiments of the present application;
图9根据本申请的一些实施例,示出了图1中(A)图所示的显示界面中各图标的空间距离示意图;Fig. 9 shows a schematic diagram of the spatial distance of each icon in the display interface shown in Fig. 1 (A) according to some embodiments of the present application;
图10A根据本申请的一些实施例,示出了一种以矩阵形式表示的布局方案的示意图;Fig. 10A shows a schematic diagram of a layout scheme expressed in matrix form according to some embodiments of the present application;
图10B根据本申请的一些实施例,示出了图1中(A)图所示的显示界面中的布局位置示意图;Fig. 10B shows a schematic diagram of layout positions in the display interface shown in Fig. 1 (A) according to some embodiments of the present application;
图11根据本申请的一些实施例,示出了一种手机100的下拉菜单界面示意图;Fig. 11 shows a schematic diagram of a drop-down menu interface of a mobile phone 100 according to some embodiments of the present application;
图12根据本申请的一些实施例,示出了一种布局方法的流程示意图;Fig. 12 shows a schematic flowchart of a layout method according to some embodiments of the present application;
图13根据本申请的一些实施例,示出了一种开户手机100下拉菜单界面的智能图标布局功能的显示界面示意图;Fig. 13 shows a schematic diagram of the display interface of the smart icon layout function of the pull-down menu interface of the account opening mobile phone 100 according to some embodiments of the present application;
图14根据本申请的一些实施例,示出了一种对图11所示的下拉菜单界面中的各图标的语义进行聚类的结果示意图;Fig. 14 shows a schematic diagram of a semantic clustering result of icons in the drop-down menu interface shown in Fig. 11 according to some embodiments of the present application;
图15根据本申请的一些实施例,示出了一种对图11所示的下拉菜单界面中的各图标进行重新布局后的效果示意图;Fig. 15 shows a schematic diagram of the effect of rearranging the icons in the pull-down menu interface shown in Fig. 11 according to some embodiments of the present application;
图16根据本申请的一些实施例,示出了一种布局评价方法的流程示意图;Fig. 16 shows a schematic flowchart of a layout evaluation method according to some embodiments of the present application;
图17根据本申请的一些实施例,示出了一种布局评价的场景示意图;Fig. 17 shows a schematic diagram of a layout evaluation scene according to some embodiments of the present application;
图18根据本申请的一些实施例,示出了一种多种不同布局的评价结果的示意图;Fig. 18 shows a schematic diagram of evaluation results of a variety of different layouts according to some embodiments of the present application;
图19根据本申请的一些实施例,示出了一种手机100的结构示意图;Fig. 19 shows a schematic structural diagram of a mobile phone 100 according to some embodiments of the present application;
图20根据本申请的一些实施例,示出了一种手机100的架件结构示意图。Fig. 20 shows a schematic structural diagram of a mobile phone 100 according to some embodiments of the present application.
具体实施方式Detailed ways
本申请的说明性实施例包括但不限于布局方法、可读介质和电子设备。Illustrative embodiments of the present application include, but are not limited to, layout methods, readable media, and electronic devices.
为了便于理解本申请实施例的技术方案,首先对本申请实施例涉及的理论和术语进行介绍。In order to facilitate the understanding of the technical solutions of the embodiments of the present application, firstly, the theories and terms involved in the embodiments of the present application are introduced.
(1)格式塔理论(1) Gestalt theory
格式塔是一种心理学理论,强调经验与行为的整体性,强调结构的整体作用和产生知觉的组成成分之间的联系,认为整体不等于部分之和。人在观察到多个目标时,并不是在一开始就区分一个形象的各个单一的组成部分,而是将各个部分组合起来,使之成为一个更易于理解的统一体,也即是对多个目标 进行分组,下面结合附图说明基于格式塔理论对目标进行分组主要遵循的原则。Gestalt is a psychological theory that emphasizes the integrity of experience and behavior, emphasizes the overall role of structure and the connection between the components that produce perception, and believes that the whole is not equal to the sum of the parts. When a person observes multiple objects, he does not distinguish the individual components of an image at the beginning, but combines the various parts to make it a more understandable unity, that is, for multiple Goals are grouped, and the following principles are mainly followed for grouping goals based on Gestalt theory with reference to the accompanying drawings.
接近性原则:将待分组的多个目标中,相互靠近的目标视为一个组。例如,图2A示出了一种接近性原则的示意图,参考图2A,矩形区域10内的多个圆形相互靠近,基于接近性原则可以认为矩形区域10内的白色圆形为一个组、方形区域11内的白色圆形为一个组、方形区域13内的白色圆形为一个组。Proximity principle: Among the multiple targets to be grouped, the targets that are close to each other are regarded as a group. For example, FIG. 2A shows a schematic diagram of a proximity principle. With reference to FIG. 2A, multiple circles in the rectangular area 10 are close to each other. Based on the principle of proximity, the white circles in the rectangular area 10 can be considered as a group, square The white circles in area 11 form a group, and the white circles in square area 13 form a group.
相似性原则:将待分组的多个目标,将具有相似度的目标视为一个组,例如形状相似度、颜色相似度、阴影相似度、语义相似度等。例如,图2B示出了一种相似性原则的示意图,参考图2B,基于相似性原则可以认为全部为白色圆形的一行为一组、全部为黑色圆形的一行为一组。Similarity principle: treat multiple targets to be grouped, and treat targets with similarities as a group, such as shape similarity, color similarity, shadow similarity, semantic similarity, etc. For example, FIG. 2B shows a schematic diagram of a similarity principle. Referring to FIG. 2B , based on the similarity principle, it can be considered that a row with all white circles is a group, and a row with all black circles is a group.
封闭性原则:待分组目标中,认为目标为完整对象,而不关注目标间可能包含的间隙。例如,图2C示出了一种封闭性原则的示意图,参考图2C,图示多段圆弧为圆形14的一部分,则可以认为图示3段圆弧为一组,类似地,多条线段/折线都是矩形15的一部分,则可以认为图示5条线段/折线为一组。Closure principle: Among the objects to be grouped, the object is regarded as a complete object, and the gaps that may be included between the objects are not paid attention to. For example, Fig. 2C shows a schematic diagram of a principle of closure. With reference to Fig. 2C, the illustrated multi-segment arc is a part of the circle 14, and it can be considered that the illustrated three-segment arc is a group, similarly, a plurality of line segments All of the polylines/polylines are part of the rectangle 15, so the five line segments/polylines in the illustration can be considered as a group.
对称性原则:在待分组目标中,若存在不相邻的两个目标相互对称时,可以认为该两个目标为一组。例如,图2D示出了一种对称性原则的示意图,参考图2D,图中的“[”和“]”为一组、“{”和“}”为一组、“【”和“】”为一组。The principle of symmetry: in the objects to be grouped, if there are two non-adjacent objects that are symmetrical to each other, the two objects can be considered as a group. For example, FIG. 2D shows a schematic diagram of a symmetry principle. Referring to FIG. 2D, "[" and "]" in the figure are a group, "{" and "}" are a group, and "【" and "] " as a group.
共同命运原则:在待分组的目标中,认为具有相同运动趋式的多个目标为一组。例如,图2E示出了一种共同命运原则的示意图,参考图2E,图示区域16内的目标有相同的运动趋式,例如向左运动,其他部分的目标具有不同的运动趋式,则可以认为区域16内的目标为一组。The principle of common fate: Among the targets to be grouped, multiple targets with the same movement tendency are considered as a group. For example, FIG. 2E shows a schematic diagram of a common fate principle. With reference to FIG. 2E , the objects in the illustrated area 16 have the same movement tendency, such as moving to the left, and the objects in other parts have different movement patterns, then The objects in the area 16 can be considered as a group.
连续性原则:在待分组目标中,若多个目标可以被看作是连接在一起的,则将多个目标组成的对象看作一个完整整体。例如,图2F示出了一种连续性原则的示意图,参考图2F,虽然图中的钥匙图案18的中间部分被钥匙图案17遮挡,但依然认为钥匙图案18为一个完整的钥匙图案,而不是中间缺少被钥匙图案17遮挡部分的图案。Continuity principle: In the target to be grouped, if multiple targets can be regarded as connected together, then the object composed of multiple targets is regarded as a complete whole. For example, Fig. 2F shows a schematic diagram of a continuity principle, with reference to Fig. 2F, although the middle part of the key pattern 18 in the figure is blocked by the key pattern 17, it is still considered that the key pattern 18 is a complete key pattern, rather than In the middle, there is a lack of patterns covered by the key pattern 17 .
(2)界面(页面)简洁性(2) Interface (page) simplicity
界面简洁性是界面可以被用户感知为视觉复杂度,视觉复杂度越高,界面简洁性越低。视觉复杂度受到信息量、信息质量和信息组织性(例如界面中各元素的布局方式)的影响。其中信息量和信息质量通常在一个界面中是固定不变的,可以通过调整界面组织性,例如调整界面中各布局元素的位置,来优化视觉复杂度,从而提高界面的简洁性。Interface simplicity means that the interface can be perceived by users as visual complexity. The higher the visual complexity, the lower the interface simplicity. Visual complexity is affected by the amount of information, the quality of information, and the organization of information (eg, the way elements are laid out in an interface). The amount of information and the quality of information are usually fixed in an interface, and the visual complexity can be optimized by adjusting the interface organization, such as adjusting the position of each layout element in the interface, so as to improve the simplicity of the interface.
可以理解,界面的布局往往体现上述格式塔理论的多个原则,例如界面中的布局元素间的距离体现接近性原则、界面中的布局元素的特征相似度体现相似性原则,当界面体现的多个原则间的一致性较高时,该界面的视觉复杂度会较低;反之,当界面体现的多个原则间的一致性较低时,该界面的视觉复杂度会较高。It can be understood that the layout of the interface often embodies multiple principles of the above-mentioned Gestalt theory. When the consistency among the principles is high, the visual complexity of the interface will be low; conversely, when the consistency among multiple principles embodied in the interface is low, the visual complexity of the interface will be high.
例如,参考图3A、图3B和图3C,图3A中的图标为随机排列,颜色分布杂乱,接近性原则和相似性原则的一致性较低,视觉复杂度较高,界面简洁性较低;图3B中的图标按颜色的接近程度进行布局,距离上相近的图标颜色也相近,接近性原则和相似性原则的一致性较高,视觉复杂度较低,界面简洁性较高。For example, referring to Figure 3A, Figure 3B and Figure 3C, the icons in Figure 3A are randomly arranged, the color distribution is messy, the consistency of the proximity principle and the similarity principle is low, the visual complexity is high, and the interface simplicity is low; The icons in Figure 3B are laid out according to the proximity of their colors. Icons with similar distances have similar colors. The consistency between the proximity principle and the similarity principle is high, the visual complexity is low, and the interface is simple.
(3)色彩空间(3) Color space
色彩空间(色彩模型)是描述使用一组值(通常使用三个、四个值或者颜色成分)表示颜色方法的抽象数学模型。常见的色彩空间包括但不限于RGB色彩空间、HSV色彩空间、CIE(国际照明委员会International Commission on illumination,简称CIE)-XYZ色彩空间、CIE-Lab色彩空间等。示例性地,图4A至图4D示出了四种常见色彩空间的示意图。A color space (color model) is an abstract mathematical model that describes the way a color is represented using a set of values (usually using three or four values or color components). Common color spaces include but are not limited to RGB color space, HSV color space, CIE (International Commission on Illumination, CIE for short)-XYZ color space, CIE-Lab color space, etc. Exemplarily, FIG. 4A to FIG. 4D show schematic diagrams of four common color spaces.
参考图4A,RGB色彩空间用3个数值R、G、B来表示一个颜色,其中R代表一个颜色中红色(Red) 的强度、G(Green)代表一个颜色中绿色的强度、B(Blue)代表一个颜色中蓝色的强度。例如,在一些实施例中,可以用0~255来表示一个颜色中R、G、B的强度,参考图4A,(0,0,255)表示蓝色、(255,255,255)表示白色、(0,255,0)表示绿色、(255,0,0)表示红色。Referring to Figure 4A, the RGB color space uses three values R, G, and B to represent a color, where R represents the intensity of red (Red) in a color, G (Green) represents the intensity of green in a color, and B (Blue) Represents the intensity of blue in a color. For example, in some embodiments, 0 to 255 can be used to represent the intensity of R, G, and B in a color. Referring to FIG. 4A, (0, 0, 255) represents blue, and (255, 255, 255) represents white. , (0, 255, 0) means green, (255, 0, 0) means red.
参考图4B,HSV色彩空间是用3个数值H、S、V来表示一个颜色,其中H(Hue,色调)用角度度量,取值范围为0°~360°,从红色开始按逆时针方向计算,红色为0°,绿色为120°,蓝色为240°;S(Saturation,饱和度)表示颜色接近光谱色的程度。一种颜色,可以看成是某种光谱色与白色混合的结果。其中光谱色所占的比例愈大,颜色接近光谱色的程度就愈高,颜色的饱和度也就愈高。饱和度高,颜色则深而艳。光谱色的白光成分为0,饱和度达到最高。通常取值范围为0~1,值越大,颜色越饱和;V(Value,明度)表示颜色明亮的程度,对于光源色,明度值与发光体的光亮度有关;对于物体色,此值和物体的透射比或反射比有关。通常取值范围为0(黑)到1(白)。例如,(-,0,1)表示白色、(-,0,0)表示黑色、(0°,1,1)表示红色。Referring to Figure 4B, the HSV color space uses three values H, S, and V to represent a color, where H (Hue, hue) is measured by angle, and the value range is 0° to 360°, starting from red in a counterclockwise direction For calculation, red is 0°, green is 120°, and blue is 240°; S (Saturation, saturation) indicates the degree to which the color is close to the spectral color. A color that can be seen as the result of mixing a certain spectral color with white. Among them, the larger the proportion of spectral color, the higher the degree of color close to spectral color, and the higher the saturation of color. The saturation is high, and the color is deep and vivid. The white light component of the spectral color is 0, and the saturation reaches the highest. Usually the value ranges from 0 to 1, the larger the value, the more saturated the color; V (Value, lightness) indicates the degree of brightness of the color, for the light source color, the lightness value is related to the brightness of the illuminant; for the object color, this value and The transmittance or reflectance of the object is related. Typically values range from 0 (black) to 1 (white). For example, (-, 0, 1) represents white, (-, 0, 0) represents black, and (0°, 1, 1) represents red.
图4C示出了CIE-XYZ色彩空间的色度图在XY平面的投影,和RGB色彩空间相似,CIE-XYZ也是用3个数值X、Y、Z来表示一个颜色,其中表示一个颜色中红原色的比例,Y表示一个颜色中绿原色的比例,Z表示一个颜色中蓝原色的比例。Figure 4C shows the projection of the chromaticity diagram of the CIE-XYZ color space on the XY plane. Similar to the RGB color space, CIE-XYZ also uses three values X, Y, and Z to represent a color, which represents a color in red The proportion of primary colors, Y indicates the proportion of green primary color in a color, and Z indicates the proportion of blue primary color in a color.
图4D示出了CIE-Lab色彩空间的示意图,CIE-Lab用3个数值L、a、b来表示一个颜色,参考图4D,其中L表示亮度;a的正极值代表红色,负极值代表绿色;b的正极值代表黄色,负极值代表蓝色。在一些场景中,L的取值范围为0~100、a的取值范围为-128~127、b的取值范围为-128~127,例如,(100,-,-)表示白色、(0,-,-)表示黑色。Figure 4D shows a schematic diagram of the CIE-Lab color space. CIE-Lab uses three values L, a, and b to represent a color. Refer to Figure 4D, where L represents brightness; the positive extreme value of a represents red, and the negative extreme value represents Green; the positive extreme value of b represents yellow, and the negative extreme value represents blue. In some scenarios, the value range of L is 0~100, the value range of a is -128~127, and the value range of b is -128~127. For example, (100, -, -) means white, ( 0, -, -) means black.
(4)颜色距离(4) Color distance
颜色距离(即是颜色差异)用于表征两个颜色间的差异程度,颜色差异可以通过色彩空间内的欧氏距离计算得出,例如,公式(1)至公式(4)示出了图4A至图4D所示的四种色彩空间的颜色距离(ΔE)计算公式。The color distance (that is, the color difference) is used to characterize the degree of difference between two colors, and the color difference can be calculated by the Euclidean distance in the color space. For example, formulas (1) to formulas (4) show Figure 4A The color distance (ΔE) calculation formulas to the four color spaces shown in FIG. 4D.
RGB色彩空间的两个颜色(R 1、G 1、B 1)和(R 2、G 2、B 2)间的颜色距离ΔE可以通过下述公式(1)确定: The color distance ΔE between two colors (R 1 , G 1 , B 1 ) and (R 2 , G 2 , B 2 ) in the RGB color space can be determined by the following formula (1):
Figure PCTCN2022126443-appb-000001
Figure PCTCN2022126443-appb-000001
HSV色彩空间的两个颜色(H 1、S 1、V 1)和(H 2、S 2、V 2)间的颜色距离ΔE可以通过下述公式(2)确定: The color distance ΔE between two colors (H 1 , S 1 , V 1 ) and (H 2 , S 2 , V 2 ) in the HSV color space can be determined by the following formula (2):
Figure PCTCN2022126443-appb-000002
Figure PCTCN2022126443-appb-000002
其中,r为HSV色彩空间的圆锥体的底面半径、h为HSV色彩空间的圆锥体的高度。Among them, r is the radius of the base of the cone in the HSV color space, and h is the height of the cone in the HSV color space.
CIE-XYZ色彩空间的两个颜色(X 1、Y 1、Z 1)和(X 2、Y 2、Z 2)间的颜色距离ΔE可以通过下述公式(3)确定: The color distance ΔE between two colors (X 1 , Y 1 , Z 1 ) and (X 2 , Y 2 , Z 2 ) in the CIE-XYZ color space can be determined by the following formula (3):
Figure PCTCN2022126443-appb-000003
Figure PCTCN2022126443-appb-000003
CIE-Lab色彩空间的两个颜色(L 1、a 1、b 1)和(L 2、a 2、b 2)间的颜色距离ΔE可以通过下述公式(4)确定: The color distance ΔE between two colors (L 1 , a 1 , b 1 ) and (L 2 , a 2 , b 2 ) in the CIE-Lab color space can be determined by the following formula (4):
Figure PCTCN2022126443-appb-000004
Figure PCTCN2022126443-appb-000004
可以理解,在一些实施例中,也可以其他方式计算CIE-Lab色彩空间的两个颜色(L 1、a 1、b 1)和(L 2、a 2、b 2)间的颜色距离。例如可以基于CIE提出的CIE 94颜色距离计算公式(5)确定该两个颜色的颜色距离ΔE 94It can be understood that in some embodiments, the color distance between two colors (L 1 , a 1 , b 1 ) and (L 2 , a 2 , b 2 ) in the CIE-Lab color space can also be calculated in other ways. For example, the color distance ΔE 94 of the two colors can be determined based on the CIE 94 color distance calculation formula (5) proposed by CIE.
Figure PCTCN2022126443-appb-000005
Figure PCTCN2022126443-appb-000005
在公式(5)中:ΔL=L 1-L 2In formula (5): ΔL=L 1 −L 2 ;
Figure PCTCN2022126443-appb-000006
Figure PCTCN2022126443-appb-000006
Figure PCTCN2022126443-appb-000007
Figure PCTCN2022126443-appb-000007
S L=1,
Figure PCTCN2022126443-appb-000008
S L =1,
Figure PCTCN2022126443-appb-000008
k C=1、k H=1,k L、k 1、k 2根据不同的应用场景取不同值。 k C =1, k H =1, and k L , k 1 , k 2 take different values according to different application scenarios.
又例如,还可以基于颜色测量委员会(the Society’s Color Measurement Committee,CMC)提出的CMC(I:c)颜色距离计算公式(6)计算该两个颜色间的颜色距离ΔE CMC(I:c)For another example, the color distance ΔE CMC (I:c) between the two colors can also be calculated based on the CMC (I:c) color distance calculation formula (6) proposed by the Society's Color Measurement Committee ( CMC):
Figure PCTCN2022126443-appb-000009
Figure PCTCN2022126443-appb-000009
在公式(6)中,ΔL、ΔC ab、ΔH ab与前述公式(5)中的定义相同,在此不做赘述,并且: In the formula (6), ΔL, ΔC ab , ΔH ab are defined the same as in the aforementioned formula (5), and will not be repeated here, and:
Figure PCTCN2022126443-appb-000010
Figure PCTCN2022126443-appb-000010
Figure PCTCN2022126443-appb-000011
Figure PCTCN2022126443-appb-000011
S H=S C(FT+1-F); S H =S C (FT+1-F);
Figure PCTCN2022126443-appb-000012
Figure PCTCN2022126443-appb-000012
Figure PCTCN2022126443-appb-000013
Figure PCTCN2022126443-appb-000013
l、c根据不同的应用场景取不同值。l and c take different values according to different application scenarios.
可以理解,颜色距离还可以是基于两个颜色色彩空间内的其他距离进行计算,例如曼哈顿距离、切比雪夫距离、闵可夫斯基距离、标准化欧氏距离、马氏距离、夹角余弦、汉明距离等,在此不做限定。It can be understood that the color distance can also be calculated based on other distances in the two color color spaces, such as Manhattan distance, Chebyshev distance, Minkowski distance, standardized Euclidean distance, Mahalanobis distance, angle cosine, Hamming The distance and the like are not limited here.
可以理解,在计算不同色彩空间的两个颜色的距离时,可以将两个颜色转换为同一色彩空间后进行计算。It can be understood that when calculating the distance between two colors in different color spaces, the two colors can be converted into the same color space before calculation.
下面结合附图进行说明本申请实施例的技术方案。The technical solutions of the embodiments of the present application will be described below with reference to the accompanying drawings.
如前所述,为提高电子设备显示的界面的美观程度、降低界面的视觉复杂度等,用户通常手动将多个显示元素按照一定的顺序排列,例如按照颜色的相似度、各显示元素的类别等进行排列,但用户手动对多个显示元素进行排列操作繁锁,影响用户体验。As mentioned above, in order to improve the aesthetics of the interface displayed by the electronic device, reduce the visual complexity of the interface, etc., the user usually manually arranges multiple display elements in a certain order, such as according to the similarity of colors, the category of each display element, etc. etc., but it is cumbersome for users to manually arrange multiple display elements, which affects user experience.
有鉴于此,本申请实施例提供了一种布局方法,电子设备可以获取界面中待布局元素间的布局特征,例如颜色特征、语义特征等,确定各待布局元素间的布局特征距离,例如颜色距离、语义距离等,再基于各待布局元素间的布局特征距离确定出使各待布局元素间的空间距离与各待布局元素间的布局特征 距离的相似度最高的布局方案,并根据确定出的布局方案对待布局元素进行自动布局。如此,电子设备可以根据待布局元素间的布局特征自动对待布局元素进行布局,提升了用户体验。此外,由于确定出的布局方案中各待布局元素间的空间距离与各待布局元素间的布局特征距离的相关性最高,也即是根据该布局方案布局后的界面体现的前述格式塔理论中的相似性原则和接近性原则一致性高,使得布局后的界面视觉复杂度较低、界面简洁性较高,进一步提升用户体验。In view of this, the embodiment of the present application provides a layout method, the electronic device can obtain the layout features between the elements to be laid out in the interface, such as color features, semantic features, etc., and determine the layout feature distance between the elements to be laid out, such as color distance, semantic distance, etc., and then determine the layout scheme that makes the spatial distance between the elements to be laid out and the layout feature distance between the elements to be laid out have the highest similarity based on the layout feature distance between the elements to be laid out, and according to the determined The layout scheme of is used to automatically layout the elements to be laid out. In this way, the electronic device can automatically layout the elements to be laid out according to the layout characteristics among the elements to be laid out, which improves the user experience. In addition, because the spatial distance between the elements to be laid out in the determined layout scheme has the highest correlation with the layout feature distance between the elements to be laid out, that is, the layout interface embodied according to the layout scheme is reflected in the aforementioned Gestalt theory. The principle of similarity and proximity is highly consistent, which makes the visual complexity of the interface after the layout low and the interface simple, which further improves the user experience.
例如,对于图1所示的场景,电子设备100可以获取各图标的主色,并确定各图标的主色间的颜色距离,再通过最优化算法,例如遗传算法等,确定出使各图标的主色间的颜色距离和各图标间的空间距离的相似度最高的布局方案,并根据确定出的布局方案自动调整各图标的位置。如此,电子设备100可以自动根据各图标的主色排列电子设备100中的图标,提高了用户调整电子设备100界面布局的体验。此外,由于确定出的布局方案中各图标间的颜色距离和各图标间的空间距离的相似度最高,也即是颜色相似的图标在位置上相邻,也即是根据该布局方案布局后的界面体现的前述相似性原则和接近性原则的一致性较高,使得布局后的界面简洁性较高,进一步提升用户体验。For example, for the scene shown in FIG. 1, the electronic device 100 can obtain the main colors of each icon, and determine the color distance between the main colors of each icon, and then use an optimization algorithm, such as a genetic algorithm, to determine the color distance between the main colors of each icon. The layout scheme with the highest similarity between the color distance between the main colors and the space distance between each icon, and automatically adjust the position of each icon according to the determined layout scheme. In this way, the electronic device 100 can automatically arrange the icons in the electronic device 100 according to the main color of each icon, which improves the user's experience of adjusting the interface layout of the electronic device 100 . In addition, since the color distance between icons and the spatial distance between icons in the determined layout scheme have the highest similarity, that is, icons with similar colors are adjacent in position, that is, the icons after layout according to the layout scheme The above-mentioned similarity principle and proximity principle reflected in the interface are highly consistent, making the interface after the layout relatively simple and further improving user experience.
可以理解,图标的主色即是该图标主要的颜色,例如图标的主色可以是该图标使用最多的一个颜色,或是使用最多的一类颜色的平均值。在一些实施例中,电子设备100可以获取图标各像素点的颜色值(例如RGB值),利用聚类方法,例如谱聚类算法等,将颜色值相近的像素点聚为同一类,并以像素点数量最多的一类的各像素点的颜色值的平均值对应的颜色作为该图标的主色。It can be understood that the main color of the icon is the main color of the icon, for example, the main color of the icon may be the most used color of the icon, or the average value of the most used color of a category. In some embodiments, the electronic device 100 can obtain the color values (such as RGB values) of each pixel of the icon, use a clustering method, such as a spectral clustering algorithm, to group pixels with similar color values into the same class, and use The color corresponding to the average value of the color values of the pixels of the category with the largest number of pixels is used as the main color of the icon.
可以理解,在一些实施例中,若一个图标有多个主色,可以计算该多个主色的平均值作为与其他图标的主色间的颜色距离作为该图标与其他图标间的颜色距离。It can be understood that, in some embodiments, if an icon has multiple main colors, the average value of the multiple main colors can be calculated as the color distance from the main colors of other icons as the color distance between the icon and other icons.
可以理解,前述待布局元素包括但不限于图标、服务卡片、图片。It can be understood that the aforementioned elements to be laid out include but are not limited to icons, service cards, and pictures.
可以理解,本申请实施例适用的电子设备100包括但不限于手机、膝上型计算机、智能电视、平板计算机、服务器、头戴式显示器、移动电子邮件设备、便携式游戏机、便携式音乐播放器、阅读器设备等,本申请实施例不做限定。It can be understood that the electronic device 100 to which the embodiment of the present application is applicable includes, but is not limited to, a mobile phone, a laptop computer, a smart TV, a tablet computer, a server, a head-mounted display, a mobile email device, a portable game console, a portable music player, The reader device and the like are not limited in this embodiment of the application.
下面以电子设备100为手机100,结合图1所示的场景,以待布局元素为手机100的显示界面中的图标、布局特征为颜色特征为例,详细介绍本申请实施例的技术方案。In the following, the electronic device 100 is the mobile phone 100, combined with the scene shown in FIG. 1, taking the icon in the display interface of the mobile phone 100 as the element to be laid out, and the layout feature as the color feature as an example, the technical solution of the embodiment of the present application is introduced in detail.
具体地,图5根据本申请的一些实施例,示出了一种布局方法的流程示意图。该方法的执行主体为手机100,如图5所示,该流程包括如下步骤:Specifically, FIG. 5 shows a schematic flowchart of a layout method according to some embodiments of the present application. The subject of execution of the method is the mobile phone 100, as shown in Figure 5, the process includes the following steps:
S501:检测到布局指令。即是手机100在检测到用户的布局指令的情况下,通过本申请实施例提供的布局方法对手机100显示界面中的图标进行自动布局。S501: A layout instruction is detected. That is, when the mobile phone 100 detects the user's layout instruction, it automatically layouts the icons in the display interface of the mobile phone 100 through the layout method provided by the embodiment of the present application.
在一些实施例中,参考图6A,用户可以通过在手机100的触摸屏上执行如图6A所示的捏合操作后,进入如图6B所示的桌面布局调整界面,再通过点击“桌面设置”控件61进入图6C所示的桌面设置界面并打开“智能排列图标”控件62,手机100在检测到用户打开“智能排列图标”控件62后,即可根据本申请实施例提供的布局方法对手机100显示界面中的图标进行自动布局。In some embodiments, referring to FIG. 6A, the user can enter the desktop layout adjustment interface as shown in FIG. 6B after performing the pinching operation on the touch screen of the mobile phone 100 as shown in FIG. 61 Enter the desktop setting interface shown in FIG. 6C and open the "Smart Arrange Icons" control 62. After the mobile phone 100 detects that the user has opened the "Smart Arrange Icons" control 62, the mobile phone 100 can be arranged according to the layout method provided by the embodiment of the present application. The icons in the display interface are automatically laid out.
在另一些实施例中,用户还可以在图6B所示的布局调整界面中晃动手机100,手机100在检测到用户的晃动操作后即可根据本申请实施例提供的布局方法对手机100显示界面中的图标进行自动布局。In some other embodiments, the user can also shake the mobile phone 100 in the layout adjustment interface shown in FIG. 6B . After the mobile phone 100 detects the user's shaking operation, it can display the interface on the mobile phone 100 according to the layout method provided by the embodiment of the present application. The icons in the .
可以理解,在另一些实施例中,手机100检测到的用户的布局指令也可以是其他指令,例如语音指令等,在此不做限定。It can be understood that, in some other embodiments, the user's layout instruction detected by the mobile phone 100 may also be other instructions, such as voice instructions, etc., which is not limited here.
S502:获取待布局图标的颜色数据,并基于颜色数据确定待布局图标间的颜色距离。也即是手机100获取显示界面中的待布局图标的颜色数据,例如各待布局图标的主色,并基于各待布局图标的颜色数据,确定待布局图标两两之间的颜色距离。S502: Obtain color data of icons to be laid out, and determine a color distance between icons to be laid out based on the color data. That is, the mobile phone 100 obtains the color data of the icons to be laid out in the display interface, such as the main color of the icons to be laid out, and determines the color distance between two icons to be laid out based on the color data of the icons to be laid out.
例如,在一些实施例中,手机100可以提取各待布局图标的颜色数据,并根据前述公式(1)至公式(6)所示的任一种颜色距离计算方法确定待布局图标间的颜色距离。For example, in some embodiments, the mobile phone 100 can extract the color data of each icon to be laid out, and determine the color distance between the icons to be laid out according to any color distance calculation method shown in the aforementioned formula (1) to formula (6) .
例如,图1中(A)图所示的手机100的显示界面中共有17个待布局图标,可用通过前述公式(1)计算各图标的主色间的距离,并用图7所示的大小为17×17的颜色距离矩阵表示各图标间的颜色距离。例如,“图库图标”与“运动健康”图标间的颜色距离为图7所示矩阵中的第4行第11列或第11行第4列对应的值,即31;“音乐”图标与“智慧生活”图标间的颜色距离为图7所示矩阵中第8行第14列或第14行第8列对应的值,即4。For example, there are 17 icons to be laid out in the display interface of the mobile phone 100 shown in (A) in Figure 1, the distance between the main colors of each icon can be calculated by the aforementioned formula (1), and the size shown in Figure 7 is The 17×17 color distance matrix represents the color distance between icons. For example, the color distance between the "Gallery Icon" and the "Sports Health" icon is the value corresponding to the 4th row, 11th column or the 11th row, 4th column in the matrix shown in Figure 7, which is 31; the "Music" icon and the " The color distance between the "Smart Life" icons is the value corresponding to row 8, column 14 or row 14, column 8 in the matrix shown in Figure 7, which is 4.
可以理解,在一些实施例中,图标与自身间的颜色距离为0。参考图7,位于矩阵对角线上的元素,即行列值相同的元素对应的值即是图标与自身间的颜色距离。例如,图7中的矩阵的第2行第2列的值对应的即是“时钟”图标与自身的颜色距离,即为0。It can be understood that, in some embodiments, the color distance between the icon and itself is 0. Referring to FIG. 7 , the elements located on the diagonal of the matrix, that is, the values corresponding to the elements with the same row and column values are the color distance between the icon and itself. For example, the value of the second row and the second column of the matrix in FIG. 7 corresponds to the color distance between the "clock" icon and itself, which is 0.
可以理解,在一些实施例中,若一个图标有多个主色,可以计算该多个主色的平均值作为与其他图标的主色间的颜色距离作为该图标与其他图标间的颜色距离。It can be understood that, in some embodiments, if an icon has multiple main colors, the average value of the multiple main colors can be calculated as the color distance from the main colors of other icons as the color distance between the icon and other icons.
可以理解,在一些实施例中,手机100可以基于前述公式(1)至公式(6)中任一种所示的方法确定待布局图标间的颜色距离;在另一些实施例中,也可以采用其他方式进行计算,例如将色相划分为多个区域,属于同一个色相的颜色间的颜色距离为0,属于不同色相的颜色间的颜色距离为1,在此不做限定。It can be understood that, in some embodiments, the mobile phone 100 can determine the color distance between the icons to be laid out based on the method shown in any one of the foregoing formulas (1) to formulas (6); in other embodiments, it can also use Computing in other ways, such as dividing the hue into multiple regions, the color distance between colors belonging to the same hue is 0, and the color distance between colors belonging to different hues is 1, which is not limited here.
可以理解,在一些实施例中,若一个图标有多个主色,可以计算该多个主色的平均值,并根据该平均值对应的颜色的色相来确定该图标与其他图标的间的颜色距离。It can be understood that, in some embodiments, if an icon has multiple main colors, the average value of the multiple main colors can be calculated, and the color between the icon and other icons can be determined according to the hue of the color corresponding to the average value distance.
S503:确定出使待布局图标间的空间距离和颜色距离的相似度最大的布局方案。也即是手机100模拟调整待布局图标的位置,确定出使待布局图标间的空间距离和颜色距离的相似度最大的布局方案。S503: Determine a layout scheme that maximizes the similarity between the spatial distance and the color distance between the icons to be laid out. That is, the mobile phone 100 simulates and adjusts the positions of the icons to be laid out, and determines a layout scheme that maximizes the similarity of the spatial distance and the color distance between the icons to be laid out.
可以理解,确定出的使待布局图标间的空间距离和颜色距离的相似度最大的布局方案使得布局后的界面体现的前述格式塔理论中的相似性原则和接近性原则的一致性较高,从而使得布局后的界面视觉复杂度较低、界面简洁性较。It can be understood that the determined layout scheme that maximizes the similarity of the spatial distance and color distance between the icons to be laid out makes the interface after the layout more consistent with the principle of similarity and proximity in the aforementioned Gestalt theory, As a result, the visual complexity of the interface after the layout is lower, and the interface is more concise.
在一些实施例中,参考图8A,可以通过以下方式确定待布局图标间的空间距离:将待布局界面划分为多个网格,每个网格为一个步长D,两个图标间隔的网格数量与步长D的乘积作为该两个图标间的空间距离。例如“畅连通话”图标与“时钟”图标、“文件管理”图标间的空间距离都为D,“畅连通话”图标与“日历”图标、“华为视频”图标间的空间距离都为2D。在另一些实施例中,待布局图标间的空间距离也可以是待布局图标的中心间的实际距离,例如待布局图标在手机100的显示屏194中的实际像素距离等,例如,参考图8B,“畅连通话”图标和“时钟”图标间的空间距离为416像素,“畅连通话”图标和“浏览器”图标间的空间距离为1096像素。可以理解,在另一些实施例中,待布局图标间的空间距离也可以采用其他方式来确定,在此不做限定。In some embodiments, referring to FIG. 8A , the spatial distance between the icons to be laid out can be determined in the following manner: the interface to be laid out is divided into a plurality of grids, each grid is a step size D, and the grid spaced between two icons The product of the grid number and the step size D is used as the spatial distance between the two icons. For example, the space distance between the "Smooth Call" icon and the "Clock" icon and "File Management" icon is D, and the space distance between the "Smooth Call" icon and the "Calendar" icon and "Huawei Video" icon is 2D. . In some other embodiments, the spatial distance between the icons to be laid out may also be the actual distance between the centers of the icons to be laid out, such as the actual pixel distance of the icons to be laid out on the display screen 194 of the mobile phone 100, etc., for example, refer to FIG. 8B , the space distance between the "Smooth Call" icon and the "Clock" icon is 416 pixels, and the space distance between the "Smooth Call" icon and the "Browser" icon is 1096 pixels. It can be understood that, in some other embodiments, the spatial distance between the icons to be laid out may also be determined in other ways, which is not limited here.
在一些实施例中,待布局图标间的空间距离可以用矩阵表示,以便于确定待布局图标间的空间距离和颜色距离间的相似度。例如,参考图9,可以用大小为17×17的空间距离矩阵来表示图1中(A)图所示场景中各图标间的空间距离。例如,“畅连通话”图标与“计算器”图标间的空间距离为图9所示矩阵中第1行第9列或第9行第1列对应的值,即826像素;又例如,“备忘录”图标与“录音机”图标间的空间距离为图9所示矩阵中第5行第16列或第16行第5列对应的值,即1109像素。In some embodiments, the spatial distance between the icons to be laid out may be represented by a matrix, so as to determine the similarity between the space distance and the color distance between the icons to be laid out. For example, referring to FIG. 9 , a spatial distance matrix with a size of 17×17 may be used to represent the spatial distance between icons in the scene shown in (A) of FIG. 1 . For example, the spatial distance between the icon of "Smooth Call" and the icon of "Calculator" is the value corresponding to row 1, column 9 or row 9, column 1 of the matrix shown in Figure 9, which is 826 pixels; another example, " The spatial distance between the “Memo” icon and the “Recorder” icon is the value corresponding to row 5, column 16 or row 16, column 5 in the matrix shown in FIG. 9 , that is, 1109 pixels.
可以理解,在一些实施例中,图标同自身的空间距离为0。参考图9,位于矩阵对角线上的元素,即行列值相同的元素对应的值即是图标与自身间的空间距离。例如,图9所示的矩阵中第12行第12列的值对应的即是“天气”图标与自身的距离,即为0。It can be understood that, in some embodiments, the spatial distance between the icon and itself is 0. Referring to FIG. 9 , the elements located on the diagonal of the matrix, that is, the values corresponding to the elements with the same row and column values are the spatial distance between the icon and itself. For example, the value in the twelfth row and the twelfth column in the matrix shown in FIG. 9 corresponds to the distance between the "weather" icon and itself, which is 0.
在一些实施例中,待布局图标间的空间距离和颜色距离的相似度可以通过待布局图标间的空间距离矩阵和颜色距离矩阵的相关系数来确定。例如,可以通过公式(7)计算待布局图标间的空间距离矩阵和颜色距离矩阵的皮尔逊相关系数来确定待布局图标间的空间距离和颜色距离的相似度:In some embodiments, the similarity between the spatial distance and the color distance between the icons to be laid out may be determined by the correlation coefficient of the space distance matrix and the color distance matrix between the icons to be laid out. For example, the Pearson correlation coefficient of the spatial distance matrix and the color distance matrix between the icons to be laid out can be calculated by formula (7) to determine the similarity of the space distance and the color distance between the icons to be laid out:
Figure PCTCN2022126443-appb-000014
Figure PCTCN2022126443-appb-000014
公式(7)中,A为待布局图标间的空间距离矩阵,B待布局图标间的颜色距离矩阵,Cov(A,B)为A和B的协方差,
Figure PCTCN2022126443-appb-000015
为A的平均值,
Figure PCTCN2022126443-appb-000016
为B的平均值。可以理解相关系数R(A,B)表征了待布局图标间的空间距离和颜色距离的相似度,R(A,B)的绝对值越大,表示待布局图标间的空间距离和颜色距离的相似度越高。例如,在图1中(A)图所示的界面中,待布局图标间的颜色距离矩阵如图7所示、空间距离矩阵如图9所示,则其于公式(7)可以确定图1中(A)图所示的界面中待布局图标间的相关系数为0.2078。又例如,基于上述公式(7)可以得到图1中(B)图所示的布局界面中待布局图标间的空间距离矩阵和颜色距离矩阵间的相关系数为0.6039。
In formula (7), A is the space distance matrix between the icons to be laid out, B is the color distance matrix between the icons to be laid out, Cov(A, B) is the covariance of A and B,
Figure PCTCN2022126443-appb-000015
is the average value of A,
Figure PCTCN2022126443-appb-000016
is the average value of B. It can be understood that the correlation coefficient R(A,B) represents the similarity of the spatial distance and color distance between the icons to be laid out, and the larger the absolute value of R(A,B), the greater the spatial distance and the color distance between the icons to be laid out. The higher the similarity. For example, in the interface shown in (A) in Figure 1, the color distance matrix between the icons to be laid out is shown in Figure 7, and the space distance matrix is shown in Figure 9, then it can be determined from the formula (7) in Figure 1 The correlation coefficient between the icons to be laid out in the interface shown in (A) is 0.2078. For another example, based on the above formula (7), it can be obtained that the correlation coefficient between the spatial distance matrix and the color distance matrix between the icons to be laid out in the layout interface shown in (B) of FIG. 1 is 0.6039.
可以理解,上述通过皮尔逊相关系数确定待布局图标间的空间距离和颜色距离的相似度只是一种示例,在另一些实施例中,还可以通过其他方式来确定,例如,斯皮尔曼相关系数、肯德尔相关系数等,在此不做限定。It can be understood that the above-mentioned determination of the similarity of the spatial distance and color distance between the icons to be laid out by the Pearson correlation coefficient is just an example. In other embodiments, it can also be determined by other methods, for example, the Spearman correlation coefficient , Kendall correlation coefficient, etc., are not limited here.
可以理解,上述通过相关系数确定待布局图标间的空间距离和颜色距离的相似度只是一种示例,在另一些实施例中也可以通过其他方法来确定,在此不做限定。It can be understood that the determination of the similarity of the spatial distance and the color distance between the icons to be laid out by using the correlation coefficient is just an example, and it can also be determined by other methods in other embodiments, which is not limited here.
在一些实施例中,手机100确定出使待布局图标间的空间距离和颜色距离的相似度最大的布局方案可以转换为一个最优化的问题,通过线性规划、遗传算法、模拟退火算法等求解该最优化问题,并以该最优化问题的解作为使待布局图标间的空间距离和颜色距离的相似度最高的布局方案,具体将在下文进行描述,在此不做赘述。例如,图10A根据本申请的一些实施例,示出了图1中(A)图所示的显示界面中的图标进行模拟布局生成的布局方案,其中第1个位置至第17个位置的具体分布可以参考图10B。在图10A中,第i行第j列的值为1即表示第i个图标布局到图10B中的第j个位置。例如,第5行第15列对应的值为1,则说明第5个图标(“备忘录”图标)布局到图B所示的第15个位置。In some embodiments, the mobile phone 100 determines that the layout scheme that maximizes the similarity between the spatial distance and the color distance between the icons to be laid out can be transformed into an optimization problem, which is solved by linear programming, genetic algorithm, simulated annealing algorithm, etc. An optimization problem, and the solution of the optimization problem is used as the layout scheme that maximizes the similarity between the spatial distance and the color distance between the icons to be laid out, which will be described in detail below, and will not be repeated here. For example, according to some embodiments of the present application, FIG. 10A shows a layout scheme in which the icons in the display interface shown in (A) of FIG. The distribution can refer to Fig. 10B. In FIG. 10A , the value of row i and column j is 1, which means that the i-th icon is laid out at the j-th position in FIG. 10B . For example, if the value corresponding to the 5th row and 15th column is 1, it means that the 5th icon ("memo" icon) is laid out at the 15th position shown in Figure B.
可以理解,在一些实施例中,确定出的布局方案也可以不是使布局图标间的空间距离和颜色距离的相似度最大的布局方案,而是使布局图标间的空间距离和颜色距离的相似度大于相似度阈值的布局方案,例如相似度阈值大于0.5的布局方案,本申请实施例不做限定。It can be understood that in some embodiments, the determined layout scheme may not be the layout scheme that maximizes the similarity between the spatial distance and the color distance between the layout icons, but the one that maximizes the similarity between the spatial distance and the color distance between the layout icons. Layout schemes greater than the similarity threshold, for example, layout schemes with a similarity threshold greater than 0.5, are not limited in this embodiment of the present application.
S504:根据确定出的布局方案调整待布局图标的位置。即是手机100根据步骤S503确定出的使待布局图标间的空间距离和颜色距离的相似度最大的布局方案调整待布局图标的位置。例如,手机100可以根据图10A所示的布局方案将图1中(A)图所示的手机100的显示界面中的图标进行重新布局,得到图1中(B)图所示的显示界面。从图1中(B)图所示的显示界面可以看出,颜色相似的图标布局在了相近的位置,使得该界面体现的前述格式塔理论中的相似性原则和接近性原则的一致性较高,降低了手机100的显示界面的视觉复杂度,提高了手机100的显示界面的界面简洁性。S504: Adjust the positions of the icons to be laid out according to the determined layout scheme. That is, the mobile phone 100 adjusts the positions of the icons to be laid out according to the layout scheme determined in step S503 that maximizes the similarity between the spatial distance and the color distance between the icons to be laid out. For example, the mobile phone 100 can rearrange the icons in the display interface of the mobile phone 100 shown in (A) in FIG. 1 according to the layout scheme shown in FIG. 10A to obtain the display interface shown in (B) in FIG. 1 . It can be seen from the display interface shown in (B) in Figure 1 that the icons with similar colors are arranged in similar positions, which makes the similarity principle and proximity principle in the Gestalt theory reflected in this interface relatively consistent. High, reduces the visual complexity of the display interface of the mobile phone 100, and improves the interface simplicity of the display interface of the mobile phone 100.
下面对前述步骤S503中通过将确定出使待布局图标间的空间距离和颜色距离的相似度最大的布局方案转换为最优化的问题来确定使待布局图标间的空间距离和颜色距离的相似度最高的布局方案,进行介绍。Next, in the foregoing step S503, determine the similarity between the spatial distance and the color distance between the icons to be laid out by converting the layout scheme that determines the maximum similarity between the space distance and the color distance between the icons to be laid out into an optimization problem. The layout scheme with the highest degree of precision is introduced.
手机100可以将图1中(A)图所示的显示界面中的17个待布局图标进行编号(参考图7所示矩阵),并将该界面中各待布局图标所在区域(也可以是各待布局图标的中心坐标)标记为图10B所示的17个 布局位置,从而将确定使待布局图标间的空间距离和颜色距离的相似度最大的布局方案转换为公式(8)所示的最优化问题,即在满足公式(8)所示的约束条件下,使得S im的和Σs im最小的x ij(i、j=1,2,……,17)值即是使待布局图标间的空间距离和颜色距离的相似度最高的布局方案。 The mobile phone 100 can number the 17 icons to be laid out in the display interface shown in (A) in FIG. 1 (refer to the matrix shown in FIG. The central coordinates of the icons to be laid out) are marked as the 17 layout positions shown in Figure 10B, so that the layout scheme that determines the maximum similarity between the space distance and the color distance between the icons to be laid out is converted into the maximum position shown in formula (8). Optimization problem, that is, under the constraints shown in formula (8), the x ij (i, j=1, 2, ... , 17) value that makes the sum of Sim and Σs im the smallest is to make the layout icon space The layout scheme with the highest similarity between the spatial distance and the color distance.
Figure PCTCN2022126443-appb-000017
Figure PCTCN2022126443-appb-000017
在公式(8)中:In formula (8):
x ij、d ijmn、y ijmn的取值为0或1; The values of x ij , d ijmn and y ijmn are 0 or 1;
x ij表示第i个图标布局在第j个布局位置,即是在i个图标布局在第j个布局位置的情况下,x ij=1,否则x ij=0; x ij indicates that the i-th icon is laid out at the j-th layout position, that is, when the i-th icon is laid out at the j-th layout position, x ij =1, otherwise x ij =0;
约束条件①表明一个布局位置只能布局一个图标; Constraint ① indicates that only one icon can be laid out in one layout position;
约束条件②表明一个图标只能布局在一个布局位置;The constraint condition ② indicates that an icon can only be placed in one layout position;
y ijmn表示第i个图标布局在第j个布局位置且第m个图标在第n个布局位置,即是在第i个图标布局在第j个布局位置且第m个图标布局在第n个布局位置的情况下,y ijmn=1,否则y ijmn=0; y ijmn means that the i-th icon layout is at the j-th layout position and the m-th icon is at the n-th layout position, that is, the i-th icon is at the j-th layout position and the m-th icon is at the n-th layout In the case of layout position, y ijmn = 1, otherwise y ijmn = 0;
约束条件③用于根据x ij和x mn确定y ijmn的值,也即是在x ij=且x mn=1(第i个图标布局在第j个布局位置且第m个图标在第n个布局位置)的情况下,yijmn=1; Constraint condition ③ is used to determine the value of y ijmn according to x ij and x mn , that is, when x ij = and x mn =1 (the i-th icon layout is at the j-th layout position and the m-th icon is at the n-th In the case of layout position), yijmn=1;
d ijmn表示第i个图标在第j个布局位置且第m个图标在第n个布局位置时,第i个图标和第m个图标间的距离; d ijmn indicates the distance between the i-th icon and the m-th icon when the i-th icon is at the j-th layout position and the m-th icon is at the n-th layout position;
z im表示第i个图标和第m个图标间的空间距离,也即是约束条件④用于计算第j个图标和第n个图标间的空间距离; z im represents the spatial distance between the i-th icon and the m-th icon, that is, the constraint condition ④ is used to calculate the spatial distance between the j-th icon and the n-th icon;
c im表示第i个图标和第m个图标间的颜色距离, c im represents the color distance between the i-th icon and the m-th icon,
s im为第i个图标和第m个图标间的空间距离和颜色距离的差的绝对值(约束条件⑤),用于通过Σs im来表征一个布局方案中待布局图标间的空间距离和颜色距离的相似度,Σs im的值越小,说明相似度越大,也即是公式(8)所示的最优化问题的解即为满足约束条件①至⑤且使Σs im的x ijs im is the absolute value of the difference between the spatial distance and color distance between the i-th icon and the m-th icon (constraint condition ⑤), which is used to represent the spatial distance and color between icons to be laid out in a layout scheme through Σs im For the similarity of distance, the smaller the value of Σs im is, the greater the similarity is, that is, the solution of the optimization problem shown in formula (8) is the x ij that satisfies constraints ① to ⑤ and makes Σs im .
可以理解,在一些实施例中,布局方案可以用一个布局矩阵来表示,行表示布局位置,列表示待布局图标,布局矩阵中第i行第j列的元素为1,即说明第i个图标布局在第j个布局位置。在一些实施例中,可以以前述公式(8)确定出的各x ij的取值为布局矩阵中第i行第j列的值。 It can be understood that, in some embodiments, the layout scheme can be represented by a layout matrix, where the row indicates the layout position, and the column indicates the icon to be laid out, and the element in the i-th row and the j-th column in the layout matrix is 1, which means that the i-th icon Layout at the jth layout position. In some embodiments, the value of each x ij determined by the foregoing formula (8) is the value of row i and column j in the layout matrix.
通过本申请实施例提供的方法,手机100可以根据待布局图标间的颜色特征自动对待布局图标进行布局,提升了用户体验。此外,由于确定出的布局方案中各待布局图标间的空间距离与各待布局图标间的颜色距离的相似度最高,使得根据该布局方案布局后的界面体现的前述格式塔理论中的相似性原则和接近性原则的一致性较高,从而使得布局后的界面视觉复杂度较低、界面简洁性较高,进一步提升用户体验。Through the method provided in the embodiment of the present application, the mobile phone 100 can automatically arrange the icons to be arranged according to the color characteristics between the icons to be arranged, which improves the user experience. In addition, since the spatial distance between the icons to be laid out in the determined layout scheme and the color distance between the icons to be laid out have the highest similarity, the similarity in the aforementioned Gestalt theory embodied in the interface after layout according to the layout scheme is the highest. The consistency of the principle and the principle of proximity is high, so that the visual complexity of the interface after the layout is low, and the interface is simple, which further improves the user experience.
如前所述,在一些实施例中,待布局元素还可以为语义特征,例如,参考图11,在手机100的下 拉菜单界面显示有手机100的多个图标,各图标的颜色相近,可以按照各图标的语义特征,例如各图标对应的应用程序/功能的类型对图标进行布局。下面结合图11所示的场景,以待布局元素为手机100的下拉菜单界面中的图标、布局特征为语义特征为例,介绍本申请实施例的技术方案。As mentioned above, in some embodiments, the elements to be laid out can also be semantic features. For example, referring to FIG. Semantic features of each icon, such as the type of application program/function corresponding to each icon, layout the icons. Combining with the scenario shown in FIG. 11 , the technical solutions of the embodiments of the present application are introduced below by taking the elements to be laid out as icons in the drop-down menu interface of the mobile phone 100 and the layout features as semantic features as examples.
具体地,图12根据本申请的一些实施例,示出了一种布局方法的流程示意图。该流程的执行主体为手机100,如图12所示,该方法包括如下步骤。Specifically, FIG. 12 shows a schematic flowchart of a layout method according to some embodiments of the present application. The subject of execution of the process is the mobile phone 100, as shown in FIG. 12, the method includes the following steps.
S1201:检测到布局指令。即是手机100在检测到用户的布局指令的情况下,通过本申请实施例提供的布局方法对手机100下拉菜单界面中的图标进行自动布局。S1201: A layout instruction is detected. That is, when the mobile phone 100 detects the user's layout instruction, it automatically layouts the icons in the drop-down menu interface of the mobile phone 100 through the layout method provided by the embodiment of the present application.
在一些实施例中,参考图13,用户可以通过点击手机100的下拉菜单界面中的“编辑控件”131触发下拉菜单界面的“编辑菜单”132,再通过打开“智能图标布局”开关1321触发布局指令。手机100在检测到用户打开“智能图标布局”开关1321后,即可根据本申请实施例提供的布局方法对手机100下拉菜单界面中的图标进行自动布局。In some embodiments, referring to FIG. 13 , the user can trigger the “edit menu” 132 of the drop-down menu interface by clicking the “edit control” 131 in the drop-down menu interface of the mobile phone 100, and then trigger the layout by turning on the “smart icon layout” switch 1321 instruction. After the mobile phone 100 detects that the user has turned on the "smart icon layout" switch 1321, it can automatically layout the icons in the drop-down menu interface of the mobile phone 100 according to the layout method provided by the embodiment of the present application.
可以理解,在另一些实施例中,手机100在检测到自动布局的手势、操作等后,触发本申请实施例提供的布局方法,在此不做限定。It can be understood that, in other embodiments, the mobile phone 100 triggers the layout method provided in the embodiment of the present application after detecting the automatic layout gesture, operation, etc., which is not limited here.
S1202:获取待布局图标的语义数据,并基于语义数据确定待布局图标间的语义距离。也即是手机100获取下拉菜单界面中的待布局图标的语义数据,例如各图标对应的应用程序/功能的类型,并基于语义数据确定待布局图标两两之间的语义距离。S1202: Acquire semantic data of icons to be laid out, and determine a semantic distance between icons to be laid out based on the semantic data. That is, the mobile phone 100 obtains the semantic data of the icons to be laid out in the drop-down menu interface, such as the type of application/function corresponding to each icon, and determines the semantic distance between two icons to be laid out based on the semantic data.
具体地,在一些实施例中,手机100可以从应用市场程序中获取待布局图标对应的应用程序/功能的类型,同一类型的应用程序/功能对应的图标间的语义距离记为0,不同类型的应用程序/功能对应的图标间的语义距离记为1。Specifically, in some embodiments, the mobile phone 100 can obtain the type of application/function corresponding to the icon to be laid out from the application market program, and the semantic distance between icons corresponding to the same type of application/function is recorded as 0, and the semantic distance between icons of different types The semantic distance between the icons corresponding to the application program/function is recorded as 1.
在另一些实施例中,手机100还可以获取不同用户对图标进行分类的数据,利用神经网络、无监督学习等方法对不同图标的语义进行分类(聚类),并将分为同一类的图标间的语义距离记为0,不同类的图标间的语义距离记为1。例如,图14示出了一种对图11所示的下拉菜单界面中的图标进行聚类的结果,如图14所示,横轴表示不同的图标,纵轴表示聚类阈值,手机100可以根据预设聚类阈值聚类结果进行裁切,并基于裁切到的分类线的数量对图标进行分类。例如,参考图14,手机100可以以预设聚类阈值15对聚类结果进行裁切,将图标分为5类,即类别C1、C2、C3、C4和C5,并将属于同一类的图标间的语义距离记为0、不同类的图标间的语义距离记为1,例如“WLAN”图标(即图中mywifi及左侧图标)、“蓝牙”图标、“飞行模式”图标、“移动数据”图标、“热点”图标、“华为分享”图标和“5G”图标都属于类别C1,则将上述7个图标间的语义距离记为0。In some other embodiments, the mobile phone 100 can also obtain data on icons classified by different users, use neural networks, unsupervised learning and other methods to classify (cluster) the semantics of different icons, and classify icons classified into the same category The semantic distance between icons is recorded as 0, and the semantic distance between different types of icons is recorded as 1. For example, FIG. 14 shows a result of clustering icons in the pull-down menu interface shown in FIG. 11. As shown in FIG. 14, the horizontal axis represents different icons, and the vertical axis represents the clustering threshold. The clustering results are cropped according to the preset clustering threshold, and the icons are classified based on the number of cropped classification lines. For example, referring to FIG. 14 , the mobile phone 100 can cut the clustering results with a preset clustering threshold of 15, classify icons into five categories, namely categories C1, C2, C3, C4 and C5, and classify icons belonging to the same category The semantic distance between icons is recorded as 0, and the semantic distance between different types of icons is recorded as 1, such as the "WLAN" icon (that is, mywifi and the icon on the left in the figure), the "Bluetooth" icon, the "airplane mode" icon, the "mobile data " icon, "Hotspot" icon, "Huawei Sharing" icon and "5G" icon all belong to category C1, and the semantic distance between the above seven icons is recorded as 0.
可以理解,在另一些实施例中,还可以通过其他方式确定各图标间的语义距离,在此不做限定。It can be understood that, in some other embodiments, the semantic distance between icons may also be determined in other ways, which is not limited here.
可以理解,在一些实施例中,待布局图标间的语义距离也可以用矩阵进行表示,具体可以参考前述步骤S502中颜色距离的表示方式,在此不做赘述。It can be understood that, in some embodiments, the semantic distance between the icons to be laid out can also be represented by a matrix. For details, reference can be made to the representation of the color distance in the aforementioned step S502 , which will not be repeated here.
S1203:确定出使待布局图标间的空间距离和语义距离的相似度最大的布局方案。也即是手机100模拟调整待布局图标的位置,生成使待布局图标间的空间距离和语义距离的相似度最大的布局方案。例如,手机100可以基于待布局图标间的空间距离和语义距离的相关系数确定待布局图标间的空间距离和语义距离的相似度,具体可以参考上述步骤S503,在此不做赘述。S1203: Determine a layout scheme that maximizes the similarity between the spatial distance and the semantic distance between the icons to be laid out. That is, the mobile phone 100 simulates and adjusts the positions of the icons to be laid out, and generates a layout scheme that maximizes the similarity between the spatial distance and the semantic distance between the icons to be laid out. For example, the mobile phone 100 may determine the similarity between the spatial distance and the semantic distance between the icons to be laid out based on the correlation coefficient of the space distance and the semantic distance between the icons to be laid out. For details, refer to the above step S503, which will not be repeated here.
可以理解,在另一些实施例中,确定出的布局方案也可以不是使待布局图标间的空间距离和语义距离的相似度最大的布局方案,而是使待布局图标间的空间距离和语义距离的相似度大于相似度阈值的布局方案,例如相似度大于0.5的布局方案,在此不做限定。It can be understood that in some other embodiments, the determined layout scheme may not be the layout scheme that maximizes the similarity between the spatial distance and the semantic distance between the icons to be laid out, but the space distance and the semantic distance between the icons to be laid out The layout schemes whose similarity is greater than the similarity threshold, for example, the layout schemes whose similarity is greater than 0.5, are not limited here.
S1204:根据确定出的布局方案调整待布局图标的位置。即是手机100根据前述步骤S1203确定的 布局方案,调整下拉菜单界面中各待布局图标的位置。例如,图15示出了一出了手机100基于图14所示的对待布局图标的聚类结果确定的布局方案,调整图11所示的手机100的下拉菜单界面中的图标后的界面示意图。如图14所示,图14中分为同一类的图标布局在了相邻的位置,使得该界面体现的前述格式塔理论中的相似性原则和接近性原则的一致性较高,降低了手机100的显示下拉菜单界面的视觉复杂度,提高了手机100的下拉菜单界面的界面简洁性。S1204: Adjust the positions of the icons to be laid out according to the determined layout scheme. That is, the mobile phone 100 adjusts the positions of the icons to be laid out in the drop-down menu interface according to the layout scheme determined in the aforementioned step S1203. For example, FIG. 15 shows a schematic diagram of the interface after the mobile phone 100 adjusts the icons in the drop-down menu interface of the mobile phone 100 shown in FIG. As shown in Figure 14, the icons classified into the same category in Figure 14 are arranged in adjacent positions, so that the consistency of the similarity principle and proximity principle in the aforementioned Gestalt theory embodied in this interface is relatively high, reducing the need for mobile phones. The visual complexity of the display drop-down menu interface of 100 improves the interface simplicity of the drop-down menu interface of the mobile phone 100 .
通过本申请实施例提供的方法,手机100可以根据待布局图标间的语义特征自动对待布局图标进行布局,提升了用户体验。此外,由于确定出的布局方案中各待布局图标间的空间距离与各待布局图标间的语义距离的相似度最高,使得根据该布局方案布局后的界面体现的前述格式塔理论中的相似性原则和接近性原则的一致性较高,从而使得布局后的界面视觉复杂度较低、界面简洁性较高,进一步提升用户体验。Through the method provided in the embodiment of the present application, the mobile phone 100 can automatically layout the icons to be laid out according to the semantic features between the icons to be laid out, which improves the user experience. In addition, due to the highest similarity between the spatial distance between the icons to be laid out and the semantic distance between the icons to be laid out in the determined layout plan, the similarity in the aforementioned Gestalt theory reflected in the interface after layout according to the layout plan The consistency of the principle and the principle of proximity is high, so that the visual complexity of the interface after the layout is low, and the interface is simple, which further improves the user experience.
可以理解,在一些实施例中,手机100还可以同时基于多种布局特征进行自动布局。例如先将待布局元素按照语义特征进行布局,再将语义上属于同一类的布局元素按照颜色特征进行布局;又例如,手机100可以同时以语义特征和颜色特征为布局特征,即是以一个多维向量表示一个待布局元素的布局特征,并以各待布局元素对应的多维向量间的距离,例如欧氏距离、曼哈顿距离、切比雪夫距离、闵可夫斯基距离、标准化欧氏距离、马氏距离、夹角余弦、汉明距离等为待布局元素间的布局特征距离,再确定出使待布局元素间的布局特征距离和空间距离间的相似度最大的布局方案,并根据该布局方案对待布局元素进行自动布局。It can be understood that, in some embodiments, the mobile phone 100 can also perform automatic layout based on multiple layout features at the same time. For example, the elements to be laid out are first laid out according to the semantic features, and then the layout elements that belong to the same category semantically are laid out according to the color features; The vector represents the layout feature of an element to be laid out, and the distance between multidimensional vectors corresponding to each element to be laid out, such as Euclidean distance, Manhattan distance, Chebyshev distance, Minkowski distance, standardized Euclidean distance, Mahalanobis distance , included angle cosine, Hamming distance, etc. are the layout feature distances between the elements to be laid out, and then determine the layout scheme that maximizes the similarity between the layout feature distance and the space distance between the elements to be laid out, and treat the layout according to the layout scheme Elements are automatically laid out.
本申请实施例还提供了一种布局评价方法,通过获取待评价布局中各布局元素间的布局特征,例如颜色特征、语义特征等,确定各布局元素间的布局特征距离,例如颜色距离、语义距离等,再基于各布局元素间的布局特征距离与各布局元素间的空间距离间的相似度,确定待评价布局的评价值。其中,各布局元素间的布局特征距离与各布局元素间的空间距离间的相似度越高、评价值越高,待评价布局对应的界面的视觉复杂度越低、界面简洁性越高。如此,电子设备可以基于待评价布局的评价值对该布局进行调整,以获得评价值更高的布局方案,也即是电子设备显示的界面的视觉复杂度低、界面简洁性高的布局方案。The embodiment of the present application also provides a layout evaluation method, which determines the layout feature distance between each layout element, such as color distance, semantic feature, etc. The evaluation value of the layout to be evaluated is determined based on the similarity between the layout feature distance between each layout element and the spatial distance between each layout element. Among them, the higher the similarity between the layout feature distance between each layout element and the spatial distance between each layout element, the higher the evaluation value, the lower the visual complexity and the higher the interface simplicity of the interface corresponding to the layout to be evaluated. In this way, the electronic device can adjust the layout based on the evaluation value of the layout to be evaluated to obtain a layout scheme with a higher evaluation value, that is, a layout scheme with low visual complexity and high simplicity of the interface displayed by the electronic device.
下面继续以电子设备为手机100为例,介绍本申请实施例的技术方案。In the following, continue to take the mobile phone 100 as an example of the electronic device to introduce the technical solution of the embodiment of the present application.
具体地,图16根据本申请的一些实施例,示出了一种布局评价方法的流程示意图。该流程的执行主体为手机100,如图16所示,该方法包括如下步骤。Specifically, Fig. 16 shows a schematic flowchart of a layout evaluation method according to some embodiments of the present application. The subject of execution of the process is the mobile phone 100, as shown in FIG. 16, the method includes the following steps.
S1601:获取待评价布局中各布局元素间的布局特征和位置数据。也即是手机100获取待评价布局中的各布局元素的布局特征,例如各布局元素的颜色数据、语义数据等,以及各布局元素的位置数据,例如各布局元素的中心在手机100的显示屏194上的像素坐标。S1601: Obtain layout features and position data between layout elements in the layout to be evaluated. That is, the mobile phone 100 obtains the layout features of each layout element in the layout to be evaluated, such as the color data, semantic data, etc. of each layout element, and the position data of each layout element, such as the center of each layout element on the display screen Pixel coordinates on 194.
例如,在待评价布局为图1中(A)图所示的布局的情况下,布局元素可以为图1中(A)图所示的显示界面中的图标,布局特征可以是各图标的主色,各图标的位置数据可以是图8A所示的网格位置,也可以是图8B所示的像素坐标,在此不做限定。For example, when the layout to be evaluated is the layout shown in (A) in Figure 1, the layout elements can be icons in the display interface shown in (A) in Figure 1, and the layout feature can be the main feature of each icon. The position data of each icon may be the grid position shown in FIG. 8A, or the pixel coordinates shown in FIG. 8B, which is not limited here.
又例如,在待评价布局为图11所示的布局的情况下,布局元素可以为图11所示的下拉菜单界面中的图标,布局特征可以是各图标对应的应用程序/功能的语义,各图标的位置数据可以是各图标的中心在手机100的显示屏上的像素坐标。For another example, when the layout to be evaluated is the layout shown in Figure 11, the layout elements can be the icons in the drop-down menu interface shown in Figure 11, and the layout feature can be the semantics of the application/function corresponding to each icon, each The location data of the icons may be the pixel coordinates of the center of each icon on the display screen of the mobile phone 100 .
再例如,在图17所示的场景中,待评价布局为灰度图形1至灰度图形8按照顺序1、2、……、7、8排列的布局A,布局元素为图形1至图形8,布局特征为图形1至图形8的灰度值。For another example, in the scene shown in Figure 17, the layout to be evaluated is layout A in which grayscale graphics 1 to grayscale graphics 8 are arranged in the order of 1, 2, ..., 7, 8, and the layout elements are graphics 1 to 8 , the layout feature is the gray value of graph 1 to graph 8.
S1602:确定各布局元素的布局特征距离和空间距离。即是手机100根据各布局元素的布局特征确 定各布局元素的布局特征距离、根据各布局元素的位置数据确定各布局元素的空间距离。S1602: Determine the layout feature distance and spatial distance of each layout element. That is, the mobile phone 100 determines the layout feature distance of each layout element according to the layout feature of each layout element, and determines the spatial distance of each layout element according to the position data of each layout element.
例如,在待评价布局为图1中(A)图所示的布局的情况下,各图标间的布局特征距离可以是各图标的主色的颜色距离,具体可以参考上文图7的相关描述,在此不做赘述;各图标的空间距离可以是各图标的像素坐标间的距离,具体可以参考上文图9的相关描述,在此不做赘述。For example, when the layout to be evaluated is the layout shown in Figure 1 (A), the layout feature distance between icons can be the color distance of the main color of each icon. For details, please refer to the relevant description in Figure 7 above , which will not be described in detail here; the spatial distance of each icon may be the distance between the pixel coordinates of each icon, for details, refer to the relevant description in FIG. 9 above, and will not be described in detail here.
又例如,在待评价布局为图11所示的布局的情况下,各图标间的特征距离可以是各图标的语义距离,具体可以参考前述图14的相关描述,在此不做赘述;各图标间的空间距离可以为各图标的中心在手机100的显示屏194上的像素坐标间的距离,具体可以参考前述步骤S1203的相关描述,在此不做赘述。For another example, when the layout to be evaluated is the layout shown in Figure 11, the characteristic distance between the icons may be the semantic distance of each icon, for details, refer to the relevant description in Figure 14 above, which will not be repeated here; each icon The spatial distance between them may be the distance between the pixel coordinates of the center of each icon on the display screen 194 of the mobile phone 100, for details, please refer to the relevant description of the aforementioned step S1203, which will not be repeated here.
再例如,在图17所示的场景中,布局A中各布局元素的布局特征距离可以是各图形间的灰度值之差的绝对值,例如图形1的灰度值为0,图形2的灰度值为180,则图形1和图形2的布局特征距离为180;各布局元素的空间距离可以是可图形的排序号之间的距离,例如图形1的排序号为1,图形4的排序号为4,则图形1和图形4的空间距离为3。可以理解,参考图17,在一些实施例中,图形1至图形8两两之间的布局特征距离和空间距离可以通过矩阵表示。For another example, in the scene shown in Figure 17, the layout feature distance of each layout element in layout A can be the absolute value of the gray value difference between the graphics, for example, the gray value of graphic 1 is 0, and the gray value of graphic 2 If the grayscale value is 180, then the layout feature distance between graphic 1 and graphic 2 is 180; the spatial distance of each layout element can be the distance between the graphic sorting numbers, for example, the sorting number of graphic 1 is 1, and the sorting number of graphic 4 number is 4, then the spatial distance between graphic 1 and graphic 4 is 3. It can be understood that, referring to FIG. 17 , in some embodiments, the layout feature distances and spatial distances between two figures 1 to 8 can be represented by a matrix.
S1603:根据各布局元素的布局特征距离和空间距离的相似度,确定待评价布局的评价值。即是手机100根据待评价布局中各布局元素的布局特征距离和空间距离的相似度确定待评价布局的评价值,各布局元素的布局特征距离和空间距离的相似度越高,评价值越高,待评价布局对应的显示界面的视觉复杂度越低、界面简洁性越高。S1603: Determine the evaluation value of the layout to be evaluated according to the similarity between the layout feature distance and the spatial distance of each layout element. That is, the mobile phone 100 determines the evaluation value of the layout to be evaluated according to the similarity between the layout feature distance and the spatial distance of each layout element in the layout to be evaluated, and the higher the similarity between the layout feature distance and the spatial distance of each layout element, the higher the evaluation value , the lower the visual complexity of the display interface corresponding to the layout to be evaluated, the higher the simplicity of the interface.
在一些实施例中,可以基于前述步骤S503的方法,计算各布局元素的布局特征距离和空间距离的相关系数,并以计算得到的相关系数作为待评价布局的评价值。In some embodiments, the correlation coefficient between the layout feature distance and the spatial distance of each layout element can be calculated based on the method in the aforementioned step S503, and the calculated correlation coefficient can be used as the evaluation value of the layout to be evaluated.
例如,在待评价布局为图1中(A)图所示的布局的情况下,该布局的评价值可以为前述实例计算得到的相关系数0.2078。For example, if the layout to be evaluated is the layout shown in (A) in FIG. 1 , the evaluation value of the layout may be the correlation coefficient 0.2078 calculated in the foregoing example.
又例如,在待评价布局为图1中(B)图所示的布局的情况下,该布局的评价值可以为前述实例计算得到的相关系数0.6039。For another example, when the layout to be evaluated is the layout shown in (B) in FIG. 1 , the evaluation value of the layout may be the correlation coefficient 0.6039 calculated in the foregoing example.
再例如,在图17所示的场景中,基于前述公式(7)和图17中的布局特征距离矩阵和空间距离矩阵可以确定布局A的评价值为0.0658。进一步,图18示出了图17中所示的图形1至图形8按照不同顺序进行排列的布局A、布局B、布局C、布局D、布局E和布局F以及各布局对应的评价值。参考图18,布局A、布局B、布局C、布局D、布局E和布局F的评价值分别为0.0658、0.2632、0.329、0.329、0.5264、0.7237,各布局的评价值随着布局中各图形的灰度值距离和空间距离的相似度的增加而增加,也即是评价值越高,布局的视觉复杂度越低、简洁性越高。For another example, in the scene shown in FIG. 17 , based on the foregoing formula (7) and the layout feature distance matrix and the space distance matrix in FIG. 17 , it can be determined that the evaluation value of layout A is 0.0658. Further, FIG. 18 shows layout A, layout B, layout C, layout D, layout E, and layout F arranged in different order from graph 1 to graph 8 shown in FIG. 17 and the evaluation values corresponding to each layout. Referring to Figure 18, the evaluation values of layout A, layout B, layout C, layout D, layout E, and layout F are 0.0658, 0.2632, 0.329, 0.329, 0.5264, and 0.7237, respectively. The similarity between the gray value distance and the spatial distance increases, that is, the higher the evaluation value, the lower the visual complexity and the higher the simplicity of the layout.
通过本申请实施例提供的方法,手机100可以基于对待评价布局对应的界面的视觉复杂度、界面简洁性进行评价,生成该布局的评价值,以便于手机100基于评价值对该布局进行调整,以获得评价值更高的布局方案,也即是手机100显示的界面的视觉复杂度低、界面简洁性高的布局方案。Through the method provided in the embodiment of the present application, the mobile phone 100 can evaluate the visual complexity and simplicity of the interface corresponding to the layout to be evaluated, and generate an evaluation value of the layout, so that the mobile phone 100 can adjust the layout based on the evaluation value, A layout scheme with a higher evaluation value is obtained, that is, a layout scheme with low visual complexity and high simplicity of the interface displayed on the mobile phone 100 .
图19根据本申请的一些实施例,示出了一种手机100的结构示意图。Fig. 19 shows a schematic structural diagram of a mobile phone 100 according to some embodiments of the present application.
如图19所示,手机100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,加速度传感器180E,指纹传感器180H,触摸传感器180K,环境光传感器 180L等。As shown in Figure 19, the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, A display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, an acceleration sensor 180E, a fingerprint sensor 180H, a touch sensor 180K, an ambient light sensor 180L and the like.
可以理解的是,本申请实施例示意的结构并不构成对手机100的具体限定。在本申请另一些实施例中,手机100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure shown in the embodiment of the present application does not constitute a specific limitation on the mobile phone 100 . In some other embodiments of the present application, the mobile phone 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。在一些实施例中,处理器110可以调用并执行存储器中存储的本申请各实施例提供的布局方法/布局评价方法的执行指令,以实现本申请实施例所提供的布局方法/布局评价方法。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system. In some embodiments, the processor 110 may call and execute execution instructions of the layout method/layout evaluation method provided by the embodiments of the present application stored in the memory, so as to implement the layout method/layout evaluation method provided by the embodiments of the present application.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现手机100的触摸功能。The I2C interface is a bidirectional synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (derail clock line, SCL). In some embodiments, processor 110 may include multiple sets of I2C buses. The processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flashlight, the camera 193 and the like through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to realize the touch function of the mobile phone 100 .
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170 . In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through the Bluetooth headset.
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communication, sampling, quantizing and encoding the analog signal. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 and the wireless communication module 160 . For example: the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现手机100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现手机100的显示功能。The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 . MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI), etc. In some embodiments, the processor 110 communicates with the camera 193 through the CSI interface to realize the shooting function of the mobile phone 100 . The processor 110 communicates with the display screen 194 through the DSI interface to realize the display function of the mobile phone 100 .
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193 , the display screen 194 , the wireless communication module 160 , the audio module 170 , the sensor module 180 and so on. The GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为手机100充电,也可以用于手机100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface conforming to the USB standard specification, specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transmit data between the mobile phone 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.
充电管理模块140用于从充电器接收充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is configured to receive a charging input from a charger. While the charging management module 140 is charging the battery 142 , it can also supply power to the electronic device through the power management module 141 .
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。The power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 . The power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the display screen 194 , the camera 193 , and the wireless communication module 160 .
手机100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the mobile phone 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。 Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
移动通信模块150可以提供应用在手机100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the mobile phone 100 . The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor, convert it into electromagnetic wave and radiate it through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 . In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
无线通信模块160可以提供应用在手机100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system, etc. applied on the mobile phone 100 (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
手机100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The mobile phone 100 realizes the display function through the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED), 柔性发光二极管(flex light-emitting diode,FLED),Mini-LED,Micro-LED,Micro-OLED,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,手机100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Mini-LED, Micro-LED, Micro-OLED, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the mobile phone 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,手机100可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other image signals. In some embodiments, the mobile phone 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储手机100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器110中的存储器的指令,执行手机100的各种功能应用。The internal memory 121 may be used to store computer-executable program codes including instructions. The internal memory 121 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data (such as audio data, phone book, etc.) created during the use of the mobile phone 100 . In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like. The processor 110 executes various functional applications of the mobile phone 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor 110 .
手机100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The mobile phone 100 can realize the audio function through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 170 may also be used to encode and decode audio signals.
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。 Speaker 170A, also referred to as a "horn", is used to convert audio electrical signals into sound signals.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。Receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。The microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.
耳机接口170D用于连接有线耳机。The earphone interface 170D is used for connecting wired earphones.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。手机100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,手机100根据压力传感器180A检测所述触摸操作强度。手机100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于前述图13所示的“智能图标布局”开关1321时,执行按照语义特征布局的指令;当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于前述图13所示的“智能图标布局”开关1321时,执行按照颜色特征布局的指令。The pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, pressure sensor 180A may be disposed on display screen 194 . There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may be comprised of at least two parallel plates with conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The mobile phone 100 determines the strength of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the mobile phone 100 detects the intensity of the touch operation according to the pressure sensor 180A. The mobile phone 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation whose intensity is less than the first pressure threshold is applied to the “smart icon layout” switch 1321 shown in FIG. When the touch operation of the pressure threshold is applied to the “smart icon layout” switch 1321 shown in FIG. 13 , the instructions arranged according to the color characteristics are executed.
加速度传感器180E可检测手机100在各个方向上(一般为三轴)加速度的大小。当手机100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the acceleration of the mobile phone 100 in various directions (generally three axes). When the mobile phone 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
环境光传感器180L用于感知环境光亮度。手机100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测手机100是否在口袋里,以防误触。The ambient light sensor 180L is used for sensing ambient light brightness. The mobile phone 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the mobile phone 100 is in the pocket, so as to prevent accidental touch.
指纹传感器180H用于采集指纹。手机100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。在本申请实施例中,主空间和隐私空间可以采用不同的解锁指纹进行验证登录,以保障隐私空间内隐私数据的安全性。用户可以在手机100上验证不同的指纹分别进入主空间和隐私空间。The fingerprint sensor 180H is used to collect fingerprints. The mobile phone 100 can use the collected fingerprint features to realize fingerprint unlocking, access to the application lock, take pictures with the fingerprint, answer calls with the fingerprint, and the like. In this embodiment of the application, the main space and the private space may use different unlocking fingerprints for verification and login, so as to ensure the security of private data in the private space. The user can verify different fingerprints on the mobile phone 100 to enter the main space and the private space respectively.
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于手机100的表面,与显示屏194所处的位置不同。The touch sensor 180K is also called "touch device". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”. The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194 . In some other embodiments, the touch sensor 180K may also be disposed on the surface of the mobile phone 100 , which is different from the position of the display screen 194 .
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。手机100可以接收按键输入,产生与手机100的用户设置以及功能控制有关的键信号输入。The keys 190 include a power key, a volume key and the like. The key 190 may be a mechanical key. It can also be a touch button. The mobile phone 100 can receive key input and generate key signal input related to user settings and function control of the mobile phone 100 .
马达191可以产生振动提示。The motor 191 can generate a vibrating reminder.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
SIM卡接口195用于连接SIM卡。The SIM card interface 195 is used for connecting a SIM card.
可以理解,上述手机100所使用的操作系统可以是安卓 TM、IOS TM(Input Output System)以及鸿蒙(Harmony OS)等操作系统中的一种,在此不做限制。下面以鸿蒙操作系统为例,介绍手机100的软件架构图。 It can be understood that the operating system used by the above-mentioned mobile phone 100 may be one of Android , IOS (Input Output System) and Harmony OS (Harmony OS), which is not limited here. Taking the Hongmeng operating system as an example, the software architecture diagram of the mobile phone 100 is introduced below.
图20根据本申请的一些实施例,示出了一种手机100的软件架构示意图。如图20所示,手机100的软件架构主要包括:Fig. 20 shows a schematic diagram of a software architecture of a mobile phone 100 according to some embodiments of the present application. As shown in FIG. 20 , the software architecture of the mobile phone 100 mainly includes:
应用层20:可以包括系统应用21和扩展应用22(或第三方应用)。其中,系统应用21可以包括桌面211、设置212等。本申请各实施例提供的布局方法/布局评价方法可以由桌面应用为执行主体,也即是可以由桌面211获取手机100的显示界面中或下拉菜单中的图标的布局特征,例如颜色特征、语义特征等,并确定各图标间的布局特征距离,例如颜色距离、语义距离等,并确定出使各图标间的布局特征距离和空间距离的相似度最高的布局方案,在按照确定出的布局方案调整手机100的显示界面或下拉菜单中的图标。Application layer 20: may include system applications 21 and extension applications 22 (or third-party applications). Wherein, the system application 21 may include a desktop 211, a setting 212, and the like. The layout method/layout evaluation method provided by each embodiment of the present application can be executed by the desktop application, that is, the desktop 211 can obtain the layout characteristics of the icons in the display interface of the mobile phone 100 or in the drop-down menu, such as color characteristics and semantics. Features, etc., and determine the layout feature distance between icons, such as color distance, semantic distance, etc., and determine the layout scheme that makes the layout feature distance and space distance between icons the highest similarity, and then follow the determined layout scheme Adjust the display interface of the mobile phone 100 or the icons in the pull-down menu.
框架层30为应用层提供多语言框架,包括界面(User Interface,UI)框架31、用户程序框架32和能力框架33等。其中,UI框架31包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等,在此不做赘述。用户程序框架32和能力框架33可为应用程序提供应用所需的各能力部件的能力,例如运算能力(可以包括CPU算力、图形处理器(Graphics Processing Unit,GPU)算力、图像信号处理器(Image Signal Processor,ISP)算力等)、拾音能力(可以包括麦克风拾音能力、语音识别能力等)、设备安全防护方面的安全能力(可以包括可信任运行环境安全等级等)、显示能力(可以包括屏幕分辨率、屏幕尺寸等)、播放能力(包括扩音能力、立体声效能力等、以及存储能力(可以包括设备的内存能力、随机存取存储器(random access memory,RAM)能力等)等,在此不做限制。The framework layer 30 provides a multilingual framework for the application layer, including an interface (User Interface, UI) framework 31, a user program framework 32, and a capability framework 33. Wherein, the UI framework 31 includes a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc., which will not be repeated here. The user program framework 32 and the capability framework 33 can provide application programs with the capabilities of various capability components required by the application, such as computing power (may include CPU computing power, graphics processing unit (Graphics Processing Unit, GPU) computing power, image signal processor (Image Signal Processor, ISP) computing power, etc.), sound pickup capabilities (including microphone pickup capabilities, voice recognition capabilities, etc.), security capabilities in equipment security protection (including trusted operating environment security levels, etc.), display capabilities (can include screen resolution, screen size, etc.), playback capability (including sound amplification capability, stereo effect capability, etc., and storage capability (may include device memory capability, random access memory (RAM) capability, etc.) etc., no limitation here.
系统服务层40是手机100软件系统的核心,可以通过框架层30对应用层20的应用程序提供服务。 系统服务层40包括分布式软总线41、分布式数据管理模块42、分布式任务调度模块43等。其中:分布式软总线41用于将手机10与其他电子设备进行耦接,构成分布式系统;分布式数据管理模块42基于分布式软总线41,实现应用程序数据和用户数据的分布式管理。分布式任务调度模块43基于分布式软总线、分布式数据管理等技术特性,构建统一的分布式服务管理(发现、同步、注册、调用)机制,支持对跨设备的应用进行远程启动、远程调用、远程连接以及迁移等操作,能够根据不同设备的能力、位置、业务运行状态、资源使用情况,以及用户的习惯和意图,选择合适的设备运行任务。The system service layer 40 is the core of the software system of the mobile phone 100 and can provide services to the application programs of the application layer 20 through the framework layer 30 . The system service layer 40 includes a distributed soft bus 41, a distributed data management module 42, a distributed task scheduling module 43, and the like. Among them: the distributed soft bus 41 is used to couple the mobile phone 10 with other electronic devices to form a distributed system; the distributed data management module 42 is based on the distributed soft bus 41 to realize distributed management of application program data and user data. The distributed task scheduling module 43 builds a unified distributed service management (discovery, synchronization, registration, call) mechanism based on technical characteristics such as distributed soft bus and distributed data management, and supports remote startup and remote call of cross-device applications , remote connection, migration and other operations, can select the appropriate device to run tasks according to the capabilities, locations, business operation status, resource usage, and user habits and intentions of different devices.
内核层50包括内核子系统51和驱动子系统52。内核子系统51通过屏蔽多内核差异,对上层提供基础的内核能力,包括进程/线程管理、内存管理、文件系统、网络管理和外设管理等。驱动子系统52包括硬件驱动框架,硬件驱动框架可以为手机100提供统一外设访问能力和管理框架。The kernel layer 50 includes a kernel subsystem 51 and a driver subsystem 52 . The kernel subsystem 51 provides basic kernel capabilities to the upper layer by shielding differences between multiple kernels, including process/thread management, memory management, file system, network management, and peripheral management. The driver subsystem 52 includes a hardware driver framework, which can provide the mobile phone 100 with a unified peripheral device access capability and a management framework.
可以理解,图20所示的手机100的软件架构,只是一种示例,在其他的实施例中手机10也可以采用不同于上述图20的其他软件架构,本申请实施例不做限定。It can be understood that the software architecture of the mobile phone 100 shown in FIG. 20 is just an example. In other embodiments, the mobile phone 10 may also adopt other software architectures different from the above-mentioned FIG. 20 , which is not limited in this embodiment of the present application.
本申请公开的机制的各实施例可以被实现在硬件、软件、固件或这些实现方法的组合中。本申请的实施例可实现为在可编程系统上执行的计算机程序或程序代码,该可编程系统包括至少一个处理器、存储系统(包括易失性和非易失性存储器和/或存储元件)、至少一个输入设备以及至少一个输出设备。Various embodiments of the mechanisms disclosed in this application may be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of the present application may be implemented as a computer program or program code executed on a programmable system comprising at least one processor, a storage system (including volatile and non-volatile memory and/or storage elements) , at least one input device, and at least one output device.
可将程序代码应用于输入指令,以执行本申请描述的各功能并生成输出信息。可以按已知方式将输出信息应用于一个或多个输出设备。为了本申请的目的,处理系统包括具有诸如例如数字信号处理器(DSP)、微控制器、专用集成电路(ASIC)或微处理器之类的处理器的任何系统。Program code can be applied to input instructions to perform the functions described herein and to generate output information. The output information may be applied to one or more output devices in known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), microcontroller, application specific integrated circuit (ASIC), or microprocessor.
程序代码可以用高级程序化语言或面向对象的编程语言来实现,以便与处理系统通信。在需要时,也可用汇编语言或机器语言来实现程序代码。事实上,本申请中描述的机制不限于任何特定编程语言的范围。在任一情形下,该语言可以是编译语言或解释语言。The program code can be implemented in a high-level procedural language or an object-oriented programming language to communicate with the processing system. Program code can also be implemented in assembly or machine language, if desired. In fact, the mechanisms described in this application are not limited in scope to any particular programming language. In either case, the language may be a compiled or interpreted language.
在一些情况下,所公开的实施例可以以硬件、固件、软件或其任何组合来实现。所公开的实施例还可以被实现为由一个或多个暂时或非暂时性机器可读(例如,计算机可读)存储介质承载或存储在其上的指令,其可以由一个或多个处理器读取和执行。例如,指令可以通过网络或通过其他计算机可读介质分发。因此,机器可读介质可以包括用于以机器(例如,计算机)可读的形式存储或传输信息的任何机制,包括但不限于,软盘、光盘、光碟、只读存储器(CD-ROMs)、磁光盘、只读存储器(ROM)、随机存取存储器(RAM)、可擦除可编程只读存储器(EPROM)、电可擦除可编程只读存储器(EEPROM)、磁卡或光卡、闪存、或用于利用因特网以电、光、声或其他形式的传播信号来传输信息(例如,载波、红外信号数字信号等)的有形的机器可读存储器。因此,机器可读介质包括适合于以机器(例如,计算机)可读的形式存储或传输电子指令或信息的任何类型的机器可读介质。In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments can also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which can be executed by one or more processors read and execute. For example, instructions may be distributed over a network or via other computer-readable media. Thus, a machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including, but not limited to, floppy disks, optical disks, optical disks, read-only memories (CD-ROMs), magnetic Optical discs, read-only memory (ROM), random-access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic or optical cards, flash memory, or A tangible, machine-readable memory used to transmit information (eg, carrier waves, infrared signals, digital signals, etc.) by electrical, optical, acoustic, or other forms of propagating signals using the Internet. Thus, a machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).
在附图中,可以以特定布置和/或顺序示出一些结构或方法特征。然而,应该理解,可能不需要这样的特定布置和/或排序。而是,在一些实施例中,这些特征可以以不同于说明性附图中所示的方式和/或顺序来布置。另外,在特定图中包括结构或方法特征并不意味着暗示在所有实施例中都需要这样的特征,并且在一些实施例中,可以不包括这些特征或者可以与其他特征组合。In the drawings, some structural or methodological features may be shown in a particular arrangement and/or order. However, it should be understood that such specific arrangements and/or orderings may not be required. Rather, in some embodiments, these features may be arranged in a different manner and/or order than shown in the illustrative figures. Additionally, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments these features may not be included or may be combined with other features.
需要说明的是,本申请各设备实施例中提到的各单元/模块都是逻辑单元/模块,在物理上,一个逻辑单元/模块可以是一个物理单元/模块,也可以是一个物理单元/模块的一部分,还可以以多个物理单元/模块的组合实现,这些逻辑单元/模块本身的物理实现方式并不是最重要的,这些逻辑单元/模块所实现的功能的组合才是解决本申请所提出的技术问题的关键。此外,为了突出本申请的创新部分,本申请上述各设备实施例并没有将与解决本申请所提出的技术问题关系不太密切的单元/模块引入,这并不表明上述设备实施例并不存在其它的单元/模块。It should be noted that each unit/module mentioned in each device embodiment of this application is a logical unit/module. Physically, a logical unit/module can be a physical unit/module, or a physical unit/module. A part of the module can also be realized with a combination of multiple physical units/modules, the physical implementation of these logical units/modules is not the most important, the combination of functions realized by these logical units/modules is the solution The key to the technical issues raised. In addition, in order to highlight the innovative part of this application, the above-mentioned device embodiments of this application do not introduce units/modules that are not closely related to solving the technical problems proposed by this application, which does not mean that the above-mentioned device embodiments do not exist other units/modules.
需要说明的是,在本专利的示例和说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in the examples and descriptions of this patent, relative terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply There is no such actual relationship or order between these entities or operations. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
虽然通过参照本申请的某些优选实施例,已经对本申请进行了图示和描述,但本领域的普通技术人员应该明白,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。Although this application has been shown and described with reference to certain preferred embodiments thereof, those skilled in the art will understand that various changes in form and details may be made therein without departing from this disclosure. The spirit and scope of the application.

Claims (14)

  1. 一种布局方法,应用于电子设备,其特征在于,包括:A layout method applied to electronic equipment, characterized in that it comprises:
    获取多个待布局元素的布局特征;Obtain the layout characteristics of multiple elements to be laid out;
    基于各所述待布局元素的布局特征,确定各所述待布局元素两两间的布局特征距离,其中,各所述待布局元素间的布局特征的相似度越高,所述待布局元素间的布局特征距离越小;Based on the layout features of each of the elements to be laid out, determine the layout feature distance between each of the elements to be laid out, wherein the higher the similarity of the layout features between the elements to be laid out, the higher the The smaller the layout feature distance is;
    基于各所述待布局元素两两间的布局特征距离与各所述待布局元素两两间的空间距离之间的相似度,确定布局方案;Determine the layout scheme based on the similarity between the layout feature distance between the two elements to be laid out and the spatial distance between the two elements to be laid out;
    根据确定出的布局方案调整各所述待布局元素的位置。The position of each element to be laid out is adjusted according to the determined layout scheme.
  2. 根据权利要求1所述的方法,其特征在于,所述布局特征,包括以下特征中的至少一种:颜色特征、语义特征。The method according to claim 1, wherein the layout features include at least one of the following features: color features and semantic features.
  3. 根据权利要求2所述的方法,其特征在于,在所述布局特征为颜色特征的情况下,所述确定各所述待布局元素两两间的布局特征距离,包括:The method according to claim 2, wherein when the layout feature is a color feature, the determining the layout feature distance between each of the elements to be laid out includes:
    根据各所述待布局元素的布局特征,确定各待布局元素的特征颜色;Determine the characteristic color of each element to be laid out according to the layout feature of each element to be laid out;
    将各所述待布局元素两两间的特征颜色之间的颜色距离,确定各所述待布局元素两两间的布局特征距离;The color distance between the characteristic colors between the two elements to be laid out is determined to determine the layout feature distance between the two elements to be laid out;
    其中,在所述待布局元素的主色为单个的情况下,所述待布局元素的特征颜色为所述待布局元素的主色;Wherein, when the main color of the element to be laid out is single, the characteristic color of the element to be laid out is the main color of the element to be laid out;
    在所述待布局元素的主色为多个的情况下,所述待布局元素的特征颜色为所述待布局元素的多个主色的平均值。When there are multiple main colors of the elements to be laid out, the characteristic color of the elements to be laid out is an average value of the main colors of the elements to be laid out.
  4. 根据权利要求3所述的方法,其特征在于,所述各所述待布局元素两两间的特征颜色之间的颜色距离,包括以下距离中的任意一种:欧氏距离、曼哈顿距离、切比雪夫距离、闵可夫斯基距离、标准化欧氏距离、马氏距离、夹角余弦、汉明距离。The method according to claim 3, wherein the color distance between the characteristic colors of each of the elements to be laid out includes any one of the following distances: Euclidean distance, Manhattan distance, cut Bishev distance, Minkowski distance, normalized Euclidean distance, Mahalanobis distance, angle cosine, Hamming distance.
  5. 根据权利要求2所述的方法,其特征在于,在所述布局特征为颜色特征的情况下,所述确定各所述待布局元素两两间的布局特征距离,包括:The method according to claim 2, wherein when the layout feature is a color feature, the determining the layout feature distance between each of the elements to be laid out includes:
    根据各所述待布局元素的布局特征,确定各待布局元素的特征颜色;Determine the characteristic color of each element to be laid out according to the layout feature of each element to be laid out;
    将特征颜色属于同一色相的各所述待布局元素两两间的布局特征距离确定为0,将特征颜色属于不同色相的各所述待布局元素两两间的布局特征距离确定为1;Determining the layout feature distance between two elements to be laid out whose feature colors belong to the same hue as 0, and determining the layout feature distance between two elements to be laid out whose feature colors belong to different hues to be 1;
    其中,在所述待布局元素的主色为单个的情况下,所述待布局元素的特征颜色为所述待布局元素的主色;Wherein, when the main color of the element to be laid out is single, the characteristic color of the element to be laid out is the main color of the element to be laid out;
    在所述待布局元素的主色为多个的情况下,所述待布局元素的特征颜色为所述待布局元素的多个主色的平均值。When there are multiple main colors of the elements to be laid out, the characteristic color of the elements to be laid out is an average value of the main colors of the elements to be laid out.
  6. 根据权利要求2所述的方法,其特征在于,在所述布局特征为语义特征的情况下,所述确定各所述待布局元素两两间的布局特征距离,包括:The method according to claim 2, wherein when the layout feature is a semantic feature, the determining the layout feature distance between each of the elements to be laid out includes:
    根据各所述待布局元素的语义对各所述待布局元素进行分类;Classifying each of the elements to be laid out according to the semantics of the elements to be laid out;
    将分为同一类的各所述布局元素两两间的布局特征距离确定为0,将不同类的各所述布局元素两两间的布局特征距离确定为1。The layout feature distance between two layout elements classified into the same category is determined as 0, and the layout feature distance between two layout elements of different categories is determined as 1.
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述基于各所述待布局元素两两间的布局特征距离与各所述待布局元素两两间的空间距离之间的相似度确定布局方案,包括:The method according to any one of claims 1 to 6, characterized in that, the distance between the layout features based on each pair of elements to be laid out and the space distance between each pair of elements to be laid out The similarity determines the layout scheme, including:
    确定出使所述待布局元素两两间的布局特征距离与各所述待布局元素两两间的空间距离之间的 相似度最大的布局方案。Determine the layout scheme that maximizes the similarity between the layout feature distances between the elements to be laid out and the spatial distances between the elements to be laid out.
  8. 根据权利要求1至6中任一项所述的方法,其特征在于,所述基于各所述待布局元素两两间的布局特征距离与各所述待布局元素两两间的空间距离之间的相似度确定布局方案,包括:The method according to any one of claims 1 to 6, characterized in that, the distance between the layout features based on each pair of elements to be laid out and the space distance between each pair of elements to be laid out The similarity determines the layout scheme, including:
    确定出使所述待布局元素两两间的布局特征距离与各所述待布局元素两两间的空间距离之间的相似度大于相似度阈值的布局方案。A layout scheme is determined that makes the similarity between the layout feature distance between two elements to be laid out and the space distance between each element to be laid out greater than a similarity threshold.
  9. 根据权利要求1至8中任一项所述的方法,其特征在于,通过各所述待布局元素两两间的布局特征距离与各所述待布局元素两两间的空间距离之间的相关系数,确定所述待布局元素两两间的布局特征距离与各所述待布局元素两两间的空间距离之间的相似度。The method according to any one of claims 1 to 8, characterized in that, through the correlation between the layout feature distance between two elements to be laid out and the spatial distance between two elements to be laid out The coefficient determines the similarity between the layout feature distance between the elements to be laid out and the space distance between the elements to be laid out.
  10. 根据权利要求9所述的方法,其特征在于,所述相关系数,包括以下相关系数中的任意一种:皮尔逊相关系数、斯皮尔曼相关系数、肯德尔相关系数。The method according to claim 9, wherein the correlation coefficient comprises any one of the following correlation coefficients: Pearson correlation coefficient, Spearman correlation coefficient, Kendall correlation coefficient.
  11. 根据权利要求1至10中任一项所述的方法,其特征在于,所述待布局元素包括以下元素中的任意一种:图标、图片、服务卡片。The method according to any one of claims 1 to 10, wherein the elements to be laid out include any one of the following elements: icons, pictures, and service cards.
  12. 根据权利要求11所述的方法,其特征在于,所述电子设备在检测到用户在所述电子设备上输入的布局指令的情况下,获取多个待布局元素的布局特征。The method according to claim 11, wherein the electronic device acquires layout features of a plurality of elements to be laid out when detecting a layout instruction input by a user on the electronic device.
  13. 一种可读介质,其特征在于,所述可读介质上存储有指令,所述指令在电子设备上执行时使所述电子设备实现权利要求1至12任一项所述的方法。A readable medium, characterized in that instructions are stored on the readable medium, and when the instructions are executed on the electronic equipment, the electronic equipment implements the method described in any one of claims 1 to 12.
  14. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    存储器,用于存储由电子设备的一个或多个处理器执行的指令;memory for storing instructions to be executed by one or more processors of the electronic device;
    以及处理器,是所述电子设备的处理器之一,用于执行所述存储器中存储的指令以实现权利要求1至12中任一项所述的方法。And the processor is one of the processors of the electronic device, configured to execute the instructions stored in the memory to implement the method according to any one of claims 1 to 12.
PCT/CN2022/126443 2021-11-24 2022-10-20 Layout method, readable medium and electronic device WO2023093390A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111405667.6A CN116166155A (en) 2021-11-24 2021-11-24 Layout method, readable medium, and electronic device
CN202111405667.6 2021-11-24

Publications (1)

Publication Number Publication Date
WO2023093390A1 true WO2023093390A1 (en) 2023-06-01

Family

ID=86416870

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/126443 WO2023093390A1 (en) 2021-11-24 2022-10-20 Layout method, readable medium and electronic device

Country Status (2)

Country Link
CN (1) CN116166155A (en)
WO (1) WO2023093390A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116627293A (en) * 2023-07-26 2023-08-22 荣耀终端有限公司 Desktop content sorting method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130093764A1 (en) * 2011-10-18 2013-04-18 Research In Motion Limited Method of animating a rearrangement of ui elements on a display screen of an electronic device
US20130132874A1 (en) * 2011-11-22 2013-05-23 Yahoo! Inc. Automatically arranging of icons on a user interface
CN103488397A (en) * 2013-09-13 2014-01-01 深圳市欧珀通信软件有限公司 Method and device for arranging icons, and mobile terminal
CN103955332A (en) * 2014-05-15 2014-07-30 深圳市中兴移动通信有限公司 Mobile terminal and arraying method and device for desktop icons of mobile terminal
CN106527853A (en) * 2016-10-31 2017-03-22 珠海市魅族科技有限公司 Method and device for displaying application icons
CN106873857A (en) * 2017-02-22 2017-06-20 Tcl集团股份有限公司 A kind of application icon autoplacement method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130093764A1 (en) * 2011-10-18 2013-04-18 Research In Motion Limited Method of animating a rearrangement of ui elements on a display screen of an electronic device
US20130132874A1 (en) * 2011-11-22 2013-05-23 Yahoo! Inc. Automatically arranging of icons on a user interface
CN103488397A (en) * 2013-09-13 2014-01-01 深圳市欧珀通信软件有限公司 Method and device for arranging icons, and mobile terminal
CN103955332A (en) * 2014-05-15 2014-07-30 深圳市中兴移动通信有限公司 Mobile terminal and arraying method and device for desktop icons of mobile terminal
CN106527853A (en) * 2016-10-31 2017-03-22 珠海市魅族科技有限公司 Method and device for displaying application icons
CN106873857A (en) * 2017-02-22 2017-06-20 Tcl集团股份有限公司 A kind of application icon autoplacement method and device

Also Published As

Publication number Publication date
CN116166155A (en) 2023-05-26

Similar Documents

Publication Publication Date Title
WO2021027649A1 (en) Dark-mode display interface processing method, electronic device, and storage medium
US9607421B2 (en) Displaying particle effect on screen of electronic device
US20220283610A1 (en) Electronic Device Control Method and Electronic Device
WO2021249053A1 (en) Image processing method and related apparatus
WO2021147396A1 (en) Icon management method and smart terminal
US20230315269A1 (en) Application Interface Display Method and Electronic Device
WO2021052344A1 (en) Parameter adjustment method and electronic device
US20220319077A1 (en) Image-text fusion method and apparatus, and electronic device
WO2021063098A1 (en) Touch screen response method, and electronic device
WO2021082564A1 (en) Operation prompt method and electronic device
WO2021013132A1 (en) Input method and electronic device
CN112598594A (en) Color consistency correction method and related device
CN110100251A (en) For handling the equipment, method and graphic user interface of document
KR102359276B1 (en) Method and apparatus for controlling white balance function of electronic device
WO2022001619A1 (en) Screenshot method and electronic device
CN110401768B (en) Method and device for adjusting working state of electronic equipment
CN112887582A (en) Image color processing method and device and related equipment
WO2021093595A1 (en) Method for verifying user identity and electronic device
WO2021057203A1 (en) Operation method and electronic device
US20230244507A1 (en) Method and Apparatus for Processing Interaction Event
WO2023142916A1 (en) Image processing method, apparatus and device, and storage medium
WO2023093390A1 (en) Layout method, readable medium and electronic device
CN114579016A (en) Method for sharing input equipment, electronic equipment and system
WO2019184017A1 (en) Control display method and electronic device
WO2018098959A2 (en) Picture display method and electronic device

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: 22897473

Country of ref document: EP

Kind code of ref document: A1