Method and system for adjusting software window based on artificial intelligence

Through the software window adjustment method based on artificial intelligence, a screen resource and window demand distribution model is established, and the window layout is dynamically adjusted using optimal transportation theory and entropy regularization optimization algorithm, which solves the shortcomings of fixed and static allocation strategies in the existing technology, and realizes efficient and flexible window management.

CN120029498APending Publication Date: 2025-05-23SHIJIAZHUANG JIAO SHANG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510044310.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-11
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In the prior art, fixed rules and static allocation strategies for screen window layout lack flexibility and cannot adapt to high task density and refined layout requirements.

Method used

Using the software window adjustment method based on artificial intelligence, we will build a comprehensive cost function by establishing a screen resource distribution model and a window demand distribution model, and use the optimal transportation theory and entropy regularization optimization algorithm to dynamically adjust the window layout.

Benefits of technology

It realizes intelligent adaptation of window layout and user operation needs, improves screen utilization efficiency and flexibility of window interaction, and solves the problem of inflexible window dynamic adjustment response in complex interactive scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029498A_ABST
    Figure CN120029498A_ABST
Patent Text Reader

Abstract

The invention relates to the field of software window adjustment, and discloses a software window adjustment method and system based on artificial intelligence, and the method comprises the following steps: building a screen resource distribution model, discretizing a screen space into a plurality of pixel points, and recording the coordinate and weight of each pixel point, the weight being used for representing the availability of the pixel points; establishing a window demand distribution model, and determining an ideal central position and a corresponding weight of each window according to the position information and task importance of the currently opened window; a cost function is constructed and used for describing the distribution cost between the screen resource points and the window demand points, and the cost comprises the geometric deviation cost of the screen resource points and the window demand points, the window weight matching cost and the layout symmetry cost. According to the method, a dynamic screen resource distribution modeling and window demand distribution analysis scheme based on artificial intelligence is adopted, intelligent adaptation of the window layout and the user operation demand is achieved, and the problem that the dynamic adjustment response of the window is not flexible in a complex interaction scene is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software window adjustment, and in particular to a software window adjustment method and system based on artificial intelligence. Background Art

[0002] In modern computing devices, the management and adjustment of screen windows is an important functional module in operating systems and application software. With the improvement of device screen resolution and user task complexity, multi-window and multi-tasking scenarios have become the mainstream usage mode. Users need to handle multiple window tasks simultaneously in a limited screen space, and the requirements of different windows vary significantly in spatial layout and priority allocation. Especially in a multi-monitor environment, resource distribution and window switching between different monitors are more complicated, and traditional window management technology faces many new technical challenges. The screen utilization efficiency and the flexibility of window interaction have a direct impact on user experience and system performance.

[0003] In the prior art, fixed rules or static layout strategies are usually used to adjust screen windows. For example, some operating systems provide a simple window partitioning scheme by default, allocating window positions and sizes through predefined areas. These schemes perform well in low task density situations, but when the number of tasks increases or users have more sophisticated requirements for window positions, their lack of flexibility and adaptability is obvious. In addition, some technologies attempt to optimize the layout by manually dragging or adjusting windows, but this method has a high operating cost for users and it is difficult to ensure the global rationality of resource allocation. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention provides an artificial intelligence-based software window adjustment method and system, which solves the problem that the fixed rules and static allocation strategies of screen window layout in the prior art lack flexibility and cannot adapt to high task density and refined layout requirements.

[0005] To achieve the above purpose, the present invention is implemented by the following technical scheme: a software window adjustment method based on artificial intelligence, comprising the following steps: Establish a screen resource distribution model: Screen resource distribution is the basis of window adjustment.

[0006] By discretizing the screen space, the screen is divided into several pixels, each of which contains position coordinates and resource weights.

[0007] The resource weight of a pixel is initially set to 1, indicating evenly distributed screen resources.

[0008] The weight value can be adjusted according to the screen characteristics. For high-resolution screens, the weight distribution can be adjusted according to the proportion of physical pixels.

[0009] After normalization, the sum of all pixel weights is equal to 1.

[0010] Build a window demand distribution model: Window demand distribution is used to describe the demand weight and ideal center location of each window.

[0011] According to the user's current operation, the window's location information and importance parameters are extracted.

[0012] The setting of window demand weight is based on window priority. The priority is determined by multi-dimensional parameters such as task importance and user interaction frequency.

[0013] The ideal center position is set according to the initial position of the window and can be adjusted based on the user's historical operation preferences.

[0014] The normalization process is also performed so that the sum of the demand weights of all windows is 1.

[0015] Construct a comprehensive cost function: The comprehensive cost function is used to measure the allocation cost between screen resource points and window demand points.

[0016] Geometric deviation cost: measures the distance from the pixel to the center of the window, reflecting the rationality of the allocated space.

[0017] Weight matching cost: measures the matching degree between pixel weight and window requirement weight. The lower the matching degree, the higher the cost.

[0018] Layout symmetry cost: Evaluate the visual effect of window layout by calculating the symmetry of the window.

[0019] The cost function adjusts the priorities of different objectives through weight parameters. The weight parameters are determined by the actual application scenario. The office scenario focuses more on the geometric deviation cost, while the entertainment scenario focuses more on the layout symmetry.

[0020] Dynamic update window requirements: User behavior is dynamic. The window demand distribution needs to be updated in real time to adapt to user operations.

[0021] Each time the user performs an action (opening, closing, moving a window), it triggers a recalculation of the demand distribution.

[0022] The demand distribution is estimated using variational inference techniques. It is assumed that the window demand follows a multidimensional Gaussian distribution, whose mean represents the ideal center position of the window and the covariance reflects the uncertainty of the demand.

[0023] The demand distribution model is updated by optimizing the variational lower bound to make it closer to the actual demand.

[0024] The updated window demand distribution will be used as the input for resource allocation optimization.

[0025] Best Transportation Optimization: Build the optimal transportation model based on screen resource distribution and window demand distribution.

[0026] The optimal matching relationship between screen resources and window requirements is determined through optimal transportation theory.

[0027] To improve computational efficiency, an entropy regularization term is introduced. The entropy regularization term balances the sparsity of the allocation matrix and the optimization complexity.

[0028] The extended Sinkhorn algorithm is used to solve the optimal allocation.

[0029] The initial allocation matrix is ​​initialized by the cost function and gradually converges to the optimal solution through iterative normalization operations.

[0030] Dynamically adjust window layout: According to the results of the best transport optimization, the actual position and size of each window is determined.

[0031] The actual position of the window is calculated by weighting the matching strength of the assignment matrix.

[0032] The actual size of the window is adjusted based on how well the assigned weights match the demand weights.

[0033] During the window adjustment process, a smooth transition function is applied to avoid sudden jumps or changes in the window position.

[0034] Dynamic iteration: The method runs in a loop, and each user operation triggers the re-execution of the entire process.

[0035] In each iteration, the screen resource distribution remains unchanged, and only the window demand distribution and matching results are dynamically updated.

[0036] Real-time monitoring of user behavior ensures that the method can respond in a timely manner, while ensuring the continuity and stability of layout optimization.

[0037] Preferably, the weight of each pixel in the screen resource distribution model is determined by the screen resolution and device characteristics and satisfies the weight normalization constraint.

[0038] Preferably, the weight of each window in the window demand distribution model is determined according to the importance of the window, the task priority or the user's historical operation behavior, and satisfies the weight normalization constraint.

[0039] Preferably, the cost function includes the following parts: Geometric deviation cost, which is used to measure the distance between the screen resource point and the center of the window; Weight matching cost, used to measure the mismatch between screen resource weight and window demand weight; Layout symmetry cost, used to measure the visual symmetry of window distribution.

[0040] Preferably, the optimal transport model is optimized by adding an entropy regularization term to improve computational efficiency, and the entropy regularization term is used to balance the sparsity of the optimal allocation matrix and the computational complexity.

[0041] Preferably, the change in user behavior includes opening, closing, moving or resizing of a window, and the change in user behavior causes a dynamic update of the window demand distribution model, and estimates the uncertainty of the window demand distribution through a variational inference method.

[0042] Preferably, the optimal matching relationship between screen resources and window requirements is optimized by extending the Sinkhorn algorithm, and the extended Sinkhorn algorithm includes the following steps: Initialize the optimal allocation matrix through the entropy regularization formula; Normalize the allocation matrix based on the constraint conditions and adjust the matching strength; The optimization of the allocation matrix is ​​repeated until convergence.

[0043] Preferably, the output of the window layout adjustment includes the following: The actual center position of the window is determined by weighted calculation of the matching strength between the screen resource distribution and the window demand distribution; The actual size of the window is determined by a weighted calculation of the window demand weight and the allocated resource weight.

[0044] Preferably, the dynamic adjustment of the window layout is processed by a smooth transition function to avoid window jumping or abrupt changes, and the smooth transition function is limited according to the range of changes in the window position and size.

[0045] An artificial intelligence-based software window adjustment system based on the above method comprises: The screen resource distribution module is used to discretize the screen space and generate screen resource distribution. This module discretizes the screen space, assigns weights to each pixel, and forms a screen resource distribution model.

[0046] Generally speaking, the screen resolution determines the pixel division accuracy. For a common 1920×1080 screen, each pixel is considered as a resource unit. The initial weight distribution is usually uniform, and can be dynamically adjusted later based on the physical characteristics of the screen (differences in importance between edge areas and center areas).

[0047] The window demand distribution module is used to establish a window demand distribution model and determine the ideal center position and demand weight of each window; the window demand distribution module captures the space demand and weight distribution of each window in real time. The initial setting of window weights is usually related to the task type or importance. A text processing window may be given a higher priority, while an auxiliary window running in the background may have a lower weight.

[0048] The core of this module is the dynamic update of window demand. When a user opens a new window, the system automatically assigns an initial weight to the new window and adjusts the demand distribution of all windows by normalizing it with the weights of existing windows. When a user operates an existing window (moves or resizes it), the demand distribution is updated synchronously. When a user moves a window to the center of the screen, the weight of the window may be appropriately increased to reflect its interactive importance.

[0049] The optimization engine module is used to determine the optimal matching relationship between screen resource distribution and window demand distribution through iterative optimization based on the optimal transportation theory; the optimization engine module is the core computing unit of the system. By calling the solution algorithm of the optimal transportation theory, the matching relationship between screen resources and window demand is calculated. The optimization process aims to minimize the comprehensive cost function to ensure that resource allocation meets user needs while taking into account the logic and visual experience of the layout.

[0050] The computational efficiency of the optimization process is crucial to the real-time performance of the system. To this end, this module improves the traditional optimal transportation model through the entropy regularization method. The regularization method not only improves the calculation speed, but also optimizes the sparsity of the allocation matrix to ensure smooth adjustment of the window layout. For multi-monitor environments, the optimization engine module runs independently in the resource pool of each monitor, while considering the weight conversion relationship between monitors.

[0051] The layout adjustment module is used to dynamically adjust the actual position and size of the window according to the optimal matching relationship; the layout adjustment module dynamically adjusts the position and size of each window according to the optimization results. The window position is determined by the weighted center position calculated by the optimization engine. The window size is scaled according to the weight of the allocated resources. During the adjustment process, the module will smooth the change range of the window to avoid user discomfort caused by window jumping or abrupt changes.

[0052] The user behavior monitoring module is used to monitor user operation behaviors in real time and update the window demand distribution; the user behavior monitoring module captures all window operation events through the system interface, including window opening, closing, moving, and resizing. Each time an event is monitored, the system triggers the recalculation of the window demand distribution and starts the iterative update of the optimization engine module.

[0053] The interface rendering module is used to update the window layout in real time according to the adjustment results; the interface rendering module renders the optimized window layout to the screen in real time according to the output results of the layout adjustment module. This module supports a variety of animation effects to enhance the visual experience of window adjustment. When the window position changes, the module will display the adjustment process in the form of a smooth animation to prevent users from perceiving obvious switching transitions.

[0054] The present invention provides a software window adjustment method and system based on artificial intelligence, which has the following beneficial effects: 1. The present invention adopts dynamic screen resource distribution modeling and window demand distribution analysis technology based on artificial intelligence to achieve intelligent adaptation of window layout and user operation requirements. Compared with the allocation method of fixed window position or relying on simple rules in the prior art, it solves the problem of inflexible dynamic adjustment response of windows in complex interactive scenarios.

[0055] 2. By combining the optimal transportation theory with the entropy regularization optimization algorithm, the present invention effectively reduces the computational complexity of resource allocation and ensures the realization of the global optimal layout. Compared with the traditional layout algorithm based on exhaustive or heuristic methods, it overcomes the shortcomings of long calculation time and poor stability of layout results in large-scale window adjustment.

[0056] 3. The present invention optimizes the user experience of window layout adjustment by using a smooth transition algorithm and a real-time iteration mechanism. The window position jumps or abrupt changes are avoided during the adjustment process. Compared with the common instantaneous adjustment method in the prior art, the problem of user discomfort with visual switching is solved, and the system operation fluency is improved.

[0057] 4. The present invention adopts modular design, combined with the weight allocation strategy of multi-tasking environment and multi-display scene, to achieve accurate response to different window requirements. Compared with the single screen optimization solution in the prior art that lacks support for multi-display layout, the present invention solves the technical bottleneck of poor adaptability of window size and position when switching between multiple screens. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is a schematic diagram of the method flow of the present invention; Figure 2 It is a system architecture diagram of the present invention. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the specification of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] Example 1 Please see attached Figure 1 , an embodiment of the present invention provides a software window adjustment method based on artificial intelligence, comprising: S1. Establish screen resource distribution model: In the software window adjustment method, the establishment of the screen resource distribution model is the basic step of the entire system. Its function is to quantify the screen space into operable resource units and provide basic data support for subsequent window demand matching and optimization. The screen resource distribution model is directly related to the subsequent window demand distribution model, and the two together constitute the core input of optimal transportation optimization. In this step, the screen is abstracted as a set of discrete pixel points, and a mathematical model is established for the allocation and scheduling of screen resources by defining their position and weight attributes.

[0061] In this embodiment, the method for establishing screen resource distribution includes the following technical contents: In general, screen resource distribution is represented by discretizing the screen space into a set of pixels. The screen discretization process can be performed according to the physical resolution of the screen. For example, when the screen resolution is 1920×1080, it is divided into 1920 columns and 1080 rows of pixels. Each pixel is represented by a two-dimensional coordinate ( ) indicates that is the horizontal axis, Is the vertical axis.

[0062] In one possible implementation, the weight of the screen resources It also needs to be introduced to describe the availability or importance of each pixel. Initially, the weight Usually set to a uniform value, e.g. This evenly distributed weighting works well in most scenarios, especially when different areas of the screen are of equal importance.

[0063] Specifically, the weight value The definition of can be adjusted dynamically according to the application scenario. For example, when certain areas of the screen (such as the center area of ​​the display) are more important, the weight of the pixels in this area can be increased. As an option, the weight value can be associated with the usage mode of the display. For example, by detecting the focus area of ​​the current user's line of sight, the weight of the pixels in this area can be dynamically increased, thereby improving the accuracy of resource allocation.

[0064] In some embodiments, the screen resource distribution needs to satisfy the normalized weight constraint. That is, the sum of the weights of all pixels must be equal to 1. Its mathematical form is:

[0065] in Indicates the total number of pixels. For example, for a 1920×1080 resolution screen, the total number of pixels is During the normalization process, the weights can be adjusted by the following formula:

[0066] This normalization operation ensures the computability of the model and provides a mathematical basis for subsequent optimal transportation optimization.

[0067] In a possible extended implementation, the distribution of screen resources can also take into account a multi-screen environment. In a multi-screen environment, the resolution and display characteristics of different displays may be different, such as the difference in importance between the main display and the auxiliary display. In this case, different global weights can be assigned to the pixels of different displays. For example, the initial weight of the pixels of the main display can be set to twice that of the auxiliary display. The specific weight distribution can be achieved by the following formula:

[0068] in and Respectively represent the total number of pixels of the primary display and the secondary display.

[0069] As an extension, this embodiment can further adjust the weight according to the physical size of the screen. For example, when the screen ratio is 16:9, the aspect ratio correction factor can be introduced. This factor is used to weight the vertical or horizontal coordinates of the pixel points to more realistically reflect the spatial distribution characteristics of the screen.

[0070] In another implementation, the screen resource distribution model can be further optimized in combination with environmental perception technology. For example, by using an ambient light sensor to detect the light intensity around the screen, and adjusting the pixel weights accordingly. In low-light environments, the weights of pixels close to the center of the user's line of sight can be increased; while in high-light environments, the weights of the edge areas of the screen can be appropriately increased to enhance the user's visual experience.

[0071] Through the above technical content, this embodiment completes the establishment of the screen resource distribution model. The screen resource distribution model is a set of discrete pixels, which describes the spatial position and weight attributes of the pixels and provides a normalized mathematical representation, providing high-precision input data for window demand matching and optimal transportation optimization.

[0072] S2. Establish window demand distribution model: The window demand distribution model is one of the core parts of the software window adjustment method, corresponding to the aforementioned screen resource distribution model. Both serve as inputs for optimal transport optimization. The window demand distribution is used to characterize the spatial location requirements and resource demand weights of each window. Its establishment process involves the initial position acquisition of the window, task priority evaluation, and normalization processing. The window demand distribution model is dynamically related to user behavior and needs to be updated in real time to adapt to user operation changes.

[0073] In this embodiment, the establishment of the window demand distribution model specifically includes the following technical contents: In general, the window demand distribution can be expressed as a set of discrete window demand points: .in Indicates The ideal center coordinates of the window, Indicates the demand weight of the window. Ideal center position It is usually determined based on the current position information of the window. For example, the initial position can be directly obtained from the window position parameters provided by the operating system window manager.

[0074] As an option, the window demand weight The calculation of can be associated with task priority. Task priority can be comprehensively evaluated by analyzing the task type, interaction frequency, and context information of the window. Specifically, different types of windows such as document editing windows and video playback windows can be assigned different basic weights. For example, for office scenarios, document windows may have a higher priority; while for entertainment scenarios, video windows may be more important.

[0075] In one possible implementation, the window weight The evaluation can be dynamically adjusted based on user behavior data. For example, when a user switches to a certain window multiple times, the demand weight of the window can be automatically increased. The historical usage frequency of the window can also be used as an important reference factor for weight calculation. Mathematically, the window demand weight can be updated using the following formula:

[0076] in, Indicates The frequency of use of the window, is the total number of windows.

[0077] Specifically, the window demand distribution must also satisfy the weight normalization constraint, that is, the sum of the weights of all windows must be 1. This normalization operation can be achieved using the following formula:

[0078] The normalization operation ensures that the total resource demand of the window demand distribution matches the supply capacity of the screen resource distribution.

[0079] In some embodiments, the center position of the window requirement Adjustments can be made based on user preferences and historical operation data. For example, when a user is used to placing the document window to the left, an offset factor can be added to the model to make the ideal center position of the window biased to the left side of the screen. The adjustment factor can be expressed by the following formula:

[0080] in is the initial position of the window, is a position offset based on user preference.

[0081] As a possible extension, this embodiment can also optimize the window demand distribution in combination with a multi-tasking scenario. In a multi-tasking scenario, the weights between different windows can be dynamically allocated according to the urgency of the task. For example, when a user is conducting a video conference, a window related to the conference (such as a conference software window) can be assigned a higher weight, while the weights of other windows are reduced accordingly.

[0082] In another implementation, the window demand weight can take into account the size of the window. For example, a larger window may require more resources, so the window area may be used to determine the window demand weight. Adjust its weight:

[0083] in For the The area of ​​the window.

[0084] The establishment of the window demand distribution model can also be combined with context-aware technology. For example, the ambient light sensor detects the brightness of the user's current environment and automatically adjusts the center position and weight of the window. For example, in a dark environment, the position of the main window can be closer to the center of the screen to reduce the user's visual fatigue.

[0085] Through the above steps, the window demand distribution model achieves a comprehensive description of window location requirements and resource requirements, and matches the screen resource distribution model. Together, the two provide reliable input data for solving the optimal transportation model. The flexibility and dynamics of the model enable it to adapt to the diverse needs of users and provide important support for window layout optimization.

[0086] S3. Construct a comprehensive cost function: The comprehensive cost function is the core of the matching of screen resource distribution and window demand distribution in the present invention, and is used to quantify the cost of allocating screen resource points to window demand points. The cost function combines multiple factors such as geometric position, weight matching, and visual layout, and provides a quantifiable target value for subsequent optimal transportation optimization. Through the multi-objective design of the cost function, the rationality and coordination of the window layout can be ensured, while adapting to the dynamic needs of users.

[0087] In this embodiment, the construction of the comprehensive cost function includes the following contents: In general, the cost function is implemented by a weighted combination of geometric deviation cost, weight matching cost and layout symmetry cost. The cost function is expressed as:

[0088] in: : Indicates screen resource points Assign to window demand points total cost.

[0089] : Geometric deviation cost, used to measure the geometric distance between two points.

[0090] : Weight matching cost, used to reflect the matching degree between resource weight and demand weight.

[0091] : Layout symmetry cost, used to evaluate the visual symmetry of window distribution.

[0092] , , : They are the weighting coefficients of geometric deviation, weight matching and layout symmetry, respectively, which are used to adjust the priorities of different objectives.

[0093] In one possible implementation, the geometric deviation cost It is the basic part of the cost function, which is mainly used to reflect the distance between the screen resource point and the window demand point in the geometric space. Specifically, the geometric deviation cost can be calculated by the following formula:

[0094] in: : Represents the two-dimensional coordinates of the screen resource point.

[0095] : Represents the ideal center coordinates of the window demand point.

[0096] : is the square of the Euclidean distance between two points.

[0097] As an option, the geometric deviation cost can also be modified in combination with screen boundary conditions. For example, when some windows are restricted to a specific screen area, the geometric deviation cost can be added with a boundary constraint term to penalize allocations beyond the boundary.

[0098] Specifically, the weight matching cost Used to measure the weight of screen resource points and the window demand weight The calculation formula of weighted matching cost is as follows:

[0099] in: : Window demand weight.

[0100] : Screen resource weight.

[0101] : Indicates the weight difference when the window demand weight is greater than the screen resource weight.

[0102] In a possible implementation, the definition of weighted matching cost can be further optimized. For example, for specific scenarios (such as multi-tasking office), window interaction weights can be introduced to enhance priority support for windows that users frequently operate.

[0103] Layout symmetry cost It is an important part of the comprehensive cost function and is used to ensure the visual symmetry and neatness of the window layout. In general, the symmetry cost can be calculated by the following formula:

[0104] in: and : Respectively represent the width and height of the screen.

[0105] and : Respectively represent the normalized positions of the screen resource points in the horizontal and vertical directions.

[0106] As an option, the symmetry cost can also be extended in combination with the relative position of windows. For example, when multiple windows need to be arranged in a specific pattern (such as matrix arrangement), the layout can be optimized by adding the window spacing term. The specific cost formula can be adjusted as follows:

[0107] in Represents the sum of the inverse distances between windows, used to avoid over-clustering of windows.

[0108] In some embodiments, the weighting coefficient , , It can be adjusted dynamically according to the actual application scenario. For example: The weight of geometric deviation cost in office scenarios Can be set to a higher value to ensure more precise window positioning.

[0109] The weight of layout symmetry cost in entertainment scenarios Can be given higher priority to improve the visual experience.

[0110] Through the above design, the comprehensive cost function realizes the quantification and trade-off of multi-objective costs. Combining user needs and application scenarios, the comprehensive cost function provides a clear mathematical expression for optimal transportation optimization, ensuring the matching efficiency and layout effect of screen resources and window requirements.

[0111] S4. Dynamic update window requirements: After the comprehensive cost function is constructed, the window demand distribution model needs to be dynamically adjusted as user operations change. The user's window demand is constantly changing, so when adjusting screen resources to match window distribution, real-time update of window demand distribution is crucial. This step captures user operation behavior and dynamically updates the core parameters of window demand distribution to keep the window adjustment method adaptable to user interaction.

[0112] In this embodiment, the dynamic update of the window demand distribution specifically includes the following contents: Generally speaking, user behavior changes can be manifested as opening, closing, moving, resizing, or switching tasks. These behaviors directly affect the demand weights in the window demand distribution model. and ideal location To adapt to these changes, the window demand distribution needs to be recalculated in real time.

[0113] Specifically, when a user opens a new window, the system adds a new demand point to the window demand distribution model. At this time, the initial weight of the new window is The value is usually assigned based on the window type or task type. For example, the initial weight of a document window in an office scenario may be higher than that of a chat window in an entertainment scenario. In some embodiments, the initial position of a new window Directly determined by the window creation position provided by the operating system.

[0114] As an option, when a user closes a window, the system removes the corresponding demand point and renormalizes the demand weights of the remaining windows. The normalization process ensures that the total resource demand of the window demand distribution matches the screen resource distribution, and the formula is as follows:

[0115] in Indicates the total number of windows that currently exist.

[0116] In one possible implementation, when the user adjusts the window position or size, the ideal position of the window and weight will be updated simultaneously. For example, when a window is moved to the center of the screen, its weight can be increased to reflect the importance of that location. The weight update formula can be defined as:

[0117] in Represents the incremental weight calculated based on the new position of the window.

[0118] Specifically, the update of window demand distribution caused by changes in user behavior not only involves weights, but may also require updating the uncertainty parameters of the window. In some embodiments, the uncertainty of window demand distribution can be estimated by variational inference methods. Assume that the window demand weight follows a Gaussian distribution with a mean of , the covariance is The optimization goal of variational inference is to maximize the following variational lower bound:

[0119] in: is the approximate distribution of window demand weights.

[0120] is the joint distribution of window weights and screen resource matching.

[0121] In another possible implementation, the system can make long-term adjustments based on historical data of user operations. For example, for windows that users frequently switch between, their demand weights can be dynamically accumulated to adapt to the user's interaction habits. The cumulative formula for historical weights is:

[0122] in It is the balance coefficient between historical weight and current weight, and usually takes a value between 0.5 and 0.9.

[0123] In some embodiments, when a user switches tasks (e.g., from work mode to entertainment mode), the system will globally adjust the window demand weights. For example, the video window demand weight in entertainment mode can be greatly increased, while the work-related window weights can be reduced accordingly. This mode switching can be achieved through a task priority table, where different task types correspond to different window weight distribution templates.

[0124] In addition, in a multi-monitor scenario, the logic for updating the window demand distribution needs to take into account the differences in the monitors. For example, when a window moves from the primary monitor to the secondary monitor, its weight can be reduced to reflect the change in priority of the window. The formula for weight adjustment can be defined as:

[0125] in is the priority factor of the display, the primary display , auxiliary display .

[0126] Through the above method, the dynamic update of window demand distribution can reflect the user's interactive behavior and operating habits in real time. The updated distribution not only ensures the real-time performance of the method, but also provides accurate input data for the next step of resource matching and layout optimization.

[0127] S5. Best Transportation Optimization: After the dynamic update of the window demand distribution is completed, the matching of the screen resource distribution and the window demand distribution needs to be achieved through optimal transportation optimization. The purpose of optimal transportation optimization is to efficiently allocate screen resources to window demand points at the lowest comprehensive cost. This step ensures the global optimal use of resources by optimizing the distribution relationship between screen pixels and window demand, and provides a decision basis for subsequent window layout adjustments.

[0128] In this embodiment, the specific implementation of optimal transportation optimization includes the following technical contents: In general, the solution to the optimal transportation problem depends on the distribution of screen resources. and window demand distribution The match between the two is given by the joint distribution Indicates that For resource points And demand point The matching strength.

[0129] Specifically, the goal of optimal transport optimization is to minimize the comprehensive cost between screen resources and window requirements. Its mathematical form is:

[0130] in: : represents the set of joint distributions that satisfy the marginal distribution constraints, that is:

[0131] : is the comprehensive cost function, which has been defined in the above step S3.

[0132] As an option, in order to improve computational efficiency, an entropy regularization term can be introduced in the optimal transportation optimization. The entropy regularization term is used to balance the sparsity of the allocation matrix and the computational complexity. The specific form is:

[0133] in: : is the regularization coefficient, which represents the influence weight of the entropy term on the optimization objective.

[0134] In a possible implementation, the introduction of the entropy regularization term can also improve the stability of the optimization results, especially when there are many screen resource points and window demand points, by increasing the continuity of the allocation and avoiding the emergence of local optimal solutions.

[0135] In general, the solution to optimal transportation optimization is implemented using the extended Sinkhorn algorithm. The Sinkhorn algorithm satisfies the edge distribution constraints while maintaining computational efficiency through iterative normalization operations. The specific steps include: Initial allocation matrix Calculated by the following formula:

[0136] in is the comprehensive cost function.

[0137] Normalize the allocation matrix to satisfy the marginal distribution constraint. The specific operation is:

[0138] After normalization, the updated allocation matrix is:

[0139] In some embodiments, in order to speed up the convergence speed, a dynamic step size can be set for the iterative process of the Sinkhorn algorithm. The selection of the dynamic step size can be combined with the convergence index of the allocation matrix, for example:

[0140] in is the preset convergence threshold, is the Frobenius norm of the matrix.

[0141] As an extension, optimal transportation optimization can also be enhanced by combining nonlinear constraints. For example, to avoid excessive concentration of resource allocation in window layout, allocation balance constraints can be introduced, whose mathematical form is:

[0142] in It is an allocation balance parameter used to limit excessive resource usage by a single window.

[0143] In addition, in multi-display scenarios, optimal transportation optimization requires the modification of the comprehensive cost function in combination with the display characteristics. For example, when the resource point comes from the primary display, the weight of the geometric deviation cost can be reduced. to increase the priority of the primary display resources.

[0144] Through the above method, optimal transportation optimization provides an efficient solution for matching screen resource distribution with window demand distribution. The optimization result not only meets the global optimality, but also provides accurate resource allocation information for the next step of window layout adjustment.

[0145] S6. Dynamically adjust window layout: After the optimal transport optimization is completed, the actual position and size of each window needs to be dynamically adjusted according to the calculation results. This step is directly based on the optimal allocation matrix The final layout parameters of the window on the screen are determined by comprehensively calculating the matching strength of resource points and demand points based on the output. The adjustment process not only needs to accurately respond to the resource allocation results, but also needs to ensure the visual smoothness of the adjustment through a smooth transition algorithm. Ultimately, real-time optimization of the window layout is achieved, and the user operation experience is enhanced.

[0146] In this embodiment, the implementation of window layout adjustment includes the following: Generally, the actual position and size of the window are determined by the allocation weight of the screen resource points and the matching strength of the window demand points. Specifically, the center position of the window It can be obtained by weighted calculation of the allocation matrix, and its formula is:

[0147] in: : Coordinates of the screen resource point.

[0148] : Indicates a resource point and window demand point The matching strength.

[0149] : Indicates window The actual center location.

[0150] As an option, when the resource allocation results are highly concentrated in certain specific areas, the above calculation results can be smoothed. For example, by introducing a location smoothing factor The window position is weighted updated, and the formula is:

[0151] in: : is the smoothing coefficient for position update, usually ranging from 0.3 to 0.7.

[0152] : The position of the window in the previous round of layout.

[0153] Specifically, the actual size of the window can be calculated by the ratio of the matching weight to the initial demand weight of the window. The adjustment formula is:

[0154] in: : The initial size of the window.

[0155] :For window The actual total amount of resource allocation obtained.

[0156] :For window The initial demand weight.

[0157] In a possible implementation, the window size adjustment can also be combined with screen boundary constraints. For example, when the actual size of the window exceeds the displayable area of ​​the screen, it can be limited to the screen range by scaling. The specific scaling formula is:

[0158] in Indicates the maximum display area of ​​the screen.

[0159] In some embodiments, in order to avoid position jumps during window layout adjustment, a smooth transition function can be used to achieve gradual layout changes. The smooth transition function can be defined in combination with the window position change amplitude, and its mathematical form is:

[0160] in: : is the window position at time The amount of adjustment.

[0161] : The change in the window position.

[0162] : To adjust the speed coefficient.

[0163] : is the center time of the smoothing process.

[0164] In another possible implementation, the dynamic adjustment of the window layout can be combined with the real-time response of the user operation. For example, when the user directly moves a window, the system can lock the position adjustment of the window and adjust the layout of other windows synchronously. This process can be achieved by reducing the resource allocation weight of the locked window, and the formula is:

[0165] in: : Window lock weight adjustment factor, usually ranging from 0.1 to 0.3.

[0166] In addition, in a multi-monitor scenario, the dynamic adjustment of windows needs to take into account the boundary switching between monitors. For example, when a window is dragged to another monitor, its actual position should be converted according to the resolution and physical position of the target monitor. The conversion formula can be expressed as:

[0167] in: : is the scaling matrix between the target display and the source display.

[0168] : is the displacement offset between displays.

[0169] Through the above steps, this embodiment completes the dynamic adjustment of the window layout. The adjusted window position and size can accurately respond to the resource allocation results, and improve the user's interactive experience through the smoothing algorithm. At the same time, the layout adjustment logic takes into account the multi-screen environment and the real-time nature of user operations, providing a reliable solution for window management in complex scenarios.

[0170] S7. Dynamic iterative optimization: After completing the window layout adjustment, the present invention further ensures that the window layout can respond to user operations and environmental changes in real time through a dynamic iteration mechanism. Dynamic iteration runs in a loop, and continuously optimizes the window layout by monitoring user behavior and recalculating window demand distribution. This process not only enhances the flexibility of layout adjustment, but also ensures the adaptability of window management to multiple tasks and multiple scenarios.

[0171] In this embodiment, the implementation of dynamic iterative optimization includes the following technical contents: In general, dynamic iterative optimization triggers each round of iterative calculation by real-time monitoring of user behavior. User behavior monitoring includes but is not limited to window opening, closing, moving, resizing, and task switching. When any behavior occurs, the system will mark the window demand distribution as invalid and start the recalculation process.

[0172] Specifically, at the beginning of each iteration, the screen resource distribution needs to be updated first. and window demand distribution Among them, the screen resource distribution usually remains unchanged, while the window demand distribution is adjusted in real time according to user operations. For example, when a user closes a window, the corresponding demand point and weight will be removed, and the weights of the remaining demand points will be redistributed using the normalization formula:

[0173] in The total number of current windows.

[0174] As an option, when a user adds a new window, the system assigns an initial weight to the new window. The initial weight can be set based on the window type, task importance, or user priority policy. For example, in an office scenario, a newly added document window can be assigned a higher weight by default, while the initial weight of the browser window is relatively low.

[0175] In one possible implementation, in order to improve the computational efficiency of dynamic iteration, the system will first determine the impact range of user behavior on the layout. The window demand distribution and resource matching relationship are recalculated only within the impact range, and the layout of unaffected windows remains unchanged. This incremental update strategy significantly reduces unnecessary computational overhead.

[0176] In general, the core of dynamic iteration is to update the matching relationship between screen resources and window requirements by resolving the optimal transportation problem. , allocation matrix and normalization operations will be recalculated. To ensure the convergence of the optimization process, the iteration step size is usually controlled by a dynamic adjustment strategy. Its mathematical expression is:

[0177] in: :For The step size of the round iteration.

[0178] : is the initial step length.

[0179] : is the step size attenuation rate.

[0180] Specifically, at each step of the iteration, the smooth transition function limits the adjustment range of the window layout. For example, when the actual position of the window changes by When a preset threshold is exceeded, location updates can be limited by the following formula:

[0181] in is the maximum adjustment allowed.

[0182] In some embodiments, in order to further improve the iteration efficiency, the iteration process can be prioritized in combination with the importance of the window. Specifically, the layout of high-weight windows, such as document windows or full-screen video windows, is updated first. Under this strategy, demand points with lower window weights will be delayed in participating in the iteration optimization.

[0183] As an extension, dynamic iterative optimization can also be adaptively adjusted based on the user's long-term operating habits. For example, when it is detected that the user frequently opens or closes a certain type of window, the system will automatically adjust the initial weight distribution of the corresponding window type before the iteration begins. This process can be achieved through the following formula:

[0184] in: : is the weight after adaptive adjustment.

[0185] : The default weight of the window.

[0186] : is the adaptive adjustment coefficient.

[0187] : The window history usage frequency.

[0188] In addition, in a multi-monitor scenario, dynamic iterative optimization needs to take into account the resource allocation ratio of different monitors. For example, when the resource distribution of the primary monitor is relatively saturated, the system will prioritize the resource requirements of the newly added window to the secondary monitor. This process can be achieved by adjusting the allocation weights between monitors, and the formula is:

[0189] in The weight adjustment factor for the display is usually set to 1.5 to 2.0 for the primary display and 0.8 to 1.0 for the secondary display.

[0190] Through the above steps, this embodiment realizes dynamic iterative optimization of window layout. This mechanism can respond to user operations in real time, ensure the continuity and stability of the layout, and show high adaptability and computing efficiency in multi-scenario and multi-task environments. The final layout result can not only meet user needs, but also provide intelligent support for complex interactive scenarios.

[0191] Example 2 Please see attached Figure 2 , an embodiment of the present invention provides a software window adjustment system based on artificial intelligence, comprising: Screen resource distribution module: This module discretizes the screen space and assigns weights to each pixel to form a screen resource distribution model.

[0192] Generally speaking, the screen resolution determines the pixel division accuracy. For a common 1920×1080 screen, each pixel is considered as a resource unit. The initial weight distribution is usually uniform, and can be dynamically adjusted later based on the physical characteristics of the screen (such as the difference in importance between the edge area and the center area).

[0193] As an option, the weight of screen resources can also be optimized based on the user's usage environment. For example, in a low-light environment, the weight of pixels in the center area can be increased to match the user's visual preference. In a multi-display scenario, the distribution of screen resources needs to be weighted and adjusted based on the frequency of use of the primary and secondary displays. Each display is an independent subset of resources, and its weight distribution is dynamically balanced according to the overall display layout.

[0194] Window demand distribution module: The window demand distribution module captures the space demand and weight distribution of each window in real time. The initial setting of window weights is usually related to the task type or importance. For example, a word processing window may be given a higher priority, while an auxiliary window running in the background may be given a lower weight.

[0195] The core of this module is the dynamic update of window demand. When a user opens a new window, the system automatically assigns an initial weight to the new window and adjusts the demand distribution of all windows by normalizing the weights of existing windows. When a user operates an existing window (such as moving or resizing), the demand distribution is updated synchronously. For example, when a user moves a window to the center of the screen, the weight of the window may be appropriately increased to reflect its interactive importance.

[0196] In a multi-tasking scenario, the update of window demand distribution needs to be combined with the task switching logic. For example, when a user switches from "office mode" to "entertainment mode", the weight of office-related windows will decrease, while the weight of multimedia windows will automatically increase. The user behavior monitoring module captures these changes in real time and provides update trigger conditions for the window demand distribution module.

[0197] Optimize engine module: The optimization engine module is the core computing unit of the system. By calling the solution algorithm of the optimal transportation theory, it calculates the matching relationship between screen resources and window requirements. The optimization process aims to minimize the comprehensive cost function to ensure that resource allocation meets user needs while taking into account the logic and visual experience of the layout.

[0198] The computational efficiency of the optimization process is crucial to the real-time performance of the system. To this end, this module improves the traditional optimal transportation model through the entropy regularization method. The regularization method not only improves the calculation speed, but also optimizes the sparsity of the allocation matrix to ensure smooth adjustment of the window layout. For multi-monitor environments, the optimization engine module runs independently in the resource pool of each monitor, while considering the weight conversion relationship between monitors.

[0199] In complex multi-window layouts, for example, when certain windows need to take up screen resources first, the optimization engine module will also dynamically adjust the weight coefficient of the comprehensive cost function according to the window weight. For example, for a window in full-screen mode, the geometric deviation cost can be completely ignored and resources can be concentrated on the target window.

[0200] Layout adjustment module: The layout adjustment module dynamically adjusts the position and size of each window based on the optimization results. The window position is determined by the weighted center position calculated by the optimization engine. The window size is scaled according to the weight of the allocated resources. During the adjustment process, the module will smooth the window change range to avoid user discomfort caused by window jumps or abrupt changes.

[0201] In multitasking scenarios, this module also supports hierarchical layout of windows. For example, low-priority windows are automatically adjusted to floating mode or reduced to the edge of the screen. At the same time, for windows that are directly operated by the user, the module will lock their positions and readjust the layout of other windows to achieve overall coordination.

[0202] User behavior monitoring module: The user behavior monitoring module captures all window operation events through the system interface, including window opening, closing, moving, and resizing. Each time an event is monitored, the system triggers the recalculation of the window demand distribution and starts the iterative update of the optimization engine module.

[0203] As an option, the monitoring module can also record the user's historical operation behavior and combine it with the window usage frequency analysis to provide a reference for the subsequent window weight allocation. For example, when a window has not been operated for a long time, the system will automatically reduce its weight and release more resources for other active windows.

[0204] Interface rendering module: The interface rendering module renders the optimized window layout to the screen in real time based on the output of the layout adjustment module. This module supports a variety of animation effects to enhance the visual experience of window adjustment. For example, when the window position changes, the module will display the adjustment process in the form of a smooth animation to prevent users from perceiving obvious switching transitions.

[0205] In a multi-monitor scenario, the interface rendering module will also adapt the window layout results according to the physical connection relationship and resolution ratio of the monitors. For example, when a window is moved from a high-resolution primary monitor to a low-resolution secondary monitor, the module will synchronously adjust the window size and content scaling to ensure consistency of display effects.

[0206] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A software window adjustment method based on artificial intelligence, characterized in that: The following steps are involved: Establish a screen resource distribution model, discretize the screen space into several pixels, record the coordinates and weight of each pixel, and use the weight to characterize the availability of the pixel; Establish a window demand distribution model, and determine the ideal center position and corresponding weight of each window based on the location information of the currently open windows and the importance of the task; Construct a cost function to describe the allocation cost between screen resource points and window demand points, where the cost includes the geometric deviation cost between screen resource points and window demand points, the window weight matching cost, and the layout symmetry cost; Based on the optimal transportation theory, the optimal matching relationship between screen resource distribution and window demand distribution is determined through iterative optimization; According to the optimal matching relationship, the actual position and size of each window are dynamically adjusted; According to changes in user behavior, the window demand distribution model is updated in real time, and the above steps are repeated to dynamically optimize the window layout.

2. The software window adjustment method based on artificial intelligence according to claim 1, characterized in that: The weight of each pixel in the screen resource distribution model is determined by the screen resolution and device characteristics, and satisfies the weight normalization constraint.

3. The software window adjustment method based on artificial intelligence according to claim 1, characterized in that: The weight of each window in the window demand distribution model is determined according to the importance of the window, task priority or user historical operation behavior, and satisfies the weight normalization constraint.

4. The software window adjustment method based on artificial intelligence according to claim 1, characterized in that: The cost function includes the following parts: Geometric deviation cost, which is used to measure the distance between the screen resource point and the center of the window; Weight matching cost, used to measure the mismatch between screen resource weight and window demand weight; Layout symmetry cost, used to measure the visual symmetry of window distribution.

5. The software window adjustment method based on artificial intelligence according to claim 1, characterized in that: The optimal transportation model is optimized by adding an entropy regularization term to improve computational efficiency. The entropy regularization term is used to balance the sparsity and computational complexity of the optimal allocation matrix.

6. The software window adjustment method based on artificial intelligence according to claim 1, characterized in that: The changes in user behavior include opening, closing, moving or resizing of windows. The changes in user behavior cause the window demand distribution model to be dynamically updated, and the uncertainty of the window demand distribution is estimated by a variational inference method.

7. The software window adjustment method based on artificial intelligence according to claim 1, characterized in that: The optimal matching relationship between screen resources and window requirements is optimized by extending the Sinkhorn algorithm, and the extended Sinkhorn algorithm includes the following steps: Initialize the optimal allocation matrix through the entropy regularization formula; Normalize the allocation matrix based on the constraint conditions and adjust the matching strength; The optimization of the allocation matrix is ​​repeated until convergence.

8. The software window adjustment method based on artificial intelligence according to claim 1, characterized in that: The output of window layout adjustment includes the following: The actual center position of the window is determined by weighted calculation of the matching strength between the screen resource distribution and the window demand distribution; The actual size of the window is determined by the weighted calculation of the window demand weight and the allocated resource weight.

9. The software window adjustment method based on artificial intelligence according to claim 1, characterized in that: The dynamic adjustment of the window layout is handled by a smooth transition function to avoid window jumping or abrupt changes. The smooth transition function is limited according to the change range of the window position and size.

10. An artificial intelligence-based software window adjustment system based on the method of claim 1, characterized in that: include: Screen resource distribution module, used to discretize screen space and generate screen resource distribution; Window demand distribution module, used to establish the window demand distribution model and determine the ideal center position and demand weight of each window; An optimization engine module is used to determine the optimal matching relationship between screen resource distribution and window demand distribution through iterative optimization based on the optimal transportation theory; A layout adjustment module is used to dynamically adjust the actual position and size of the window according to the optimal matching relationship; User behavior monitoring module, used to monitor user operation behavior in real time and update window demand distribution; The interface rendering module is used to update the window layout in real time according to the adjustment results.