Automatic control layout optimization method of human-computer interaction interface and related device
Through the automated control layout optimization method, the problem that traditional human-computer interactive interface cannot adapt to the dynamic increase and decrease of controls is solved, and flexible layout is realized when switching between different processes, improving interface adaptability and development efficiency.
Patent Information
- Application Number
- CN202511062680.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-07-31
AI Technical Summary
In traditional human-computer interactive interface design, static layout solutions cannot adapt to the dynamic increase and decrease of controls during switching between different processes, resulting in developers needing to manually adjust the code, hindering the ability of industrial software to quickly respond to changes in business scenarios.
By extracting the spatial geometric properties of all controls in the current interface, generating an initial data set, traverse the set according to the geometric parameters of the newly created control, determining whether the new control can be placed in the current control area, and automatically layout according to the position parameters, including splitting controls above the threshold, building a dynamic spatial margin analysis model, merging or compressing controls to meet the placement conditions.
It automatically retrieves the appropriate coordinate position for placement when creating a new control, meets the diverse needs of use scenarios, and improves the flexibility of the software and the clarity of the interface structure.
Smart Images

Figure CN120560770A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of embedded system development, and in particular to a method for automatically optimizing the layout of controls in a human-computer interaction interface and related devices. Background Art
[0002] In the design of human-machine interfaces (HMIs) in the industrial control field, such as centralized monitoring systems in petrochemical plants or intelligent production line control consoles, the operating interface typically needs to integrate dozens of real-time data controls for pressure, temperature, valve status, and more. Traditional designs use a static layout solution, where the positions of all controls are fixed and written into the code during the development phase. This results in the same HMI interface being unable to adapt to the dynamic addition and subtraction of controls when switching between different processes (such as switching from production mode to equipment maintenance mode). When adding new fault diagnosis controls or temporary monitoring modules, developers must manually adjust the coordinate parameters in the code or even redesign the entire interface partition. This rigid layout mechanism seriously hinders the ability of industrial software to quickly respond to changes in business scenarios. Summary of the Invention
[0003] The present application provides a method and related device for automatic layout optimization of controls in a human-computer interaction interface, which are used to solve the problem in related technologies that the interface solidification cannot meet the needs of diversified usage scenarios.
[0004] In a first aspect, the present application provides a method for automatically optimizing the layout of controls in a human-computer interaction interface. The method comprises: 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, the new control is placed according to the position parameter of the new control.
[0005] Optionally, in a first implementation of the first aspect of the present application, the step of extracting spatial geometric properties of all controls on the current interface and generating an initial data set of all 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.
[0006] Optionally, in a second implementation of the first aspect of the present application, 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 step 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.
[0007] Optionally, in a third implementation of the first aspect of the present application, 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 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.
[0008] Optionally, in a fourth implementation of the first aspect of the present application, after the step of determining whether there is sufficient horizontal space within the horizontal coordinate range to accommodate the new control based on the geometric parameters of the new 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 overlap judgment with the boundaries of other surrounding controls is performed again.
[0009] Optionally, in a fifth implementation of the first aspect of the present application, the method further includes: 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.
[0010] Optionally, in a sixth implementation of the first aspect of the present application, the method further includes: 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.
[0011] A second aspect of the present application provides a device for automatically optimizing the layout of controls on a human-computer interaction interface, the device comprising: 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.
[0012] A third aspect of an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the processor is used to execute a computer program stored on the memory. When the processor executes the computer program, it implements the steps of the method for automatic layout optimization of controls in a human-computer interaction interface provided in the first aspect of the embodiment of the present application.
[0013] The fourth aspect of the embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for automatic layout optimization of controls in the human-computer interaction interface provided in the first aspect of the embodiment of the present application are implemented.
[0014] In summary, according to the automatic layout optimization method and related device of controls of a human-computer interaction interface provided by the present application, the spatial geometric properties of all controls of the current interface are extracted to generate an initial data set of all the controls; the initial data set is traversed according to the geometric parameters of the newly created controls to obtain the target spatial geometric properties of the current control among all the controls; according to 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 according to 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1A flow chart of a method for automatically optimizing the layout of controls in a human-computer interaction interface provided in an embodiment of the present application; Figure 2 A schematic diagram of a program module of an apparatus for automatically optimizing the layout of controls in a human-computer interaction interface provided by an embodiment of the present application; Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0016] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.
[0017] In order to solve the problem in related technologies that the interface is rigid and cannot meet the needs of diversified usage scenarios, the embodiment of the present application provides a method for automatically optimizing the layout of controls in a human-computer interaction interface, such as Figure 1 This is a flow chart of a method for automatically optimizing the layout of controls in a human-computer interaction interface provided by this embodiment. The method includes the following steps: Step 110: Extract the spatial geometric properties of all controls on the current interface and generate an initial data set of all controls.
[0018] Specifically, in the automatic layout optimization method of controls in the human-computer interaction interface, it is first necessary to extract the spatial geometric properties of all controls in the current interface and use this to generate a complete initial data set. The spatial geometric properties of controls usually include horizontal coordinates, vertical coordinates, width values, and height values. This information is the basis for building a spatial distribution model of controls. By scanning all existing controls on the interface and extracting their corresponding properties, a data set reflecting the current layout state of the interface can be constructed. This set provides a basis for subsequent calculations and layout decisions. In order to ensure information integrity and processing efficiency, the system needs to uniformly classify and structure all control properties so that they can be traversed, accessed, and dynamically updated, thereby laying a data foundation for the automatic layout process.
[0019] In an optional implementation of this embodiment, the steps of extracting the spatial geometric properties of all controls in the current interface and generating an initial data set for all controls include: scanning the spatial geometric properties of all controls in the current interface; wherein the spatial geometric properties include a horizontal coordinate, a vertical coordinate, a width value, and a height value; when it is detected that the height value of a target control is higher than a preset height threshold, splitting the target control into several sub-controls whose height values are equal to the preset height threshold; judging whether all controls have been scanned; if all controls have been scanned, generating an initial data set based on the spatial geometric properties of the several sub-controls and the spatial geometric properties of the remaining controls.
[0020] Specifically, the automatic control layout optimization method first scans all controls on the current interface through the interface rendering engine interface, obtaining the horizontal and vertical coordinates, width, and height information of each control in the two-dimensional plane. This information is retrieved using the geometry query API provided by the UI framework, ensuring a complete understanding of the distribution and size of each control in the interface. Next, the height data in the scanned result is compared with a preset height threshold (e.g., 40 pixels). Controls exceeding the threshold are vertically split into several sub-control blocks with a height equal to the threshold. Their widths and horizontal coordinates remain the same as the original control, while the vertical coordinates of the sub-controls are incremented 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 100-pixel-high control can be divided into three 40-pixel-high sub-blocks, achieving standardized geometric unit division. During the splitting process, an internal counter accumulates the number of processed original controls and their sub-control blocks and compares it with the number of controls in the interface. When the count matches the expected number of items, the geometric property scanning and splitting process is complete, ensuring that all control information has been fully collected and converted. Finally, the geometric information of all child controls and unsplit controls is aggregated into an initial data set. This data set stores each control's horizontal coordinate, vertical coordinate, width, and height in a structured list format, and associates the control identifier. For example, if the original control A is split into A1 and A2, the set will contain A1, A2, and the remaining control items.
[0021] It should be noted that splitting controls whose height exceeds a preset threshold into several equal-height units vertically essentially converts complex, irregular geometric shapes into standardized "geometric units," enabling them to be processed at a uniform granularity in subsequent spatial analysis and layout decisions. This segmentation allows each control to be viewed as consisting of several rectangular blocks (each with a height equal to the threshold) arranged in rows, reducing the overall control complexity to simple operations on multiple homogeneous sub-blocks. With standardized geometric units, the layout engine only needs to operate block by block in a gridded coordinate system when scanning, detecting overlaps, and finding free areas. For collision detection and spatial availability, fixed-height sub-control blocks facilitate the use of matrix or grid-based data structures to store interface state, known as "spatial block tables." This table divides the entire interface into rows and columns, with each sub-control block occupying exactly one or more adjacent cells. Therefore, using cells as the basic unit of calculation allows for faster Boolean operations when performing duplicate checks or connectivity checks, making it more efficient than directly checking all pixels or continuous coordinate ranges for controls of arbitrary height. For example, after a control with a vertical height of 100 pixels is split into three units of 40 pixels high, the detection of spatial overlap with surrounding controls only needs to be performed within the coordinate domain of the cubic sub-block level, without calling a complex polygon intersection algorithm.
[0022] Step 120: 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.
[0023] Specifically, the initial data set is traversed according to the geometric parameters of the new control, and the target geometric properties associated with the current control are obtained. This operation requires comparing 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 new control, and identifying the target control in the surrounding area where the new control may be placed. The identification conditions of the target control include but are not limited to the absence of other controls within the preset range in at least one direction around the existing control. The target control is then selected and set as the current control for placement judgment. At the same time, the target spatial geometric properties corresponding to the current control are obtained, including the coordinates, size and relative position of the current control and adjacent controls. This is the prerequisite for determining whether the new control has the placement conditions.
[0024] Step 130: Determine whether the new control can be placed in the area corresponding to the current control based on the geometric properties of the target space.
[0025] Specifically, after identifying the target geometric properties, it is necessary to further determine whether the new control can be placed in the area corresponding to the current control based on these properties. The basis for judgment is the geometric relationship between the geometric parameters of the new control and the spatial boundary of the current control, mainly whether there is an intersection or overlap in the coordinate range. The system uses the coordinate calculation method to analyze whether the placement boundary of the new control will enter the boundary range of the existing control. If there is no overlap and the expected position of the new control will not exceed the boundary area allowed by the entire interface, it can be determined that the spatial area corresponding to the current control meets the placement conditions. This judgment process ensures that the layout operation will not destroy the existing interface structure.
[0026] In an optional implementation of this embodiment, before the step of determining whether a new control can be placed in the area corresponding to the current control based on the target space geometric properties, the step also includes: performing multi-level sorting processing on the controls of the initial data set according to the sorting rules of the preset space priority to generate an ordered control queue; constructing a dynamic space margin analysis model based on the boundary coordinates of each control in the ordered control queue; calculating the horizontal and vertical spacing between adjacent controls through 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 of the current control and the potential available area below.
[0027] Specifically, during the interface layout calculation, the controls in the initial data set are first sorted in multiple levels according to preset spatial priority rules to generate an ordered control queue. This sorting uses the control's y-coordinate as the primary key, prioritizing controls with smaller y-coordinates. Controls with the same y-coordinate are then sorted from smallest to largest y-coordinate, ensuring that the control access order aligns with the visual reading order. For example, if control A is located at (10, 10), control B is located at (200, 10), and control C is located at (10, 60), the sorted queues are A, B, and C. After the sorting is complete, the ordered control queue is traversed and the boundary coordinates of each control are read to construct a dynamic space margin analysis model. This model divides the interface into closed intervals bounded by the boundaries of each control and the interface edge. A space margin matrix or grid data structure is used to track the remaining white space in real time. The space margin matrix is a data structure based on minimum cells, where each grid point records whether the corresponding coordinate is occupied by a control, allowing for quick query of available cells in subsequent calculations. The dynamic space margin analysis model calculates the horizontal and vertical spacing between adjacent controls and identifies potential usable areas based on this information. For example, if the horizontal spacing between controls A and B is 20 pixels and no less than a preset threshold, the rectangular area to the right of A can be included in the right potential usable area. When the vertical spacing between controls B and C meets the requirements, a lower potential usable area can be generated in the corresponding area below B. This calculation is based on the principle of rectangular collision detection. The boundaries of any two rectangles are projected onto the X or Y axis and the spacing is compared. If there is no overlap, it is considered usable space. All the right potential usable areas and lower potential usable areas thus derived will provide precise coordinate references for subsequent control placement.
[0028] Optionally, when controls are circular in shape, the layout system treats each control as a circle with its center as the center and its radius as the radius of influence. A collision occurs when the Euclidean distance between the centers of two controls is less than or equal to the sum of their radii. Compared to rectangular collision detection, circular collision detection does not rely on edge alignment and is therefore suitable for describing how controls diffusely influence the surrounding layout.
[0029] In an optional implementation of the present embodiment, the step of judging whether a new control can be placed in the area corresponding to the current control according to the target space geometric properties includes: obtaining 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; judging whether there is sufficient horizontal space to accommodate the new control within the horizontal coordinate range according to the geometric parameters of the new control and a preset horizontal spacing threshold; if so, judging 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 so, generating the first position parameter of the new control by the sum of the horizontal coordinate and width value of the current control, the vertical coordinate and the width and height value of the new control; judging whether there is overlap between the boundary of the new control and the boundaries of the surrounding controls according to the first position parameter and the spatial geometric properties of the remaining controls in the initial data set; if there is no overlap, judging that the new control can be placed in the area corresponding to the current control.
[0030] Specifically, after obtaining the target spatial geometry of the current control, the horizontal coordinate range of the potential usable area is calculated using the sum of its horizontal starting coordinate and width, along with the pre-read horizontal coordinate of the right edge of the interface. This range is the continuous interval from the right edge of the current control to the rightmost edge of the interface. It serves to limit the horizontal available space that can be retrieved during subsequent layout. For example, if the horizontal coordinate plus the width of a control is 150 pixels and the interface width is 800 pixels, the horizontal coordinate range is [151, 800], providing the primary candidate placement segment for the new control. Then, by comparing the actual width of the new control with the preset horizontal spacing threshold, it is determined whether there is sufficient horizontal margin within the coordinate range to accommodate the new control. 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, if the new control width is 100 pixels and the horizontal spacing threshold is set to 10 pixels, (800 - 151 + 1) ≥ (100 + 10) to consider the horizontal available space sufficient. This is to ensure that when new controls are placed horizontally, they do not exceed the boundaries while maintaining a safe distance from existing controls.
[0031] After confirming that horizontal space is feasible, the potential available area needs to be further verified vertically by combining the vertical coordinate and height values of the current control, 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, if the vertical coordinate of the control is 50 pixels and the height of the new control is 40 pixels, the height parameter of the new control is 30 pixels, and the vertical spacing threshold is 5 pixels, it is necessary to check whether the vertical coordinate of the area is outside [50-(30+5),50+(40+5)]. If the overlapping area does not intrude into this forbidden range, the vertical placement conditions are considered met, ensuring that the new control fits the layout in the context without interfering with existing controls.
[0032] Once both horizontal and vertical placement conditions are met, the first position parameter is generated based on the current control's horizontal coordinate plus its width and vertical coordinates, along with the width and height parameters of the new control. This parameter, in the form of a two-tuple (x, y), represents the coordinates of the top-left corner of the new control. For example, x = 150 + 1, y = 50, to determine the placement starting point. The generation of the first position parameter provides precise coordinates for subsequent visualization and rendering. These coordinates correspond to the control information in the initial dataset, ensuring a logically closed loop for the overall layout. Next, the first position parameter is checked for overlap with the spatial geometric properties of other controls in the initial dataset. Using a rectangular collision detection algorithm, the proposed placement area of the new control and the bounding rectangles of all controls in the dataset are projected onto the horizontal and vertical coordinate axes. If there is overlap in any of the projected dimensions, a conflict is determined; otherwise, no overlap is considered. For example, if the area of the new control is [151, 250] × [50, 80], placement is considered safe if the areas of other controls do not intersect this rectangle. Finally, after collision detection confirms there's no overlap, the potential space is determined to be suitable for placing the new control, enabling intelligent positioning of the control to the right of the current interface. This process ensures efficient space utilization while maintaining the independence and visual coordination of interface elements.
[0033] In an optional implementation of this embodiment, after the step of determining whether there is sufficient horizontal space within the horizontal coordinate range to accommodate the new control based on the geometric parameters of the new 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, generating a second position parameter 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 new control, and again performing a judgment on whether the boundaries of the new control overlap with the surrounding controls.
[0034] Specifically, if the width of the continuous available pixel interval to the right of the current control is determined to be less than the sum of the new control's width and the horizontal spacing threshold, the layout logic deems the horizontal placement strategy infeasible and conducts a vertical availability analysis of the potential available area below. The potential available area below is the continuous vertical interval between the sum of the current control's bottom vertical coordinate and its height to the bottom edge of the interface. The length of this interval is calculated by subtracting (the control's vertical coordinate + the control's height) from the interface height. This interval represents the vertical space where the new control can be inserted. To ensure a predetermined vertical spacing from surrounding controls, this interval length is compared with the new control's height and a preset vertical spacing threshold. The vertical spacing threshold is defined as the minimum pixel distance between adjacent controls to prevent intersecting or visually overlapping control edges. For example, if the new control's height is 30 pixels and the vertical spacing threshold is set to 5 pixels, the length of the available interval below must be at least 35 pixels to meet the placement requirements. Once the required length of the lower interval is confirmed, the second position parameter is generated based on the sum of the current control's horizontal and vertical coordinates plus its height. This parameter is a two-tuple representing the coordinates of the top-left corner of the newly created control. The horizontal coordinate is the same as the current control's horizontal coordinate, and the vertical coordinate is (the current control's vertical coordinate + the control's height + the vertical spacing threshold). For example, if the current control is located at 150 pixels horizontally, 100 pixels vertically, and 40 pixels high, 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 bounding box of the newly created control. Subsequently, this rectangular bounding box must be checked for overlap with the spatial geometric properties of the remaining controls in the initial data set to ensure that the vertical placement does not infringe on the area of existing controls. This overlap check is based on the principle of rectangular collision detection. The new control rectangle and the surrounding control rectangles are projected onto the X and Y axes respectively and the projected intervals are compared. If there is no overlap on either axis, it is determined that there is no conflict and the lower positioning is complete. This fault-tolerant mechanism not only provides secondary verification for the vertical placement of controls, but also enables safe distribution and flexible arrangement of interface elements at runtime by combining dynamic judgment of spatial geometric properties.
[0035] In another embodiment, the potentially available area below refers not only to the vertical space directly below the current control, but also to the horizontal scan space represented by the new starting row after a line break. Specifically, when the interface layout system detects that the current control's row can no longer accommodate the newly added control, it automatically moves to the next row, starting at the horizontal coordinate of 0 and scanning rightward to find available space. This line-breaking layout logic is similar to "automatic line wrapping" in text typesetting, emphasizing that after the current logical layout unit ends, the control is relocated to the starting point of the next row and attempts to continuously fill it horizontally. This mode sets the vertical coordinate of the newly added control to the maximum vertical coordinate of all controls in the previous row plus their corresponding height and vertical spacing threshold, and initializes the horizontal coordinate to 0. The system then determines, from left to right, whether there is sufficient horizontal space at the current location to accommodate the newly added control. If there is no conflict and the boundary constraints are met, the location is confirmed as a suitable placement point. This mechanism enables the layout system to have a dual strategy of in-line layout and automatic line wrapping, making it particularly suitable for interface scenarios with limited screen width or a large number of controls, while also improving space utilization efficiency and interface structure consistency. The potential space below the line break thus becomes a structural and sequential space compensation area. It is no longer just a local vertical gap between controls, but an important part of the entire interface layout strategy.
[0036] Step 140: If the new control can be placed in the area corresponding to the current control, the new control is placed according to the position parameters of the new control.
[0037] Specifically, when it is confirmed that the corresponding area of the current control meets the placement conditions, it can be placed on the interface according to the position parameters of the newly created control. The position parameters here include the specific coordinate points selected by the system for the newly created control. Combined with the size information of the control, its complete space occupation area can be determined. The system writes the newly created control into the interface graphic object according to the position parameters, so that it is formally presented on the visual interface. This placement action also marks the completion of the execution of the control layout behavior, ensuring that the control finds the appropriate position among the 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.
[0038] In an optional implementation of this embodiment, when the placement position of the new control is still not determined after traversing the potential available area, the 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 merged potential available area; the boundary coordinates of the new potential available area are updated by the dynamic space margin analysis model, and the coordinate range of the new potential available area is recalculated based on the geometric parameters of the new control; a secondary match is performed with the recalculated coordinate range and the width and height values of the new control; if the width value of the new potential available area 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 by the upper left corner coordinates of the new potential available area and the geometric parameters of the new 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 new control is placed based on the updated initial data set.
[0039] Specifically, in this embodiment, when all previously identified potential available spaces cannot meet the control placement requirements, the width and height information of each control in the established initial data set will be used to determine whether the preset merging conditions are met through the spatial distance and size ratio relationship of adjacent controls, so as to merge the boundaries of adjacent controls and create a larger available area. The merging conditions generally include that the distance between two controls in a certain direction is less than or equal to the preset merging threshold, and the rectangular area formed after merging does not overlap with other controls. For example, when the edge spacing between control A and control B in the horizontal or vertical direction does not exceed 10 pixels, the two can be regarded as adjacent mergeable objects. By taking the minimum horizontal and vertical coordinates and the maximum horizontal and vertical coordinates of the areas contained by the two, the boundaries are fused to generate a new rectangular area C. Subsequently, the boundary coordinates of the generated new potential available area are updated 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. It uses the minimum pixel unit or predefined grid as the calculation unit to record the occupancy and idle status of each area on the interface. On this basis, when the boundary of the new area C is updated, the model will automatically mark the state of the grid cells corresponding to the area as idle and recalculate the regional connectivity and spatial margin, so as to accurately identify the available range of the merged area at the grid level. Through this model, it is possible to quickly complete real-time monitoring of the width, height and spacing of the new area with the surrounding controls. Based on the boundary coordinates of the updated new potential available area, the actual length and width of the new area are again matched according to the preset width and height parameters of the new control, as well as the original horizontal and vertical spacing thresholds. The so-called secondary matching operation here refers to re-comparing the width of the merged area with the sum of the width of the new control plus twice the horizontal spacing threshold, and at the same time comparing the height of the merged area with the sum of the height of the new control plus twice the vertical spacing threshold. Only when the width of the new area is greater than or equal to the sum of the width of the new control and the two horizontal spacings, and the height is greater than or equal to the sum of the height of the new control and the two vertical spacings, can it be determined that the merged area meets the placement requirements. For example, if the width of the new area C is 300 pixels and the height is 200 pixels, the width of the new control is 100 pixels and the height is 50 pixels, and the horizontal and vertical spacing thresholds are both set to 10 pixels, it is necessary to verify that 300 ≥ (100 + 2 × 10) and 200 ≥ (50 + 2 × 10). If the verification is passed, the position calculation phase will be entered. When the merged new potential available area passes the secondary matching test, the third position parameter can be generated based on the coordinates of the upper left corner of the area and the width and height parameters of the new control. The third position parameter represents the landing point of the upper left corner of the new control in the interface space in the form of binary coordinates. The calculation method is to take the minimum horizontal coordinate of the merged area plus the horizontal spacing threshold, and the minimum vertical coordinate of the area plus the vertical spacing 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.
[0040] 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.
[0041] Specifically, when the pre-identified potential free area cannot accommodate a new control, the system first compresses the geometric dimensions of the already laid out controls based on the dynamic adjustment priority parameters of each control in the initial data set. These dynamic adjustment priority parameters define the degree to which each control can tolerate compression. For example, a function button can be reduced to 80% of its original size, while an information panel must remain full size. Therefore, by linearly scaling the width or height according to the inverse of the priority factor, additional horizontal or vertical space can be freed. For example, if a control is 200 pixels wide and the compression factor is set to 0.8, its width will be resized to 160 pixels, resulting in a 40-pixel horizontal margin. After the compression operation is complete, a dynamic space margin analysis model recalculates the remaining space to the right and below the control. This model uses a built-in grid data structure to track the occupied and unoccupied status of each cell on the interface. During real-time updates, newly free cells created by compression are added to the update list. Adjacent free cells are then merged based on their connectivity to form an expanded potential free area. At the same time, the system will also perform compensation processing on the boundaries of the extended area based on the width and height parameters of the new control. That is, the horizontal and vertical distances consistent with the control boundaries are added to the edges of the original free area 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 area will extend an additional 10 pixels outward to meet subsequent placement requirements. The extended potential available area is then elastically matched to determine 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 extra margin for the control and the surrounding space during placement to cope with dynamic content or subsequent layout adjustments. For example, when the horizontal elastic coefficient is 1.2, it is necessary to verify whether the width of the extended area is at least equal to (the width of the new control × 1.2) to ensure that there is a certain buffer space after placement. Once the matching conditions are met, the fourth position parameter can be generated based on the coordinates of the upper left corner of the expanded area and the size parameters of the newly created control. This parameter determines the final landing coordinates of the control in the form of (x, y). Finally, the system needs to perform offset calculations on the existing controls that have changed their positions due to compression based on the fourth position parameter, and synchronously update the offset horizontal and vertical coordinates and size information to the initial data set to keep the geometric properties of the set consistent with the interface rendering state. After completing the set update, the newly created control is finally laid out with the fourth position parameter, and it is presented in conjunction with the compressed control on the interface to ensure the rationality of global space allocation and the consistency of visual layout.
[0042] In an optional implementation of this embodiment, a state vector for representing the state of the environment is generated based on the spatial geometric properties of existing controls in the interface and preset functional semantic cluster information; a set of action candidate grids is obtained by performing two-dimensional grid division on the state vector; the candidate grid position with the highest score is determined by performing multiple rounds of strategy network reasoning and reward value calculation on the action candidate grid set; and the spatial geometric properties of the controls to be placed in the initial data set are updated based on the candidate grid positions.
[0043] Specifically, during intelligent control layout, a state vector representing the current environment state is generated based on the spatial geometric properties of existing controls in the interface and their corresponding functional semantic cluster information. Functional semantic clusters classify controls into specific semantic categories based on their functional type, such as input, display, or control. A global state vector is constructed by encoding geometric position information and semantic labels into a multidimensional vector and merging them according to the order of controls. This vector fully reflects the spatial distribution and functional grouping of the current interface layout and serves as input for policy reasoning. For example, each segment in the state vector can represent a control's semantic cluster, location coordinates, and dimensions. Combining multiple segments forms a high-dimensional state description with comprehensive spatial semantic representation. Based on the generated state vector, a two-dimensional grid is generated, dividing the entire interface area into several equal-sized grid cells. Grid areas already occupied by controls are excluded through spatial overlap, resulting in a set of candidate action grids that can serve as candidate locations for new controls. Each grid in this set represents a potential layout action, and each action corresponds to a two-dimensional coordinate point, indicating the probability of placing the control at that location. After obtaining a set of candidate action grids, the system invokes a policy network to perform multiple rounds of inference on each candidate location. The policy network is a neural network-based functional model that takes as input a state vector and candidate action encodings and outputs the expected reward value for each action. The reward calculation is based on multiple factors, including layout compactness, reasonable functional clustering, control alignment, and user habit weighting, with a weighted integration of these factors to form a comprehensive score. The policy network may use structures such as feedforward neural networks, graph neural networks, or attention mechanisms to model the nonlinear mapping relationship between state and action. After each round of inference, the reward values of all candidate actions are updated and ranked, ultimately selecting the candidate grid with the highest score as the optimal placement location. After determining the final candidate grid location with the highest score, the system extracts the coordinates of its upper left corner as the target location parameters and updates the spatial geometric properties of the control to be placed in the initial dataset. This involves replacing the control's horizontal and vertical coordinates with the coordinates of the candidate grid, while retaining the control's original width and height information, and marking the control as placed. Updated control information is incorporated into the interface's spatial model and state vector, providing real-time feedback for the next round of layout operations. This enables intelligent, orderly, and adaptive placement of controls within complex interfaces through policy learning. This mechanism not only adapts to changes in interface size and number of controls, but also continuously optimizes decision paths as data accumulates, demonstrating the shift in layout algorithms from rule-driven to policy-driven.
[0044] 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.
[0045] 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: 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; 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; 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; 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.
[0046] 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.
[0047] In an optional implementation of this embodiment, the automatic control layout optimization device further includes a construction module. The construction module is configured to: perform multi-level sorting of 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 based on the boundary coordinates of each control in the ordered control queue; calculate the horizontal and vertical spacing between adjacent controls 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 below the current control.
[0048] In an optional implementation of this embodiment, the judgment module is specifically used to: 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; determine whether there is sufficient horizontal space within the horizontal coordinate range to accommodate the new control according to the geometric parameters of the new control and the preset horizontal spacing threshold; if so, determine 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 so, generate the first position parameter of the new control by the sum of the horizontal coordinate and width value of the current control, the vertical coordinate and the width and height value of the new control; determine whether there is overlap between the boundary of the new control and the boundaries of the surrounding controls according to the first position parameter and the spatial geometric properties of the remaining controls in the initial data set; if there is no overlap, determine that the new control can be placed in the corresponding area of the current control.
[0049] In an optional implementation of this embodiment, the judgment module is also used to: when it is determined that there is insufficient horizontal space to the right of the current control, determine 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 the preset vertical spacing threshold; if it can be accommodated, generate a second position parameter through the sum of the horizontal coordinate, vertical coordinate and height value of the current control and the width value and height value of the new control, and perform another judgment on the overlap with the boundaries of the remaining surrounding controls.
[0050] In an optional implementation of this embodiment, the placement module is used for: when the placement position of the new control is still not determined after traversing the potential available area, merging the adjacent controls that meet the preset merging conditions according to the width and height values of each control in the initial data set to generate a new merged potential available area; updating the boundary coordinates of the new potential available area through the dynamic space margin analysis model, and recalculating the coordinate range of the new potential available area based on the geometric parameters of the new control; performing secondary matching with the recalculated coordinate range and the width and height values of the new control; if the width value of the new potential available area 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 upper left corner coordinates of the new potential available area and the geometric parameters of the new control; updating the spatial geometric properties of the controls involved in the merging process in the initial data set according to the third position parameter, and placing the new control based on the updated initial data set.
[0051] In an optional implementation of this embodiment, the placement module is used to: when the new control cannot be placed through the potential available area, compress the spatial geometric properties of the laid out controls according to the dynamic adjustment priority parameters of each control in the initial data set; calculate the space margin to the right and below the compressed control through a dynamic space margin analysis model to generate an extended potential available area, and perform boundary compensation on the extended area 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, generate a fourth position parameter based on the upper left corner coordinate of the extended area; calculate the offset of the control affected by the compression according to the fourth position parameter, update the initial data set, and execute the final placement operation of the new control.
[0052] According to the automatic layout optimization device for controls of 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 according to 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 according to 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.
[0053] According to the application plan Figure 3An electronic device provided in an embodiment of the present application can be used to implement the automatic layout optimization method for controls in the human-computer interaction interface of the aforementioned embodiment, mainly comprising: Memory 301, processor 302, and computer program 303 stored on memory 301 and executable on processor 302. Memory 301 and processor 302 are connected via communication. When processor 302 executes computer program 303, the method for automatically optimizing the layout of controls in a human-computer interaction interface in the aforementioned embodiment is implemented. The number of processors may be one or more.
[0054] The memory 301 can be a high-speed random access memory (RAM) memory or a non-volatile memory such as a disk drive. The memory 301 is used to store executable program code. The processor 302 is coupled to the memory 301 .
[0055] Furthermore, the embodiment of the present application also provides a computer-readable storage medium, which can be provided in the electronic device in the above embodiments. The computer-readable storage medium can be the above Figure 3 Memory in the illustrated embodiment.
[0056] The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method for automatically optimizing the layout of controls in a human-computer interaction interface described in the aforementioned embodiments. Furthermore, the computer-readable storage medium may be a USB flash drive, a mobile hard drive, a read-only memory (ROM), RAM, a magnetic disk, or an optical disk, among other media capable of storing program code.
[0057] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0058] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.
[0059] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions 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, the new control is placed according to the position parameter of the new 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 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.
3. The method for automatic layout optimization of controls in a human-computer interaction interface according to claim 2, characterized in that: 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.
4. The method for automatic layout optimization of controls in a human-computer interaction interface according to claim 3, 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 properties 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.
5. The method for automatic layout optimization of controls in a human-computer interaction interface according to claim 4, 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 overlap judgment with the boundaries of other surrounding controls is performed again.
6. The method for automatic layout optimization of controls in a human-computer interaction interface according to claim 3, 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.
7. The method for automatic layout optimization of controls in a human-computer interaction interface according to claim 3, 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.
8. 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 the human-computer interaction interface includes: 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.
9. 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 7 are implemented.
10. 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 7 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
Control display method and device, equipment, storage medium and product
CN115509526A
User interface generation system
US20200081692A1
Method and apparatus of processing data, device and storage medium
US20210055854A1
