A method for automatically optimizing the layout of controls in a human-computer interaction interface and related devices

By extracting the spatial geometric attributes of controls in the human-computer interaction interface, generating an initial data set, and automatically laying out the controls based on their geometric parameters, the problem of diverse usage scenarios caused by interface rigidity is solved, and flexible adjustment of controls and clarity of interface structure are achieved.

CN120560770BActive Publication Date: 2025-10-17SHENZHEN LANGYUXIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511062680.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-10-17
Estimated Expiration
2045-07-31

AI Technical Summary

Technical Problem

In traditional human-machine interface (HMI) design, the rigid interface cannot meet the diverse needs of usage scenarios, and controls cannot be added or removed dynamically, which affects the ability of industrial software to quickly respond to changes in business scenarios.

Method used

By extracting the spatial geometric attributes of all controls on the current interface, an initial data set is generated. The set is then traversed according to the geometric parameters of the new control to determine whether the area corresponding to the current control can accommodate the new control. Automatic layout is then performed based on the position parameters, including splitting controls that exceed the threshold, constructing a dynamic space margin analysis model, and merging or compressing controls to meet the placement conditions.

Benefits of technology

It enables automatic adjustment of control layout in the human-computer interaction interface to meet the diverse needs of usage scenarios, and improves the flexibility of the software and the clarity of the interface structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120560770B_ABST
    Figure CN120560770B_ABST
Patent Text Reader

Abstract

The present application provides a method and related device for automatic layout optimization of controls in a human-computer interaction interface. The method includes: extracting the spatial geometric properties of all controls in the current interface to generate an initial data set for all controls; traversing the initial data set based on the geometric parameters of the newly created control to obtain the target spatial geometric properties of the current control among all controls; judging whether the newly created control can be placed in the area corresponding to the current control based on the target spatial geometric properties; if the newly created control can be placed in the area corresponding to the current control, then placing the newly created control based on the position parameters of the newly created control. Through the implementation of the scheme of the present application, when a new control is created, the appropriate coordinate position on the interface is automatically retrieved for placement, meeting the needs of diverse usage scenarios and improving the flexibility of the software.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of embedded development, and in particular, to a control automatic layout optimization method for a human-computer interaction interface and related devices. BACKGROUND

[0002] In the design of human-computer interface (HMI) in the field of industrial control, such as a petrochemical plant centralized monitoring system or an intelligent production line console, the operation interface usually needs to integrate tens of real-time data controls such as pressure, temperature, valve state, etc. The traditional design adopts a static layout scheme, and the positions of all controls are fixedly written into the code in the development stage, which causes the same set of HMI interface to be unable to adapt to the requirement of dynamically adding or reducing controls when switching between different processes (such as switching from a production mode to a device maintenance mode). When a new fault diagnosis control or a temporary monitoring module is added, the developer must manually adjust the coordinate parameters in the code, or even redesign the entire interface partition, and this rigid layout mechanism seriously hinders the ability of industrial software to quickly respond to changes in business scenarios. SUMMARY

[0003] The present application provides a control automatic layout optimization method for a human-computer interaction interface and related devices, which is used to solve the problem that the use scene diversification requirement cannot be met due to interface solidification in the related art.

[0004] The first aspect of the present application provides a control automatic layout optimization method for a human-computer interaction interface, which comprises:

[0005] extracting spatial geometric properties of all controls of a current interface to generate an initial data set of all the controls;

[0006] traversing the initial data set according to geometric parameters of a newly created control to obtain target spatial geometric properties of a current control among all the controls;

[0007] determining whether the newly created control can be placed in a region corresponding to the current control according to the target spatial geometric properties;

[0008] if the newly created control can be placed in the region corresponding to the current control, placing the newly created control according to a position parameter of the newly created control.

[0009] Optionally, in the first implementation manner of the first aspect of the present application, the step of extracting spatial geometric properties of all controls of a current interface to generate an initial data set of all the controls comprises:

[0010] scanning spatial geometric properties of all controls of a current interface; wherein the spatial geometric properties comprise a horizontal coordinate, a vertical coordinate, a width value, and a height value;

[0011] when it is detected that the height value of the target control is higher than a preset height threshold, splitting the target control into a plurality of sub-controls with a height value equal to the preset height threshold;

[0012] determining whether all the controls are scanned;

[0013] if all the controls are scanned, generating an initial data set according to the spatial geometric attributes of the plurality of sub-controls and the spatial geometric attributes of the remaining controls.

[0014] Optionally, in the second implementation manner of the first aspect of the present application, before the step of determining whether the new control can be placed in the region corresponding to the current control according to the target spatial geometric attribute, the method further comprises:

[0015] performing multi-level sorting processing on the controls in the initial data set according to a preset spatial priority sorting rule to generate an ordered control queue;

[0016] constructing a dynamic spatial margin analysis model according to the boundary coordinates of the controls in the ordered control queue;

[0017] calculating the horizontal distance and the vertical distance between adjacent controls through the dynamic spatial margin analysis model to determine all potential available regions in the current interface; wherein the all potential available regions include a right potential available region and a lower potential available region of the current control.

[0018] Optionally, in the third implementation manner of the first aspect of the present application, the step of determining whether the new control can be placed in the region corresponding to the current control according to the target spatial geometric attribute comprises:

[0019] obtaining the horizontal coordinate range of the right potential available region of the current control according to the target spatial geometric attribute of the current control and the horizontal coordinate of the right boundary of the interface;

[0020] determining whether there is enough horizontal space to accommodate the new control in the horizontal coordinate range according to the geometric parameters of the new control and a preset horizontal distance threshold;

[0021] if there is, determining whether the right potential available region meets the placement condition of the new control in the vertical direction according to the vertical coordinate and the height value of the current control, and in combination with the height parameter of the new control and a preset vertical distance threshold;

[0022] if yes, generating a first position parameter of the new control through the sum of the horizontal coordinate and the width value of the current control, the vertical coordinate, and the width value and the height value of the new control;

[0023] determining whether the new control has an overlapping boundary with the remaining controls in the initial data set according to the first position parameter and the spatial geometric attributes of the remaining controls;

[0024] If there is no overlapping, determining that the new control can be placed in the region corresponding to the current control.

[0025] Optionally, in a fourth implementation manner of the first aspect of the present application, after the step of determining whether there is sufficient horizontal space to accommodate the new control in the horizontal coordinate range according to the geometric parameters of the new control and the preset horizontal spacing threshold, the method further comprises:

[0026] When it is determined that there is not sufficient horizontal space to the right of the current control, determining whether the potential available region below the current control can accommodate the new control according to the target spatial geometric attributes of the current control, the geometric parameters of the new control and the preset vertical spacing threshold;

[0027] If the potential available region can accommodate the new control, generating a second position parameter through the sum of the horizontal coordinate, the vertical coordinate and the height value of the current control and the width value and the height value of the new control, and performing the overlapping boundary determination again.

[0028] Optionally, in a fifth implementation manner of the first aspect of the present application, the method further comprises:

[0029] When the placement position of the new control is not determined after traversing the potential available region, performing region merging processing on adjacent controls that meet the preset merging condition according to the width value and the height value of each control in the initial data set, to generate a new potential available region after merging;

[0030] updating the boundary coordinates of the new potential available region through the dynamic spatial margin analysis model, and recalculating the coordinate range of the new potential available region based on the geometric parameters of the new control;

[0031] performing secondary matching according to the recalculated coordinate range and the width value and the height value of the new control;

[0032] If the width value of the new potential available region is greater than or equal to the sum of the width value of the new control and twice the preset horizontal spacing threshold, and the height value is greater than or equal to the sum of the height value of the new control and twice the preset vertical spacing threshold, generating a third position parameter through the top-left corner coordinates of the new potential available region and the geometric parameters of the new control;

[0033] updating the spatial geometric attributes of the controls involved in the merging processing in the initial data set according to the third position parameter, and placing the new control based on the updated initial data set.

[0034] Optionally, in a sixth implementation form of the first aspect of the application, the method further comprises:

[0035] when the new control cannot be placed by using the potential available area, performing compression processing on the spatial geometry attribute of the laid-out control according to the dynamic adjustment priority parameter of each control in the initial data set;

[0036] calculating the spatial margin on the right and below the compressed control by using the dynamic spatial margin analysis model, generating an extended potential available area, and performing boundary compensation on the extended area according to the geometry parameter of the new control;

[0037] if the width value of the extended area is greater than or equal to the product of the width value of the new control and the horizontal elasticity coefficient, and the height value satisfies the height elasticity product condition, generating a fourth position parameter based on the top-left corner coordinate of the extended area;

[0038] performing offset calculation on the control affected by the compression according to the fourth position parameter, updating the initial data set, and performing a final placement operation of the new control.

[0039] The second aspect of the application provides a control automatic layout optimization device of a human-computer interaction interface, which comprises:

[0040] a generation module configured to extract the spatial geometry attribute of all controls of a current interface, and generate an initial data set of all the controls;

[0041] an acquisition module configured to traverse the initial data set according to the geometry parameter of a new control, and acquire the target spatial geometry attribute of a current control among all the controls;

[0042] a judgment module configured to judge whether the new control can be placed in the region corresponding to the current control according to the target spatial geometry attribute;

[0043] a placement module configured to place the new control according to the position parameter of the new control if the new control can be placed in the region corresponding to the current control.

[0044] The third aspect of the embodiment of the application provides an electronic device comprising a memory and a processor, wherein the processor is configured to execute a computer program stored in the memory, and the processor, when executing the computer program, implements each step in the control automatic layout optimization method of the human-computer interaction interface provided in the first aspect of the embodiment of the application.

[0045] The fourth aspect of the embodiment of the present application provides a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, each step of the control automatic layout optimization method of the human-computer interaction interface provided in the first aspect of the embodiment of the present application is implemented.

[0046] In summary, according to the control automatic layout optimization method of the human-computer interaction interface and the related device provided in the present application, the spatial geometric properties of all the controls of the current interface are extracted, and the initial data set of all the controls is generated. The target spatial geometric property of the current control among all the controls is obtained by traversing the initial data set according to the geometric parameter of the newly created control. It is judged whether the newly created control can be placed in the region corresponding to the current control according to the target spatial geometric property. If the newly created control can be placed in the region corresponding to the current control, the newly created control is placed according to the position parameter of the newly created control. Through the implementation of the present application, the appropriate coordinate position on the interface is automatically searched and placed when the control is newly created, which meets the diversified use scene requirement and improves the flexibility of the software. BRIEF DESCRIPTION OF DRAWINGS

[0047] Figure 1 The flowchart of the control automatic layout optimization method of the human-computer interaction interface provided in the embodiment of the present application is shown.

[0048] Figure 2 The program module schematic diagram of the control automatic layout optimization device of the human-computer interaction interface provided in the embodiment of the present application is shown.

[0049] Figure 3 The structure schematic diagram of the electronic device provided in the embodiment of the present application is shown. DETAILED DESCRIPTION

[0050] In order to make the purposes, characteristics and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0051] In order to solve the problem that the interface is fixed and cannot meet the diversified use scene requirement in the related art, the present application provides a control automatic layout optimization method of a human-computer interaction interface, as shown in Figure 1 The flowchart of the control automatic layout optimization method of the human-computer interaction interface provided in the embodiment is shown. The control automatic layout optimization method of the human-computer interaction interface includes the following steps:

[0052] Step 110, extract the spatial geometric properties of all controls of the current interface to generate an initial data set of all controls.

[0053] Specifically, in the control automatic layout optimization method of the human-computer interaction interface, firstly, the spatial geometric properties of all controls of the current interface are extracted, and a complete initial data set is generated based on the spatial geometric properties. The spatial geometric properties of the controls usually include horizontal coordinates, vertical coordinates, width values and height values, and these information is the basis for constructing the control spatial distribution model. By scanning all the existing controls on the interface and extracting their corresponding properties, a data set reflecting the current layout state of the interface can be constructed, which provides the basis for subsequent calculation and layout decision. In order to ensure the integrity of the information and the processing efficiency, the system needs to classify and structure all the control properties uniformly, so that they can be accessed and updated dynamically, thereby laying a data foundation for the automatic layout process.

[0054] In an optional embodiment of the present embodiment, the step of extracting the spatial geometric properties of all controls of the current interface to generate an initial data set of all controls includes: scanning the spatial geometric properties of all controls of the current interface; wherein the spatial geometric properties include horizontal coordinates, vertical coordinates, width values and height values; when it is detected that the height value of a target control is higher than a preset height threshold, the target control is split into a plurality of sub-controls with height values equal to the preset height threshold; it is judged whether all controls are scanned; if all controls are scanned, an initial data set is generated based on the spatial geometric properties of the plurality of sub-controls and the spatial geometric properties of the remaining controls.

[0055] Specifically, in the control automatic layout optimization method, first, all controls on the current interface are scanned through the interface rendering engine interface to obtain the horizontal coordinate, vertical coordinate, width and height information of each control in the two-dimensional plane. The information is read by the geometry query API provided by the UI framework to ensure a complete understanding of the distribution position and size of each control in the interface. Then, the height data in the scanning result is compared with the preset height threshold (such as 40 pixels). Any control that exceeds the threshold is split into several sub-control blocks with a height equal to the threshold in the vertical direction. The width and horizontal coordinate of the sub-control blocks remain the same as the original control, and the vertical coordinate of the sub-control blocks is sequentially added by the threshold and a fixed interval. The number of splits is the result of rounding up the original height and the threshold. For example, a control with a height of 100 pixels can be divided into three 40-pixel-high sub-blocks to achieve the division of standardized geometric units. During the splitting process, the number of processed original controls and their sub-control blocks is accumulated by an internal counter, and is compared with the number of controls in the interface. When the counter value is consistent with the expected number of entries, the scanning and splitting process of the geometric properties is completed, ensuring that all control information is fully collected and converted. Finally, the geometric information of all sub-controls and unsplit controls is summarized as an initial data set, and the horizontal coordinate, vertical coordinate, width and height of each control are stored in a structured list form, and the control identifier is associated. For example, the original control A is split into A1 and A2, and the set contains A1, A2 and other control items.

[0056] It should be noted that the control with a height exceeding the preset threshold is split into several equal-height units in the vertical direction, which essentially converts complex and irregular geometric shapes into several standardized "geometric units" to facilitate uniform granularity processing in subsequent spatial analysis and layout decision-making. Through this segmentation, each control can be regarded as being arranged in rows by several rectangular blocks (each block has a height equal to the threshold), thereby reducing the overall complexity of the control to simple operations on multiple homogeneous sub-blocks. With standardized geometric units, the layout engine only needs to run block by block in the grid-based coordinate system when scanning, detecting overlaps and finding free areas. In collision detection and spatial availability judgment, the fixed-height sub-control blocks are conducive to using matrix-type or grid-type data structures to store the interface state, which can be referred to as a "space block table". The table divides the overall interface into several row and column units, and each sub-control block occupies one or more adjacent units. Therefore, when checking for duplicates or connectivity, the Boolean operation can be completed more quickly and efficiently than directly detecting all pixels or continuous coordinate ranges for any high control at one time.

[0057] Step 120, according to the geometric parameters of the newly created control, traversing the initial data set, obtaining the target space geometric properties of the current control in all controls.

[0058] Specifically, according to the geometric parameters of the newly created control, traversing the initial data set, obtaining the target geometric properties associated with the current control. This operation needs to compare the spatial geometric properties of the existing controls in the initial data set one by one according to the preset size information (such as width and height) of the newly created control, identify the target control that may place the newly created control in its surrounding area, and the identification conditions of the target control include but are not limited to that there is no other control within the preset range in at least one direction around the existing control. Then the target control is selected and set as the current control for placement judgment, and the target space geometric properties corresponding to the current control are obtained, including the coordinates, size of the current control and the relative position of the adjacent control, which is the premise of judging whether the newly created control has placement conditions.

[0059] Step 130, according to the target space geometric properties, judging whether the newly created control can be placed in the region corresponding to the current control.

[0060] Specifically, after identifying the target geometric properties, it is further necessary to judge whether the newly created control can be placed in the region corresponding to the current control according to these properties. The judgment basis is the geometric relationship between the geometric parameters of the newly created control and the spatial boundary of the current control, mainly whether the coordinate range exists intersection or overlap. The system uses coordinate calculation method to analyze whether the placement boundary of the newly created control will enter the boundary range of the existing control, if there is no coincidence relationship, and the expected position of the newly created control will not exceed the boundary area allowed by the whole interface, then it can be determined that the space region corresponding to the current control satisfies the placement condition. This judgment process ensures that the layout operation will not damage the existing interface structure.

[0061] In an optional embodiment of the present embodiment, before the step of judging whether the newly created control can be placed in the region corresponding to the current control according to the target space geometric properties, it further includes: according to the sorting rule of the preset space priority, performing multi-level sorting processing on the controls of the initial data set, generating an ordered control queue; according to the boundary coordinates of each control in the ordered control queue, constructing a dynamic space margin analysis model; calculating the horizontal and vertical distances between adjacent controls through the dynamic space margin analysis model, determining all potential available regions in the current interface; wherein, all potential available regions include the right potential available region and the lower potential available region of the current control.

[0062] Specifically, in the interface layout calculation, first, according to the preset space priority rule, the controls in the initial data set are processed by multi-level sorting to generate an ordered control queue. This sorting takes the control vertical coordinate as the primary key, and the Y coordinate is smaller. The Y coordinate is smaller, and then the X coordinate is sorted from small to large, to ensure that the control access order and the visual reading order are consistent. For example, when control A is located at (10, 10), control B is located at (200, 10), and control C is located at (10, 60), the queue after sorting is A, B, and C. After sorting, the ordered control queue is traversed and the boundary coordinates of each control are read to construct a dynamic space margin analysis model. The model divides the interface into several closed intervals defined by the control boundaries and the interface edges, and uses a space margin matrix or a grid data structure to track the remaining blank area in real time. The space margin matrix is a data structure based on the smallest cell, where each grid point records whether the corresponding coordinate has been occupied by the control, so that the available unit can be quickly queried in subsequent calculations. The horizontal and vertical distances between adjacent controls are calculated through the dynamic space margin analysis model, and the potential available areas are identified accordingly. For example, if the horizontal interval between control A and control B is 20 pixels and is not less than the preset threshold, the rectangular area to the right of A can be included in the right potential available area; when the vertical distance between control B and control C meets the condition, the lower potential available area can be generated in the corresponding area below B. The above calculation is based on the principle of rectangular collision detection, which compares the interval distance after projecting the boundaries of any two rectangles onto the X axis or Y axis. If there is no overlap, it is considered as available space. All the right potential available areas and the lower potential available areas obtained in this way will provide accurate coordinate references for subsequent control placement.

[0063] Optionally, when the control shape tends to be circular, in the layout system, each control can be regarded as a circle with the center point as the center and the radius as the influence range. When the Euclidean distance between the centers of two controls is less than or equal to the sum of their radii, it is determined that a collision occurs. Compared with rectangular collision detection, circular detection does not depend on edge alignment and is suitable for describing the relationship between controls in space that affect the surrounding layout in a diffuse manner.

[0064] In an alternative implementation of the embodiment, the step of determining whether the newly created control can be placed in the region corresponding to the current control according to the target space geometry attribute comprises: obtaining the horizontal coordinate range of the potential available region to the right of the current control according to the target space geometry attribute of the current control and the horizontal coordinate of the right boundary of the interface; determining whether there is sufficient horizontal space to accommodate the newly created control in the horizontal coordinate range according to the geometry parameter of the newly created control and the preset horizontal spacing threshold; if there is, determining whether the potential available region to the right satisfies the placement condition of the newly created control in the vertical direction according to the vertical coordinate and height value of the current control and in combination with the height parameter of the newly created control and the preset vertical spacing threshold; if it does, generating the first position parameter of the newly created control through the sum of the horizontal coordinate and width value of the current control, the vertical coordinate, and the width value and height value of the newly created control; determining whether the boundary of the newly created control overlaps with the boundary of the surrounding remaining controls according to the first position parameter and the space geometry attribute of the remaining controls in the initial data set; and if there is no overlap, determining that the newly created control can be placed in the region corresponding to the current control.

[0065] Specifically, first, after obtaining the target space geometry attribute of the current control, the sum of the horizontal starting coordinate and width value of the current control and the pre-read horizontal coordinate of the right boundary of the interface are used to calculate the horizontal coordinate range of the potential available region, which is the continuous interval from the right edge of the current control to the rightmost edge of the interface, and its role is to limit the horizontal available space that can be searched in subsequent layout. For example, when the horizontal coordinate plus width value of a certain control is 150 pixels and the width of the interface is 800 pixels, the horizontal coordinate range is [151, 800], which provides the primary candidate placement segment for the newly created control. Then, by comparing the actual width of the newly created control with the preset horizontal spacing threshold, it can be determined whether there is sufficient horizontal margin to accommodate the newly created control in the coordinate interval. The horizontal spacing threshold refers to the minimum horizontal distance that should be maintained between the new and old controls to prevent visual or functional interference; for example, when the width of the newly created control is 100 pixels and the horizontal spacing threshold is set to 10 pixels, it is necessary to confirm that (800-151+1) ≥ (100+10) before considering that the horizontal available space meets the requirements. This is to ensure that the newly created control is not placed beyond the boundary and maintains a safe interval with the existing controls.

[0066] After confirming the horizontal space is feasible, the vertical direction of the potential available area is further verified by the vertical coordinate and height value of the current control, and in combination with the height parameter of the new control and the preset vertical spacing threshold. The vertical spacing threshold is used to ensure that the necessary gap is maintained between the upper and lower controls. For example, when the control vertical coordinate is 50 pixels, the height is 40 pixels, the new control height parameter is 30 pixels, and the vertical spacing threshold is 5 pixels, it is necessary to check whether the area vertical coordinate is outside [50-(30+5), 50+(40+5)]. If the overlapping area does not invade the forbidden zone range, it is considered that the vertical direction meets the placement condition, so that the new control can not only fit the layout, but also not touch the existing control in the context.

[0067] When both the horizontal and vertical directions meet the placement condition, the first position parameter is generated based on the horizontal coordinate and width value of the current control, and the width and height parameters of the new control. The parameter represents the coordinate point of the upper left corner of the new control in the form of a two-element group (x, y), such as x=150+1, y=50, which can determine the starting point of placement. The generation of the first position parameter provides accurate coordinates for subsequent visual rendering, and the coordinates correspond to the control information in the initial data set, ensuring the overall layout logic closed loop. Next, the first position parameter needs to be overlapped with the spatial geometric properties of other controls in the initial data set. The rectangular collision detection algorithm is used to project the proposed placement area of the new control and the boundary rectangle of all controls in the set to the horizontal and vertical coordinate axes. If there is an interval overlap in any projection dimension, it is determined as a conflict; otherwise, it is considered as no overlap. For example, when the area of the new control is [151, 250]x[50, 80], if the areas of other controls do not intersect with this rectangle, it is determined that the placement is safe. Finally, after confirming that there is no overlap through collision detection, it is determined that the potential space has the condition to place the new control, thereby realizing the intelligent positioning of the control on the right side of the current interface. This process not only guarantees the space utilization, but also maintains the mutual independence and visual coordination of interface elements.

[0068] In an optional embodiment of the present embodiment, after the step of determining whether there is sufficient horizontal space in the horizontal coordinate range to accommodate the new control according to the geometric parameters of the new control and the preset horizontal spacing threshold, the method further comprises: when it is determined that there is no sufficient horizontal space to the right of the current control, determining whether the potential available area below the current control can accommodate the new control according to the target spatial geometric properties of the current control, the geometric parameters of the new control, and the preset vertical spacing threshold; if it can accommodate, generating a second position parameter by summing the horizontal coordinate, vertical coordinate and height value of the current control, and the width and height values of the new control, and again performing overlap judgment with the boundaries of the remaining controls.

[0069] Specifically, when it is determined that the width of the continuous available pixel interval to the right of the current control is less than the sum of the width of the new control and the horizontal spacing threshold, the layout logic considers the horizontal placement strategy infeasible, and further performs a vertical availability analysis on the potential available area below. The potential available area below refers to the continuous vertical interval between the sum of the bottom coordinate of the current control and its height and the bottom boundary of the interface, the length of which is obtained by subtracting (control vertical coordinate + control height) from the interface height, and this interval represents the vertical space available for the new control to be inserted. In order to ensure that the vertical direction maintains a predetermined spacing from the surrounding controls, the length of the interval needs to be compared with the height of the new control and the preset vertical spacing threshold, wherein the vertical spacing threshold is defined as the minimum pixel distance that should be maintained between adjacent controls to prevent the edges of the controls from intersecting or visually overlapping. For example, when the height of the new control is 30 pixels and the vertical spacing threshold is set to 5 pixels, the length of the available interval below needs to be not less than 35 pixels to be considered to meet the placement requirements. Once it is confirmed that the length of the interval below meets the requirements, a second position parameter can be generated based on the sum of the horizontal coordinate and the vertical coordinate plus the height of the current control, which represents the coordinate point of the upper left corner of the new control in the form of a two-element tuple, wherein the horizontal coordinate remains the same as that of the current control, and the vertical coordinate is (current control vertical coordinate + control height + vertical spacing threshold). For example, if the current control is located at a horizontal coordinate of 150 pixels, a vertical coordinate of 100 pixels, and a height of 40 pixels, and the vertical spacing threshold is set to 5 pixels, the resulting second position parameter is (150, 145). This parameter is used to initialize the rectangular boundary of the new control. Subsequently, overlap detection needs to be performed again between the rectangular boundary and the spatial geometric properties of the remaining controls in the initial data set to ensure that the vertical placement does not infringe on the areas of existing controls. This overlap detection is based on the principle of rectangular collision detection, which projects the rectangle of the new control and the rectangles of the surrounding controls onto the X-axis and the Y-axis and compares the projection intervals. When there is no interval overlap between the two on either coordinate axis, it is determined that there is no conflict, and the positioning below is completed. This fault-tolerant mechanism not only provides secondary verification guarantee for the vertical placement of controls, but also realizes the safe distribution and flexible arrangement of interface elements at runtime by combining dynamic judgment of spatial geometric properties.

[0070] In another embodiment, the underlying potential available area not only refers to the vertical space directly below the current control, but can also extend to the horizontal scanning space represented by the new starting line after line break, that is, the interface layout system automatically enters the next line and starts scanning from the position with horizontal coordinate 0 to the right to find the available area when it is detected that the line where the current control is located can no longer continue to accommodate newly created controls. This line break layout logic is similar to the "automatic line break" in text layout, emphasizing that after the end of the current logical arrangement unit, the control is relocated to the starting point of a new line and attempts to continuously fill along the horizontal direction. This mode sets the vertical coordinate of the newly created control to the maximum vertical coordinate of all controls in the previous line plus the corresponding height and vertical spacing threshold, and initializes the horizontal coordinate to 0. Then the system judges in turn from left to right whether there is enough horizontal space to accommodate the newly created control at the current position. If there is no conflict and the boundary limit is met, it can be confirmed that the position is a place where the control can be placed. This mechanism enables the layout system to have both in-line arrangement and automatic line break strategies, which is particularly suitable for interface scenarios where the screen width is limited or the number of controls is large, and also improves the space utilization efficiency and the consistency of the interface structure. The underlying space after line break thus becomes a space compensation area with structure and sequence, which is no longer just a local vertical gap between controls, but an important part of the entire interface arrangement strategy.

[0071] Step 140, if the current control corresponding area can place a newly created control, place the newly created control according to the position parameter of the newly created control.

[0072] Specifically, under the condition that it is confirmed that the current control corresponding area meets the placement condition, the newly created control can be placed on the interface according to its position parameter. The position parameter here includes the specific coordinate point selected by the system for the newly created control, which can determine its complete space occupation area in combination with the size information of the control. The system writes the newly created control into the interface graphics object according to the position parameter, so that it is formally presented on the visual interface. This placement action also marks the completion of the control layout behavior execution, ensuring that the control finds the correct position between existing controls and does not conflict with the original layout, thereby maintaining the clarity of the interface structure and the rationality of the control organization.

[0073] In an optional implementation of the embodiment, when the placement position of the new control is not determined after traversing the potential available regions, the adjacent controls satisfying the preset merging condition are subjected to region merging processing according to the width value and the height value of each control in the initial data set, to generate a merged new potential available region; the boundary coordinates of the new potential available region are updated through a dynamic space margin analysis model, and the coordinate range of the new potential available region is recalculated based on the geometric parameters of the new control; secondary matching is performed according to the recalculated coordinate range and the width value and the height value of the new control; if the width value of the new potential available region is greater than or equal to the sum of the width value of the new control and twice the preset horizontal spacing threshold, and the height value is greater than or equal to the sum of the height value of the new control and twice the preset vertical spacing threshold, a third position parameter is generated through the top-left corner coordinates of the new potential available region and the geometric parameters of the new control; the controls involved in the merging processing in the initial data set are subjected to spatial geometric attribute updating according to the third position parameter, and the new control is placed based on the updated initial data set.

[0074] Specifically, in the present embodiment, when all previously identified potential available spaces cannot meet the control placement requirements, based on the width and height information of each control in the established initial data set, whether the adjacent control space distance and size ratio meet the preset merging condition is determined to merge the adjacent control boundaries to create a larger area of available space. The merging condition generally includes that the distance between two controls in a certain direction is less than or equal to the preset merging threshold, and the rectangular region formed after merging does not overlap with other controls. For example, when the edge distance between control A and control B in the horizontal or vertical direction is not more than 10 pixels, the two can be considered as adjacent mergable objects, and by taking the minimum horizontal and vertical coordinates and the maximum horizontal and vertical coordinates of the two included regions, the boundaries are fused to generate a new rectangular region C. Subsequently, the generated new potential available region is updated in boundary coordinates by the previously constructed dynamic space margin analysis model. The dynamic space margin analysis model is a real-time tracking tool based on a grid or matrix data structure, which takes the minimum pixel unit or a predefined grid as the calculation unit to record the occupied and idle state of each region on the interface. On this basis, after the boundary of the new region C is updated, the model automatically marks the corresponding grid cell state of the region as idle and recalculates the region connectivity and space margin, thereby accurately identifying the available range of the merged region at the grid level. Through this model, real-time monitoring of the width, height, and distance between the new region and the surrounding controls can be quickly completed. Based on the updated boundary coordinates of the new potential available region, the actual length and width of the new region are matched again according to the preset width and height parameters of the new control and the original horizontal and vertical distance threshold. The so-called second matching operation here refers to comparing the sum of the width of the merged region and the width of the new control plus twice the horizontal distance threshold, and comparing the sum of the height of the merged region and the height of the new control plus twice the vertical distance threshold. Only when the width of the new region is greater than or equal to the sum of the width of the new control and twice the horizontal distance, and the height is greater than or equal to the sum of the height of the new control and twice the vertical distance, can it be determined that the merged region meets the placement requirements. For example, if the new region C has a width of 300 pixels and a height of 200 pixels, the new control has a width of 100 pixels and a height of 50 pixels, and the horizontal and vertical distance thresholds are both set to 10 pixels, then 300 ≥ (100 + 2 × 10) and 200 ≥ (50 + 2 × 10) need to be verified, and if the verification is passed, the position calculation link is entered. When the merged new potential available region passes the second matching test, the third position parameter is generated based on the top-left corner coordinates of the region and the width and height parameters of the new control. The third position parameter represents the drop point of the top-left corner of the new control in the interface space in the form of a binary coordinate, and the calculation method is to take the minimum horizontal coordinate of the merged region plus the horizontal distance threshold, and the minimum vertical coordinate of the region plus the vertical distance threshold.For example, for the coordinates of the upper left corner of region C (150, 100), with both the horizontal and vertical spacing thresholds set to 10 pixels, the third position parameter is (160, 110). This position ensures that the new control has sufficient buffer distance within the merged region while maintaining a consistent visual style with the original region boundary and the merged control. Finally, the third position parameter is reflected back into the initial data set, and the spatial geometric properties of the controls involved in the merge are updated to form the latest spatial distribution snapshot. During the specific update process, the original control items in the set are replaced with new control items that match the third position parameter, and the boundary markers of the controls before the merge are adjusted or removed to ensure that the subsequent layout rendering engine accurately interprets the interface structure. Finally, the control placement operation is re-executed on the rendering layer using the updated initial data set as input, so that the new control is officially presented on the human-computer interaction interface with the merged and optimized coordinates, completing an intelligent compensation layout for controls with difficult-to-match heights.

[0075] In an optional implementation of this embodiment, when the new control cannot be placed through the potential available area, the spatial geometric properties of the laid out controls are compressed according to the dynamic adjustment priority parameters of each control in the initial data set; the space margin to the right and below the compressed control is calculated through a dynamic space margin analysis model to generate an extended potential available area, and the boundary compensation of the extended area is performed according to the geometric parameters of the new control; if the width value of the extended area is greater than or equal to the product of the width value of the new control and the horizontal elasticity coefficient, and the height value meets the height elasticity product condition, then a fourth position parameter is generated based on the upper left corner coordinate of the extended area; the offset of the control affected by the compression is calculated according to the fourth position parameter, the initial data set is updated, and the final placement operation of the new control is performed.

[0076] Specifically, when none of the pre-identified potential available regions can accommodate the new control, the system first performs compression on the geometry of the laid-out controls according to a dynamic adjustment priority parameter of each control in the initial data set. The dynamic adjustment priority parameter defines the acceptable degree of each control in the interface compression process, for example, a function button can be reduced to 80% of the original size while an information panel needs to be kept full size, so by performing linear scaling on the width or height by the inverse priority coefficient, additional horizontal or vertical space can be released. For example, when the width of a control is 200 pixels and the compression factor is set to 0.8, the width will be adjusted to 160 pixels, thereby generating a horizontal space of 40 pixels. After the compression operation is completed, the dynamic space margin analysis model recalculates the remaining space to the right and below the control. The model tracks the occupied and idle state of each cell on the interface with an embedded grid data structure, and in real-time updates, the new idle cells generated by compression are included in the update list, and then through the connectivity of adjacent idle cells, the extended potential available regions are formed. At the same time, the system also performs compensation on the boundary of the extended region according to the width and height parameters of the new control, that is, a horizontal and vertical distance consistent with the control boundary is added outside the original idle area edge to ensure that there is a necessary buffer interval with the surrounding controls when placed. For example, when the width of the new control is 80 pixels, the height is 30 pixels, and the compensation distance is set to 10 pixels, the extended region will be extended outward by 10 pixels to meet the subsequent placement requirements. Then the elastic matching of the extended potential available region is judged, whether its width is greater than or equal to the product of the width of the new control and the horizontal elastic coefficient, and whether the height meets the threshold defined by the product of the height of the new control and the vertical elastic coefficient. The elastic coefficient is a value greater than 1, which is used to leave additional space for the control and the surrounding space when placed to cope with dynamic content or subsequent layout adjustment. For example, when the horizontal elastic coefficient is 1.2, it needs to be verified whether the width of the extended region is at least equal to (new control width x 1.2) to ensure that there is a certain buffer margin after placement. After the matching conditions are met, the fourth position parameter is generated according to the upper left corner coordinates of the extended region and the size parameters of the new control, which determines the final drop point coordinates of the control in the form of (x, y). Finally, the system needs to calculate the offset of the existing controls that have changed their positions due to compression according to the fourth position parameter, and update the horizontal and vertical coordinates and size information after the offset to the initial data set to keep the geometry properties in the set consistent with the interface rendering state. After completing the set update, the new control is placed according to the fourth position parameter for the final layout, and it is cooperatively presented with the compressed controls on the interface to ensure the rationality of global space allocation and the consistency of visual layout.

[0077] In an optional implementation of the embodiment, a state vector for representing an environment state is generated according to spatial geometric properties and preset function semantic cluster information of existing controls in an interface; a candidate grid set of actions is obtained by performing two-dimensional grid division on the state vector; a candidate grid position with the highest score is determined by performing multiple rounds of strategy network reasoning and reward value calculation on the candidate grid set of actions; and the spatial geometric properties of a control to be placed in the initial data set are updated according to the candidate grid position.

[0078] Specifically, in the process of intelligent layout of controls, a state vector representing the current environment state is generated according to the spatial geometric properties of the existing controls in the interface and the corresponding functional semantic cluster information. The functional semantic cluster is to classify the controls according to their functional types into specific semantic categories, such as input class, display class, control class, etc. By encoding the geometric position information and semantic labels into a multi-dimensional vector and merging them according to the control order, a global state vector is constructed. This vector can fully reflect the spatial distribution and functional grouping state of the current interface layout, and is the input basis for strategy reasoning. For example, each segment in the state vector can represent the semantic cluster, position coordinates, and size information of a control, and the merging of multiple segments forms a high-dimensional state description with comprehensive spatial semantic expression capability. Based on the generated state vector, two-dimensional grid division is performed to divide the entire interface area into several equal-sized grid cells, and the grid areas occupied by the controls are excluded through spatial overlap judgment, and then the action candidate grid set that can be used as the candidate position for newly created controls is obtained. Each grid in the set represents a potential layout action, and each action corresponds to a two-dimensional coordinate point, representing the possibility of placing the control at that position. After obtaining the action candidate grid set, the system calls the strategy network to perform multiple rounds of reasoning on each candidate position. The strategy network is a function model based on neural network, whose input is the state vector and the candidate action encoding, and the output is the expected reward value corresponding to each action. The reward value calculation can include layout compactness, functional clustering rationality, control alignment, user habit weight, and other factors, and the comprehensive score is formed by weighting and integrating these factors. The strategy network may use feedforward neural network, graph neural network, or attention mechanism to model the nonlinear mapping relationship between state and action. After each round of reasoning, the reward values of all candidate actions are updated and sorted, and the candidate grid with the highest score is finally selected as the optimal placement position. After determining the candidate grid position with the highest final score, the system extracts the top-left corner coordinates of the position as the target position parameter, and updates the spatial geometric properties of the current control to be placed in the initial data set. Specifically, the horizontal and vertical coordinates of the control are replaced with the coordinates of the candidate grid, while the original width and height information of the control are preserved, and the control is marked as placed. The updated control information will be added to the spatial model and state vector of the interface, providing real-time feedback for the next round of layout operation, realizing the intelligent, orderly, and adaptive arrangement of controls in complex interfaces. This mechanism not only adapts to changes in interface size and control quantity, but also has the ability to continuously optimize decision paths with data accumulation, embodying the transition of layout algorithm from rule-driven to strategy-driven.

[0079] According to the automatic layout optimization method for controls in a human-computer interaction interface provided by the present application, the spatial geometric properties of all controls in the current interface are extracted to generate an initial data set for all controls; the initial data set is traversed based on the geometric parameters of the newly created control to obtain the target spatial geometric properties of the current control among all controls; based on the target spatial geometric properties, it is determined whether the newly created control can be placed in the area corresponding to the current control; if the newly created control can be placed in the area corresponding to the current control, the newly created control is placed based on the position parameters of the newly created control. Through the implementation of the present application, when a new control is created, the appropriate coordinate position on the interface is automatically retrieved for placement, meeting the needs of diverse usage scenarios and improving the flexibility of the software.

[0080] Figure 2 The embodiment of the present application provides a device for automatically optimizing the layout of controls on a human-computer interaction interface. The device for automatically optimizing the layout of controls on a human-computer interaction interface can be used to implement the method for automatically optimizing the layout of controls on a human-computer interaction interface in the aforementioned embodiment. Figure 2 As shown, the automatic layout optimization device for controls of the human-computer interaction interface mainly includes:

[0081] The generation module 10 is used to extract the spatial geometric properties of all controls in the current interface and generate an initial data set for all controls;

[0082] An acquisition module 20 is used to traverse the initial data set according to the geometric parameters of the newly created control and obtain the target space geometric properties of the current control among all controls;

[0083] A judgment module 30 is used to judge whether a new control can be placed in the area corresponding to the current control according to the geometric properties of the target space;

[0084] The placement module 40 is configured to place the new control according to the position parameters of the new control if the new control can be placed in the area corresponding to the current control.

[0085] In an optional implementation of this embodiment, the generation module is specifically used to: scan the spatial geometric properties of all controls in the current interface; wherein the spatial geometric properties include horizontal coordinates, vertical coordinates, width values, and height values; when it is detected that the height value of a target control is higher than a preset height threshold, split the target control into several sub-controls whose height values ​​are equal to the preset height threshold; determine whether all controls have been scanned; if all controls have been scanned, generate an initial data set based on the spatial geometric properties of the several sub-controls and the spatial geometric properties of the remaining controls.

[0086] In an optional implementation of the embodiment, the control automatic layout optimization apparatus further comprises a construction module. The construction module is configured to perform multi-level sorting processing on the controls in the initial data set according to a preset spatial priority sorting rule to generate an ordered control queue, construct a dynamic space margin analysis model according to the boundary coordinates of the controls in the ordered control queue, and calculate the horizontal and vertical distances between adjacent controls by using the dynamic space margin analysis model to determine all potential available regions in the current interface, wherein the potential available regions include a right potential available region and a lower potential available region of the current control.

[0087] In an optional implementation of the embodiment, the judgment module is specifically configured to obtain the horizontal coordinate range of the right potential available region of the current control according to the target spatial geometric attribute of the current control and the horizontal coordinate of the right boundary of the interface, determine whether there is sufficient horizontal space in the horizontal coordinate range to accommodate the newly created control according to the geometric parameters of the newly created control and a preset horizontal distance threshold, if there is, determine whether the right potential available region satisfies the placement condition of the newly created control in the vertical direction according to the vertical coordinate and the height value of the current control and in combination with the height parameter of the newly created control and a preset vertical distance threshold, if the placement condition is satisfied, generate a first position parameter of the newly created control by using the sum of the horizontal coordinate and the width value of the current control, the vertical coordinate, and the width value and the height value of the newly created control, and determine whether the boundary of the newly created control overlaps with the boundaries of the surrounding controls according to the first position parameter and the spatial geometric attributes of the remaining controls in the initial data set, and if there is no overlap, determine that the newly created control can be placed in the region corresponding to the current control.

[0088] In an optional implementation of the embodiment, the judgment module is further configured to, when it is determined that there is no sufficient horizontal space to the right of the current control, determine whether the lower potential available region of the current control can accommodate the newly created control according to the target spatial geometric attribute of the current control, the geometric parameters of the newly created control, and a preset vertical distance threshold, if the lower potential available region can accommodate the newly created control, generate a second position parameter by using the sum of the horizontal coordinate, the vertical coordinate and the height value of the current control, and the width value and the height value of the newly created control, and perform the overlap judgment with the boundaries of the surrounding controls again.

[0089] In an optional implementation of the embodiment, the placing module is configured to: when the placement position of the new control is not determined after traversing the potential available region, perform region merging processing on adjacent controls that meet preset merging conditions according to the width value and the height value of each control in the initial data set, to generate a merged new potential available region; update the boundary coordinates of the new potential available region through a dynamic space margin analysis model, and recompute the coordinate range of the new potential available region based on the geometric parameters of the new control; perform secondary matching according to the recomputed coordinate range and the width value and the height value of the new control; if the width value of the new potential available region is greater than or equal to the sum of the width value of the new control and twice the preset horizontal spacing threshold, and the height value is greater than or equal to the sum of the height value of the new control and twice the preset vertical spacing threshold, generate third position parameters through the top-left corner coordinates of the new potential available region and the geometric parameters of the new control; update the spatial geometric attributes of the controls involved in the merging processing in the initial data set according to the third position parameters, and place the new control based on the updated initial data set.

[0090] In an optional implementation of the embodiment, the placing module is configured to: when the new control cannot be placed through the potential available region, compress the spatial geometric attributes of the already-laid-out controls according to the dynamic adjustment priority parameters of the controls in the initial data set; calculate the space margin on the right and below the compressed controls through a dynamic space margin analysis model, generate an extended potential available region, and perform boundary compensation on the extended region according to the geometric parameters of the new control; if the width value of the extended region is greater than or equal to the product of the width value of the new control and the horizontal elasticity coefficient, and the height value meets the height elasticity product condition, generate fourth position parameters based on the top-left corner coordinates of the extended region; calculate the offset of the controls affected by the compression according to the fourth position parameters, update the initial data set, and perform a final placement operation of the new control.

[0091] According to the control automatic layout optimization device of the human-computer interaction interface provided in the application, the spatial geometric attributes of all controls of a current interface are extracted, and an initial data set of all controls is generated; the target spatial geometric attributes of a current control among all controls are obtained by traversing the initial data set according to the geometric parameters of a new control; it is judged whether the new control can be placed in the region corresponding to the current control according to the target spatial geometric attributes; and the new control is placed according to the position parameters of the new control if the new control can be placed in the region corresponding to the current control. Through the implementation of the application, the appropriate coordinate position on the interface is automatically searched and placed when a new control is created, the demand of diversified use scenarios is met, and the flexibility of the software is improved.

[0092] According to the control automatic layout optimization device of the human-computer interaction interface provided in the application, Figure 3An electronic device is provided in the embodiments of the present application. The electronic device can be used to implement the control automatic layout optimization method of the human-computer interaction interface in the foregoing embodiments, and mainly includes

[0093] The memory 301, the processor 302, and the computer program 303 stored in the memory 301 and executable on the processor 302 are connected by communication. When the processor 302 executes the computer program 303, the control automatic layout optimization method of the human-computer interaction interface in the foregoing embodiments is implemented. The number of processors can be one or more.

[0094] The memory 301 can be a high-speed random access memory (RAM) memory, and can also be a non-volatile memory such as a disk memory. The memory 301 is used to store executable program codes, and the processor 302 is coupled with the memory 301.

[0095] Further, the embodiments of the present application also provide a computer readable storage medium, which can be arranged in the electronic device in the foregoing embodiments. The computer readable storage medium can be the memory in the foregoing embodiments. Figure 3

[0096] The computer readable storage medium stores a computer program, and the program is executed by the processor to implement the control automatic layout optimization method of the human-computer interaction interface in the foregoing embodiments. Further, the computer readable storage medium can also be a U disk, a mobile hard disk, a read-only memory (ROM), a RAM, a magnetic disk or an optical disk, and various media that can store program codes.

[0097] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be described here.

[0098] ​The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the entire or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0099] The above description and the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for automatically optimizing the layout of controls in a human-computer interaction interface, characterized in that: include: Extracting the spatial geometric properties of all controls on the current interface and generating an initial data set of all the controls; Traversing the initial data set according to the geometric parameters of the newly created control, obtaining the target space geometric properties of the current control in all the controls; Determine whether the new control can be placed in the area corresponding to the current control according to the geometric properties of the target space; If the new control can be placed in the area corresponding to the current control, then place the new control according to the position parameter of the new control; The step of extracting the spatial geometric properties of all controls on the current interface and generating an initial data set of all the controls includes: Scan the spatial geometric properties of all controls in the current interface; wherein the spatial geometric properties include abscissa, ordinate, width, and height; When it is detected that the height of a target control is higher than a preset height threshold, the target control is split into a plurality of sub-controls whose heights are equal to the preset height threshold; Determine whether all the controls have been scanned; If all the controls are scanned, an initial data set is generated according to the spatial geometric properties of the plurality of sub-controls and the spatial geometric properties of the remaining controls; Before the step of determining whether the new control can be placed in the area corresponding to the current control according to the geometric attributes of the target space, the method further includes: Performing multi-level sorting on the controls of the initial data set according to a preset spatial priority sorting rule to generate an ordered control queue; Constructing a dynamic space margin analysis model according to the boundary coordinates of each control in the ordered control queue; The horizontal and vertical spacing between adjacent controls are calculated using the dynamic space margin analysis model to determine all potential available areas in the current interface; wherein all potential available areas include the potential available area to the right and the potential available area below the current control.

2. The method for automatic layout optimization of controls in a human-computer interaction interface according to claim 1, characterized in that: The step of judging whether the new control can be placed in the area corresponding to the current control according to the geometric attributes of the target space includes: Obtain the horizontal coordinate range of the potential available area to the right of the current control according to the target space geometric properties of the current control and the horizontal coordinate of the right boundary of the interface; Determining whether there is sufficient horizontal space within the horizontal coordinate range to accommodate the newly created control based on the geometric parameters of the newly created control and a preset horizontal spacing threshold; If it exists, determining whether the potential available area on the right meets the placement conditions of the new control in the vertical direction according to the vertical coordinate and height value of the current control, combined with the height parameter of the new control and the preset vertical spacing threshold; If satisfied, the first position parameter of the newly created control is generated by the sum of the horizontal coordinate and width value of the current control, the vertical coordinate, and the width value and height value of the newly created control; Determining whether a boundary of the newly created control overlaps with boundaries of surrounding controls based on the first position parameter and spatial geometric properties of the remaining controls in the initial data set; If there is no overlap, it is determined that the new control can be placed in the area corresponding to the current control.

3. The method for automatic layout optimization of controls in a human-computer interaction interface according to claim 2, characterized in that: After the step of determining whether there is sufficient horizontal space within the horizontal coordinate range to accommodate the newly created control based on the geometric parameters of the newly created control and a preset horizontal spacing threshold, the method further includes: When it is determined that there is insufficient horizontal space to the right of the current control, determining whether the potential available area below the current control can accommodate the new control based on the target space geometric properties of the current control, the geometric parameters of the new control, and a preset vertical spacing threshold; If it can be accommodated, a second position parameter is generated by the sum of the horizontal coordinate, vertical coordinate and height value of the current control and the width value and height value of the newly created control, and the boundary overlap judgment with the surrounding other controls is performed again.

4. The method for automatic layout optimization of controls in a human-computer interaction interface according to claim 1, characterized in that: The method further comprises: If the placement position of the newly created control is still not determined after traversing the potential available area, adjacent controls that meet the preset merging conditions are merged according to the width and height values ​​of each control in the initial data set to generate a new potential available area after merging; Updating the boundary coordinates of the new potential available area using the dynamic space margin analysis model, and recalculating the coordinate range of the new potential available area based on the geometric parameters of the newly created control; Perform secondary matching based on the recalculated coordinate range and the width and height of the newly created control; If the width of the new potential available area is greater than or equal to the sum of the width of the newly created control and twice the preset horizontal spacing threshold, and the height is greater than or equal to the sum of the height of the newly created control and twice the preset vertical spacing threshold, then generate a third position parameter by using the coordinates of the upper left corner of the new potential available area and the geometric parameters of the newly created control; The spatial geometric properties of the controls involved in the merging process in the initial data set are updated according to the third position parameter, and the newly created controls are placed based on the updated initial data set.

5. The method for automatic layout optimization of controls in a human-computer interaction interface according to claim 1, characterized in that: The method further comprises: When the newly created control cannot be placed in the potential available area, compressing the spatial geometric properties of the already laid out controls according to the dynamically adjusted priority parameters of the controls in the initial data set; Calculating the space margins to the right and below the compressed control using the dynamic space margin analysis model to generate an expanded potential available area, and performing boundary compensation on the expanded area based on the geometric parameters of the newly created control; If the width of the extended area is greater than or equal to the product of the width of the newly created control and the horizontal elastic coefficient, and the height satisfies the height elasticity product condition, generating a fourth position parameter based on the coordinates of the upper left corner of the extended area; An offset calculation is performed on the control affected by the compression according to the fourth position parameter, the initial data set is updated, and a final placement operation of the newly created control is performed.

6. A device for automatically optimizing the layout of controls in a human-computer interaction interface, characterized in that: The automatic layout optimization device for controls of a human-computer interaction interface is used to implement the automatic layout optimization method for controls of a human-computer interaction interface according to claim 1, and the automatic layout optimization device for controls of a human-computer interaction interface comprises: A generation module is used to extract the spatial geometric properties of all controls in the current interface and generate an initial data set for all the controls; An acquisition module, configured to traverse the initial data set according to geometric parameters of the newly created control, and acquire target spatial geometric properties of the current control among all the controls; A judgment module, configured to judge whether the new control can be placed in the area corresponding to the current control according to the geometric properties of the target space; A placement module is configured to place the new control according to a position parameter of the new control if the new control can be placed in the area corresponding to the current control.

7. An electronic device, characterized in that: Comprising a memory and a processor, wherein: The processor is configured to execute a computer program stored in the memory; When the processor executes the computer program, the steps of the method for automatic layout optimization of controls in a human-computer interaction interface described in any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for automatic layout optimization of controls in a human-computer interaction interface described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method and system for dynamic laying-out interface element

    CN101140516A

  • Graphical interface construction method and device, computer equipment and storage medium

    CN111651161A